随笔分类 - ACM / 线段树&&主席树
摘要:这一部分的功能和树状数组一样,这里是树状数组的模板 除了求和之外,还能解决区间最小最大值,区间染色 1 单点修改,区间查询 P3374 【模板】树状数组 1 #include <bits/stdc++.h> using namespace std; #define int long long con
阅读全文
摘要:POJ-3321 大佬的博客 #include <iostream> #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> #include <vector> using namespace std; #
阅读全文
摘要:小象喜欢玩数组。他有一个数组a,由n个正整数组成,从1到n进行索引。让我们用索引i表示数字ai。 此外,小象对数组还有m个查询,每个查询的特征是一对整数lj和rj(1 ≤ lj ≤ rj ≤ n)。对于每一个查询LJ,小的大象必须计数,有多少个X数字存在,这样X数恰好在alj,alj+1…arj出现
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=6601 #include <bits/stdc++.h> #define int long long using namespace std; const int maxn=1e5+5; int n,m,a[max
阅读全文

浙公网安备 33010602011771号