Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 0494.目标和.md #2538

Merged
merged 1 commit into from
May 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions problems/0494.目标和.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ dp[j] 表示:填满j(包括j)这么大容积的包,有dp[j]种方法

* 已经有一个1(nums[i]) 的话,有 dp[4]种方法 凑成 容量为5的背包。
* 已经有一个2(nums[i]) 的话,有 dp[3]种方法 凑成 容量为5的背包。
* 已经有一个3(nums[i]) 的话,有 dp[2]中方法 凑成 容量为5的背包
* 已经有一个4(nums[i]) 的话,有 dp[1]中方法 凑成 容量为5的背包
* 已经有一个5 (nums[i])的话,有 dp[0]中方法 凑成 容量为5的背包
* 已经有一个3(nums[i]) 的话,有 dp[2]种方法 凑成 容量为5的背包
* 已经有一个4(nums[i]) 的话,有 dp[1]种方法 凑成 容量为5的背包
* 已经有一个5 (nums[i])的话,有 dp[0]种方法 凑成 容量为5的背包

那么凑整dp[5]有多少方法呢,也就是把 所有的 dp[j - nums[i]] 累加起来。

Expand Down