操作3死循环30pts人没了求助
查看原帖
操作3死循环30pts人没了求助
294562
EDqwq楼主2021/1/26 15:26
int find(int x){
    int now = rt,ans = 0;
    while (1){
        if (x < w[now]){
            now = son[now][0]; 
            continue;
        }
        ans += size[son[now][0]];
        if (x == w[now]){ 
            splay(now); 
            return ans + 1;
        }
        ans += num[now];
        now = son[now][1];
    }
}
2021/1/26 15:26
加载中...