I refer you to the problem Lemmings from VK Cup Round 2.
I wrote a binary search solution, and I set my EPSILON value in binary search to 1e-12. My code is given here.
However, I still get wrong answers. For one testcase, the optimal solution will give 9.999999^-5, but my solution gave 0.0001. Can someone help me and tell me what I should do?
Also in general, may I know what most coders do when they need to have extremely accurate floating point values? I don't like coding fractions D=.
Thank you very much!
EDIT: I read the analysis, so I changed my EPSILON to 1e-18. But then I get TLE. Afterwards, I changed my code so that I run 90 iterations of binary search (Code here), but I still get wrong answer on the same testcase (testcase 12)!!