|
|
вернуться в форумCan we use hashes? Can we solve this problems with hashes? It takes TLE #3 with hash table... Who solved with hashes, comment please =) Re: Can we use hashes? I tried, but i didn't use tables. Just calculated the number of different hashes. But I have WA3. And it seems quite interesting to me. Re: Can we use hashes? I tried, but i didn't use tables. Just calculated the number of different hashes. But I have WA3. And it seems quite interesting to me. Why do you think that you could avoid hash collisions? There could be 5000*5000/2 different substrings and if your hash size (modulo you are using) is less than that, some two will DEFINITELY be in the same section and they could be unequal. Even if your number is greater, you still can get WA because of a collision ... |
|
|