Multiset
HardRating 1900CodeforcesSegment Tree & Fenwick Tree
Approach hintTry it first, then revealHide
Keep value counts in a Fenwick tree and find the k-th smallest by descending through powers of two rather than binary searching over prefix sums. The tight memory limit rules out storing all queries or heavier structures.