Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[pull] master from youngyangyang04:master #451

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

Merged
pull merged 8 commits into AlgorithmAndLeetCode:master from youngyangyang04:master
May 21, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions problems/0494.目标和.md
View file Open in desktop
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

AltStyle によって変換されたページ (->オリジナル) /