![](https://img-blog.csdnimg.cn/20200310223638417.jpeg?x-oss-process=image/resize,m_fixed,h_224,w_224)
DP
动态规划
浅眠流转
这个作者很懒,什么都没留下…
展开
-
Count the string_HDU3336
文章目录[Count the string_HDU3336](http://acm.hdu.edu.cn/showproblem.php?pid=3336)题目大意解题思路代码Count the string_HDU3336题目大意一共有T组字符串,每组有一个长度为n的字符串。让你求这个字符串的每一个前缀串在这个字符串中出现的次数和是多少。解题思路我们对这个字符串进行KMP求出next数组,我们会发现,next[i] 表示的是,公共前缀子串的长度,进而对next数组的值作为线性DP的下标进行求解就原创 2020-10-10 12:24:50 · 156 阅读 · 0 评论 -
Two Matchings(有趣的一道简单dp)
文章目录[E.Two Matchings ](https://ac.nowcoder.com/acm/contest/5668/E)这里直接放一位大佬的题解吧本题所得代码E.Two Matchings 这里直接放一位大佬的题解吧本题所得当一个数列在计算的时候,出现了多种状态的时候,不能只顾头尾不管中间,这时候需要用的dp去慢慢的选择每一步中最优的状态!代码#include<bits/stdc++.h>using namespace std;typedef long long ll原创 2020-07-20 11:05:42 · 143 阅读 · 0 评论 -
E. Array Shrinking
文章目录[E. Array Shrinking](https://codeforces.com/contest/1312/problem/E)题目大意解题思路代码E. Array Shrinking题目大意给你一个长度为n的数列,没两个相同的数字可以抵消,变成不这个数字大一的新数字,问你经过多次操作后,这一个数列最少省多少个。解题思路这是一个区间DP,,可能是我太菜了,我个人感觉就是换个...原创 2020-03-10 22:35:23 · 468 阅读 · 0 评论 -
F. Good Contest(DP+组合数学)
文章目录[F. Good Contest](https://codeforces.com/contest/1295/problem/F)题目大意解题思路代码F. Good Contestinput31 21 21 2output499122177input242 133713 420output578894053input21 10 0output...原创 2020-02-02 22:00:59 · 312 阅读 · 0 评论 -
背包九讲
B站上的一位大佬将的还挺不错可以点击观看本片博客的例题来源都还挺不错的可以进去看看背包问题对于学动态规划还是挺有帮助的,写的比较简单,对于01背包可以自己画个流程图多跑几遍就可以了!个人感悟比较错漏!01背包01背包九讲里面最简单的一种了,但是也是最重要的一种,其他的几种基本上都可以用01背包的解题思路来去解决,接下来结合例题来解决一下吧;有 N 件物品和一个容量是 V 的背包。每件物...原创 2019-08-02 21:14:41 · 3300 阅读 · 0 评论 -
HDU-2196-Computer
computerTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 37195 Accepted Submission(s): 6420A school bought the first computer some time ...原创 2019-07-25 17:56:22 · 124 阅读 · 0 评论 -
CF-1121D-D. Make The Fence Great Again
D. Make The Fence Great Againtime limit per test:2 secondsmemory limit per test:256 megabytesinputstandard inputoutputstandard outputYou have a fence consisting of n vertical boards. The width of...原创 2019-09-20 16:54:37 · 369 阅读 · 0 评论