1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 14:12:17 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 16:56:27 +08:00
parent e730aa6794
commit ad15da05aa
2517 changed files with 7358 additions and 7332 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>你和你的朋友,两个人一起玩&nbsp;<a href=\"https://baike.baidu.com/item/Nim游戏/6737105\" target=\"_blank\">Nim 游戏</a></p>\n\n<ul>\n\t<li>桌子上有一堆石头。</li>\n\t<li>你们轮流进行自己的回合,&nbsp;<strong>你作为先手&nbsp;</strong>。</li>\n\t<li>每一回合,轮到的人拿掉&nbsp;1 - 3 块石头。</li>\n\t<li>拿掉最后一块石头的人就是获胜者。</li>\n</ul>\n\n<p>假设你们每一步都是最优解。请编写一个函数,来判断你是否可以在给定石头数量为 <code>n</code> 的情况下赢得游戏。如果可以赢,返回 <code>true</code>;否则,返回 <code>false</code> 。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong><code>n = 4</code>\n<strong>输出:</strong>false \n<strong>解释:</strong>以下是可能的结果:\n1. 移除1颗石头。你的朋友移走了3块石头包括最后一块。你的朋友赢了。\n2. 移除2个石子。你的朋友移走2块石头包括最后一块。你的朋友赢了。\n3.你移走3颗石子。你的朋友移走了最后一块石头。你的朋友赢了。\n在所有结果中你的朋友是赢家。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 1\n<strong>输出:</strong>true\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 2\n<strong>输出:</strong>true\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= n &lt;= 2<sup>31</sup> - 1</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 577,
"likes": 578,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Flip Game II\", \"titleSlug\": \"flip-game-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u7ffb\\u8f6c\\u6e38\\u620f II\"}]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"128.2K\", \"totalSubmission\": \"181.1K\", \"totalAcceptedRaw\": 128155, \"totalSubmissionRaw\": 181130, \"acRate\": \"70.8%\"}",
"stats": "{\"totalAccepted\": \"128.4K\", \"totalSubmission\": \"181.4K\", \"totalAcceptedRaw\": 128363, \"totalSubmissionRaw\": 181409, \"acRate\": \"70.8%\"}",
"hints": [
"If there are 5 stones in the heap, could you figure out a way to remove the stones such that you will always be the winner?"
],