Cool technique! Looks like its complexity is amortized $O\left(\dfrac{n}{\sqrt{k}}\right)$ per query and $O(k)$ per update, where $n$ is the length of initial array and $k$ is the number of so-called "MO segments".
Cool technique! Looks like its complexity is amortized $O\left(\dfrac{n}{\sqrt{k}}\right)$ per query and $O(k)$ per update, where $n$ is the length of initial array and $k$ is the number of so-called "MO segments".