# | 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 | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
4 | adamant | 160 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
8 | Dominater069 | 154 |
8 | nor | 154 |
Name |
---|
Because you use
endl
.I changed
endl
with'\n'
but I still got TLE. SolutionBut I just found out that if I pass
String s
in build functions by reference it doesn't give TLE. Correct SolutionBut I am not able to understand why because we don't need to change
s
while building the tree? Please tell me this.Oh right, I did not notice you were passing
s
by value.If you pass
s
by value, then it gets copied for everybuild
call you make. If you pass by reference, there is only one string. Copying the string is expensive.endl
is still too slow btw, even if you got accepted with it this time.