11

I have a set<int> and I want to see how many elements in it are less than x. (x is also int)

What should i do?

4

1 回答 1

19

用于lower_bound计算std::distance(s.begin(), s.lower_bound(x)). (如果是一个键,这将严格计算之前x的元素数。) x

于 2011-08-04T09:58:07.330 回答