mohammedawni's blog

By mohammedawni, history, 9 years ago, In English

Hi, Can anyone explain why does i get Runtime Error ?! Problem : http://codeforces.me/contest/975/problem/C Submission Code : http://codeforces.me/contest/975/submission/37910273 Thanks

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

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

Next time, spend some time to write code to generate random tests. It is not difficult to do that, especially in python.

I've got no time to read your code. But I've modified the input portion to accept randomly generated tests rather than read from stdin.

I found that the following test case causes a runtime error in your code.

Test Case

Note that this might not be the only test that causes a runtime error.

Here is the modified version of your code that reads randomly generated inputs:

Code