maroonrk's blog

By maroonrk, history, 3 years ago, In English

After the last ARC, one participant pointed out that the result is WA when the error is precisely the same as $$$EPS$$$ (submission).

For example, consider these two outputs: 331997010.50000000000000000000 (the jury output) and 331997342.4970105 (the user output). Their relative error is exactly $$$10^{-6}$$$, so when $$$EPS=10^{-6}$$$, this should get AC.

However, with the current implementation of the doubleCompare function in testlib.h, the result is WA. This is because perturbations in the line 429 (return result + 1E-15 >= minv && result <= maxv + 1E-15;) don't work when the values of result/minv/maxv are large. We made a fix and sent a pull request.

If you believe you were affected by this in the last ARC, please let me know.

That being said, given the popularity of testlib.h and the fact that no one has ever raised this issue, I hope no one was affected by this in the entire history of testlib.h.

  • Vote: I like it
  • +191
  • Vote: I do not like it

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

Thanks, I'll merge it.