Lib/ordered_set
code:cpp
int main() {
ordered_set s;
s.insert(1);
s.insert(4);
s.insert(8);
s.insert(15);
// order_of_key(x): x 未満の要素の数を返す
cout << s.order_of_key(8) << endl; // 出力: 2 (1と4があるので)
cout << s.order_of_key(10) << endl; // 出力: 3 (1, 4, 8 があるので)
cout << s.order_of_key(1) << endl; // 出力: 0 (1未満はない)
// find_by_order(x): x 番目の要素のポインタを返す
cout << *s.find_by_order(3) << endl; // 出力: 15
return 0;
}
Policy-Based Data Structuresって拡張ライブラリ らしい?
・i番目に大きい要素を取り出す
・X未満の要素の個数を取り出す
#Lib