警示后人
查看原帖
警示后人
1284088
meifan666楼主2025/6/28 10:21

反转时,不光在打上懒标记时是取反,下传懒标记时儿子节点也是取反。

wrong code:

if(tr[now].other)
	tr[now].other=0;
	tr[now*2].other=1,tr[now*2+1].other=1;

AC code:

if(tr[now].other){
	tr[now].other=0;
	tr[now*2].other^=1,tr[now*2+1].other^=1;
2025/6/28 10:21
加载中...