We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9cea074 commit a50b8bcCopy full SHA for a50b8bc
1 file changed
Data_Structure/Segment_Tree.cpp
@@ -38,7 +38,7 @@ void upd_point(int l,int r,int now,int idx,int v){
38
int mid = (l+r)/2;
39
if(idx<=mid) upd_point(l,mid,now*2,idx,v);
40
else upd_point(mid+1,r,now*2+1,idx,v);
41
- tree[now]+=tree[now*2] + tree[now*2+1];
+ tree[now]=tree[now*2] + tree[now*2+1];
42
}
43
LL read_point(int l,int r,int now,int idx){
44
if(l == r) return tree[now];
0 commit comments