ACM_单调队列
文章平均质量分 87
zhj5chengfeng
这个作者很懒,什么都没留下…
展开
-
POJ 2823——Sliding Window
Sliding WindowTime Limit: 12000MS Memory Limit: 65536KTotal Submissions: 24525 Accepted: 7206Case Time Limit: 5000MSDescriptionAn array of size n ≤ 106 is giv原创 2012-06-09 22:36:29 · 470 阅读 · 0 评论 -
关于单调队列的个人理解
一、何为单调队列? 1、首先搞懂,什么是队列 队列是一种数据结构,两个端口,一个端口进元素,一个端口出元素,那么,根据这种操作的定义,不难发现:队列具有“先进先出”的性质 2、单调队列 单调队列,顾名思义,具有的单调性的队列,即队列中的元素按照某种特征有一定的顺序。比如单调递增的队列,单调递减的队列。 3、举个例子:单调递增的队列:原创 2012-06-09 23:01:35 · 1168 阅读 · 0 评论 -
HDU 1003——Max Sum (单调队列做法)
Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5原创 2012-06-15 16:02:30 · 616 阅读 · 0 评论 -
单调队列优化DP能到什么程度(今天中午进行的实验记录)
想了一早上单调队列优化DP,总觉得不能优化到哪里去,又从来没有做过这种需要用单调队列优化的DP,于是自己用手模拟了一下实现过程,瞬间就明白了单调队列优化DP,这个DP的转移方程应该具有的性质。单调队列很好理解,就是一个双向队列,队首队尾允许删除操作,队尾进行添加操作,维护整个队列的严格单调性,即队列中不存在相等的元素(这样时间常数小一点)。那么用单调队列优化的DP应该具有怎样的性质呢?原创 2012-06-11 16:37:49 · 3639 阅读 · 1 评论 -
HDU 3706——Second My Problem First
【题目描述】Give you three integers n, A and B. Then we define Si = Ai mod B and Ti = Min{ Sk | i-A = 1}Your task is to calculate the product of Ti (1 【输入】Each line will contain three inte原创 2012-06-15 15:08:04 · 1253 阅读 · 3 评论 -
HDU 3415——Max Sum of Max-K-sub-sequence
Problem DescriptionGiven a circle sequence A[1],A[2],A[3]......A[n]. Circle sequence means the left neighbour of A[1] is A[n] , and the right neighbour of A[n] is A[1].Now your job is to calculate原创 2012-06-15 17:18:34 · 835 阅读 · 0 评论