ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1074. Very Short Problem

HOWTO AC Java
Posted by raggzy 9 Feb 2013 06:23
Hints for Java'ers who also hates problems like this and doesn't want to write automation-based solution.

new BigDecimal(line1) - it's almost cool, but you need some fixes before use constructor
1. Check for empty fraction case, e.g. "1.", "1.e2", "1.E2" - these are NANs according P1074 grammar, but OK according BigDecimal grammar (this is the only difference in grammars).
2. Fix big exponent to something smaller, for BigDecimal to be able to parse it
e.g. e1000000000000 => e1000
     e-1000000000000 => e-1000

Edited by author 09.02.2013 06:24
Re: HOWTO AC Java
Posted by xingxing 1 Dec 2018 18:48
can you show your answer?