1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-13 01:15:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
leetcode-problemset/leetcode-cn/problem (Chinese)/完成一个任务的最早时间 [earliest-time-to-finish-one-task].html
2025-09-25 00:20:19 +08:00

42 lines
1.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

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>tasks</code>,其中 <code>tasks[i] = [s<sub>i</sub>, t<sub>i</sub>]</code></p>
<p>数组中的每个 <code>[s<sub>i</sub>, t<sub>i</sub>]</code> 表示一个任务,该任务的开始时间为 <code>s<sub>i</sub></code>,完成该任务需要 <code>t<sub>i</sub></code> 个时间单位。</p>
<p>返回至少完成一个任务的最早时间。</p>
<p>&nbsp;</p>
<p><strong class="example">示例 1</strong></p>
<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">tasks = [[1,6],[2,3]]</span></p>
<p><strong>输出:</strong> <span class="example-io">5</span></p>
<p><strong>解释:</strong></p>
<p>第一个任务从时间 <code>t = 1</code> 开始,并在 <code>1 + 6 = 7</code> 时完成。第二个任务在时间 <code>t = 2</code> 开始,并在 <code>2 + 3 = 5</code> 时完成。因此,最早完成的任务在时间 5。</p>
</div>
<p><strong class="example">示例 2</strong></p>
<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">tasks = [[100,100],[100,100],[100,100]]</span></p>
<p><strong>输出:</strong> <span class="example-io">200</span></p>
<p><strong>解释:</strong></p>
<p>三个任务都在时间 <code>100 + 100 = 200</code> 时完成。</p>
</div>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= tasks.length &lt;= 100</code></li>
<li><code>tasks[i] = [s<sub>i</sub>, t<sub>i</sub>]</code></li>
<li><code>1 &lt;= s<sub>i</sub>, t<sub>i</sub> &lt;= 100</code></li>
</ul>