警示后人
查看原帖
警示后人
779970
lunjiahao楼主2024/5/30 19:27

若你的代码中需要使用平衡树,例如 FHQ_Treap 或者 Splay,TLE 或者 MLE 了的话,可以试着使用神奇的 vector,直接 AC 了。

e.ge.g

int cnt,rt[N];
vector <int> t[N];
void insert(int &root,int x){
	if(!root) root=++cnt;
	t[root].insert(lower_bound(t[root].begin(),t[root].end(),x),x);
}
void del(int root,int x){
	t[root].erase(lower_bound(t[root].begin(),t[root].end(),x));
}
int kth(int u,int k){
	return t[u][k-1];
}
2024/5/30 19:27
加载中...