Hi guys ,I was just lingering through problem set where I found this question http://codeforces.me/contest/368/problem/B
I was curious about whether this Question can be done using fenwick tree.(Which,apparently,I could not think of as in how to implement!? )
If u guys can implement fenwick tree for the question I would be more than overwhelmed . Or even if You can actively suggest some idea on how to proceed in implementing fenwick tree for finding distinct integers !!
Thanking you