mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-07 00:11:41 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>有 <code>N</code> 堆石头排成一排,第 <code>i</code> 堆中有 <code>stones[i]</code> 块石头。</p>\n\n<p>每次<em>移动(move)</em>需要将<strong>连续的</strong> <code>K</code> 堆石头合并为一堆,而这个移动的成本为这 <code>K</code> 堆石头的总数。</p>\n\n<p>找出把所有石头合并成一堆的最低成本。如果不可能,返回 <code>-1</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>stones = [3,2,4,1], K = 2\n<strong>输出:</strong>20\n<strong>解释:</strong>\n从 [3, 2, 4, 1] 开始。\n合并 [3, 2],成本为 5,剩下 [5, 4, 1]。\n合并 [4, 1],成本为 5,剩下 [5, 5]。\n合并 [5, 5],成本为 10,剩下 [10]。\n总成本 20,这是可能的最小值。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>stones = [3,2,4,1], K = 3\n<strong>输出:</strong>-1\n<strong>解释:</strong>任何合并操作后,都会剩下 2 堆,我们无法再进行合并。所以这项任务是不可能完成的。.\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>stones = [3,5,1,2,6], K = 3\n<strong>输出:</strong>25\n<strong>解释:</strong>\n从 [3, 5, 1, 2, 6] 开始。\n合并 [5, 1, 2],成本为 8,剩下 [3, 8, 6]。\n合并 [3, 8, 6],成本为 17,剩下 [17]。\n总成本 25,这是可能的最小值。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= stones.length <= 30</code></li>\n\t<li><code>2 <= K <= 30</code></li>\n\t<li><code>1 <= stones[i] <= 100</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 169,
|
||||
"likes": 175,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Burst Balloons\", \"titleSlug\": \"burst-balloons\", \"difficulty\": \"Hard\", \"translatedTitle\": \"\\u6233\\u6c14\\u7403\"}, {\"title\": \"Minimum Cost to Connect Sticks\", \"titleSlug\": \"minimum-cost-to-connect-sticks\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u8fde\\u63a5\\u68d2\\u6750\\u7684\\u6700\\u4f4e\\u8d39\\u7528\"}]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"4.4K\", \"totalSubmission\": \"10.4K\", \"totalAcceptedRaw\": 4440, \"totalSubmissionRaw\": 10442, \"acRate\": \"42.5%\"}",
|
||||
"stats": "{\"totalAccepted\": \"4.6K\", \"totalSubmission\": \"10.7K\", \"totalAcceptedRaw\": 4614, \"totalSubmissionRaw\": 10729, \"acRate\": \"43.0%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user