警示后人
查看原帖
警示后人
302394
dingshengyang楼主2022/7/22 10:54

RT。

void erase(int x){
	int L = pre(x);
	int R = succ(x);
	splay(L,0);
	splay(R,L);
	if(tr[R].s[0] == 0)return;
	if(--tr[tr[R].s[0]].cnt == 0)tr[R].s[0] = 0;
	else splay(tr[R].s[0],0);
}

删完了一定把这东西 splay 上去,否则 WA 60pts。

2022/7/22 10:54
加载中...