# | 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 |
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