mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-07 15:45:40 +08:00
Update
This commit is contained in:
@ -70,7 +70,10 @@ public:
|
||||
|
||||
## 动态规划
|
||||
|
||||
使用背包要明确dp[i]表示的是什么,i表示的又是什么
|
||||
使用背包要明确dp[i]表示的是什么,i表示的又是什么?
|
||||
|
||||
填满i(包括i)这么大容积的包,有dp[i]种方法。
|
||||
|
||||
|
||||
```
|
||||
// 时间复杂度O(n^2)
|
||||
@ -94,6 +97,15 @@ public:
|
||||
}
|
||||
};
|
||||
```
|
||||
dp数组中的数值变化:(从[0 - 4])
|
||||
|
||||
```
|
||||
1 1 0 0 0
|
||||
1 2 1 0 0
|
||||
1 3 3 1 0
|
||||
1 4 6 4 1
|
||||
1 5 10 10 5
|
||||
```
|
||||
|
||||
# 总结
|
||||
|
||||
|
Reference in New Issue
Block a user