![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
【线段树】
文章平均质量分 81
Gijkstra
Can we do better?
展开
-
线段树(单点更新+区间更新)
转自http://blog.csdn.net/zip_fan/article/details/46775633线段树的两种基本用法:单点更新和区间更新(又叫成段更新)。 首先线段树它是一棵高度平衡的二叉树,那么很多二叉树的性质它是完美继承的,比如用数组去模拟的话,父节点的下标*2=左儿子的下标,父节点的下标*2+1=右儿子的下标。而这个性质也在线段树的实现中得到了很好的运用(转载 2017-04-28 16:18:58 · 307 阅读 · 0 评论 -
BZOJ 4627回转寿司(值域线段树)
4627: [BeiJing2016]回转寿司Time Limit: 10 Sec Memory Limit: 256 MBSubmit: 507 Solved: 217[Submit][Status][Discuss]Description酷爱日料的小Z经常光顾学校东门外的回转寿司店。在这里,一盘盘寿司通过传送带依次呈现在小Z眼前。不同的寿司带给小Z的味觉感受是不原创 2017-08-07 14:54:46 · 417 阅读 · 0 评论 -
POJ2528 Mayor's posters (线段树+离散化)
Mayor's postersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 66380 Accepted: 19164DescriptionThe citizens of Bytetown, AB, could not stand that the ca原创 2017-08-04 13:47:52 · 206 阅读 · 0 评论 -
BZOJ2957 楼房重建(线段树+思路)
楼房重建Description 小A的楼房外有一大片施工工地,工地上有N栋待建的楼房。每天,这片工地上的房子拆了又建、建了又拆。他经常无聊地看着窗外发呆,数自己能够看到多少栋房子。 为了简化问题,我们考虑这些事件发生在一个二维平面上。小A在平面上(0,0)点的位置,第i栋楼房可以用一条连接(i,0)和(i,Hi)的线段表示,其中Hi为第i栋楼房的高度。如果这栋楼房上任何一原创 2017-08-04 18:00:15 · 448 阅读 · 0 评论 -
HDU1542-Atlantis(线段树+扫描线——面积并)
AtlantisTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12947 Accepted Submission(s): 5401Problem DescriptionThere are severa原创 2017-05-29 09:31:19 · 592 阅读 · 0 评论 -
HDU3265 Posters(线段树+扫描线——面积交)
PostersTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6338 Accepted Submission(s): 1523Problem DescriptionTed has a new hous原创 2017-08-05 10:24:59 · 344 阅读 · 0 评论 -
ZOJ1610 Count the Colors(线段树+思路)
Count the ColorsTime Limit: 2 Seconds Memory Limit: 65536 KBPainting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your ta原创 2017-08-04 11:31:22 · 226 阅读 · 0 评论 -
nyoj108~士兵杀敌(一)(树状数组+线段树)
A. 士兵杀敌(一)Time Limit: 1000msMemory Limit: 128000KB64-bit integer IO format: Java class name:Submit Status南将军手下有N个士兵,分别编号1到N,这些士兵的杀敌数都是已知的。小工是南将军手下的军师,南将军现在想知道第m号到第n号士兵的总原创 2017-04-26 16:25:44 · 332 阅读 · 0 评论 -
codeforce 914-D. Bash and a Tough Math Puzzle(线段树)
D. Bash and a Tough Math Puzzletime limit per test2.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBash likes playing with arrays. He has an array a1, a2, ... an of...原创 2018-02-23 14:01:16 · 166 阅读 · 0 评论 -
CodeForces - 877E Danil and a Part-time Job(线段树+dfs序)
E. Danil and a Part-time Jobtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDanil decided to earn some money, so he had found a part-time job. The...原创 2018-04-20 09:02:25 · 285 阅读 · 0 评论 -
HDU6070 Dirt Ratio(线段树+二分)
Dirt RatioTime Limit: 18000/9000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1934 Accepted Submission(s): 901Special JudgeProblem Description原创 2017-08-08 09:51:15 · 403 阅读 · 0 评论 -
UESTC - 1597An easy problem C(线段树)
An easy problem CTime Limit: 4000/2000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit StatusN个数排成一列,有三种操作。1.给一段区间内的每个数乘上一个非负整数。2.给一段区间内的每个数加上一个非负整数.3.询问一段区原创 2017-08-01 08:37:28 · 687 阅读 · 2 评论 -
HDU3974-Assign the task(线段树+区间建树)
Assign the taskTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2774 Accepted Submission(s): 1158Problem DescriptionThere is原创 2017-05-27 16:09:49 · 309 阅读 · 0 评论 -
HDU4027-Can you answer these queries?(线段树+思路)
Can you answer these queries?Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 16133 Accepted Submission(s): 3771Problem Descriptio原创 2017-05-24 18:25:39 · 352 阅读 · 0 评论 -
HDU1540-Tunnel Warfare(线段树区间合并)
Tunnel WarfareTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8634 Accepted Submission(s): 3337Problem DescriptionDuring the原创 2017-05-26 10:34:20 · 299 阅读 · 0 评论 -
POJ 3468 A Simple Problem with Integers(线段树区间更新模板题)
A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 108110 Accepted: 33683Case Time Limit: 2000MSDescriptionYou have N原创 2017-04-30 16:06:35 · 326 阅读 · 0 评论 -
nyoj119 士兵杀敌(三)(线段树||RMQ)
C. 士兵杀敌(三)Time Limit: 2000msMemory Limit: 128000KB64-bit integer IO format: Java class name:Submit Status南将军统率着N个士兵,士兵分别编号为1~N,南将军经常爱拿某一段编号内杀敌数最高的人与杀敌数最低的人进行比较,计算出两个人的杀敌数差原创 2017-04-26 19:30:39 · 356 阅读 · 0 评论 -
NYOJ备用2344 盖伦的告白(线段树||双端队列)
2344: 盖伦的告白时间限制: 1 Sec 内存限制: 128 MB提交: 56 解决: 19[提交][状态][讨论版]题目描述盖伦和赵信这对基友又在打赌,谁输了就去向卡特琳娜告白。。这一季中盖伦一如既往的怂。赵信为了帮他一把,故意表现出很厉害的样子,结果成功激活了盖伦的智商。赵信手中有n张牌,每张牌上面有一个数,这些牌是非递减的。现在盖伦从他手中抽取k张原创 2017-07-31 15:29:52 · 288 阅读 · 0 评论 -
HDU1255-覆盖的面积(线段树+扫描线——面积交)
覆盖的面积Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5801 Accepted Submission(s): 2899Problem Description给定平面上若干矩形,求出被这些矩形覆盖原创 2017-05-29 11:58:30 · 239 阅读 · 0 评论 -
玲珑1117RE:从零开始的异世界生活(线段树+思路)
1117 - RE:从零开始的异世界生活Time Limit:1s Memory Limit:256MByteSubmissions:431Solved:66DESCRIPTION486到了异世界,看到了一群可爱的妹子比如蕾姆啊,艾米莉亚啊,拉姆啊,白鲸啊,怠惰啊等等!有一天膜女告诉486说她的能力可能不能再用了,因为膜女在思考一个数据结原创 2017-08-07 18:02:34 · 443 阅读 · 0 评论 -
HDU 6430 Problem E. TeaTree(线段树)
Problem E. TeaTree Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 781 Accepted Submission(s): 291Problem Description Recently, TeaTr...原创 2018-08-23 17:03:53 · 260 阅读 · 0 评论