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

Commit b16426b

Browse files
Update Readme.md
1 parent 0a73a82 commit b16426b

File tree

1 file changed

+1
-1
lines changed
  • DFS/698.Partition-to-K-Equal-Sum-Subsets

1 file changed

+1
-1
lines changed

‎DFS/698.Partition-to-K-Equal-Sum-Subsets/Readme.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ for (int i=curPos; i<n; i++)
3737
3838
所以我们本题状态转移的思想是,根据当前的state,考察可以加入哪些新元素(比如说i)得到新的state2,使得```dp[state]+nums[i]<=target```。满足的话,那么就可以更新dp[state2]为该组合的元素之和对于target的取余(零头)。
3939
40-
最终的答案就是考察state=(1<<n)-1时的dp值是否不为-1. (其实,如果dp值不为-1的话,它一定是0)
40+
最终的答案就是考察state=(1<<n)-1时的dp值是否不为-1. (其实,如果dp值不为-1的话,它一定是0,因为我们预判了所有元素之和必然要被target整除)
4141
4242
[Leetcode Link](https://leetcode.com/problems/partition-to-k-equal-sum-subsets)

0 commit comments

Comments
(0)

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