1. 01背包问题 有 N 件物品和一个容量为 V 的背包,每件物品有各自的价值且只能被选择一次,要求在有限的背包容量下,装入的物品总价值最大。 方程:f [ i ][ j ] = max( f [ i -1 ][ j ] , f [ i -1 ][ j - v[ i ] ] + w[ i ] ) #include <stdio.h> int max(int a,int b) { return a>b?a:b; } const int N=1010; int f[N][N]; int v[N],w[N]; int n,m; int main() {...