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.
因此你可以构建所有子问题,判断它的重量,是否小于背包的重量,然后选择值最大的子问题。
And if you want to lose body fat as far as that kind of weight, that's the way to do it.
如果你想要减掉脂肪和重量,这就是方法。
Then if the weight of i is less than the available weight, I can return the value of i.
然后如果i的重量,小于剩下的重量,我将返回i的价值。
And inside of each of these cups is a different weight so that in theory all of these cups are different weights.
每个杯子里的东西重量都不同,这样,从理论上看,这些杯子的重量都不同。
Fat has twice the calories per unit weight that protein or carbohydrate sugar has, as a consequence, has the greatest survival value.
单位重量中脂肪的热量含量,是蛋白质和碳水化合物的两倍,因此,脂肪才是最能维持生存的物质
Each weighing, say, one 100th of the weight 1/100 needed to establish p external is equal to p1.
每颗重,比方说,使外压强,达到p1的重量的。
It was a tragic--It was crushed by the weights of the electrodes.
是个悲剧,被电极的重量给压死了
He has on top of his head a helmet made of bronze, perhaps weighing about five pounds, these are approximate; they would have differed from person to person to some degree.
他的头部有铜质头盔,头盔大概重五磅,这只是大概的重量,实际重量因人而异
They pay you money, we had a lot of very famous, very prominent customers, but all of a sudden, we started to compete with every one of them. It's quite risky.
他们付你钱,那时我们有许多有名的,重量级的客户,但突然间,客户变成了对手,这么做风险很大。
And during the siege there were sixty-five balloon flights carrying two and a half million letters, weighing a grand total of 10,000 kilograms, so roughly about 20,000 pounds.
在巴黎被围期间,共放出了六十五个热气球,带走了多达两百五十万封信,合计重量约有一万公斤,也就是两万磅左右
STUDENT: PROFESSOR: Yeah. There's a branch we could finish here, but since we're out of weight we sort of know we're going to be done.
学生:【听不见】,教授:是的,我们可以在,这个分支结束,但是因为我们重量超标了,我们知道我们只能结束。
And now we want to find the subset of a that has the maximum value, subject to the weight constraint.
会有一个值与其对应,现在我们想要找出满足,重量约束条件的a的最大值子集。
So all you have behind here for spaces sake is just 8 cups, each with different weights.
在天平后面就是8个杯子,它们的重量互不相同。
As I mentioned before, fat has twice the calories per unit weight as protein and carbohydrate.
如我之前所说,单位重量中脂肪的热量含量,是蛋白质和碳水化合物的两倍
So here's where we have 30 elements, 40 and a maximum weight of 40.
所以这里我们有30个元素,最大重量是。
Let's look at an example.
让我们假设重量是。
So each of these cups again have different weights if I want to find the lightest of them I might start not knowing which is which.
它们的重量互不相同,如果我要,找出最轻的一个,而我根本不知道会是,哪一个。
And people are making errors of this magnitude you can see the problem.
如果人们在重量估测上犯了错,问题便出现了
So how would we go about solving this problem if I told you not only was there a maximum weight, but there was a maximum volume. Well, we want to go back and attack it exactly the way we attacked it the first time, which was write some mathematical formulas.
有些时候两个都重要,所以如果我告诉你这里不仅有,最大重量还有最大容量,我们应该怎么解决这个问题呢?,好了,我们想回过来然后,和第一次一样看看这个问题。
The next line says if the weight of i is greater than a w, well then I know I can't put it in.
下一行说的是,如果i的重量比a,w大,好吧,我知道我不能把它放进去。
Item 1 has a weight of 3.
号物品重量是。
Of the weights and the values.
代表的是重量和价值。
This is the weight still available.
这是剩下的重量。
v The weight, w, and v, these are the two vectors we've seen here.
重量是w和价值,这是我们看过的向量的两个值。
a w And the amount of weight available, a w, for available weight.
合适的重量的个数是,也就是available,weight的简写。
And so the value of with i will be the value of i plus whatever I can get using the remaining items and decrementing the weight by the weight of i.
所以装上i之后的总价值,就是i的价值加上剩下物品中,符合条件者的所有价值,再在剩余重量中减去i的重量。
应用推荐