线段树
ldu商正昌
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Count the Colors (线段树区间染色问题)
Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your task is counting the segments of different colors you can see at last.Input...原创 2019-08-07 20:15:47 · 871 阅读 · 0 评论 -
Tunnel Warfare 线段树最值
在抗日战争期间,华北平原广大地区进行了大规模的隧道战。一般来说,通过隧道连接的村庄排成一列。除了两端,每个村庄都与两个相邻的村庄直接相连。入侵者经常对一些村庄发动袭击并摧毁其中的部分隧道。八路军指挥官要求最新的隧道和村庄连接状态。如果某些村庄严重隔离,必须立即恢复连接!输入输入的第一行包含两个正整数n和m(n,m≤50,000),表示村庄和事件的数量。接下来的m行中的每一行描述一个事...原创 2019-08-18 15:10:15 · 239 阅读 · 0 评论 -
P1531 I Hate It(线段树区间最大值)
题目背景很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。题目描述不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩输入格式第一行,有两个正整数 N 和 M ( 0<N<=200000,0<M<5000 ),分别代表学生的数目和操作的数目。学生...原创 2019-10-02 21:05:55 · 215 阅读 · 0 评论 -
A Simple Problem with Integers POJ - 3468
A Simple Problem with Integers POJ - 3468整理一下之前刷过的题You have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each numbe...原创 2019-10-03 20:35:10 · 219 阅读 · 0 评论 -
P1558 色板游戏(线段树+位运算)
题目链接:https://www.luogu.org/problem/P1558题目背景阿宝上学了,今天老师拿来了一块很长的涂色板。题目描述色板长度为L,L是一个正整数,所以我们可以均匀地将它划分成L块1厘米长的小方格。并从左到右标记为1, 2, … L。现在色板上只有一个颜色,老师告诉阿宝在色板上只能做两件事:“C A B C” 指在A到 B 号方格中涂上颜色 C。“P A B” ...原创 2019-10-03 20:57:07 · 279 阅读 · 0 评论 -
P1607 [USACO09FEB]庙会班车Fair Shuttle(贪心+线段树维护)
题目描述Although Farmer John has no problems walking around the fair to collect prizes or see the shows, his cows are not in such good shape; a full day of walking around the fair leaves them exhausted. ...原创 2019-10-04 20:29:10 · 230 阅读 · 0 评论
分享