{"id":453,"date":"2023-01-30T19:51:40","date_gmt":"2023-01-30T11:51:40","guid":{"rendered":"https:\/\/blog.cirno.fun\/?p=453"},"modified":"2024-09-12T09:29:26","modified_gmt":"2024-09-12T01:29:26","slug":"%e5%8f%b0%e9%98%b6nim%e6%b8%b8%e6%88%8f","status":"publish","type":"post","link":"https:\/\/blog.sssn.tech\/?p=453","title":{"rendered":"\u53f0\u9636NIM\u6e38\u620f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/blog.cirno.fun\/wp-content\/uploads\/2023\/01\/image-1675076790769.png\" alt=\"file\" \/><\/p>\n<p>\u53f0\u9636NIM\u6e38\u620f\u662fNIM\u6e38\u620f\u7684\u53d8\u79cd\uff0c\u5982\u679c\u4e0d\u6e05\u695aNIM\u6e38\u620f\u662f\u4ec0\u4e48\u8bf7\u770b<a href=\"https:\/\/blog.cirno.fun\/?p=450\" title=\"\u4e0a\u7bc7\u6587\u7ae0\">\u4e0a\u7bc7\u6587\u7ae0<\/a><\/p>\n<p>\u786e\u4fdd\u7406\u89e3\u7ecf\u5178NIM\u6e38\u620f\u4e4b\u540e\u6765\u5206\u6790\u672c\u4f8b<\/p>\n<p>\u5bf9\u4e8e\u53f0\u9636NIM\u6e38\u620f\u6709\u5982\u4e0b\u7ed3\u8bba<\/p>\n<p><strong>\u53f0\u9636NIM\u6e38\u620f\u53ef\u4ee5\u770b\u505a\u662f\u5bf9\u6240\u6709\u5947\u6570\u7ea7\u53f0\u9636\u505a\u7ecf\u5178NIM\u6e38\u620f<\/strong><\/p>\n<p>\u7ed3\u8bba\u53ef\u4ee5\u8bc1\u660e\uff0c\u5982\u4e0b\uff1a<\/p>\n<h4>\u8bc1\u6cd5\u4e00<\/h4>\n<p>\u8981\u8bc1\u660e\u4e0a\u8ff0\u7ed3\u8bba\u53ea\u9700\u8bc1\u660e<\/p>\n<ol>\n<li>\u5bf9\u5076\u6570\u7ea7\u53f0\u9636\u7684\u64cd\u4f5c\u548c\u6e38\u620f\u7ed3\u679c\u6ca1\u6709\u5173\u7cfb<\/li>\n<li>\u5947\u6570\u7ea7\u53f0\u9636\u7684\u535a\u5f08\u95ee\u9898\u7b49\u4ef7\u4e8e\u7ecf\u5178NIM\u6e38\u620f<\/li>\n<\/ol>\n<p>\u5148\u8bc1\u660e\u7b2c\u4e00\u6761\uff1a<\/p>\n<p>\u5bf9\u4e8e\u5bf9\u624b\u5bf9\u5076\u6570\u7ea7\u53f0\u9636\u7684\u67d0\u6b21\u64cd\u4f5c\uff08\u5c062n\u53f7\u53f0\u9636\u4e0a\u7684\u77f3\u5b50\u62ff\u4e0bx\u4e2a\u52302n-1\u53f7\u4e0a\uff09\uff0c\u6211\u4eec\u90fd\u53ef\u4ee5\u5bf9\u4e0b\u4e00\u7ea7\u53f0\u9636\u91c7\u53d6\u540c\u6837\u64cd\u4f5c\u4f7f\u5176\u65e0\u6548\uff08\u5c062n-1\u53f7\u7684x\u4e2a\u77f3\u5b50\u62ff\u52302n-2\u4e0a\uff09<\/p>\n<p>\u8fd9\u6837\u4fbf\u53ef\u4ee4\u5076\u6570\u7ea7\u53f0\u9636\u7684\u64cd\u4f5c\u4e0d\u4f1a\u5f71\u54cd\u5230\u5947\u6570\u7ea7\u53f0\u9636<\/p>\n<p>\u800c\u6839\u636e\u9898\u610f\uff0c\u5730\u9762\u4e0a\uff080\u7ea7\uff09\u53f0\u9636\u662f\u4e0d\u53ef\u64cd\u4f5c\u7684\uff0c\u6240\u4ee5\u5bf9\u624b\u53ea\u80fd\u64cd\u4f5c2,4,6\uff0c\u00b7\u00b7\u00b7\u7b49\u53f0\u9636\uff0c\u800c\u64cd\u4f5c\u8fd9\u4e9b\u53f0\u9636\u7684\u7ed3\u679c\u6700\u7ec8\u90fd\u4f1a\u6536\u655b\u5230\u64cd\u4f5c\u7b2c\u4e8c\u7ea7\u53f0\u9636\uff0c\u5373\uff1a\u5bf9\u624b\u5c06\u7b2c\u4e8c\u7ea7\u53f0\u9636\u7684\u82e5\u5e72\u77f3\u5b50\u79fb\u81f3\u7b2c\u4e00\u7ea7\uff0c\u6211\u4eec\u8fd9\u65f6\u5c06\u540c\u6837\u6570\u91cf\u7684\u77f3\u5b50\u79fb\u81f3\u5730\u9762\uff0c\u65e0\u6548\u5316\u4ed6\u7684\u64cd\u4f5c<\/p>\n<p>\u8fd9\u6837\u7684\u60c5\u51b5\u4f1a\u6536\u655b\u4e8e\u5076\u6570\u53f0\u9636\u5747\u4e3a0\uff08\u4e0d\u53ef\u64cd\u4f5c\uff09\u7684\u72b6\u6001\uff0c\u6240\u4ee5<strong>\u5076\u6570\u7ea7\u53f0\u9636\u7684\u72b6\u6001\u5bf9\u6e38\u620f\u7ed3\u679c\u6ca1\u6709\u5173\u7cfb<\/strong><\/p>\n<p>\u518d\u8bc1\u660e\u7b2c\u4e8c\u6761\uff1a \u5bf9\u4e8e\u5bf9\u624b\u5bf9\u5947\u6570\u7ea7\u53f0\u9636\u7684\u67d0\u6b21\u64cd\u4f5c\uff08\u5c062n+1\u53f7\u53f0\u9636\u4e0a\u7684\u77f3\u5b50\u62ff\u4e0bx\u4e2a\u52302n\u53f7\u4e0a\uff09\uff0c<strong>\u53ef\u4ee5\u770b\u505a\u662f\u5728\u7ecf\u5178NIM\u6e38\u620f\u4e2d\u5c06\u8fd9\u5806\u77f3\u5b50\u53d6\u8d70<\/strong>\u2014\u2014\u56e0\u4e3a\u5076\u6570\u7ea7\u53f0\u9636\u76f8\u5f53\u4e8e\u201c\u5783\u573e\u6876\u201d\uff0c\u8fdb\u6765\u7684\u77f3\u5b50\u90fd\u5bf9\u80dc\u8d1f\u7ed3\u679c\u6ca1\u6709\u5f71\u54cd<\/p>\n<p>\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u5957\u7528\u7ecf\u5178NIM\u6e38\u620f\u7684\u7ed3\u8bba\uff1a<\/p>\n<p><strong>\u53f0\u9636NIM\u6e38\u620f\u5148\u624b\u5fc5\u80dc\uff0c\u5f53\u4e14\u4ec5\u5f53\u6240\u6709\u5947\u6570\u7ea7\u53f0\u9636\u77f3\u5b50\u6570\u5f02\u6216\u548c\u4e0d\u7b49\u4e8e0<\/strong><\/p>\n<h4>\u8bc1\u6cd5\u4e8c<\/h4>\n<p>\u56e0\u4e3a\u7b2ck\u7ea7\u53f0\u9636\u4e0a\u7684\u77f3\u5b50\u9700\u8981k\u6b21\u79fb\u52a8\u624d\u53ef\u4ee5\u5230\u5730\u9762\uff08\u9000\u51fa\u6e38\u620f\uff09\uff0c\u6240\u4ee5\u7b2ck\u7ea7\u53f0\u9636\u4e0a\u7684n\u4e2a\u77f3\u5b50\u53ef\u4ee5\u770b\u505a\u7ecf\u5178NIM\u6e38\u620f\u4e2d\u7684k\u4e2a\u77f3\u5b50\u5806\uff0c\u6bcf\u5806\u77f3\u5b50\u6709n\u4e2a<\/p>\n<p>\u5f53k\u662f\u5076\u6570\u65f6\uff0ck\u4e2a\u76f8\u540c\u7684\u77f3\u5b50\u5806\u4e4b\u95f4\u5f02\u6216\u548c\u4e3a0 \u5f53k\u662f\u5947\u6570\u65f6\uff0ck\u4e2a\u76f8\u540c\u7684\u77f3\u5b50\u5806\u4e4b\u95f4\u5f02\u6216\u548c\u4e3an<\/p>\n<p>\u6240\u4ee5\u547d\u9898\u5f97\u8bc1\uff0c\u5373\u2014\u2014\u53f0\u9636NIM\u6e38\u620f\u53ef\u4ee5\u770b\u505a\u662f\u5bf9\u6240\u6709\u5947\u6570\u7ea7\u53f0\u9636\u505a\u7ecf\u5178NIM\u6e38\u620f<\/p>\n<p>\u4e0a\u539f\u9898\u4ee3\u7801<\/p>\n<pre><code class=\"language-cpp\">#include &lt;bits\/stdc++.h&gt;\nusing namespace std;\n\nint main()\n{\n    int n;\n    cin &gt;&gt; n;\n    int res = 0;\n    for(int i = 1; i &lt;= n; i++)\n    {\n        int x;\n        cin &gt;&gt; x;\n        if(i % 2)\n            res ^= x;\n    }\n    if(res)\n        puts(&quot;Yes&quot;);\n    else\n        puts(&quot;No&quot;);\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u53f0\u9636NIM\u6e38\u620f\u662fNIM\u6e38\u620f\u7684\u53d8\u79cd\uff0c\u5982\u679c\u4e0d\u6e05\u695aNIM\u6e38\u620f\u662f\u4ec0\u4e48\u8bf7\u770b\u4e0a\u7bc7\u6587\u7ae0 \u786e\u4fdd\u7406 [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,10,13,16],"tags":[],"class_list":["post-453","post","type-post","status-publish","format-standard","hentry","category-nim","category-10","category-13","category-16"],"_links":{"self":[{"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=\/wp\/v2\/posts\/453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=453"}],"version-history":[{"count":1,"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=\/wp\/v2\/posts\/453\/revisions"}],"predecessor-version":[{"id":727,"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=\/wp\/v2\/posts\/453\/revisions\/727"}],"wp:attachment":[{"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.sssn.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}