没有 ,在 的过程中看有没有被整段覆盖。
void pup(int p,int l,int r){
if(t[p].sum)t[p].len=r-l+1;
else t[p].len=t[lc].len+t[rc].len;
}
void build(int p,int l,int r){
t[p]={0,0};
if(l==r)return;
build(lc,l,md);build(rc,md+1,r);pup(p,l,r);
}
void mdf(int p,int l,int r,int x,int y,int v){
if(x<=l&&r<=y)return t[p].sum+=v,pup(p,l,r);
if(x<=md)mdf(lc,l,md,x,y,v);
if(y>=md+1)mdf(rc,md+1,r,x,y,v);
pup(p,l,r);
}