mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-24 22:38:57 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>Alice 和 Bob 用几堆石子在做游戏。一共有偶数堆石子,<strong>排成一行</strong>;每堆都有 <strong>正</strong> 整数颗石子,数目为 <code>piles[i]</code> 。</p>\n\n<p>游戏以谁手中的石子最多来决出胜负。石子的 <strong>总数</strong> 是 <strong>奇数</strong> ,所以没有平局。</p>\n\n<p>Alice 和 Bob 轮流进行,<strong>Alice 先开始</strong> 。 每回合,玩家从行的 <strong>开始</strong> 或 <strong>结束</strong> 处取走整堆石头。 这种情况一直持续到没有更多的石子堆为止,此时手中 <strong>石子最多</strong> 的玩家 <strong>获胜</strong> 。</p>\n\n<p>假设 Alice 和 Bob 都发挥出最佳水平,当 Alice 赢得比赛时返回 <code>true</code> ,当 Bob 赢得比赛时返回 <code>false</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>piles = [5,3,4,5]\n<strong>输出:</strong>true\n<strong>解释:</strong>\nAlice 先开始,只能拿前 5 颗或后 5 颗石子 。\n假设他取了前 5 颗,这一行就变成了 [3,4,5] 。\n如果 Bob 拿走前 3 颗,那么剩下的是 [4,5],Alice 拿走后 5 颗赢得 10 分。\n如果 Bob 拿走后 5 颗,那么剩下的是 [3,4],Alice 拿走后 4 颗赢得 9 分。\n这表明,取前 5 颗石子对 Alice 来说是一个胜利的举动,所以返回 true 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>piles = [3,7,2,3]\n<strong>输出:</strong>true\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>2 <= piles.length <= 500</code></li>\n\t<li><code>piles.length</code> 是 <strong>偶数</strong></li>\n\t<li><code>1 <= piles[i] <= 500</code></li>\n\t<li><code>sum(piles[i])</code> 是 <strong>奇数</strong></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 414,
|
||||
"likes": 418,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"76.2K\", \"totalSubmission\": \"100.3K\", \"totalAcceptedRaw\": 76192, \"totalSubmissionRaw\": 100268, \"acRate\": \"76.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"77.9K\", \"totalSubmission\": \"102.4K\", \"totalAcceptedRaw\": 77887, \"totalSubmissionRaw\": 102421, \"acRate\": \"76.0%\"}",
|
||||
"hints": [],
|
||||
"solution": {
|
||||
"id": "64",
|
||||
|
||||
Reference in New Issue
Block a user