# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
Name |
---|
Note that not only c++ standard versions differ but also compiler version. It is not surprising for performance to slightly vary between compiler versions. While compiler makers try to not make things worse it is not too uncommon having changes that improve performance of some programs and decrease for others. In your case the accepted solution is within 10% of time limit. So even small changes in performance could cause it to TL. Seeing that other accepted solutions are far from TL 50-400ms your solution probably has some mistake. You can probably improve something to make it AC more reliably. The TL test case starts with a lot of ))))))))), your solution in such case inserts symbols at the start of string one by one making it O(n2) . n2 solutions with n ≤ 105 are usually not supposed to pass, but with large time limits, fast computer and some luck it might barely pass.
It is not a ON*N solution as far as I am concerned. The statement of the problem shows that the sum of the length is less than or eq to 300000, so at the worst case, I only need to add 300000 (or). The string operation + is too slow, if I really want to use this algorithm and pass all versions, I need to write is as puah_back several times and do one operation of add. ON solution I have writtern and submitted. And, thank you!
upd: it is ON*N, sorry
The complexity of string + operator is linear as said in this reference. Maybe that is the problem?
got it. thank you.
It's O(N2)
got it. thankyou