摘要:
题意:略多重背包#include #include#includeusing namespace std;#define MAXV 15#define MAXM 100050int cash,n,value[MAXV],c[MAXV],f[MAXM],user[MAXM];int main(){ int i,j,max; while(~scanf("%d%d",&cash,&n)){ for(i=1;imax) max=j; } } printf("%d\n",max); } return 0;} 阅读全文
posted @ 2013-12-01 21:52
Teemo的技术blog
阅读(79)
评论(0)
推荐(0)
摘要:
题意:略求最长公共子串#include#include#includeusing namespace std;int dp[500][500];int max(int a,int b){ return a>b?a:b;}int main(){ int i,j,a,b; char s1[400],s2[400]; while(scanf("%s%s",s1,s2)!=EOF) { memset(dp,0,sizeof(dp)); a=strlen(s1); b=strlen(s2); for(i=1;i<=a;i++) { for(j=1;j<=b;j++) 阅读全文
posted @ 2013-12-01 21:49
Teemo的技术blog
阅读(90)
评论(0)
推荐(0)