C++ アルゴリズムとデータ構造のライブラリ
#include "library/search/binary_search/bi_ge_cnt.hpp"$O(logN)$
sort(A.begin(), A.end());
int cnt = bi_ge_cnt(A, x);
#pragma once
template <typename T> int bi_ge_cnt(vector<T> &v, const T &x) {
return v.end() - lower_bound(v.begin(), v.end(), x);
}#line 2 "library/search/binary_search/bi_ge_cnt.hpp"
template <typename T> int bi_ge_cnt(vector<T> &v, const T &x) {
return v.end() - lower_bound(v.begin(), v.end(), x);
}