ShockProof's blog

By ShockProof, history, 9 years ago, In English

got Wrong answer on test 11 after rejudge 11857092

later just printed two digits after decimal point and got Accepted 11868319

I don't understand the reason... please explain

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it +3 Vote: I do not like it

The amount of error you allowed in the binary search is 1e-9, so when multiplied by n = 100000, the error can be as high as 1e-4, which is too much. Therefore if the answer is 2, you could print something (about) as far off as 2.0001, which would be considered wrong. However, it happens that in this problem the answer is always a multiple of .5, when you printed to 2 decimal places you would always be close enough to that multiple of .5 that you would round to exactly that answer.