Arithmetic Notes - Hash Types Topic
1. Candy Rush TL;DR - string hash accelerated comparison + big hash trick 2023-2024 ACM-ICPC Latin American Regional Programming Contest Official solution (a math. puzzle):https://codeforces.com/gym/104736/attachments/download/22730/editorial.pdf After taking the frequency of occurrence of $C_i$ as a vector and doing a prefix sum, we can find that the frequency difference between valid intervals is $k \cdot 1_n$; the leveling complexity of the direct comparison is $O(nk\log{n})$, with $O(k)$ coming from the comparison itself...