动态规划
文章平均质量分 74
Jane-Young
这个作者很懒,什么都没留下…
展开
-
hdu 2084 数塔
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2084这题如果从上往下递推就要分两种情况写递推式:if(i-j>=1)dp[i][j]=max(dp[i-1][j]+dp[i-1][j+1])+当前[i][j]的值elsedp[i][j]=dp[i-1][j-1]+当前[i][j]的值但是如果倒过来考虑,也就是从底部开始往上递原创 2013-11-15 10:18:59 · 735 阅读 · 0 评论 -
hdu 1003 Max Sum
DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.原创 2013-11-15 10:18:21 · 612 阅读 · 0 评论 -
hdu 1087 Super Jumping! Jumping! Jumping!
DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now. T原创 2013-11-15 10:18:19 · 651 阅读 · 0 评论 -
hdu 1159 Common Subsequence
DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exists a st原创 2013-11-15 10:18:17 · 700 阅读 · 0 评论 -
hdu 1158 Employment Planning
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1158动态规划(表示我的dp好弱,挽尊~~~)dp[i][j]表示第i个月雇佣j人的最小代价。其中j大于等于当月需求人数,小于等于这几个月中需求最大的那个月的人数。状态转移方程: dp[i][j]=min(dp[i-1][k]+当月代价,dp[i][j]) k大于等于i-1月需求人数,小原创 2013-11-15 10:19:07 · 751 阅读 · 0 评论 -
uva11584 Partitioning by Palindromes
dp[i]表示到字符串第i个时原创 2014-07-01 22:46:34 · 408 阅读 · 0 评论 -
uva 11361 Investigating Div-Sum Property
各位数之和不会超过100,所原创 2014-08-05 09:07:17 · 426 阅读 · 0 评论