https://www.luogu.org/problemnew/show/P3369 知识点:1.拆分split,合并merge 2.split,merge要点:通过传址调用来简便代码 3.记得root = merge(xxxxx,xxxxx); 2 wrong in code #include <bits/stdc++.h> #define M 200002 using namespace std; int tot = ; int val[M],rd[M]; int ch[M][]; in
题目链接 splay: #include<bits/stdc++.h> using namespace std; typedef long long ll; ,inf=0x3f3f3f3f; ],val[N],siz[N],rev[N],tot,n,m,a[N],rt; ,ch[u][]=ch[u][]=rev[u]=; return u;} ]]+siz[ch[u][]]+;} ,swap(ch[u][],ch[u][]),rev[ch[u][]]^=,rev[ch[u][]]^=;} vo