摘要: hduoj1025——dp, lisConstructing Roads In JGShining's KingdomTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submis... 阅读全文
posted @ 2015-03-20 23:27 __560 阅读(248) 评论(0) 推荐(0) 编辑
摘要: poj1080——lcs变形,dpHuman Gene FunctionsTime Limit:1000MSMemory Limit:10000KTotal Submissions:17610Accepted:9821DescriptionIt is well known that a human ... 阅读全文
posted @ 2015-03-20 21:11 __560 阅读(213) 评论(0) 推荐(0) 编辑
摘要: lis(最长上升子序列) dp求序列的lis,子序列可不连续 for(int i=1;ians) ans=dp[i]; } printf("%d\n",ans);View Code上面的算法是n^2的,现在补充nlogn的算法,下面算法手动模拟一下不难理解#include#incl... 阅读全文
posted @ 2015-03-20 19:59 __560 阅读(312) 评论(0) 推荐(0) 编辑
摘要: lcs(最长公共子序列)求两个序列的lcs的长度,子序列可不连续dp[i][j]=dp[i-1][j-1]+1(a[i]==b[i])dp[i][j]=max(dp[i-1][j],dp[i][j-1])(a[i]!=b[i]) memset(dp,0,sizeof(dp)); for(... 阅读全文
posted @ 2015-03-20 19:56 __560 阅读(259) 评论(0) 推荐(0) 编辑
摘要: poj3176——dpCow BowlingTime Limit:1000MSMemory Limit:65536KTotal Submissions:14683Accepted:9764DescriptionThe cows don't use actual bowling balls when ... 阅读全文
posted @ 2015-03-20 18:32 __560 阅读(184) 评论(0) 推荐(0) 编辑
摘要: poj2533——lis(最长上升子序列), 线性dpLongest Ordered SubsequenceTime Limit:2000MSMemory Limit:65536KTotal Submissions:36143Accepted:15876DescriptionA numeric se... 阅读全文
posted @ 2015-03-20 18:17 __560 阅读(199) 评论(0) 推荐(0) 编辑
摘要: poj1260——线性dpPearlsTime Limit:1000MSMemory Limit:10000KTotal Submissions:7705Accepted:3811DescriptionIn Pearlania everybody is fond of pearls. One com... 阅读全文
posted @ 2015-03-20 12:35 __560 阅读(200) 评论(0) 推荐(0) 编辑
摘要: poj1836——dp,最长上升子序列(lis)AlignmentTime Limit:1000MSMemory Limit:30000KTotal Submissions:13767Accepted:4450DescriptionIn the army, a platoon is composed... 阅读全文
posted @ 2015-03-20 00:12 __560 阅读(253) 评论(0) 推荐(0) 编辑