01背包#include <iostream>#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;const int N = 1e3 + 7;int n, m, w, v, f[N][N]; //考虑前i个物品,容量不超过j的最大价值// f[x][y]:考虑前x件物品中,当前使用的体积不超过y时,所能取得的最大价值/*状态转移方程、
01背包#include <iostream>#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;const int N = 1e3 + 7;int n, m, w, v, f[N][N]; //考虑前i个物品,容量不超过j的最大价值// f[x][y]:考虑前x件物品中,当前使用的体积不超过y时,所能取得的最大价值/*状态转移方程、