SPOJ D-Query , BIT but how?

548 views Asked by At

I am trying to solve D-query problem on Spoj. http://www.spoj.com/problems/DQUERY/ I am thinking about set and memorizing the result but that is really slow. So I was thinking about that Binary Indexed tree could help me to get lgN for one query but I can't think the solution with it. Can anyone help me.

0

There are 0 answers