Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a273e8f

Browse files
committed
20210128动规周末总结:修改目标和 动规五部曲步骤1和2中 i 和 j 的错误使用
1 parent 70d779d commit a273e8f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

problems/周总结/20210128动规周末总结.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ S 和 sum都是固定的,那此时问题就转化为01背包问题(数列中
1010

1111
1. 确定dp数组以及下标的含义
1212

13-
**dp[j] 表示:填满j(包括j)这么大容积的包,有dp[i]种方法**
13+
**dp[j] 表示:填满j(包括j)这么大容积的包,有dp[j]种方法**
1414

1515
2. 确定递推公式
1616

17-
dp[i] += dp[j - nums[j]]
17+
dp[j] += dp[j - nums[i]]
1818

1919
**注意:求装满背包有几种方法类似的题目,递推公式基本都是这样的**
2020

0 commit comments

Comments
 (0)