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:
Can someone please tell me why is there a TLE?
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3773 |
3 | Radewoosh | 3646 |
4 | ecnerwala | 3624 |
5 | jqdai0815 | 3620 |
5 | Benq | 3620 |
7 | orzdevinwang | 3612 |
8 | Geothermal | 3569 |
8 | cnnfls_csy | 3569 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | Um_nik | 161 |
1 | cry | 161 |
3 | maomao90 | 160 |
4 | awoo | 158 |
4 | -is-this-fft- | 158 |
6 | atcoder_official | 157 |
7 | nor | 155 |
7 | adamant | 155 |
9 | maroonrk | 152 |
10 | Dominater069 | 149 |
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:
Can someone please tell me why is there a TLE?
Name |
---|
Auto comment: topic has been updated by Nishant__Ranjan (previous revision, new revision, compare).
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.
Python issue. Submitting it with PyPy3-64 passes pretty fast.
Submission: 272993104
Thank you, I got it now!