DHello! I am 100% that's the results from the tests are correct, but still I am getting wrong result. Could you possible check my code ?
http://www.z-trening.com/new/www/html/submit.php?submit=7100041526&subm_code=1
AYou compare two doubles with == ....
Try comparing like
fabs( double - double) <0.0000001
DWhy I can't compare two doubles with == ?
Could you possibly tell me where to put:
fabs( double - double) <0.0000001 ?
AWell 5 isn't five in double....
5 could be:
5 = 5.000000000000000034
5 = 5.0000000000000001
5 = 5.00000000000000456
Dont aks me why....
pIf you have to check if A=B, then do it
fabs(A-B)<0.000001
So just replace A and B with whatever you need for this task
DStill I can't get it working.
I tried with int(A)=int(B), but only 3 of 10 has passed the test.
pfabs(q - (m*p+b))<0.00001
Dyes, that's what I tried, not working.
I also #include <cmath> to get work fabs
buse scanf, printf to avoid TLE
scanf( "%lf %lf" ), without , between %lf and %lf
D@picsel
thank you very much for the help. Now works. I could never imagine that ( ) could make some problem.
@boris4
Thank you very much for the tip. Now there is no TLE :-)