Comment

avatar username

Let's define $f(x)$ as the frequency of $x$ in $[l, r]$, and $g(x)$ as the number of times frequency $x$ appeared in $[l, r]$. Mo's works by "moving" the range for a total of at most $\sqrt{n}$ times, and each move only takes $\mathcal{O}(1)$, so we can do this in a total of $\mathcal{O}(n\sqrt{n})$

The actual rating of this user is 1951.

Original comment.

Statistics