问题描述
问题:
游客想在周末和他的朋友一起旅行。他们会去山上看看大自然的奇观,所以他需要为这次旅行打包好。他有一个很好的背包用于携带东西,但他知道他最多只能携带4公斤的东西,而且必须持续一整天。他创建了一份他希望为旅行带来的清单,但所有物品的总重量太多了。然后,他决定将列添加到他的初始列表中,详细说明其权重,以及表示该项目对旅行的重要程度的数值。
游客可以选择从列表中选择任意项目组合,但每个项目中只有一个可用。他可能不会削减或减少物品,所以他只能拿走任何物品的整个单位。
游客选择哪些物品以获得最大值并且不超过背包可以携带的重量?
这里是清单:
Question:
A tourist wants to make a good trip at the weekend with his friends. They will go to the mountains to see the wonders of nature, so he needs to pack well for the trip. He has a good knapsack for carrying things, but knows that he can carry a maximum of only 4kg in it and it will have to last the whole day. He creates a list of what he wants to bring for the trip but the total weight of all items is too much. He then decides to add columns to his initial list detailing their weights and a numerical value representing how important the item is for the trip.
The tourist can choose to take any combination of items from the list, but only one of each item is available. He may not cut or diminish the items, so he can only take whole units of any item.
Which items does the tourist choose in order to get the total maximum value and not exceed the weight that the knapsack can carry?
Here is the list:
item weight (grams) value
map 90 150
compass 130 35
water 1530 300
Gold bar 3000 130
sandwich 500 160
glucose 150 60
tin 680 45
banana 270 60
apple 390 40
cheese 230 30
beer 620 10
suntan cream 110 70
camera 320 30
T-shirt 240 15
trousers 480 10
推荐答案
这篇关于任何人都可以指导我在哪里可以获得解决此问题的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!