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 1875. Angry Birds

What in 57 test?
Posted by sapiens_sch 18 Sep 2012 18:12
I have a problem when comparing real numbers

       private static double EPS = 0.33333333333333;

       public static boolean eq (double a, double b) {
          return Math.abs (a - b) <EPS;
       }

when checking whether a given point belongs to a parabola, I simply substitutes the x and y
the function (y = x ^ 2 * a + x * b)
I can not pass the test 57

Edited by author 18.09.2012 18:13

Edited by author 27.05.2014 23:45
Re: What in 57 test?
Posted by sapiens_sch 18 Sep 2012 18:17
the fact that a decrease in EPS say up to 1E-10 then the program does not pass the test 13

Edited by author 18.09.2012 19:14

Edited by author 27.05.2014 23:46
Re: What in 57 test?
Posted by SHIRINKIN 27 May 2014 23:43
I found a suitable number: 0.000050010002, but it is only for java (passes 62nd), for C++10 does not work, a stop on the 57th. Apparently my solution is not suitable for this task.

Edited by author 27.05.2014 23:46
Re: What in 57 test?
Posted by SHIRINKIN 28 May 2014 00:00
Set aside the alarm! Number: 1e-8. (I found on the forum)