1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-24 14:28:56 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一个数组&nbsp;<code>time</code>&nbsp;,其中&nbsp;<code>time[i]</code>&nbsp;表示第 <code>i</code>&nbsp;辆公交车完成 <strong>一趟</strong><strong>旅途</strong>&nbsp;所需要花费的时间。</p>\n\n<p>每辆公交车可以 <strong>连续</strong> 完成多趟旅途,也就是说,一辆公交车当前旅途完成后,可以 <strong>立马开始</strong>&nbsp;下一趟旅途。每辆公交车 <strong>独立</strong>&nbsp;运行,也就是说可以同时有多辆公交车在运行且互不影响。</p>\n\n<p>给你一个整数&nbsp;<code>totalTrips</code>&nbsp;,表示所有公交车&nbsp;<strong>总共</strong>&nbsp;需要完成的旅途数目。请你返回完成 <strong>至少</strong>&nbsp;<code>totalTrips</code>&nbsp;趟旅途需要花费的 <strong>最少</strong>&nbsp;时间。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre><b>输入:</b>time = [1,2,3], totalTrips = 5\n<b>输出:</b>3\n<strong>解释:</strong>\n- 时刻 t = 1 ,每辆公交车完成的旅途数分别为 [1,0,0] 。\n 已完成的总旅途数为 1 + 0 + 0 = 1 。\n- 时刻 t = 2 ,每辆公交车完成的旅途数分别为 [2,1,0] 。\n 已完成的总旅途数为 2 + 1 + 0 = 3 。\n- 时刻 t = 3 ,每辆公交车完成的旅途数分别为 [3,1,1] 。\n 已完成的总旅途数为 3 + 1 + 1 = 5 。\n所以总共完成至少 5 趟旅途的最少时间为 3 。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre><b>输入:</b>time = [2], totalTrips = 1\n<b>输出:</b>2\n<strong>解释:</strong>\n只有一辆公交车它将在时刻 t = 2 完成第一趟旅途。\n所以完成 1 趟旅途的最少时间为 2 。\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= time.length &lt;= 10<sup>5</sup></code></li>\n\t<li><code>1 &lt;= time[i], totalTrips &lt;= 10<sup>7</sup></code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 26,
"likes": 32,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"8.5K\", \"totalSubmission\": \"33.4K\", \"totalAcceptedRaw\": 8535, \"totalSubmissionRaw\": 33401, \"acRate\": \"25.6%\"}",
"stats": "{\"totalAccepted\": \"9.2K\", \"totalSubmission\": \"35.4K\", \"totalAcceptedRaw\": 9213, \"totalSubmissionRaw\": 35374, \"acRate\": \"26.0%\"}",
"hints": [
"For a given amount of time, how can we count the total number of trips completed by all buses within that time?",
"Consider using binary search."