###### 343. Integer Break

Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.

For example, given n = 2, return 1 (2 = 1 + 1); given n = 10, return 36 (10 = 3 + 3 + 4).

Note: You may assume that n is not less than 2 and not larger than 58.

class Solution {
public:
int integerBreak(int n) {
vector<int> maxPro(n+1, 0);
if(n == 1) return 0;
maxPro[1] = 0;
maxPro[2] = 1;
for(int i = 3; i <= n; i++){
for(int j = 1; j < i; j++){
maxPro[i] = max(maxPro[i], max(j*(i-j), j*maxPro[i-j]));
}
}
return maxPro[n];
}
};

#### 【Leetcode】：343. Integer Break 问题 in JAVA

2016-04-20 21:11:30

#### LeetCode 343. Integer Break（整数分拆）

2016-04-30 12:00:37

#### LeetCode 第 343 题 (Integer Break)

2016-04-20 09:48:03

#### leetcode343-Integer Break(整数拆分求最大乘积)

2016-04-19 20:32:32

#### 343. Integer Break 分析证明与python解答

2016-05-12 21:37:50

#### 343. Integer Break(LeetCode, C++, 动态规划)

2016-11-09 18:17:51

#### 343. Integer Break （划分整数使乘积最大）

2016-11-26 21:42:09

#### 343. Integer Break （动态规划）

2017-11-09 20:50:27

#### 动态规划-343. Integer Break

2017-09-23 17:11:59

#### (LeetCode) 343. Integer Break

2017-05-30 21:34:04

## 不良信息举报

343. Integer Break