This is just unfair that my PyPy submission got TLE! Can this be reviewed?
# | User | Rating |
---|---|---|
1 | tourist | 3845 |
2 | jiangly | 3707 |
3 | Benq | 3630 |
4 | orzdevinwang | 3573 |
5 | Geothermal | 3569 |
5 | cnnfls_csy | 3569 |
7 | jqdai0815 | 3532 |
8 | ecnerwala | 3501 |
9 | gyh20 | 3447 |
10 | Rebelz | 3409 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 171 |
2 | adamant | 163 |
3 | awoo | 161 |
4 | nor | 152 |
5 | maroonrk | 151 |
5 | -is-this-fft- | 151 |
7 | TheScrasse | 148 |
8 | atcoder_official | 146 |
9 | Petr | 145 |
10 | pajenegod | 144 |
This is just unfair that my PyPy submission got TLE! Can this be reviewed?
Name |
---|
skill issue
Python issue* cuz same code on C++ got AC
because python is slow. I also got TLE on test 42 214898344, and the C++ code is Accepted 215049350
I think that your program would have passed if you had written in c++
Yea agreed, time to say good bye to Python
Its not an issue related to python slowness, but its related to hash collisions being o(n^2)
sort the array before you use counter and it should pass.
https://codeforces.com/contest/1850/submission/215081606 Passes in 200 ms
nice, new knowledge, thank you
thank you
WOW! it worked! can you please give a brief explanation on why this is the case? How does sorting the array decrease hash collisions? very counter intuitive !
I tried the same for G as i also used a dictionaries there. it passed test case 14 but unfortunately it still got TLE on test 17. Is there anything i could do with that? Problem G submission
Maaan! Wth! It passed! this is crazy. can you explain why this happens?
can u explain why sorting the list reduced the runtime?
People have designed the testcase to cause hash collision resulting in n^2. If you sort the array you get rid of the hash collision as elements are inserted in a different order, resulting in o(n)