![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
单调队列优化dp
吴俊达9812
这个作者很懒,什么都没留下…
展开
-
Vijos1243:生产产品
单调队列优化dp模板题 #include <bits/stdc++.h> #define fi first #define se second using namespace std; typedef long long LL; const int maxn = 10; const int maxm = 100005; LL T[maxn][maxm]; LL dp[maxm][m...原创 2019-08-25 20:52:02 · 142 阅读 · 0 评论 -
【POJ3017】Cut the Sequence
单调队列 + set #include <cstdio> #include <set> #include <deque> using namespace std; const int maxn=1e5+10; int n,a[maxn],q[maxn]; long long m,sum[maxn],dp[maxn]; multiset<long lo...原创 2019-08-26 14:24:39 · 176 阅读 · 0 评论 -
bzoj 2806 后缀自动机 + 单调队列dp + 性质
题意:将 一个字符串分为几段,且其中长度 大于 L 且在文本库中出现的串的长度 大于等于90%,求满足条件的最大L 思路:好题好题 1.至少这种东西8成是二分(二分不要总想等于) 2.考虑用dp对每一个L进行验证。这里的难点是发现dp的转移具有单调性,不太明显的单调性。 主要用到 一个性质,相邻的两个前缀在另一个字符串中的最长公共后缀的 差( 后 - 前 ) <= 1 3.另一个...原创 2019-09-12 22:25:01 · 269 阅读 · 0 评论