Why aren’t the solutions for this problem public?

I guess it requires a Segment Tree. The solutions would be really helpful to learn implementation of trees.

Why aren’t the solutions for this problem public?

I guess it requires a Segment Tree. The solutions would be really helpful to learn implementation of trees.

Well, this is one of the greatest examples (for me) of how to use BIT (Binary Indexed Tree) in practice, take a look at this tutorial on TopCoder.

3 Likes

Me too, I tried a lot and didn’t solve it

i am also want to solve it…but it is more tricky

Does anyone have the solution for this problem using fenwick tree ? I could not find a single solution which uses BIT, they all have submitted solution using segtree with lazy propagation.