#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update>
int main(){
ordered_set oSet;
// idx 번째 iterator 반환
oSet.find_by_order(idx);
// value의 idx를 반환 (value보다 작은 원소 개수를 반환)
oSet.order_of_key(value);
oSet.insert(v);
oSet.erase(v);
}
https://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/
https://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/tree_based_containers.html
728x90
'알고리즘&자료구조 > 이론' 카테고리의 다른 글
| [알고리즘] 유니온 파인드(Union-FInd) (0) | 2023.02.23 |
|---|---|
| [알고리즘] 두 포인터 (Two Pointers) (1) | 2023.02.15 |
| [알고리즘] DFS와 BFS (0) | 2023.02.02 |
| [자료구조] 그래프(Graph) (0) | 2023.02.01 |
| [자료구조] 해시 테이블(Hash Table) (0) | 2022.10.21 |