Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

Find kth element in a multiset

Revision en1, by SupaHotFire, 2019-09-11 12:10:07

I did solve this problem for a set with binary searching in a BIT but for multiset I don't know how to solve it for example if the multiset elements are 3 3 3 my solution will only see the last element because BIT is a prefix sum and BIT array would be BIT[3]=3 so binary searching with query is not giving a correct answer because I'm looking for a certain value not a range using binarysearch

any advice would be appreciated

Tags #fenwick tree

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English SupaHotFire 2019-09-11 12:10:07 461 Initial revision (published)