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 | 3947 |
2 | jiangly | 3734 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3612 |
7 | ecnerwala | 3581 |
8 | Geothermal | 3569 |
8 | cnnfls_csy | 3569 |
10 | ksun48 | 3479 |
# | User | Contrib. |
---|---|---|
1 | awoo | 162 |
2 | maomao90 | 160 |
3 | nor | 156 |
3 | cry | 156 |
5 | atcoder_official | 155 |
5 | -is-this-fft- | 155 |
7 | maroonrk | 154 |
7 | adamant | 154 |
9 | Petr | 146 |
10 | djm03178 | 145 |
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 .