标签:chm search image ems print href str and number
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 66304 Accepted Submission(s): 27660
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int T,n,m,w[1100],v[1100],f[1100]; int main(){ scanf("%d",&T); while(T--){ memset(f,0,sizeof(f)); scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) scanf("%d",&v[i]); for(int i=1;i<=n;i++) scanf("%d",&w[i]); for(int i=1;i<=n;i++) for(int j=m;j>=w[i];j--) f[j]=max(f[j],f[j-w[i]]+v[i]); printf("%d\n",f[m]); } }
标签:chm search image ems print href str and number
原文地址:http://www.cnblogs.com/cangT-Tlan/p/7435371.html