1 #include <cstdio> 2 #include <iostream> 3 using namespace std; 4 const int N=100010; 5 int n,m,ch[N][2],fa[N],tot[N],col[N],lcol[N],rcol[N],tag[N]; 6 bool rv[N]; 7 char s[10]; 8 void update(int x) 9 14 bool nroot(int x) { return ch[fa[x]][0]!=x&&ch[fa[x]][1]!=x; } 15 void rev(int x) 16 void change(int x,int y) 17 void down(int x) 18 23 void rotate(int x) 24 29 void splay(int x) 30 35 void access(int x) { for (int y=0;x;x=fa[y=x]) splay(x),ch[x][1]=y,update(x); } 36 void makeroot(int x) { access(x),splay(x),rev(x); } 37 void insert(int x,int y) { makeroot(x),fa[x]=y; } 38 void split(int x,int y) { makeroot(x),access(y),splay(y); } 39 int main() 40 49 }
PLCT检查是什么[lct] Luogu P2486 染色
未经允许不得转载:上海聚慕医疗器械有限公司 » PLCT检查是什么[lct] Luogu P2486 染色









