Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I have a set<int> and I want to see how many elements in it are less than x. (x is also int)
set<int>
What should i do?
用于lower_bound计算std::distance(s.begin(), s.lower_bound(x)). (如果是一个键,这将严格计算之前x的元素数。) x
lower_bound
std::distance(s.begin(), s.lower_bound(x))
x