mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-24 14:28:56 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个数组 <code>time</code> ,其中 <code>time[i]</code> 表示第 <code>i</code> 辆公交车完成 <strong>一趟</strong><strong>旅途</strong> 所需要花费的时间。</p>\n\n<p>每辆公交车可以 <strong>连续</strong> 完成多趟旅途,也就是说,一辆公交车当前旅途完成后,可以 <strong>立马开始</strong> 下一趟旅途。每辆公交车 <strong>独立</strong> 运行,也就是说可以同时有多辆公交车在运行且互不影响。</p>\n\n<p>给你一个整数 <code>totalTrips</code> ,表示所有公交车 <strong>总共</strong> 需要完成的旅途数目。请你返回完成 <strong>至少</strong> <code>totalTrips</code> 趟旅途需要花费的 <strong>最少</strong> 时间。</p>\n\n<p> </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> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= time.length <= 10<sup>5</sup></code></li>\n\t<li><code>1 <= time[i], totalTrips <= 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."
|
||||
|
||||
Reference in New Issue
Block a user