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 两个人轮流玩一个游戏,Alice 先手。</p>\n\n<p>一开始,有 <code>n</code> 个石子堆在一起。每个人轮流操作,正在操作的玩家可以从石子堆里拿走 <strong>任意</strong> 非零 <strong>平方数</strong> 个石子。</p>\n\n<p>如果石子堆里没有石子了,则无法操作的玩家输掉游戏。</p>\n\n<p>给你正整数 <code>n</code> ,且已知两个人都采取最优策略。如果 Alice 会赢得比赛,那么返回 <code>True</code> ,否则返回 <code>False</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 1\n<strong>输出:</strong>true\n<strong>解释:</strong>Alice 拿走 1 个石子并赢得胜利,因为 Bob 无法进行任何操作。</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 2\n<strong>输出:</strong>false\n<strong>解释:</strong>Alice 只能拿走 1 个石子,然后 Bob 拿走最后一个石子并赢得胜利(2 -> 1 -> 0)。</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 4\n<strong>输出:</strong>true\n<strong>解释:</strong>n 已经是一个平方数,Alice 可以一次全拿掉 4 个石子并赢得胜利(4 -> 0)。\n</pre>\n\n<p><strong>示例 4:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 7\n<strong>输出:</strong>false\n<strong>解释:</strong>当 Bob 采取最优策略时,Alice 无法赢得比赛。\n如果 Alice 一开始拿走 4 个石子, Bob 会拿走 1 个石子,然后 Alice 只能拿走 1 个石子,Bob 拿走最后一个石子并赢得胜利(7 -> 3 -> 2 -> 1 -> 0)。\n如果 Alice 一开始拿走 1 个石子, Bob 会拿走 4 个石子,然后 Alice 只能拿走 1 个石子,Bob 拿走最后一个石子并赢得胜利(7 -> 6 -> 2 -> 1 -> 0)。</pre>\n\n<p><strong>示例 5:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 17\n<strong>输出:</strong>false\n<strong>解释:</strong>如果 Bob 采取最优策略,Alice 无法赢得胜利。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 10^5</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 41,
|
||||
"likes": 43,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,13 +149,13 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"6.1K\", \"totalSubmission\": \"10.3K\", \"totalAcceptedRaw\": 6073, \"totalSubmissionRaw\": 10318, \"acRate\": \"58.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"6.2K\", \"totalSubmission\": \"10.5K\", \"totalAcceptedRaw\": 6224, \"totalSubmissionRaw\": 10542, \"acRate\": \"59.0%\"}",
|
||||
"hints": [
|
||||
"Use dynamic programming to keep track of winning and losing states. Given some number of stones, Alice can win if she can force Bob onto a losing state."
|
||||
],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "1",
|
||||
"sampleTestCase": "1\r",
|
||||
"metaData": "{\n \"name\": \"winnerSquareGame\",\n \"params\": [\n {\n \"name\": \"n\",\n \"type\": \"integer\"\n }\n ],\n \"return\": {\n \"type\": \"boolean\"\n }\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
|
||||
Reference in New Issue
Block a user