#include
摘要: /* 带点更新(累加),求部分线段和 */ /*(1) Add i j,i和j为正整数,表示第i个营地增加j个人(j不超过30) (2)Sub i j ,i和j为正整数,表示第i个营地减少j个人(j不超过30); (3)Query i j ,i和j为正整数,i #include #define maxn 50010 typedef struct node{ int sum ; ... 阅读全文
posted @ 2017-10-21 01:02 0一叶0知秋0 阅读(173) 评论(0) 推荐(0) 编辑
摘要: HDU 1166 敌兵布阵(单点更新,区域查询求和的线段树模板) http://acm.hdu.edu.cn/showproblem.php?pid=1166////////////////////////////////////////////////敌兵布阵Time Limit: 2000/10 阅读全文
posted @ 2017-10-21 01:00 0一叶0知秋0 阅读(180) 评论(0) 推荐(0) 编辑
摘要: HDU 1754 I Hate Ithttp://acm.hdu.edu.cn/showproblem.php?pid=1754//////////////////注意线段树 的大小要比 需要使用线段树的数据的个数 大个3到4倍 /////////////////////////////////// 阅读全文
posted @ 2017-10-21 00:38 0一叶0知秋0 阅读(172) 评论(0) 推荐(0) 编辑
摘要: HDU 1698 ( 延迟标记,区间更新(赋值)求和 ) Just a Hook题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1698////////////////////////////////////注意 : lazy思想的简单应用,所谓的laz 阅读全文
posted @ 2017-10-21 00:36 0一叶0知秋0 阅读(343) 评论(0) 推荐(0) 编辑
摘要: /* 延迟标记,区间更新(赋值)求总和 , HDU1698 */ #include #include #include #include using namespace std ; #define maxn 2000000 struct node { int le ; int ri ; int sum , flag ; }; node tree[maxn]... 阅读全文
posted @ 2017-10-21 00:36 0一叶0知秋0 阅读(232) 评论(0) 推荐(0) 编辑
摘要: /* 单点更新,区间查询最值 *//* 注意线段树的大小要比需要使用线段树的数据的个数 大3到4倍 */ #include #include #include #include using namespace std ; #define maxn 4000001 struct node { int le , ri ; int num ; }; node tree... 阅读全文
posted @ 2017-10-21 00:35 0一叶0知秋0 阅读(161) 评论(0) 推荐(0) 编辑