1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 19:31:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part6

This commit is contained in:
2022-03-27 20:56:26 +08:00
parent c11d601602
commit 08d1f2a596
1096 changed files with 88216 additions and 2 deletions

View File

@@ -0,0 +1,39 @@
<p>给定一个非负整数数组 <code>nums</code> 和一个整数&nbsp;<code>m</code> ,你需要将这个数组分成&nbsp;<code>m</code><em>&nbsp;</em>个非空的连续子数组。</p>
<p>设计一个算法使得这&nbsp;<code>m</code><em>&nbsp;</em>个子数组各自和的最大值最小。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>nums = [7,2,5,10,8], m = 2
<strong>输出:</strong>18
<strong>解释:</strong>
一共有四种方法将 nums 分割为 2 个子数组。
其中最好的方式是将其分为 [7,2,5] 和 [10,8] 。
因为此时这两个子数组各自的和的最大值为18在所有情况中最小。</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>nums = [1,2,3,4,5], m = 2
<strong>输出:</strong>9
</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>nums = [1,4,4], m = 3
<strong>输出:</strong>4
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= nums.length &lt;= 1000</code></li>
<li><code>0 &lt;= nums[i] &lt;= 10<sup>6</sup></code></li>
<li><code>1 &lt;= m &lt;= min(50, nums.length)</code></li>
</ul>