这里
```cpp
int query(int u,int l,int r,int L,int R){
pushdown(u);
if(l<=L&&R<=r){
return tr[u].sum;
}
int res=0;
int mid=L+R>>1;
pushdown(u);
if(l<=mid)res+=query(u<<1,l,r,L,mid);
if(r>mid)res+=query(u<<1|1,l,r,mid+1,r);
pushup(u);
return res;
}
```
改成
```cpp
int query(int u,int l,int r,int L,int R){
if(l<=L&&R<=r){
return tr[u].sum;
}
int res=0;
int mid=(L+R)>>1;
pushdown(u);
if(l<=mid)res+=query(u<<1,l,r,L,mid);
if(r>mid)res+=query(u<<1|1,l,r,mid+1,R);
pushup(u);
return res;
}
```
by ShieHere @ 2023-08-02 10:40:24
不用谢,我是列文虎克
by ShieHere @ 2023-08-02 10:41:51
真的想似cccccccccccccccccccccccccccccc
by Let_Fly @ 2023-08-02 10:41:58
已关,此帖结wwwwwww
by Let_Fly @ 2023-08-02 10:45:21