摘要: 树状数组可以用来维护前缀最大值 把矩形按某个坐标排序来处理问题的思想 点击查看代码 #include <bits/stdc++.h> using namespace std; int p[300005],v[300005],n,m; long long ans[300005],tmp[300005] 阅读全文
posted @ 2024-07-30 15:52 D06 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 二维数点问题 我们通过扫描线可以将静态的二维问题转换为动态的一维问题 维护动态的一维问题就使用数据结构维护序列 点击查看代码 #include <bits/stdc++.h> using namespace std; struct t1 { int x,y; }t[500005]; struct q 阅读全文
posted @ 2024-07-30 13:29 D06 阅读(4) 评论(0) 推荐(0) 编辑