问题:0/1背包问题
例子:weight数组代表物品重量,value数组代表物品价值,M代表背包容量。背包是按单位价值递减的顺序排列的,即value[i]/weight[i]>value[i-1]/weight[i-1].
const int weight [ Max ] = { 1 , 11 , 21 , 23 , 33 , 43 , 45 , 55 };
问题:0/1背包问题
例子:weight数组代表物品重量,value数组代表物品价值,M代表背包容量。背包是按单位价值递减的顺序排列的,即value[i]/weight[i]>value[i-1]/weight[i-1].
const int weight [ Max ] = { 1 , 11 , 21 , 23 , 33 , 43 , 45 , 55 };