{"id":111,"date":"2026-10-27T23:25:21","date_gmt":"2026-10-27T15:25:21","guid":{"rendered":"https:\/\/blog.sirin.fun\/?p=111"},"modified":"2026-10-28T00:04:30","modified_gmt":"2026-10-27T16:04:30","slug":"acm%e5%88%b7%e9%a2%98%e7%ac%94%e8%ae%b0%ef%bc%88%e5%85%b6%e4%b8%89%ef%bc%89","status":"publish","type":"post","link":"https:\/\/blog.sirin.fun\/index.php\/2026\/10\/27\/acm%e5%88%b7%e9%a2%98%e7%ac%94%e8%ae%b0%ef%bc%88%e5%85%b6%e4%b8%89%ef%bc%89\/","title":{"rendered":"acm\u5237\u9898\u7b14\u8bb0\uff08\u5176\u4e09\uff09"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Game Prediction\uff08<a href=\"http:\/\/acm.hnu.edu.cn\/online\/?action=problem&amp;type=show&amp;id=10019\" target=\"_blank\"  rel=\"nofollow\" >10019<\/a>\uff09<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"648\" src=\"https:\/\/blog.sirin.fun\/wp-content\/uploads\/2026\/10\/1793114972-1793114972-1793114967-1793114967-F1C9FF1C-1E57-425F-9593-9BD743D2373E-1024x648-1.png\" alt=\"\" class=\"wp-image-112\" srcset=\"https:\/\/blog.sirin.fun\/wp-content\/uploads\/2026\/10\/1793114972-1793114972-1793114967-1793114967-F1C9FF1C-1E57-425F-9593-9BD743D2373E-1024x648-1.png 1024w, https:\/\/blog.sirin.fun\/wp-content\/uploads\/2026\/10\/1793114971-1793114971-1793114967-1793114967-F1C9FF1C-1E57-425F-9593-9BD743D2373E-300x190-1.png 300w, https:\/\/blog.sirin.fun\/wp-content\/uploads\/2026\/10\/1793114971-1793114971-1793114967-1793114967-F1C9FF1C-1E57-425F-9593-9BD743D2373E-767x486-1.png 767w, https:\/\/blog.sirin.fun\/wp-content\/uploads\/2026\/10\/1793114967-1793114967-F1C9FF1C-1E57-425F-9593-9BD743D2373E.png 1358w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">AC<\/p>\n\n\n\n<pre><code class=\"language-cpp\">#include&lt;iostream&gt;\n#include&lt;vector&gt;\n#include&lt;algorithm&gt;\n\nusing namespace std;\n\nint main(){\n\tvector&lt;int&gt; anss;\n\twhile(1){\n\t\tint players,cards;\n\t\tcin&gt;&gt;players&gt;&gt;cards;\n\t\t\n\t\tif(players==0&amp;&amp;cards==0){\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tvector&lt;int&gt; mycards(cards);\n\t\tint card_max = players*cards;\n\t\tvector&lt;int&gt; used_map(card_max+1,1);\n\t\tfor(int i=0;i&lt;mycards.size();i++){\n\t\t\tcin&gt;&gt;mycards[i];\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i=0;i&lt;cards;i++){\n\t\t\t\/\/\u770b\u770b\u654c\u4eba\u6709\u6ca1\u6709\u6bd4\u6211\u4eec\u5927\u7684\u724c\n\t\t\t\/*\n\t\t\t* \u5047\u8bbe\u6211\u4eec\u67095\u5f20\u724c 3\u4e2a\u4eba \uff081-15\uff09\n\t\t\t* \u6211\u670915 14 12 11 9\n\t\t\t* 15 14\u90fd\u5728\u6211\u624b\u4e0a\uff0c\u90a3\u8fd92\u8f6e\u6211\u80af\u5b9a\u8d62\uff0c\u5047\u8bbe\u6700\u574f\u7684\u60c5\u51b5\uff1a\n\t\t\t* \u8fd92\u8f6e\u5bf9\u624b\u51fa\u6700\u5c0f\u7684\u724c\n\t\t\t* \u7136\u540e\u6211\u51fa12\uff0c\u5bf9\u9762\u8981\u538b\u6211\uff1a\u51fa13\n\t\t\t* \u8fd9\u4e2a\u65f6\u5019\u6211\u768411\u5df2\u7ecf\u5b8c\u5168\u65e0\u654c\u4e86\n\t\t\t* \n\t\t\t* \u8fd9\u5c31\u662f\u8bf4\n\t\t\t* \u6211\u53ef\u4ee5\u7ef4\u62a4\u4e00\u4e2a\u6570\u7ec4\uff0c\u5b58\u653e\u67d0\u5f20\u724c\u662f\u5426\u88ab\u6253\u51fa\n\t\t\t* \u82e5\u5bf9\u624b\u624b\u4e0a\u6ca1\u6709\u6bd4\u6211\u7684\u724c\u5927\u7684\n\t\t\t* \u90a3\u5c31\u8d62\u4e86\n\t\t\t* \n\t\t\t* 0-opponent use\n\t\t\t* 1-opponent unused\n\t\t\t* -1-my cards\n\t\t\t* \n\t\t\t*\/\n\t\t\tsort(mycards.begin(),mycards.end());\/\/\u6392\u4e2a\u5e8f\u5148\n\n\t\t\tused_map[mycards[i]\/*\u8fd9\u4e2a\u5730\u65b9\u662f\u6b63\u5e38\u6570\u5b57\u54e6,\n\t\t\t\t\u6211\u4eec\u7684\u724c\u7528-1\u6807\u6ce8*\/] = -1;\n\t\t\t\/*\n\t\t\t\u5047\u8bbe\u5bf9\u9762\u90fd\u662f\u667a\u4eba\n\t\t\t\u5982\u679c\u6709\u591a\u4e2a\u724c\u80fd\u591f\u538b\u6b7b\u4f60\n\t\t\t\u4f18\u5148\u51fa\u5c0f\u7684\u724c\n\t\t\t*\/\n\t\t}\n\t\tint ans = 0;\n\t\tfor(int i=mycards.size()-1;i&gt;=0;i--){\n\t\t\t\/\/\u5012\u5e8f\n\t\t\tif(mycards[i]==card_max){\n\t\t\t\tans++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbool isentry = false;\n\t\t\tfor(int i1=1;i1&lt;=card_max-mycards[i];i1++){\n\t\t\t\tif(used_map[mycards[i]+i1]==1){\n\t\t\t\t\tisentry = true;\n\t\t\t\t\tused_map[mycards[i]+i1] = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!isentry){\n\t\t\t\tans++;\n\t\t\t}\n\t\t}\n\t\tanss.push_back(ans);\n\t\t\n\t}\n\tfor(int i=0;i&lt;anss.size();i++){\n\t\t\tcout&lt;&lt;\"Case \"&lt;&lt;i+1&lt;&lt;\": \"&lt;&lt;anss[i]&lt;&lt;\"\\n\";\n\t}\t\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u601d\u8def\u6211\u5199\u5728\u91cc\u9762\u4e86<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u518d\u8981\u8be6\u7ec6\u70b9\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f60\u7684\u6838\u5fc3\u601d\u8def\u5c31\u662f\u201c\u62ff\u6211\u7684\u5927\u724c\u5f53\u70ae\u7070\uff0c\u903c\u51fa\u5bf9\u624b\u7684\u5927\u724c\uff0c\u4fdd\u4f4f\u6211\u540e\u9762\u7684\u724c\u201d\uff1a<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>\u724c\u9762\u5206\u654c\u6211<\/strong>\uff1a\u7528\u4e00\u4e2a\u6570\u7ec4\uff08<code>used_map<\/code>\uff09\u628a\u5168\u573a\u6240\u6709\u724c\u6807\u8bb0\u51fa\u6765\uff0c\u533a\u5206\u54ea\u4e9b\u662f\u6211\u7684\uff08<code>-1<\/code>\uff09\u3001\u54ea\u4e9b\u5728\u5bf9\u624b\u624b\u91cc\u8fd8\u6ca1\u51fa\uff08<code>1<\/code>\uff09\u3002<\/li>\n\n\n\n<li><strong>\u4ece\u5927\u5230\u5c0f\u51fa\u724c<\/strong>\uff1a\u5148\u628a\u6211\u7684\u724c\u4ece\u5c0f\u5230\u5927\u6392\u597d\u5e8f\uff0c\u7136\u540e\u4ece\u6700\u5927\u7684\u724c\u5f00\u59cb\u5012\u7740\u5f80\u5916\u51fa\uff0c\u4f18\u5148\u7528\u5927\u724c\u53bb\u8bd5\u63a2\u548c\u6d88\u8017\u5bf9\u624b\u3002<\/li>\n\n\n\n<li><strong>\u5bf9\u624b\u7cbe\u51c6\u538b\u724c\uff08\u7530\u5fcc\u8d5b\u9a6c\uff09<\/strong>\uff1a\u6bcf\u5f53\u6211\u51fa\u4e00\u5f20\u724c\uff0c\u7edd\u9876\u806a\u660e\u7684\u5bf9\u624b\u4e3a\u4e86\u4e0d\u6d6a\u8d39\u597d\u724c\uff0c\u4e00\u5b9a\u4f1a\u4ece\u6bd4\u6211\u5927\u4e00\u70b9\u70b9\u7684\u724c\u5f00\u59cb\u5f80\u4e0a\u627e\uff0c\u6311\u51fa<strong>\u521a\u521a\u597d\u80fd\u538b\u6b7b\u6211\u7684\u6700\u5c0f\u90a3\u5f20\u724c<\/strong>\u6253\u51fa\u6765\uff08\u628a\u90a3\u5f20\u724c\u4ece <code>1<\/code> \u53d8\u6210\u5df2\u4f7f\u7528\u7684 <code>0<\/code>\uff09\u3002<\/li>\n\n\n\n<li><strong>\u6ca1\u724c\u7ba1\u6211\u5c31\u8d62<\/strong>\uff1a\u5982\u679c\u5bf9\u624b\u628a\u6bd4\u6211\u5927\u7684\u724c\u5168\u627e\u904d\u4e86\uff0c\u53d1\u73b0\u8981\u4e48\u672c\u6765\u5c31\u662f\u6211\u7684\u724c\uff0c\u8981\u4e48\u5df2\u7ecf\u5728\u524d\u9762\u51e0\u8f6e\u88ab\u6211\u7684\u5927\u724c\u5f53\u70ae\u7070\u5151\u6389\u4e86\uff08\u627e\u4e0d\u5230 <code>1<\/code> \u4e86\uff09\uff0c\u90a3\u6211\u8fd9\u5f20\u724c\u5c31\u5f7b\u5e95\u65e0\u654c\uff0c\u7a33\u8d62\u4e00\u5c40\u3002<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u7136\uff0c\u8fd9\u4e48\u641e\u5f53\u7136\u80fdAC\uff0c\u4f46\u662f\u65f6\u95f4\u590d\u6742\u5ea6\u8fd8\u662f\u592a\u5927\u4e86<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6709\u6ca1\u6709\u4ec0\u4e48\u53ef\u4ee5\u4f18\u5316\u7684\u70b9\u5462\uff1f<\/p>\n\n\n\n<div style=\"font-size: 16px; line-height: 1.8; color: #333; padding: 16px; background-color: #fdfdfd; border-left: 4px solid #0969da; border-radius: 4px;\">\n    <p style=\"margin-top: 0;\">\u5bf9\u6bd4\u6700\u521d\u7684\u5b9e\u73b0\uff0c\u6211\u4eec\u53ef\u4ee5\u6df1\u523b\u4f53\u4f1a\u5230\u7b97\u6cd5\u4f18\u5316\u4e2d\u7684\u51e0\u4e2a\u5173\u952e\u5207\u5165\u70b9\uff1a<\/p>\n\n    <h3 style=\"margin-top: 20px; margin-bottom: 10px; font-size: 17px;\">1. \u91cd\u590d\u626b\u63cf\uff08\u65f6\u95f4\u590d\u6742\u5ea6\u504f\u9ad8\uff09<\/h3>\n    <p>\u6bcf\u6b21\u6253\u51fa\u4e00\u5f20\u724c <code>mycards[i]<\/code>\uff0c\u90fd\u8981\u5199\u4e00\u4e2a\u5185\u5c42\u5faa\u73af <code>for(int i1=1; ...)<\/code> \u5f80\u540e\u626b\u63cf\u5bfb\u627e <code>1<\/code>\u3002<\/p>\n    <p>\u5047\u5982\u6700\u5927\u724c\u662f 1000\uff0c\u4f60\u6709 50 \u5f20\u724c\uff0c\u6bcf\u6b21\u90fd\u4ece\u5f53\u524d\u724c\u626b\u5230 1000\uff0c\u6700\u574f\u60c5\u51b5\u4e0b\u8981\u626b\u63cf N \u00d7 (N \u00d7 M) \u6b21\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u662f <strong>O(N\u00b2 M)<\/strong>\u3002<\/p>\n    <p>\u867d\u7136\u672c\u9898 N \u2264 50, M \u2264 20 \u6570\u636e\u5f88\u5c0f\u80fd\u79d2\u8fc7\uff0c\u4f46\u5982\u679c\u9898\u76ee\u628a\u6570\u636e\u8303\u56f4\u653e\u5927\u5230 N \u00d7 M = 10\u2076\uff0c\u8fd9\u79cd\u4e8c\u91cd\u5faa\u73af\u5c31\u4f1a\u76f4\u63a5 TLE\uff08\u8d85\u65f6\uff09\u3002\u800c\u5012\u5e8f\u904d\u5386\u53ea\u626b\u4e00\u904d\uff0c\u590d\u6742\u5ea6\u76f4\u63a5\u964d\u5230 <strong>O(NM)<\/strong>\uff0c\u5c5e\u4e8e\u964d\u7ef4\u6253\u51fb\u3002<\/p>\n\n    <h3 style=\"margin-top: 20px; margin-bottom: 10px; font-size: 17px;\">2. sort \u6392\u5e8f\u5176\u5b9e\u662f\u591a\u4f59\u7684<\/h3>\n    <p>\u6211\u4eec\u5df2\u7ecf\u628a\u6240\u6709\u724c\u653e\u8fdb\u4e86\u4e0b\u6807\u5929\u7136\u6709\u5e8f\u7684 <code>used_map<\/code>\uff08\u4e0b\u6807\u4ece 1 \u5230 <code>card_max<\/code>\uff09\u91cc\u3002\u65e2\u7136\u6876\u672c\u8eab\u5c31\u662f\u6392\u597d\u5e8f\u7684\uff0c\u5176\u5b9e\u6839\u672c\u4e0d\u9700\u8981\u518d\u7528 <code>mycards<\/code> \u6570\u7ec4\u5b58\u4e00\u904d\u5e76\u8c03\u7528 <code>sort<\/code> \u6392\u5e8f\u3002<\/p>\n    <p>\u8fd9\u4e0d\u4ec5\u7701\u53bb\u4e86 O(N log N) \u7684\u6392\u5e8f\u65f6\u95f4\uff0c\u8fd8\u76f4\u63a5\u7701\u53bb\u4e86\u4e00\u4e2a\u6570\u7ec4\u7684\u989d\u5916\u7a7a\u95f4\u5f00\u9500\u3002\u5728\u201c\u6876\u201d\u7684\u89c6\u89d2\u4e0b\uff0c\u6211\u4eec\u53ea\u9700\u8981\u77e5\u9053\u54ea\u4e2a\u6570\u5b57\u88ab\u5360\u7528\u4e86\u5373\u53ef\u3002<\/p>\n\n    <h3 style=\"margin-top: 20px; margin-bottom: 10px; font-size: 17px;\">3. \u5bf9\u624b\u5176\u5b9e\u4e0d\u9700\u8981\u6311\u201c\u521a\u521a\u597d\u201d\u7684\u724c\uff08\u7b49\u4ef7\u6027\u8f6c\u6362\uff09<\/h3>\n    <p>\u5728\u4f60\u7684\u521d\u59cb\u601d\u8def\u91cc\uff0c\u5f53\u6211\u6709 12\uff0c\u5bf9\u624b\u6709 13 \u548c 15 \u65f6\uff0c\u5bf9\u624b\u5fc5\u987b\u7528 13 \u538b\u6211\u7684 12\u3002<\/p>\n    <p>\u4f46\u6362\u4e2a\u89d2\u5ea6\u60f3\uff1a<strong>\u53ea\u8981\u6211\u4eec\u662f\u4ece 15 \u5012\u7740\u5f80 1 \u770b\uff0c\u5728\u770b\u5230 12 \u7684\u90a3\u4e00\u523b\uff0c\u6bd4 12 \u5927\u7684\u724c\uff0813 \u548c 15\uff09\u5730\u4f4d\u662f\u5b8c\u5168\u4e00\u6837\u7684<\/strong>\u2014\u2014\u5b83\u4eec\u5168\u90fd\u662f\u201c\u80fd\u538b\u6b7b 12 \u4ee5\u53ca 12 \u4ee5\u4e0b\u4efb\u4f55\u724c\u7684\u6b66\u5668\u201d\u3002<\/p>\n    <p>\u5bf9\u624b\u968f\u4fbf\u62ff\u5176\u4e2d\u54ea\u4e00\u5f20\u6765\u5151\u6389\u4f60\u7684 12\uff0c\u5269\u4e0b\u7684\u6709\u6548\u6b66\u5668\u6570\u91cf\u90fd\u53ea\u4f1a\u51cf 1\uff01\u65e2\u7136\u5730\u4f4d\u7b49\u4ef7\uff0c\u6211\u4eec\u6839\u672c\u4e0d\u9700\u8981\u53bb\u8bb0\u5f55\u5b83\u4eec\u5177\u4f53\u662f\u51e0\uff0c\u53ea\u9700\u8981\u7528\u4e00\u4e2a\u8ba1\u6570\u5668 <code>enemy_weapons<\/code> \u8bb0\u5f55\u6b66\u5668\u6570\u91cf\u5373\u53ef\u3002\u8fd9\u5c31\u662f\u7528\u8d2a\u5fc3\u72b6\u6001\u66ff\u4ee3\u5177\u4f53\u6a21\u62df\u7684\u9b45\u529b\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u54c8\u57fa\u7c73\u4e5f\u662f\u7ed9\u4e86\u4e00\u7248\u4f18\u5316\u4ee3\u7801<\/p>\n\n\n\n<pre><code class=\"language-cpp\">#include &lt;iostream&gt;\n#include &lt;vector&gt;\n\nusing namespace std;\n\nint main() {\n    ios::sync_with_stdio(false);\n    cin.tie(nullptr);\n\n    int players, cards, case_num = 1;\n    while (cin &gt;&gt; players &gt;&gt; cards &amp;&amp; (players || cards)) {\n        int card_max = players * cards;\n        \n        \/\/ true \u4ee3\u8868\u662f\u6211\u4eec\u7684\u724c\uff0cfalse \u4ee3\u8868\u662f\u5bf9\u624b\u7684\u724c\uff08\u6bd4 int \u6570\u7ec4\u66f4\u7701\u7a7a\u95f4\uff09\n        vector&lt;bool&gt; is_mine(card_max + 1, false);\n        for (int i = 0; i &lt; cards; i++) {\n            int pip;\n            cin &gt;&gt; pip;\n            is_mine[pip] = true; \n        }\n\n        int ans = 0;\n        int enemy_weapons = 0; \/\/ \u5bf9\u624b\u624b\u91cc\u76ee\u524d\u6512\u7740\u7684\u3001\u6bd4\u5f53\u524d\u724c\u5927\u7684\u201c\u6b66\u5668\u201d\u6570\u91cf\n\n        \/\/ \u76f4\u63a5\u4ece\u6700\u5927\u724c\u5012\u7740\u904d\u5386\u5230 1\uff0c\u5f7b\u5e95\u7701\u53bb sort \u548c\u5185\u5c42\u5faa\u73af\uff01\n        for (int i = card_max; i &gt;= 1; i--) {\n            if (is_mine[i]) {\n                \/\/ \u9047\u5230\u6211\u4eec\u7684\u724c\uff1a\u770b\u5bf9\u624b\u624b\u91cc\u6709\u6ca1\u6709\u6512\u7740\u6bd4 i \u5927\u7684\u6b66\u5668\n                if (enemy_weapons == 0) {\n                    ans++; \/\/ \u5bf9\u624b\u6ca1\u6b66\u5668\u7ba1\u6211\u4eec\uff0c\u7a33\u8d62\uff01\n                } else {\n                    enemy_weapons--; \/\/ \u5bf9\u624b\u6d88\u8017\u4e00\u628a\u6b66\u5668\u538b\u6b7b\u6211\u4eec\uff08\u4e00\u6362\u4e00\u5151\u5b50\uff09\n                }\n            } else {\n                \/\/ \u9047\u5230\u5bf9\u624b\u7684\u724c\uff1a\u5bf9\u624b\u6b66\u5668\u5e93 +1\n                enemy_weapons++;\n            }\n        }\n\n        cout &lt;&lt; \"Case \" &lt;&lt; case_num++ &lt;&lt; \": \" &lt;&lt; ans &lt;&lt; \"\\n\";\n    }\n    return 0;\n}<\/code><\/pre>\n\n\n\n<div style=\"font-size: 16px; line-height: 1.8; color: #333;\">\n    <p>\u6839\u636e\u4e0a\u9762\u7684\u7b2c 2\u30013 \u70b9\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u4e8c\u91cd\u5faa\u73af\u76f4\u63a5\u62cd\u5e73\u4e3a\u4e00\u4e2a\u5355\u5c42\u5faa\u73af\uff0c\u8fde <code>mycards<\/code> \u6570\u7ec4\u3001<code>sort<\/code> \u6392\u5e8f\u5168\u90fd\u7701\u6389\uff01<\/p>\n\n    <h3 style=\"margin-top: 24px; margin-bottom: 12px; font-size: 18px; border-bottom: 1px solid #eee; padding-bottom: 6px;\">\u6539\u8fdb\u4e00\uff1a\u53cc\u6307\u9488 \/ \u62ec\u53f7\u62b5\u6d88\u6cd5\uff08\u6700\u63a8\u8350\uff0c\u65f6\u95f4 O(NM)\uff09<\/h3>\n    <p>\u6211\u4eec\u4fdd\u7559\u4f60\u7684 <code>used_map<\/code>\uff08\u6216\u8005\u7528 <code>vector&lt;bool&gt;<\/code> \u66f4\u7701\u5185\u5b58\uff09\uff0c\u76f4\u63a5\u4ece <code>card_max<\/code> \u5012\u7740\u8d70\u5230 <code>1<\/code>\u3002<\/p>\n    <p>\u4e0d\u518d\u6bcf\u6b21\u56de\u5934\u5f80\u4e0a\u627e\u5bf9\u624b\u7684\u724c\uff0c\u800c\u662f\u987a\u8def\u7528\u4e00\u4e2a\u53d8\u91cf <code>enemy_weapons<\/code> \u8bb0\u5f55\u201c\u4ece\u6700\u5927\u724c\u8d70\u5230\u73b0\u5728\uff0c\u5bf9\u624b\u624b\u91cc\u6512\u4e86\u591a\u5c11\u5f20\u8fd8\u6ca1\u7528\u6389\u7684\u5927\u724c\u201d\uff1a<\/p>\n    <ul style=\"padding-left: 20px; margin-bottom: 24px;\">\n        <li>\u5982\u679c\u9047\u5230\u5bf9\u624b\u7684\u724c\uff0c<code>enemy_weapons++<\/code>\uff08\u6b66\u5668\u5165\u5e93\uff09\u3002<\/li>\n        <li>\u5982\u679c\u9047\u5230\u6211\u4eec\u7684\u724c\uff0c\u770b <code>enemy_weapons<\/code> \u662f\u5426\u4e3a 0\u3002\u4e3a 0 \u8bf4\u660e\u6211\u4eec\u8fd9\u5f20\u724c\u65e0\u654c\uff0c\u76f4\u63a5\u5f97\u5206\uff1b\u4e0d\u4e3a 0 \u8bf4\u660e\u5bf9\u624b\u7528\u4e00\u5f20\u6b66\u5668\u5151\u6362\u4e86\u6211\u4eec\u7684\u724c\uff0c<code>enemy_weapons--<\/code>\uff08\u4e00\u6362\u4e00\u5151\u5b50\uff09\u3002<\/li>\n    <\/ul>\n\n    <h3 style=\"margin-top: 24px; margin-bottom: 12px; font-size: 18px; border-bottom: 1px solid #eee; padding-bottom: 6px;\">\u6539\u8fdb\u4e8c\uff1a\u5bf9\u6bd4\u4e00\u4e0b\u4e24\u79cd\u5199\u6cd5\u7684\u6027\u80fd\u4e0e\u4ee3\u7801\u91cf<\/h3>\n    <div style=\"overflow-x: auto; margin-bottom: 20px;\">\n        <table style=\"border-collapse: collapse; width: 100%; text-align: left; font-size: 15px; min-width: 600px;\">\n            <thead>\n                <tr>\n                    <th style=\"border: 1px solid #d0d7de; padding: 10px; background-color: #f6f8fa; font-weight: bold; width: 20%;\">\u5bf9\u6bd4\u7ef4\u5ea6<\/th>\n                    <th style=\"border: 1px solid #d0d7de; padding: 10px; background-color: #f6f8fa; font-weight: bold; width: 40%;\">\u4f60\u7684\u539f\u7248\u601d\u8def\uff08\u4e8c\u91cd\u5faa\u73af\u627e\u724c\uff09<\/th>\n                    <th style=\"border: 1px solid #d0d7de; padding: 10px; background-color: #f6f8fa; font-weight: bold; width: 40%;\">\u6539\u8fdb\u7248\u601d\u8def\uff08\u5355\u6b21\u5012\u5e8f\u8ba1\u6570\uff09<\/th>\n                <\/tr>\n            <\/thead>\n            <tbody>\n                <tr>\n                    <td style=\"border: 1px solid #d0d7de; padding: 10px;\"><strong>\u6838\u5fc3\u64cd\u4f5c<\/strong><\/td>\n                    <td style=\"border: 1px solid #d0d7de; padding: 10px;\">\u5148 sort \u624b\u724c\uff0c\u518d\u5bf9\u6bcf\u5f20\u624b\u724c\u5f80\u4e0a\u904d\u5386\u627e\u7b2c\u4e00\u4e2a 1 \u6539\u6210 0<\/td>\n                    <td style=\"border: 1px solid #d0d7de; padding: 10px;\">\u4e0d\u9700\u8981 sort\uff0c\u76f4\u63a5\u4ece card_max \u5230 1 \u626b\u4e00\u904d\uff0c\u7528\u52a0\u51cf\u6cd5\u62b5\u6d88<\/td>\n                <\/tr>\n                <tr>\n                    <td style=\"border: 1px solid #d0d7de; padding: 10px;\"><strong>\u65f6\u95f4\u590d\u6742\u5ea6<\/strong><\/td>\n                    <td style=\"border: 1px solid #d0d7de; padding: 10px;\">O(N log N + N\u00b2 M)<\/td>\n                    <td style=\"border: 1px solid #d0d7de; padding: 10px;\"><strong>O(NM)<\/strong>\uff08\u6bcf\u4e2a\u6570\u5b57\u53ea\u770b 1 \u6b21\uff0c\u901f\u5ea6\u6781\u5feb\uff09<\/td>\n                <\/tr>\n                <tr>\n                    <td style=\"border: 1px solid #d0d7de; padding: 10px;\"><strong>\u7a7a\u95f4\u590d\u6742\u5ea6<\/strong><\/td>\n                    <td style=\"border: 1px solid #d0d7de; padding: 10px;\">mycards + used_map \u4e24\u4e2a int \u6570\u7ec4<\/td>\n                    <td style=\"border: 1px solid #d0d7de; padding: 10px;\">\u4ec5\u9700 1 \u4e2a bool \u6570\u7ec4\uff08\u6216 bitset\uff09<\/td>\n                <\/tr>\n                <tr>\n                    <td style=\"border: 1px solid #d0d7de; padding: 10px;\"><strong>\u72b6\u6001\u6807\u5fd7\u4f4d<\/strong><\/td>\n                    <td style=\"border: 1px solid #d0d7de; padding: 10px;\">\u9700\u8981 isentry \u914d\u5408 break \u8df3\u51fa\u5faa\u73af<\/td>\n                    <td style=\"border: 1px solid #d0d7de; padding: 10px;\">\u65e0\u4efb\u4f55\u6807\u5fd7\u4f4d\uff0c\u7eaf if-else \u52a0\u51cf\u6cd5<\/td>\n                <\/tr>\n            <\/tbody>\n        <\/table>\n    <\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u603b\u7ed3<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u4ee5\u540e\u7684 ACM \u5237\u9898\u4e2d\uff0c\u53ea\u8981\u53d1\u73b0\u81ea\u5df1\u5728\u5199\u201c\u6bcf\u6b21\u4ece\u4f4d\u7f6e $i$ \u5f80\u540e\u627e\u7b2c\u4e00\u4e2a\u6ee1\u8db3\u6761\u4ef6\u7684\u5143\u7d20\u5e76\u6807\u8bb0\u5220\u9664\u201d\u7684\u4e8c\u91cd\u5faa\u73af\u65f6\uff0c\u90fd\u53ef\u4ee5\u505c\u4e0b\u6765\u60f3\u4e00\u60f3\uff1a<strong>\u80fd\u4e0d\u80fd\u53cd\u8fc7\u6765\u904d\u5386\uff0c\u7528\u4e00\u4e2a\u8ba1\u6570\u5668\u628a\u90a3\u4e9b\u5143\u7d20\u5148\u6512\u8d77\u6765\uff0c\u9047\u5230\u7684\u65f6\u5019\u76f4\u63a5 <code>count--<\/code> \u62b5\u6d88\u6389\uff1f<\/strong> \u638c\u63e1\u4e86\u8fd9\u4e2a\u601d\u7ef4\u8f6c\u6362\uff0c\u5f88\u591a\u590d\u6742\u7684\u6a21\u62df\u9898\u548c\u8d2a\u5fc3\u9898\u90fd\u80fd\u77ac\u95f4\u53d8\u6210\u5341\u884c\u4ee5\u5185\u7684\u6781\u7b80\u4ee3\u7801\uff01<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uff08\u4e0a\u4e00\u9898\u4e5f\u662f\u8d2a\u5fc3\u6765\u7740<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Game Prediction\uff0810019\uff09 AC #include&lt;iostream&gt; #include&lt;ve ...<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":""},"categories":[1],"tags":[],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.sirin.fun\/index.php\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.sirin.fun\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.sirin.fun\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.sirin.fun\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.sirin.fun\/index.php\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":0,"href":"https:\/\/blog.sirin.fun\/index.php\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.sirin.fun\/index.php\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.sirin.fun\/index.php\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.sirin.fun\/index.php\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}