摘要: 题意;5Ab3bd加上多少个字符可以是字符串为回文串#includeusing namespace std;short dp[5005][5005];char s1[5005],s2[5005];int fmax(int x,int y){ if(x>y) return x; return y;}i... 阅读全文
posted @ 2014-07-15 16:14 _一千零一夜 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 2//两个测试用例2//需要购买两种珠宝100 1//需要购买的珠宝数量与价值100 2//31 101 11100 12低价的珠宝可以被高价的珠宝代替,买每种珠宝都必须多买10件,问最少需要花费多少钱#includeusing namespace std;int dp[111],cunt[111]... 阅读全文
posted @ 2014-07-15 16:13 _一千零一夜 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 71 7 3 5 9 4 8求最长上升子序列的个数#includeusing namespace std;int dp[10001];int a[10001];int main(){ int max; int i,j; int n; while(scanf("%d",&n)!=EOF) { max... 阅读全文
posted @ 2014-07-15 16:12 _一千零一夜 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 81.86 1.86 1.30621 2 1.4 1 1.97 2.2有八个大兵身高如上 求至少出列几个大兵可以站成山形队列#includeusing namespace std;double a[1111];int dp1[1111];int dp2[1111];int main(){ int i... 阅读全文
posted @ 2014-07-15 16:11 _一千零一夜 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Poj 3267题意:6 10Browndcodw 长度为10下面为字典 cowmilkwhiteblackbrownfarmer 让求字符串删除多少字符可以与字典匹配#include#include#includeusing namespace std; int w,l,dp[305];char ... 阅读全文
posted @ 2014-07-15 16:10 _一千零一夜 阅读(249) 评论(0) 推荐(0) 编辑