Wrong answer on 492D

Revision en1, by newbie_forever_at_cp, 2017-12-04 18:41:54

Hi guys, Am trying to solve the problem 492 D. http://codeforces.net/problemset/problem/492/D. My approach is use binary search, to find the index at which the monster dies. My solution is https://ide.geeksforgeeks.org/Dcs5Fn6w2S. But i got wrong answer in test 7. so i changed the equal function to compare upto 10^-6. Then i got wrong answer on test 6. Can someone plz tell me why this method fails.

Tags #binary search, #math

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English newbie_forever_at_cp 2017-12-04 18:41:54 422 Initial revision (published)