
线段树
Aurum_potestas_est
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
2017ICPC网络赛北京赛区 I题
2017ICPC网络赛北京赛区 I题 描述 You are given a list of integers a0, a1, …, a2^k-1.You need to support two types of queries:Output Minx,y∈[l,r] {ax∙ay}.Let ax=y.输入 The first line is an integer T, indicatin原创 2017-09-23 19:44:18 · 515 阅读 · 0 评论 -
HDU1754
Problem Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input 本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和 M ( 0#include<std原创 2017-09-23 20:02:09 · 326 阅读 · 0 评论 -
HDU1166
Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。原创 2017-09-23 20:07:55 · 310 阅读 · 0 评论 -
HDU1698
Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same原创 2017-09-23 20:27:17 · 330 阅读 · 0 评论 -
HDU2795
题意:有一块尺寸为h*w的矩形长板,要在上面贴1*wi的海报n张,选择贴海报的位置是:尽量高,同一高度,选择尽量靠左的地方。要求输出每张海报的高度位置。 思路:因为海报的宽度都是1,就可以把长板旋转90°(长变成高,高变成长),把底层的每张海报当作单个结点(线段树中 tree[root].l==tree[root].r的点)用来表示高度。 因为只有200000个点,所以线段树原创 2017-09-23 21:25:14 · 305 阅读 · 0 评论 -
POJ-2528-Mayor's posters(线段树)
Sample Input 1 5 1 4 2 6 8 10 3 4 7 10 Sample Output 4 题意:第一行输入几组样例T,第二行输入n次更新,接下来n行输入每次更新的区间,每次更新在区间上覆盖一种新的颜色,求全部更新完毕之后,最外一层能看到的有几种颜色。 思路:令每种颜色对应一个数字,其中数字0表示未被染色或者被多种颜色染色。 注意:由于l,r过大,需要...原创 2018-02-22 17:44:15 · 226 阅读 · 0 评论 -
HDU3887 dfs序+线段树
Problem Description You are given a tree, it’s root is p, and the node is numbered from 1 to n. Now define f(i) as the number of nodes whose number is less than i in all the succeeding nodes of node ...原创 2018-04-19 21:25:11 · 559 阅读 · 1 评论 -
HDU5039线段树+dfs序
Problem Description After June 1st, elementary students of Ted Land are still celebrating “The Sacred Day of Elementary Students”. They go to the streets and do some elementary students stuff. So we ...原创 2018-04-20 17:00:17 · 303 阅读 · 0 评论 -
HDU3333 线段树+离线询问
After inventing Turing Tree, 3xian always felt boring when solving problems about intervals, because Turing Tree could easily have the solution. As well, wily 3xian made lots of new problems about int...原创 2018-07-18 18:59:00 · 290 阅读 · 0 评论