版本比较
P3997 [SHOI2013]扇形面积并 题解
正文
增加 2 行删除 2 行
123455678992 行未改动10210310410510610610710810911066 行未改动UP 23 10 10:感谢 @Java_Herobrine 指出的错误。
理解题意后可以把题目看成一个覆盖线段的问题。
对于点在 $-m$ 上,看成在 $m$ 上。 对于点在 $-m$ 上,看成在 $m$ 上。
对于 $l<r$,不用处理。
对于 $l>r$,将问题看成 $(l,m)$ 和 $(-m+1.r)$ 两个区间。92 行未改动 else if(t[x].ch[1]) { int p=t[x].ch[1]; while(t[p].ch[0])p=t[p].ch[0]; splay(p,x); splay(p,x); root=p,connect(t[x].ch[0],p,0),t[p].fa=0; pushup(p); } else root=t[x].ch[0],t[t[x].ch[0]].fa=0;66 行未改动