911G-Mass Change Queries

array
codeforces
queries

#1

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


#2

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


#3

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


#4

Awesome thanks!


#5

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:


#6

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