mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 07:21:40 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>传送带上的包裹必须在 <code>days</code> 天内从一个港口运送到另一个港口。</p>\n\n<p>传送带上的第 <code>i</code> 个包裹的重量为 <code>weights[i]</code>。每一天,我们都会按给出重量(<code>weights</code>)的顺序往传送带上装载包裹。我们装载的重量不会超过船的最大运载重量。</p>\n\n<p>返回能在 <code>days</code> 天内将传送带上的所有包裹送达的船的最低运载能力。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>weights = [1,2,3,4,5,6,7,8,9,10], days = 5\n<strong>输出:</strong>15\n<strong>解释:</strong>\n船舶最低载重 15 就能够在 5 天内送达所有包裹,如下所示:\n第 1 天:1, 2, 3, 4, 5\n第 2 天:6, 7\n第 3 天:8\n第 4 天:9\n第 5 天:10\n\n请注意,货物必须按照给定的顺序装运,因此使用载重能力为 14 的船舶并将包装分成 (2, 3, 4, 5), (1, 6, 7), (8), (9), (10) 是不允许的。 \n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>weights = [3,2,2,4,1,4], days = 3\n<strong>输出:</strong>6\n<strong>解释:</strong>\n船舶最低载重 6 就能够在 3 天内送达所有包裹,如下所示:\n第 1 天:3, 2\n第 2 天:2, 4\n第 3 天:1, 4\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>weights = [1,2,3,1,1], days = 4\n<strong>输出:</strong>3\n<strong>解释:</strong>\n第 1 天:1\n第 2 天:2\n第 3 天:3\n第 4 天:1, 1\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= days <= weights.length <= 5 * 10<sup>4</sup></code></li>\n\t<li><code>1 <= weights[i] <= 500</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 445,
|
||||
"likes": 446,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"71K\", \"totalSubmission\": \"114.3K\", \"totalAcceptedRaw\": 71042, \"totalSubmissionRaw\": 114305, \"acRate\": \"62.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"71.2K\", \"totalSubmission\": \"114.6K\", \"totalAcceptedRaw\": 71233, \"totalSubmissionRaw\": 114619, \"acRate\": \"62.1%\"}",
|
||||
"hints": [
|
||||
"Binary search on the answer. We need a function possible(capacity) which returns true if and only if we can do the task in D days."
|
||||
],
|
||||
|
Reference in New Issue
Block a user