Choice of MOD for rolling hash 
Разница между en1 и en2, 7 символ(ов) изменены
For rolling hash, how do you decide which MOD to pick/ whether to use a tuple of 2 or more hashes? It is hard to know a priori whether the mod is high enough to prevent collisions / too high to cause memory limit / and multiple hashes could cause time limit. In [This](https://mirror.codeforces.com/contest/1902/problem/E), [10**9 + 7](https://mirror.codeforces.com/contest/1902/submission/235742776) gave an incorrect answer, while [10**18 + 3](https://mirror.codeforces.com/contest/1902/submission/235743012) was accepted. Using a pair of hashes with [10**9 + 7 and 998244353](https://mirror.codeforces.com/contest/1902/submission/2360318002716) gave memory limit exceeded. ↵


История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский SamuelTull 2023-12-06 14:04:52 7 Tiny change: 'sion/236031800) gave mem' -> 'sion/236032716) gave mem'
en1 Английский SamuelTull 2023-12-06 14:00:21 681 Initial revision (published)