GoldenShadow's blog

By GoldenShadow, history, 4 years ago, In English

I recently submitted a (greedy) solution to problem 1374E1. However, the algorithm received a wrong answer verdict on testcase 5, which had such large numbers that I was unable to access the entirety of the testcase. Could someone please tell me what the problem is in the code, or why it failed the fifth testcase? Any assistance would be appreciated.

[update] found the issue, need to do the greedy checking from the beginning instead of the end.

WA submisson: https://codeforces.net/contest/1374/submission/102733730

AC submission: https://codeforces.net/contest/1374/submission/102739800

Full text and comments »

  • Vote: I like it
  • -4
  • Vote: I do not like it