![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
动态规划
文章平均质量分 88
June.lu
这个作者很懒,什么都没留下…
展开
-
HDU 4856 Tunnels(BFS+状压DP)
TunnelsTime Limit: 3000/1500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1859 Accepted Submission(s): 546Problem DescriptionBob is travelling i原创 2015-11-07 00:50:53 · 122 阅读 · 0 评论 -
二维费用背包问题+空间优化(滚动数组)
题目描述:在计算机世界,我们一直追求用最小的资源产生最大的价值。现在,假设你可以支配m个0和n个1。同时有一些只有0和1组成的字符串。你的任务是用这些0和1去组成这些字符串,输出最多能组成多少个字符串。每个0和1只能被使用一次。样例输入样例一输入: Array = {"10", "0001", "111001", "1", "0"}, m = 5, n =原创 2017-09-01 13:54:40 · 784 阅读 · 0 评论 -
HDU2089 不要62(简单的数位DP)
不要62Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 29687 Accepted Submission(s): 10460Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音原创 2016-02-29 22:52:41 · 471 阅读 · 0 评论 -
2015 UESTC Training for Dynamic Programming N - 导弹拦截 LIS nlog(n)+打印字典序最小的路径
N - 导弹拦截Time Limit:1000MS Memory Limit:65535KB 64bit IO Format:%lld & %lluSubmit Status Practice UESTC 251Appoint description: System Crawler (2016-03-21)Description某国原创 2016-03-24 20:27:39 · 831 阅读 · 0 评论 -
LCIS详解
dp[i][j]表示a[1]~a[i]和b[1]~b[j]并以b[j]结尾的最长公共上升子序列,如果a[i]不等于b[j]时,很明显dp[i][j]的值就等于dp[i-1][j];如果a[i]等于b[j]时,就在b[1]~b[j]中寻找b[k]使得b[j]>b[k]而且dp[i][k]是最大的。即状态转移方程为:dp[i][j] = dp[i-1][j](a[i] != b[j]),dp[i][j原创 2016-03-11 22:13:27 · 1243 阅读 · 0 评论 -
POJ 1836 Alignment 变形的LIS
AlignmentTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 15323 Accepted: 4974DescriptionIn the army, a platoon is composed by n soldiers. During the mor原创 2016-04-04 21:57:41 · 377 阅读 · 0 评论 -
POJ 3267 The Cow Lexicon 基础DP
The Cow LexiconTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 9199 Accepted: 4369DescriptionFew know that the cows have their own dictionary with W (原创 2016-04-04 21:38:59 · 915 阅读 · 0 评论 -
POJ 1276 Cash Machine 多重背包O(n*m)算法
Cash MachineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 31407 Accepted: 11288DescriptionA Bank plans to install a machine for cash withdrawal. The原创 2016-04-04 18:41:27 · 474 阅读 · 0 评论 -
UVA - 12507 状压DP
KingdomsTime Limit: 1000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescription题意:在钱数为k的限制下,求建与1直接或者间接相连的桥,使得人数最多。思路:初始化只有1的状态为0,其余为原创 2016-03-11 01:00:44 · 492 阅读 · 0 评论 -
POJ 1837 Balance 基础DP
BalanceTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 12659 Accepted: 7935DescriptionGigel has a strange "balance" and he wants to poise it. Actually,原创 2016-04-04 18:28:52 · 483 阅读 · 0 评论 -
2015 UESTC Training for Dynamic Programming 男神的约会 BFS+状压DP
D - 男神的约会Time Limit:1000MS Memory Limit:65535KB 64bit IO Format:%lld & %lluSubmit Status Practice UESTC 1134Appoint description: System Crawler (2016-03-02)Description原创 2016-03-05 10:53:20 · 159 阅读 · 0 评论 -
回文串划分(动态规划)
题目描述给出一个字符串 s,对这个字符串进行切分,每个子串都必须是一个回文字符串,问最少要切多少次。Example:给出 s = “aab”,返回最少切分次数 1。因为只需要一次切分就能把 s 切分成符合要求的两个子串[“aa”, “b”] 。暴力法:枚举起点和终点去求该区间字符串的最长回文字串(时间复杂度O(n^2)),找到后就去递归剩下的字串(时间复杂度原创 2017-09-11 21:52:49 · 1224 阅读 · 0 评论