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 | jiangly | 4039 |
2 | tourist | 3841 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3590 |
5 | ecnerwala | 3542 |
6 | Benq | 3535 |
7 | orzdevinwang | 3526 |
8 | gamegame | 3477 |
9 | heuristica | 3357 |
10 | Radewoosh | 3355 |
# | User | Contrib. |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | atcoder_official | 160 |
3 | Um_nik | 160 |
5 | djm03178 | 158 |
6 | Dominater069 | 156 |
7 | adamant | 153 |
8 | luogu_official | 152 |
9 | awoo | 151 |
10 | TheScrasse | 147 |
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 .