Thanks for your reply. But why this method is wrong....??
I have tried two possibilities. But if there is one possibility then why I will get WA.
In fact this method is quite faster. And again if we use m^2 there will we no change in the output. And I have tried many inputs, but got no errors.
Any tricky cases?? ....
Could anyone tell me what is wrong with my code? It's just a simple binary search to take care of both the increasing and the decreasing case. Thanks a lot.
1. calculate x=f(0) and y=f(1)
2. if (x > 0 && y > 0) print 'No solution'.
3. if (x < 0 && y < 0) print 'No solution'.
4. if ( x == 0 ) print '0.0000'.
5. if ( y == 0 ) print '1.0000'.
6. You are sure that u have a solution, and calculate it (by your process).
For checking the floating point numbers try to use epsilon.
Fellows,
what can be wrong with yhe standard "dividing-by-two" algorithm applied to the problem 10341? I still have WA, though this method applied to other similiar problems accepted.
Or rather would you mind sharing with me your source code for this problem if it got accepted?
on the one hand, hte solution is obvious:
cos and exp are decreasing in [0.1], while sin and tan and t*t are increasing strictly, so there always one solution, provided that some certain equation holds.
BUT THIS DOESNT WORK!
it only passses sample inputs successfully, but I got WA still.
Those smart boys who did succeded with this problem, send me your source code, please. serur@mail.ru