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*

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

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

Awesome thanks!

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

Will be a great help

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