自己学习的代码片段如下
void update(int u,int L,int R,int l,int r,long long x){
if(InRange(L,R,l,r)){
maketag(u,R-L+1,x);
}
else if(!OutofRange(L,R,l,r)){
int M=(L+R)/2;
pushdown(u,L,R);
update(u*2,L,M,l,r,x);
update(u*2+1,M+1,R,l,r,x);
pushup(u);
}
}
但是在调用的时候要
if(op==1)
{
long long k;
scanf("%d%d%lld",&x,&y,&k);
update(1,1,n,x,y,k);
}
我不理解为什么L和R对应的是1和n
但l和r对应着x和y
不应该x和y在1到n里面吗?
有没有dalao教教QwQ