559B - Equivalent Strings what is causing Time Limit ? - And what is the best solution to avoid TL ? - solution http://codeforces.net/contest/559/submission/13479349
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3773 |
3 | Radewoosh | 3646 |
4 | ecnerwala | 3624 |
5 | jqdai0815 | 3620 |
5 | Benq | 3620 |
7 | orzdevinwang | 3612 |
8 | Geothermal | 3569 |
8 | cnnfls_csy | 3569 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | cry | 161 |
2 | maomao90 | 160 |
3 | awoo | 159 |
4 | atcoder_official | 157 |
5 | -is-this-fft- | 155 |
5 | nor | 155 |
5 | adamant | 155 |
8 | maroonrk | 152 |
8 | Um_nik | 152 |
10 | Petr | 146 |
559B - Equivalent Strings what is causing Time Limit ? - And what is the best solution to avoid TL ? - solution http://codeforces.net/contest/559/submission/13479349
Name |
---|
my solution http://codeforces.net/contest/559/submission/13479349
Auto comment: topic has been updated by Emsawy (previous revision, new revision, compare).
Auto comment: topic has been updated by Emsawy (previous revision, new revision, compare).
ur doing it in o(n2)
well there is a solution like urs that the only difference is u can find if two strings are the same with hash
I reads about hash but i can`t understand the relation between hash and the problem . but , I used the array of char instead of strings and get AC http://codeforces.net/contest/559/submission/13719791
could you illustrate the relation between hash and the problem and send me your code for it .
well if tow strings are equal then their hash is equal ! and as hash is only a number u can check it in O(1)
thanks, I will try to do that .