911G-Mass Change Queries

May i have some ideas on how to approach this problem?Very simple question,but the best question i have come across till date!

Link: Mass change Queries

Please abstain from providing complete solution

1 Like

if you know sqrt decomposition then thought of applying the same. And yes it’s a very nice question :slight_smile:

Awesome thanks!

Happy new year :slight_smile: If you can then please answer this : https://discuss.codechef.com/questions/120548/help-in-understanding-expectation

Will be a great help :slight_smile:

Using Sqrt decomposition it can be done. By storing indices for each element in the given array blockwise and manipulating them.

I finding difficulty in storing the indices for each unique element in the given array blockwise.