摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=610View Code 1 #include <cmath> 2 #include <cstdio> 3 #include <cstdlib> 4 #include <iostream> 5 #include <cstring> 6 #include <string> 7 #include <algorithm> 8 #include <queue> 9 #include 阅读全文
posted @ 2012-02-27 17:52 我们一直在努力 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1698线段树水题View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 #define L(x)(x<<1) 6 #define R(x)(x<<1|1) 7 #define MID(x,y) ((x+y)>>1) 8 const int MAX=100005; 9 struct Tnode 阅读全文
posted @ 2012-02-27 17:44 我们一直在努力 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1754存四个变量,两个边界一个sum存其成绩,max存这段的最值。在更新成绩时 父节点的max要同时更新。View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 #define L(x)(x<<1) 6 #define R(x)(x<<1|1) 7 #define MID(x,y) ((x+y)> 阅读全文
posted @ 2012-02-27 17:37 我们一直在努力 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1166View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 #define L(x)(x<<1) 6 #define R(x)(x<<1|1) 7 #define MID(x,y) ((x+y)>>1) 8 const int MAX=50010; 9 struct Tnode{10 in 阅读全文
posted @ 2012-02-27 16:59 我们一直在努力 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=3468以前看过线段树,不过没看明白,也没做过这类题;这次一定要搞懂!!!再次看了两天的线段树,开始有点明白了,多谢媛神博客的支持。View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 #define L(x) (x<<1) 6 #define R(x) (x<<1|1) 7 #define MID(x,y) ((x+y)>&g 阅读全文
posted @ 2012-02-27 12:30 我们一直在努力 阅读(194) 评论(0) 推荐(0) 编辑