Explanation need!

Revision en1, by Ehsan_sShuvo, 2017-02-11 11:24:21

I have tried my level best to understand this problem.Could anyone else please explain me how i solve this problem?

Note: I know Binary Indexed tree and want to solve this problem by this algorithm.Google search couldn't make a sense for myself to solve this problem.Everywhere,i saw,sort query according to it's value 'k'.And suggestion was that sort your given array also..But,i failed to get that!Pure explanation needed!

Thanks in advance!

Tags bit, spoj

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Ehsan_sShuvo 2017-02-11 11:24:21 510 Initial revision (published)