摘要:
B. Kevin and Geometry vector的删除,无论是删除单个元素还是区间,一定是传入迭代器,而且区间一定是左闭右开区间 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(f 阅读全文
摘要:
题目链接 在证明了标记的添加必定伴随着标记的删除后,你可以放心地使用或运算更新标记,而不用担心标记的重叠问题 点击查看代码 #include <bits/stdc++.h> using namespace std; struct t1 { long long c,w,f; }t[100005]; b 阅读全文
摘要:
题目链接 通过这道题,了解了标记永久化的思想,也加深了对线段树的理解~ 另外,这道题也是可以将原数组转化成差分数组做 #include <bits/stdc++.h> using namespace std; long long a[100005]; struct t1 { long long l, 阅读全文
摘要:
题目链接 【调试程序】转移的时候要用原始值转移,复制一份数组或者从大到小枚举 点击查看代码 #include <bits/stdc++.h> using namespace std; int r[2000005]; int s[2000005]; int d[5005],f[5005],g[5005 阅读全文