摘要: #include <cstdlib>#include <cstring>#include <iostream>using namespace std;int p[1005], w[1005], dp[1005][1005], N, V;void DP(){ memset(dp, 0, sizeof (dp)); for (int i = 1; i <= N; ++i) { for (int j = V; j >= 0; --j) { if (j >= w[i] && dp[i-1][j-w[i]] + p[i] > d 阅读全文
posted @ 2012-06-27 12:48 沐阳 阅读(748) 评论(0) 推荐(0) 编辑