1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-04 23:11:41 +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>请你将一些箱子装在 <strong>一辆卡车</strong> 上。给你一个二维数组 <code>boxTypes</code> ,其中 <code>boxTypes[i] = [numberOfBoxes<sub>i</sub>, numberOfUnitsPerBox<sub>i</sub>]</code> </p>\n\n<ul>\n\t<li><code>numberOfBoxes<sub>i</sub></code> 是类型 <code>i</code> 的箱子的数量。</li>\n\t<li><code>numberOfUnitsPerBox<sub>i</sub></code><sub> </sub>是类型 <code>i</code> 每个箱子可以装载的单元数量。</li>\n</ul>\n\n<p>整数 <code>truckSize</code> 表示卡车上可以装载 <strong>箱子</strong> 的 <strong>最大数量</strong> 。只要箱子数量不超过 <code>truckSize</code> ,你就可以选择任意箱子装到卡车上。</p>\n\n<p>返回卡车可以装载 <strong>单元</strong> 的 <strong>最大</strong> 总数<em>。</em></p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>boxTypes = [[1,3],[2,2],[3,1]], truckSize = 4\n<strong>输出:</strong>8\n<strong>解释:</strong>箱子的情况如下:\n- 1 个第一类的箱子,里面含 3 个单元。\n- 2 个第二类的箱子,每个里面含 2 个单元。\n- 3 个第三类的箱子,每个里面含 1 个单元。\n可以选择第一类和第二类的所有箱子以及第三类的一个箱子。\n单元总数 = (1 * 3) + (2 * 2) + (1 * 1) = 8</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>boxTypes = [[5,10],[2,5],[4,7],[3,9]], truckSize = 10\n<strong>输出:</strong>91\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= boxTypes.length <= 1000</code></li>\n\t<li><code>1 <= numberOfBoxes<sub>i</sub>, numberOfUnitsPerBox<sub>i</sub> <= 1000</code></li>\n\t<li><code>1 <= truckSize <= 10<sup>6</sup></code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 32,
"likes": 33,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"14.8K\", \"totalSubmission\": \"21.3K\", \"totalAcceptedRaw\": 14801, \"totalSubmissionRaw\": 21274, \"acRate\": \"69.6%\"}",
"stats": "{\"totalAccepted\": \"15.4K\", \"totalSubmission\": \"22.2K\", \"totalAcceptedRaw\": 15430, \"totalSubmissionRaw\": 22158, \"acRate\": \"69.6%\"}",
"hints": [
"If we have space for at least one box, it's always optimal to put the box with the most units.",
"Sort the box types with the number of units per box non-increasingly.",