Need help on problem 1374E1 (WA)

Revision en4, by GoldenShadow, 2020-12-30 10:07:32

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

Tags greedy, help, 1374e1, question, wa, wrong answer

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English GoldenShadow 2020-12-30 10:07:32 2655
en3 English GoldenShadow 2020-12-30 08:50:06 14
en2 English GoldenShadow 2020-12-30 08:49:09 2705
en1 English GoldenShadow 2020-12-30 08:48:04 384 Initial revision (published)