cut函数内三个连续判断
查看原帖
cut函数内三个连续判断
368760
chenkejin楼主2021/4/14 20:23
void cut(int x,int y){
    Makeroot(x);
    if (Findroot(y)==x&&c[y][0]==0){
        f[y]=c[x][1]=0;
        pushup(x);
    }
}

这样为什么也是不对的,, find (root )都等于x了

find的过程中 y先 splay到顶点,之后就是x splay到顶点, 那么f [y] 肯定等于x啊,,,可是去掉这句话后,这样过不去数据

2021/4/14 20:23
加载中...