HELP REQUIRED IN SPOJ K-QUERY

Revision en1, by FineLine, 2016-06-07 19:56:25

Hi everyone,I have been trying this question SPOJ K-QUERYfor 2 days now.After unsuccessful attempts to come up with logic,I finally referred Blogs available online.But I am neither getting head nor tail of the logic. Can someone please tell me the formation of fenwick/segment tree that is used(especially the technique used).It will be a great help.Please! Thanks in advance.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English FineLine 2016-06-07 19:56:25 446 Initial revision (published)