# | User | Rating |
---|---|---|
1 | jiangly | 3898 |
2 | tourist | 3840 |
3 | orzdevinwang | 3706 |
4 | ksun48 | 3691 |
5 | jqdai0815 | 3682 |
6 | ecnerwala | 3525 |
7 | gamegame | 3477 |
8 | Benq | 3468 |
9 | Ormlis | 3381 |
10 | maroonrk | 3379 |
# | User | Contrib. |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | Dominater069 | 160 |
4 | atcoder_official | 159 |
4 | Um_nik | 159 |
6 | djm03178 | 154 |
7 | adamant | 153 |
8 | luogu_official | 149 |
9 | awoo | 148 |
10 | TheScrasse | 146 |
Name |
---|
Python is slower than C++. Hence for the same code/logic, python code will give TLE, but C++ would pass.
Reading input using the built-in
input()
function is slow in Python because it flushes. You can fix this by adding something liketo the top of your program. Using this, your code gets AC 247808788.
Btw your friend using C++ has a similar problem. By switching
endl
to'\n'
and addingto the start of main, the solution goes from taking 1154 ms 247782555 to 92 ms 247809134.
Thank you, i tried it and it worked :)
hello, I've seen someone also uses
input = lambda: sys.stdin.buffer.read().decode()
. So, which one is faster?