Update the text and code of DP.

This commit is contained in:
krahets
2023-07-10 20:36:48 +08:00
parent 5ea016816a
commit 465dafe9ec
5 changed files with 24 additions and 21 deletions

View File

@@ -6,7 +6,7 @@
!!! question
给定 $n$ 个物品,第 $i$ 个物品的重量为 $wgt[i-1]$ 、价值为 $val[i-1]$ ,现在有个容量为 $cap$ 的背包,请求解在不超过背包容量下背包中物品的最大价值。
给定 $n$ 个物品,第 $i$ 个物品的重量为 $wgt[i-1]$ 、价值为 $val[i-1]$ ,现在有个容量为 $cap$ 的背包,每个物品只能选择一次,问在不超过背包容量下背包中物品的最大价值。
请注意,物品编号 $i$ 从 $1$ 开始计数,数组索引从 $0$ 开始计数,因此物品 $i$ 对应重量 $wgt[i-1]$ 和价值 $val[i-1]$ 。