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>几块石子 <strong>排成一行</strong> ,每块石子都有一个关联值,关联值为整数,由数组 <code>stoneValue</code> 给出。</p>\n\n<p>游戏中的每一轮:Alice 会将这行石子分成两个 <strong>非空行</strong>(即,左侧行和右侧行);Bob 负责计算每一行的值,即此行中所有石子的值的总和。Bob 会丢弃值最大的行,Alice 的得分为剩下那行的值(每轮累加)。如果两行的值相等,Bob 让 Alice 决定丢弃哪一行。下一轮从剩下的那一行开始。</p>\n\n<p>只 <strong>剩下一块石子</strong> 时,游戏结束。Alice 的分数最初为 <strong><code>0</code></strong> 。</p>\n\n<p>返回 <strong>Alice 能够获得的最大分数</strong><em> 。</em></p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>stoneValue = [6,2,3,4,5,5]\n<strong>输出:</strong>18\n<strong>解释:</strong>在第一轮中,Alice 将行划分为 [6,2,3],[4,5,5] 。左行的值是 11 ,右行的值是 14 。Bob 丢弃了右行,Alice 的分数现在是 11 。\n在第二轮中,Alice 将行分成 [6],[2,3] 。这一次 Bob 扔掉了左行,Alice 的分数变成了 16(11 + 5)。\n最后一轮 Alice 只能将行分成 [2],[3] 。Bob 扔掉右行,Alice 的分数现在是 18(16 + 2)。游戏结束,因为这行只剩下一块石头了。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>stoneValue = [7,7,7,7,7,7,7]\n<strong>输出:</strong>28\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>stoneValue = [4]\n<strong>输出:</strong>0\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= stoneValue.length <= 500</code></li>\n\t<li><code>1 <= stoneValue[i] <= 10^6</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 43,
|
||||
"likes": 45,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"4.5K\", \"totalSubmission\": \"11.5K\", \"totalAcceptedRaw\": 4467, \"totalSubmissionRaw\": 11498, \"acRate\": \"38.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"4.5K\", \"totalSubmission\": \"11.7K\", \"totalAcceptedRaw\": 4531, \"totalSubmissionRaw\": 11657, \"acRate\": \"38.9%\"}",
|
||||
"hints": [
|
||||
"We need to try all possible divisions for the current row to get the max score.",
|
||||
"As calculating all possible divisions will lead us to calculate some sub-problems more than once, we need to think of dynamic programming."
|
||||
|
||||
Reference in New Issue
Block a user