神秘pbds知识
引入头文件
#include<bits/extc++.h>
using namespace __gnu_pbds;
内置平衡树
tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update>T;
T.insert();//插入
T.erase();//删除
T.order_of_key({pii});//返回多少个元素比该元素小
T.find_by_order(x-1);//返回从小到大排列后,排名为x的元素
T.lower_bound({pii});//返回第一个小于等于该元素的元素的迭代器
T.upper_bound({pii});//...
//可使用it--,it++,begin(),end()

浙公网安备 33010602011771号