All these items in the knapsack are evocative, and what they do is suggesting a plot.
背包里的所有物品都能唤起人们的回忆,而它们所做的就是暗示一个情节。
You could construct all subsets, check that the weight is less than the weight of the knapsack, and then choose the subset with the maximum value.
你可以构建所有子集,检查重量是否小于背包的重量,然后选择最大值的子集。
While serving a compulsory stint in the military, Nurmi entered a 20-k march carrying a rifle, a cartridge belt, and a knapsack.
在军中服义务役的时候,努尔米带着一支步枪、一条子弹带和一个背包参加了20公里行军。
Of course, all these items in the knapsack are evocative and what they do is they suggest a plot.
而这些东西都能唤起士兵的回忆和感情,它们作为线索。
And so you could construct all subsets, check that the weight is less than the weight of the knapsack, and then choose the subset with the maximum value.
因此你可以构建所有子问题,判断它的重量,是否小于背包的重量,然后选择值最大的子问题。
Let's now go back and instantiate these ideas for the knapsack problem we looked at last time In particular, for the 0-1 knapsack problem.
让我们回来用具体例子,来说明我们上次看过的背包问题,特别是对0-1背包问题来说。
应用推荐