{"id":1765,"date":"2016-02-03T13:18:29","date_gmt":"2016-02-03T05:18:29","guid":{"rendered":"http:\/\/boweihe.me\/?p=1765"},"modified":"2016-02-03T13:18:29","modified_gmt":"2016-02-03T05:18:29","slug":"leetcode-oj-292-nim-game","status":"publish","type":"post","link":"https:\/\/dayandcarrot.space\/?p=1765","title":{"rendered":"LeetCode OJ #292. Nim Game"},"content":{"rendered":"<p>\u539f\u9898\u5730\u5740\uff1a<a href=\"https:\/\/leetcode.com\/problems\/nim-game\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/leetcode.com\/problems\/nim-game\/<\/a><br \/>\n\u601d\u8def\uff1a<br \/>\n\u8fd9\u9898\u76ee\u662f\u4e2a\u627e\u89c4\u5f8b\u7684\u9898\uff0c\u53f7\u79f0\u5168OJ\u6700\u7b80\u5355&#8230;.\u901a\u8fc7\u627e\u89c4\u5f8b\u53ef\u4ee5\u53d1\u73b0\uff0c\u5f53n\u4e3a4\u7684\u500d\u6570\u65f6\uff0c\u65e0\u8bba\u5982\u4f55\u81ea\u5df1\u90fd\u8d62\u4e0d\u4e86&#8230;\u7136\u540e\u641e\u5b9a\u4e86<br \/>\n\u4ee3\u7801\uff1a<\/p>\n<pre class=\"lang:c++ decode:true \">class Solution {\npublic:\n    bool canWinNim(int n) {\n        if(n%4 == 0)\n            return false;\n        return true;\n    }\n};<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u9898\u5730\u5740\uff1ahttps:\/\/leetcode.com\/problems\/nim-game\/ \u601d\u8def\uff1a \u8fd9\u9898\u76ee\u662f\u4e2a\u627e\u89c4\u5f8b\u7684\u9898\uff0c\u53f7\u79f0\u5168OJ\u6700\u7b80\u5355&#8230;.\u901a\u8fc7\u627e\u89c4\u5f8b\u53ef\u4ee5\u53d1\u73b0\uff0c\u5f53n\u4e3a4\u7684\u500d\u6570\u65f6\uff0c\u65e0\u8bba\u5982\u4f55\u81ea\u5df1\u90fd\u8d62\u4e0d\u4e86&#8230;\u7136\u540e\u641e\u5b9a\u4e86 \u4ee3\u7801\uff1a class Solution { public: bool canWinNim(int n) { if(n%4 == 0) return false; return true; } }; &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[66],"class_list":["post-1765","post","type-post","status-publish","format-standard","hentry","category-study","tag-leetcode-oj"],"_links":{"self":[{"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/posts\/1765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1765"}],"version-history":[{"count":0,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/posts\/1765\/revisions"}],"wp:attachment":[{"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}