摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=610先用线段树维护区间颜色的覆盖,然后在把区间的颜色映射到数组,再从数组统计颜色。 1 #include 2 #include 3 #include 4 #defin... 阅读全文
posted @ 2014-08-15 21:06 null1019 阅读(152) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4302 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define maxn 100010 7 using namespace std... 阅读全文
posted @ 2014-08-15 15:15 null1019 阅读(135) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4288题意:add 就是在集合里面加上一个数x; del 就是从集合里删去一个数x; sum是求位置i%5==3的数的和。tree[i].sum[5] 里面数组存的是不同位置%5之后分别对应的和。 1 #incl... 阅读全文
posted @ 2014-08-15 08:37 null1019 阅读(148) 评论(0) 推荐(0) 编辑