![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
单调队列DP
plalap
这个作者很懒,什么都没留下…
展开
-
单调队列(滑动窗口):纪念我因head tail的WA
初值似乎没什么用 然后我就WA了。。。 如果初值为h1=1,t1=0,h2=1,h1=0; 判断head tail是加等号 如果h1==t1 可以不加 代码如下: //1359:滑动窗口(pusu)//next单调队列 #include<iostream> #include<cstring> #include<algorithm&a原创 2018-10-08 21:13:55 · 193 阅读 · 0 评论 -
最大子序列和(2种)
(转载请标明作者) 1276: 最大子序列和 时间限制: 1 Sec 内存限制: 64 MB 题目描述 输入一个长度为n的整数序列(A1,A2,…,An),从中找出一段连续的长度不超过M的子序列,使得这个子序列的和最大。例如: 序列1,-3,5,l,-2,3, 当M = 2或3时,S = 5 + 1 = 6;当M = 4时,S = 5 + 1 +(-2)+ 3 = 7。 输入...原创 2018-10-27 10:58:38 · 289 阅读 · 0 评论