1
0
Fork 0

Update segtree-d.cc

This commit is contained in:
Ariel 2023-12-16 10:02:23 +08:00 committed by GitHub
parent 35f241f3b9
commit c091a8f50a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1,6 +1,6 @@
constexpr int MAXN=1e5+10; constexpr int MAXN=1e5+10;
int cnt,root; int cnt,root;
int d[MAXN*2],ls[MAXN*2],rs[MAXN*2]; int d[MAXN*2],ls[MAXN*2],rs[MAXN*2]; // minimum size is q*log(N)
void update(int s,int t,int &p,int x,int c){ // add constant c to #x void update(int s,int t,int &p,int x,int c){ // add constant c to #x
if(!p)p=++cnt; // create node if(!p)p=++cnt; // create node