![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
dp
丽尔巴茨
这个作者很懒,什么都没留下…
展开
-
hdu 1069 线性dp LIS变形题
Monkey and Banana Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 23070 Accepted Submission(s): 12365 Problem Description A group of researc...原创 2019-06-14 15:43:44 · 145 阅读 · 0 评论 -
算法竞赛进阶指南 位运算与状态dp经典入门题 最短哈密顿路径
题目描述 给定一张 nn 个点的带权无向图,点从 0~n-1 标号,求起点 0 到终点 n-1 的最短Hamilton路径。 Hamilton路径的定义是从 0 到 n-1 不重不漏地经过每个点恰好一次。 输入格式 第一行输入整数nn。 接下来nn行每行nn个整数,其中第ii行第jj个整数表示点ii到jj的距离(记为a[i,j])。 对于任意的x,y,zx,y,z,数据保证 a[x,x]=0...原创 2019-06-05 04:57:10 · 199 阅读 · 0 评论 -
P3041AC自动机+dp
第一道ac自动机加dp的题目 1a了很开心 据说ac自动机的dp都是有套路的,就是状态表示大都是2维,dp[i][j],表示串匹配了i个,最后一位停留在了trie图的j号点上了 这题是模板题, 以下给出ac代码 #include <stdio.h> #include <string.h> #include <algorithm> #include <que...原创 2019-08-21 06:24:36 · 160 阅读 · 0 评论 -
p3572 单调队列优化dp模板题
以下给出ac代码: #include <stdio.h> #include <algorithm> #include <string.h> #include <queue> using namespace std; const int maxn=1e6+7; int h[maxn],q[maxn],head,tail,dp[maxn]; int n...原创 2019-09-09 18:54:05 · 113 阅读 · 0 评论