摘要:
POJ.2528 Mayor’s posters (线段树 区间更新 区间查询 离散化)题意分析贴海报,新的海报能覆盖在旧的海报上面,最后贴完了,求问能看见几张海报。最多有10000张海报,海报左右坐标范围不超过10000000。 一看见10000000肯定就要离散化了,因为建树肯定... 阅读全文
摘要:
POJ.3468 A Simple Problem with Integers(线段树 区间更新 区间查询)题意分析注意一下懒惰标记,数据部分和更新时的数字都要是long long ,别的没什么大坑。代码总览#include #include #include #define nma... 阅读全文
摘要:
HDU.1556 Color the ball (线段树 区间更新 单点查询)题意分析注意一下pushdown 和 pushup 模板类的题还真不能自己套啊,手写一遍才行代码总览#include #define nmax 200000using namespace std;struc... 阅读全文
摘要:
HDU.1166 敌兵布阵 (线段树 单点更新 区间查询)题意分析加深理解,重写一遍代码总览#include #define nmax 100000using namespace std;struct Tree{ int l,r,val; int lazy; int... 阅读全文