update ucpc2026
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
ll tree[N];
|
||||
void update(int i,ll x) {
|
||||
while(i < N) tree[i] += x, i += i&-i;
|
||||
}
|
||||
void update(int i,ll x){ while(i<N) tree[i] += x, i+=i&-i; }
|
||||
int query(int i) {
|
||||
ll s = 0;
|
||||
while(i) s += tree[i], i -= i&-i;
|
||||
while(i) s += tree[i], i-=i&-i;
|
||||
return s;
|
||||
}
|
||||
Reference in New Issue
Block a user