单调队列/栈
文章平均质量分 86
mrcoderrev
C
展开
-
FZU 1894
Time Limit: 1500MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescription世博会马上就要开幕了,福州大学组织了一次志愿者选拔活动。 参加志愿者选拔的同学们排队接受面试官们的面试。参加面试的同学们按照先来先面试并且先结原创 2016-07-30 08:31:14 · 328 阅读 · 0 评论 -
2017 计蒜之道 初赛 第六场 微软大楼设计方案(困难)(rmq+二分优化)@
近日,微软新大楼的设计方案正在广泛征集中,其中一种方案格外引人注目。在这个方案中,大楼由 nn 栋楼组成,这些楼从左至右连成一排,编号依次为 11 到 nn,其中第 ii 栋楼有 h_ihi 层。每栋楼的每一层为一个独立的 办公区域,可以步行 直达同层相邻楼栋的办公区域,以及 直达同楼栋相邻楼层的办公区域。由于方案设计巧妙,上一层楼、下一层楼、向左右移动到相邻楼栋同层的办公区域均刚好原创 2017-06-06 09:54:41 · 193 阅读 · 0 评论 -
HDU - 4362 Dragon Ball(单调队列优化的DP)@
Sean has got a Treasure map which shows when and where the dragon balls will appear. some dragon balls will appear in a line at the same time for each period.Since the time you got one of them,the oth原创 2017-06-06 11:40:08 · 233 阅读 · 0 评论 -
POJ - 4003 Bob’s Race (树形DP+二分+单调队列+记忆化搜索)@
Bob wants to hold a race to encourage people to do sports. He has got trouble in choosing the route. There are N houses and N - 1 roads in his village. Each road connects two houses, and all houses ar原创 2017-06-09 13:26:57 · 361 阅读 · 0 评论 -
51 nod 1255 字典序最小的子序列(单调栈 贪心)
1255 字典序最小的子序列题目来源: 天津大学OJ基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注给出一个由a-z组成的字符串S,求他的一个子序列,满足如下条件:1、包含字符串中所有出现过的字符各1个。2、是所有满足条件1的串中,字典序最小的。例如:bab原创 2017-09-14 17:33:13 · 902 阅读 · 0 评论 -
51 nod 合法括号子段 (单调栈)
合法括号子段 System Message (命题人)基准时间限制:1 秒 空间限制:131072 KB 分值: 40有一个括号序列,现在要计算一下它有多少非空子段是合法括号序列。合法括号序列的定义是:1.空序列是合法括号序列。2.如果S是合法括号序列,那么(S)是合法括号序列。3.如果A和B都是合法括号序列,那原创 2017-08-14 10:24:10 · 381 阅读 · 0 评论 -
LA 3029 City Game (DP||单调栈)
City Gamehttp://acm.hdu.edu.cn/showproblem.php?pid=1505Problem DescriptionBob is a strategy game programming specialist. In his new city building game the gaming environment is as fo原创 2017-07-23 20:09:42 · 278 阅读 · 0 评论 -
51 nod 1158 全是1的最大子矩阵(单调栈)
1158 全是1的最大子矩阵基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注给出1个M*N的矩阵M1,里面的元素只有0或1,找出M1的一个子矩阵M2,M2中的元素只有1,并且M2的面积是最大的。输出M2的面积。Input第1行:2个数m,n中间用空格分隔(2 <原创 2017-07-28 15:45:38 · 345 阅读 · 0 评论 -
EOJ 3246 实验室传染病(单调栈)@
实验室传染病Time limit per test: 2.0 secondsTime limit all tests: 10.0 secondsMemory limit: 256 megabytesECNU 的 ACM 实验室患上了一种传染病,这种病的传染性极强,并且因为每个人的体质不同传染的范围也不同。为了简化这个问题,我们不妨假设有 n 个人站在一条水平原创 2017-06-06 09:18:44 · 420 阅读 · 2 评论 -
hdu 4374 One hundred layer (DP+单调队列)@
Now there is a game called the new man down 100th floor. The rules of this game is: 1. At first you are at the 1st floor. And the floor moves up. Of course you can choose which part you will sta原创 2017-04-15 10:54:45 · 484 阅读 · 0 评论 -
hdu 5380 Travel with candy (单调队列)@
There are n+1 cities on a line. They are labeled from city 0 to city n. Mph has to start his travel from city 0, passing city 1,2,3...n-1 in order and finally arrive city n. The distance between city原创 2017-04-15 10:53:26 · 210 阅读 · 0 评论 -
POJ 3162 Walking Race (单调队列)@
flymouse’s sister wc is very capable at sports and her favorite event is walking race. Chasing after the championship in an important competition, she comes to a training center to attend a training c原创 2017-04-15 10:52:53 · 261 阅读 · 0 评论 -
hdu 5261 蜀道难 (单调队列)@
度度熊最近去四川游玩了一趟,在西南边,它发现了一个神奇的地方,那里有数不清的山,山脚的路组成了一个完美的圆,而山均匀的坐落在这个圆上。“此乃造物者之无尽藏也”,它大发诗情的感慨道。 山高皆不一,度度熊现在很想知道,距离最远的两座山顶是哪两座山。由于山顶不能直接到达,从一座山顶到另一座山顶的唯一方法是,先下山,沿着山脚的圆走到另一个山脚,再上山。当然,在山脚可以选择任意方向行走。In原创 2017-04-15 10:52:40 · 318 阅读 · 0 评论 -
POJ 2823 Sliding Window (单调队列)@
An array of size n ≤ 10 6 is given to you. There is a sliding window of size kwhich is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each ti原创 2017-04-15 10:52:02 · 321 阅读 · 0 评论 -
hdu 5945 Fxx and game(单调队列OR标记过程的bfs)@
Fxx and gameTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 486 Accepted Submission(s): 120Problem DescriptionYoung theoreti原创 2016-10-30 12:51:48 · 532 阅读 · 0 评论 -
51 nod 1275 连续子段的差异(单调队列)
1275 连续子段的差异题目来源: Codility基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注给出一个包括N个元素的整数数组A,包括A本身在内,共有 (N+1)*N / 2个非空子段。例如:1 3 2的子段为{1} {3} {2} {1 3} {3 2} {1 3 2}。在这些子原创 2017-10-15 12:46:05 · 334 阅读 · 0 评论