Nishant__Ranjan's blog

By Nishant__Ranjan, 6 hours ago, In English

This is about problem C of Codeforces Round 962 (Div 3).

In my opinion, I have followed the correct algorithm to solve this problem. However, my code gives a TLE in test 3. Here is the code:

Submission

Can someone please tell me why is there a TLE?

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

»
6 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Nishant__Ranjan (previous revision, new revision, compare).

»
5 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Resubmitting your solution in PyPy yielded an AC. I believe this is Python's fault, may be due to the fact that we require to initiate 2D arrays, and such things in Python could be much more costly than common sense would tell.

»
5 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Python issue. Submitting it with PyPy3-64 passes pretty fast.

Submission: 272993104