update ucpc2026

This commit is contained in:
2026-07-11 09:38:32 +09:00
parent 7176febe54
commit 0b8c2864ae
20 changed files with 329 additions and 163 deletions
+2 -4
View File
@@ -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;
}