求大佬解释下这是为什么
by 老K @ 2017-07-15 17:30:54
完整代码:[传送门](https://paste.ubuntu.com/25095074/)
by 老K @ 2017-07-15 17:32:35
@[罗恺](/space/show?uid=8943) 你双旋写得太丑了
by xunzhen @ 2018-01-11 22:02:16
```cpp
int check(int x){
return A[A[x].fa].son[1]==x;
}
void splay(int x,int y){
while (A[x].fa!=y){
int f=A[x].fa;
int dx=check(x),df=check(f);
if (A[f].fa==y) rotate(x);
else if (dx==df) rotate(f),rotate(x);
else rotate(x),rotate(x);
}
if (!y) root=x;
}
```
by xunzhen @ 2018-01-11 22:04:55