2020-09-04から1日間の記事一覧

upper_boundとlower_bound

ソート済みのvector Aに対してhoge以上の最小の要素のイテレータ lower_bound(A.begin(), A.end(), hoge)hogeを超える最小の要素のイテレータ upper_bound(A.begin(), A.end(),hoge) 値がhoge以上の要素の個数 A.end() - lower_bound(A.begin(), A.end(), ho…