# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | 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 | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
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