随笔分类 -  ACM_线段树

摘要:划分树:一般用于快速求区间[a,b]第k大的数。 阅读全文
posted @ 2016-08-10 11:29 chenhuan001 阅读(282) 评论(0) 推荐(0) 编辑
摘要:不知道怎么搞的就报名了蓝桥杯,还报的B组的。。。然后就开始刷刷历年的题目,结果发现题目、数据巨坑。 数据是怎么乱搞都能得个75。。。这题幸运数测试数据也是太水了,以至于暴力的通通能过,目测题目最大数据也就是10^4+ 不超过10^5本来想水水就算了的,但是不解为什么锦囊说用堆写。。。想了几天堆的解法... 阅读全文
posted @ 2015-03-24 09:55 chenhuan001 阅读(605) 评论(0) 推荐(0) 编辑
摘要:区间更新,单点查询。hdu3333#include #include #include #include #include #include #include #include #include #include using namespace std;#define N 30300#define ... 阅读全文
posted @ 2014-11-06 22:35 chenhuan001 阅读(270) 评论(0) 推荐(0) 编辑
摘要:上海邀请赛的一道题目,看比赛时很多队伍水过去了,当时还想了好久却没有发现这题有什么水题的性质,原来是道成题。 最近学习了下线段树扫描线才发现确实是挺水的一道题。hdu5091#include #include #include #include #include #include #include ... 阅读全文
posted @ 2014-11-04 20:05 chenhuan001 阅读(434) 评论(0) 推荐(0) 编辑
摘要:又知道了线段树的一种用法,除了单点更新,区间更新,还有这种在一段线段上标号但不往下推。 真是神奇hdu1828#include #include #include #include #include #include #include #include #include using namespac... 阅读全文
posted @ 2014-11-04 17:26 chenhuan001 阅读(393) 评论(0) 推荐(0) 编辑
摘要:对线段树的区间更新有了初步的了解。。。A Simple Tree ProblemTime Limit:3 Seconds Memory Limit:65536 KBGiven a rooted tree, each node has a boolean (0 or 1) labeled on it. Initially, all the labels are 0.We define this kind of operation: given a subtree, negate all its labels.And we want to query the numbers of 1's 阅读全文
posted @ 2013-07-13 23:31 chenhuan001 阅读(233) 评论(0) 推荐(0) 编辑
摘要:比赛的时候想了很久,但是没有想出来。 这题用线段树思路应该挺好想, 但是会复杂一些,而用这个方法简单又好写,但是确实比较难想到。。大牛的解题报告,很详细 http://blog.csdn.net/wh2124335/article/details/8739097威威猫系列故事——晒被子Time Li... 阅读全文
posted @ 2013-04-02 08:51 chenhuan001 阅读(311) 评论(0) 推荐(0) 编辑
摘要:思路很明确,直接用线段树.Balanced LineupTime Limit:5000MSMemory Limit:65536KTotal Submissions:26161Accepted:12250Case Time Limit:2000MSDescriptionFor the daily milking, Farmer John'sNcows (1 ≤N≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with 阅读全文
posted @ 2013-02-27 11:28 chenhuan001 阅读(158) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示