Submission passes when I try to print exception, fails if not. Why?

Revision en1, by aberent, 2020-06-20 12:29:16

I have been trying to get my Python solution to Lamps in a Circle (Codeforces Global problem 8) to work. I was getting runtime errors on test 6, so I put in some code to print the error. On doing so my solution was accepted.

The accepted solution is https://codeforces.me/contest/1368/submission/84398375, the rejected one is https://codeforces.me/contest/1368/submission/84398296. The only difference is the code to catch the exception.

I initially saw this with PyPy3, but I get the same behaviour with Python 3.

Does anybody have any ideas on why this is happening?

Tags #python3

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English aberent 2020-06-20 12:29:16 756 Initial revision (published)