Need help in Mo's Algorithm DSU part

Правка en1, от goyalnikhil064, 2020-06-17 15:47:49
There is this problem https://www.codechef.com/problems/GERALD07. I tried solving it using Mo algorithm but I am stuck with the dsu. Like when I am going to move left pointer rightwards or right pointer leftwards, then I would need to break the set previously merged. I am not getting how to break the joined set. Plus I know it can be solved by link-cut, but I haven't read that topic so kindly give me suggestions with regard to Mo algorithm. Thanks!
Теги #mos algorithm, #dsu, #graph theory

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский goyalnikhil064 2020-06-17 15:47:49 506 Initial revision (published)