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 072eb2a

Browse files
Update 0343.整数拆分.md
1 parent 5527410 commit 072eb2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎problems/0343.整数拆分.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,11 @@ class Solution:
262262

263263
# 计算切割点j和剩余部分(i-j)的乘积,并与之前的结果进行比较取较大值
264264

265-
dp[i] = max(dp[i], max((i - j) * j, dp[i - j] * j))
265+
dp[i] = max(dp[i], (i - j) * j, dp[i - j] * j)
266266

267267
return dp[n] # 返回最终的计算结果
268268

269+
269270
```
270271
动态规划(版本二)
271272
```python

0 commit comments

Comments
(0)

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