goyalnikhil064's blog

By goyalnikhil064, history, 4 years ago, In English
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!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it