I want to do binary search on a multiset, because I need to know "How many elements in the multiset greater or equal to x". And obviously I want to get the data in O(logn).
I want to do binary search on a multiset, because I need to know "How many elements in the multiset greater or equal to x". And obviously I want to get the data in O(logn).
Multisets support only lower bound and upper bound operations, and not operations of the type number of elements ≥ X. For this purpose, you can use a BIT, or if the values are too large, then compression with a BIT.
STL pb tree