Hey MikeMirzayanov In the recent div2 contest, I encountered an issue where my code for Problem D, "A Wide, Wide Graph," resulted in a TLE. However, I submitted the same code today and it was accepted.
Tle Submission:Tle
Ac Submission:AC
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
Hey MikeMirzayanov In the recent div2 contest, I encountered an issue where my code for Problem D, "A Wide, Wide Graph," resulted in a TLE. However, I submitted the same code today and it was accepted.
Tle Submission:Tle
Ac Submission:AC
Name |
---|
998ms means about to TLE
Ya ik it is very close to time limit but because of unconsistency may be due to load on site sometimes it is just below and sometimes it is just above the time limit
this, i think, means that this isn't the intended complexity, it just happened to be >=2ms faster the second time. This is precisely the reason why many coders would submit multiple solutions to a problem trying to get their runtime down, to make sure it wasn't a fluke.
Still, interesting situation though.
Also 18o3 orz.
🤡 🤡 🤡
As far as the logic is concerned and intended complexity it is fully fine it is just the time python takes
Use PyPy3 instead, it would much faster.
With dfs it gives runtime more so python 3 is best choice for dfs related stuff
For dfs, I recommend you convert dfs to stack version. I was in the same situation in the past.
At that time, I try to 2 experiments:
Use python3 and set a recursion limit, it's work but need carefully when choose a recursion limit.
Continue use Pypy3 (it isn't work with set a recursion limit -> memory error). I convert dfs to stack version
Although both ways can AC but Pypy3 still faster and stable than Python 3 version (both recursion and stack implementation) in run time.
converting to stack version makes the problem tough for sure . like it makes +100 tougher