1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/完成所有工作的最短时间 [find-minimum-time-to-finish-all-jobs].html
2022-03-29 12:43:11 +08:00

35 lines
1.3 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个整数数组 <code>jobs</code> ,其中 <code>jobs[i]</code> 是完成第 <code>i</code> 项工作要花费的时间。</p>
<p>请你将这些工作分配给 <code>k</code> 位工人。所有工作都应该分配给工人,且每项工作只能分配给一位工人。工人的 <strong>工作时间</strong> 是完成分配给他们的所有工作花费时间的总和。请你设计一套最佳的工作分配方案,使工人的 <strong>最大工作时间</strong> 得以 <strong>最小化</strong></p>
<p>返回分配方案中尽可能 <strong>最小</strong><strong>最大工作时间</strong></p>
<p> </p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>jobs = [3,2,3], k = 3
<strong>输出:</strong>3
<strong>解释:</strong>给每位工人分配一项工作,最大工作时间是 3 。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>jobs = [1,2,4,7,8], k = 2
<strong>输出:</strong>11
<strong>解释:</strong>按下述方式分配工作:
1 号工人1、2、8工作时间 = 1 + 2 + 8 = 11
2 号工人4、7工作时间 = 4 + 7 = 11
最大工作时间是 11 。</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= k <= jobs.length <= 12</code></li>
<li><code>1 <= jobs[i] <= 10<sup>7</sup></code></li>
</ul>