摘要:
###链接 线段树合并,计算 \(sum\) 值时,要记录前缀和与后缀和,维护区间和与区间乘, 合并后的节点如果直接继承之前的节点的话要注意提前将值提取。 #include<bits/stdc++.h> #define IL inline #define LL long long using nam 阅读全文
摘要:
###链接 类似于权值线段树查询区间 \(k\) 大值。。。(写复杂了。。。 #include<bits/stdc++.h> #define IL inline #define LL unsigned int using namespace std; const int N=5e5+3; int n 阅读全文
摘要:
###P3899 [湖南集训]谈笑风生 二维数点问题,主席树模板(两种写法 #include<bits/stdc++.h> #define IL inline #define LL long long #define pb push_back using namespace std; const i 阅读全文
摘要:
###P1270 “访问”美术馆 裸题。 #include<bits/stdc++.h> #define IL inline #define LL long long using namespace std; const int N=2e2+3,M=6e2+3; int n,cnt,kin[N],f 阅读全文
摘要:
1.93k,70行树状数组套权值线段树代码不来康康嘛~ #include<bits/stdc++.h> #define IL inline using namespace std; const int N=5e4+3,Maxn=1e8+1,inf=2147483647; int n,m,a[N],c 阅读全文