From 6586f9a8299138d0e7fcb6135f68c75d67a36bdc Mon Sep 17 00:00:00 2001 From: weiting-cn <2254912@qq.com> Date: Thu, 13 Jan 2022 17:06:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=8C=E5=85=A8=E8=83=8C?= =?UTF-8?q?=E5=8C=85=E9=81=8D=E5=8E=86=E8=83=8C=E5=8C=85=E5=AE=B9=E9=87=8F?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E8=BE=B9=E7=95=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/背包问题理论基础完全背包.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/背包问题理论基础完全背包.md b/problems/背包问题理论基础完全背包.md index 3cc8557c..f79310b8 100644 --- a/problems/背包问题理论基础完全背包.md +++ b/problems/背包问题理论基础完全背包.md @@ -52,7 +52,7 @@ for(int i = 0; i < weight.size(); i++) { // 遍历物品 ```CPP // 先遍历物品,再遍历背包 for(int i = 0; i < weight.size(); i++) { // 遍历物品 - for(int j = weight[i]; j < bagWeight ; j++) { // 遍历背包容量 + for(int j = weight[i]; j <= bagWeight ; j++) { // 遍历背包容量 dp[j] = max(dp[j], dp[j - weight[i]] + value[i]); }