{"id":1376,"date":"2023-04-16T02:48:25","date_gmt":"2023-04-15T18:48:25","guid":{"rendered":"https:\/\/blog.cruciferslab.net\/?p=1376"},"modified":"2023-04-16T02:57:30","modified_gmt":"2023-04-15T18:57:30","slug":"gcj-2023-farewell-round-c","status":"publish","type":"post","link":"https:\/\/blog.cruciferslab.net\/?p=1376","title":{"rendered":"GCJ 2023 Farewell Round C"},"content":{"rendered":"\n<p>\u6c92\u60f3\u5230\u4eca\u5e74\u5c31\u662f\u6700\u5f8c\u4e00\u5e74\u7684 GCJ \u4e86\u2026\u2026<\/p>\n\n\n\n<p>\u9019\u6700\u5f8c\u4e00\u5e74\u4e5f\u4e0d\u662f\u4e00\u500b\u5b8c\u6574\u7684\u8cfd\u4e8b\u5e74\uff0c\u800c\u662f\u5c31\u7c21\u55ae\u5730\u5728 4\/15 \u5e73\u884c\u958b\u56db\u500b\u96e3\u5ea6\u5404\u6709\u4e0d\u540c\u7684\u56de\u5408\u505a\u70ba Farewell Round\uff0c\u5c31\u6b64\u544a\u5225\u5927\u5bb6\u4e86\u3002\u6839\u64da FAQ\uff0c\u9019\u56db\u500b\u56de\u5408\u7684\u96e3\u5ea6\u5206\u914d\u662f\u9019\u6a23\u5b50\u7684\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"193\" src=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image-1024x193.png\" alt=\"\" class=\"wp-image-1379\" srcset=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image-1024x193.png 1024w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image-300x56.png 300w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image-150x28.png 150w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image-768x145.png 768w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image.png 1031w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u8003\u616e\u5230\u6211\u9019\u5e7e\u5e74\u7684 GCJ \u5927\u7d04\u90fd\u5728 R2 \u843d\u99ac\uff0cRound B \u82e5\u662f\u7d04 GCJ R1 \u96e3\u5ea6\u7684\u8a71\u6211\u61c9\u8a72\u76f8\u5c0d\u8f15\u9b06\uff0c\u6240\u4ee5\u6c7a\u5b9a\u9019\u6700\u5f8c\u4e00\u6b21\u5c31\u4ee5 Round C \u4f5c\u7d50\u5427\u3002<\/p>\n\n\n\n<p>\u2026\u2026\u7136\u5f8c\u5c31\u767c\u73fe\u597d\u50cf\u54ac\u592a\u591a\u4e86\uff0c\u6700\u7d42\u6210\u7e3e\u662f 24\/100\u3002\u90a3\u9ebc\uff0c\u9019\u53e5\u8a71\u4e5f\u662f\u6700\u5f8c\u4e00\u6b21\u7528\u5728 GCJ\uff1a\u6210\u7e3e\u622a\u5716\u4ee5\u4e0b\u6709\u96f7\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"161\" src=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image-1-1024x161.png\" alt=\"\" class=\"wp-image-1380\" srcset=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image-1-1024x161.png 1024w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image-1-300x47.png 300w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image-1-150x24.png 150w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image-1-768x121.png 768w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image-1-1536x242.png 1536w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2023\/04\/image-1.png 1660w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Q1. Game Sort: Part 1<\/h2>\n\n\n\n<p>\u7406\u8ad6\u4e0a\u61c9\u8a72\u662f\u6c92\u4ec0\u9ebc\u597d\u8aaa\u7684\u5566\uff0c\u5c31\u627e\u4e0b\u4e00\u7d44\u88e1\u5927\u65bc\u7b49\u65bc\u4e0a\u4e00\u7d44\u7684\u6700\u5c0f\u5b57\u4e32\uff0c\u7121\u6cd5\u5c31 <code>IMPOSSIBLE<\/code>\u3002\u53ea\u662f\u6211\u5beb\u5230 Q5 \u624d\u767c\u73fe Q1 \u9019\u500b\u6838\u5fc3\u90e8\u4efd\u6709 bug&#8230;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Q2. Immunization Operation<\/h2>\n\n\n\n<p>\u6211\u7684\u505a\u6cd5\u662f\u7528\u500b <code>set<\/code> \u8a18\u4e0b\u54ea\u500b\u4f4d\u7f6e\u6709\u4ec0\u9ebc\u64cd\u4f5c (\u62ff N \u865f\u75ab\u82d7\u8ddf\u7d66 N \u865f\u75ab\u82d7)\uff0c\u7136\u5f8c\u5728\u9019\u4e0a\u9762\u8d70\u5c31\u597d\u3002\u6bd4\u8f03\u9ebb\u7169\u4e00\u9ede\u9ede\u7684\u662f\u9019\u500b\u300c\u5728\u4e0a\u9762\u8d70\u300d\u7684\u610f\u7fa9\uff1a\u6211\u8a2d\u5b9a\u6307\u6a19\u6307\u5728\u67d0\u64cd\u4f5c\u4e0a\u8868\u793a\u6a5f\u5668\u4eba\u4f4d\u7f6e\u5728\u524d\u4e00\u4f4d\u7f6e (\u542b) \u5230\u6b64\u4e00\u4f4d\u7f6e (\u4e0d\u542b) \u7684\u5340\u9593\uff0c\u9019\u6a23\u6240\u6709\u6307\u6a19 (\u542b <code>.end()<\/code>) \u5c31\u90fd\u5c0d\u61c9\u5230\u4e00\u6bb5\u7a7a\u9593\u4e86\uff0c\u4e0d\u904e\u9019\u5c31\u4ee3\u8868\u4e00\u4e9b\u5224\u65b7\u7684\u7b49\u865f\u8ddf\u524d\u4e00\u5f8c\u4e00\u7684\u7d30\u7bc0\u5c31\u8981\u5f88\u5c0f\u5fc3\u3002<\/p>\n\n\n\n<p>\u53ea\u662f\u53ea\u8d70\u9805\u76ee\u770b\u8d77\u4f86\u6642\u9593\u9084\u662f\u4e0d\u884c\u7684\u6a23\u5b50\u2026\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Q3. Evolutionary Algorithms<\/h2>\n\n\n\n<p>\u9019\u662f\u500b\u770b\u8d77\u4f86\u5f88\u53ef\u6015\u7684\u7d44\u5408\u984c\u3002\u6bcf\u4e00\u500b\u9ede\u8f2a\u6d41\u7576 B \u9ede\uff0c\u9019\u6a23 A \u9ede\u5c31\u5728 B \u4e0b\u9762\u53d6\uff0cC \u9ede\u5c31\u5728\u9019\u4e4b\u5916\u7684\u5730\u65b9\u53d6\uff0c\u6240\u4ee5\u7d71\u8a08\u597d\u6bcf\u500b\u5b50\u6a39\u7684\u5206\u6578\u6578\u91cf\u4e4b\u5f8c\u5c31\u80fd\u62c9\u51fa\u6578\u91cf\u4e58\u8d77\u4f86\u52a0\u9032\u7d2f\u52a0\u88e1\u53bb\u3002<\/p>\n\n\n\n<p>\u53ea\u662f\u770b\u4f86\u9ede\u6578\u592a\u591a\u8a18\u61b6\u9ad4\u7206\u4e86\u2026\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Q4. The Decades of Coding Competitions<\/h2>\n\n\n\n<p>\u9019\u984c\u2026\u2026\u61c9\u8a72\u662f Floyd-Warshall \u7684\u8b8a\u5f62\u3002\u628a\u8a08\u7b97\u6700\u77ed\u8def\u5f91\u6539\u6210\u7d71\u8a08\u6709\u54ea\u4e9b\u8def\u5f91\u984f\u8272\u96c6\u5408\uff0c\u518d\u53bb\u770b\u8981\u554f\u7684\u984c\u76ee\u54ea\u4e9b\u6709\u5947\u6578\u984f\u8272\u7a2e\u8def\u5f91\u3002\u56e0\u70ba Hard \u6e2c\u8cc7\u6709\u767e\u8272\uff0c\u61c9\u8a72\u662f\u4e0d\u592a\u80fd\u76f4\u63a5\u8a18\u5947\u5076\u624d\u5c0d\u2026\u2026\u53ea\u662f\u679c\u7136\u591a\u9019\u4e00\u5c64\u8ff4\u5708\u6642\u9593\u5c31\u7206\u4e86\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Q5. Game Sort: Part 2<\/h2>\n\n\n\n<p>\u597d\u7684\uff0c\u9019\u984c\u8cca\u5230\u4e86\u4e00\u500b\u6975\u9ede\u3002\u6700\u96e3\u7684\u554f\u984c\u662f P=3 \u7684\u72c0\u6cc1\uff0c\u5176\u6b21\u662f P=2\uff0cP >= 4 \u53cd\u800c\u662f\u6700\u7c21\u55ae\u7684\u3002<\/p>\n\n\n\n<p>P >= 4 \u7684\u72c0\u6cc1\uff0c\u5982\u679c\u5728\u539f\u5b57\u4e32\u88e1\u627e\u5230\u4e86\u9023\u7e8c\u5169\u500b\u5b57\u6bcd\u524d\u8005\u5927\u65bc\u5f8c\u8005\uff0c\u90a3\u6211\u5011\u7e3d\u662f\u80fd\u628a\u9019\u5169\u500b\u5b57\u6bcd\u500b\u5225\u5207\u958b\uff1b\u5982\u679c\u627e\u4e0d\u5230\uff0c\u4ee3\u8868\u539f\u5b57\u4e32\u672c\u8eab\u5c31\u662f\u975e\u905e\u6e1b\u6392\u5217\uff0c\u90a3\u9019\u5c31\u7121\u89e3\u3002(EDIT: \u7136\u5f8c\u88ab\u984c\u89e3\u6253\u81c9\u4e86\uff1a\u6211\u6f0f\u4e86\u4e00\u500b\u72c0\u6cc1\u662f <code>...PPP...<\/code> \u5207\u6210 <code>... PP P ...<\/code> \u4e5f\u884c\uff0c\u5269\u4e0b\u7684\u624d\u771f\u7684\u7121\u89e3)<\/p>\n\n\n\n<p>\u5269\u4e0b\u4f86\u7684\u72c0\u6cc1\u5f97\u8981\u50cf Q1 \u4e00\u6a23\u627e\u80fd\u7d44\u5408\u51fa\u4f86\u7684\u5b57\u4e32\u7bc4\u570d\uff0c\u5982\u679c\u80fd\u627e\u51fa\u524d\u5b57\u4e32\u6700\u5c0f\u9084\u6bd4\u5f8c\u5b57\u4e32\u5927\u90a3\u5c31\u662f\u89e3\u4e86\u3002P=2 \u4ee3\u8868\u53ea\u8981\u5207\u4e00\u5200\uff0c\u90a3\u6211\u5011\u53ef\u4ee5\u5148\u6c42\u51fa\u6240\u6709\u7684\u524d\u7db4\u6700\u5c0f\u8ddf\u5f8c\u7db4\u6700\u5927\uff0c\u9010\u4e00\u6aa2\u67e5\u904e\u53bb\u5c31\u884c\u4e86\uff1b\u4f46 P=3 \u60f3\u4e86\u8001\u534a\u5929\u6c92\u6709\u60f3\u5230\u6709\u6548\u7387\u7684\u505a\u6cd5\uff0c\u53ea\u5f04\u4e86\u500b\u534a\u5957\u8d77\u4f86 (\u9084\u5728\u4e2d\u9593\u767c\u73fe\u4e86 Q1 \u90a3\u6bb5\u6838\u5fc3\u7684 bug)\uff0c\u5beb\u5b8c\u53ea\u5269\u516b\u5206\u9418\u53ea\u597d\u5c31\u9001\uff0c\u679c\u7136\u5c0f\u6e2c\u8a66\u5c31 WA\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c0f\u7d50<\/h2>\n\n\n\n<p>\u662f\u4e0d\u662f\u61c9\u8a72\u53bb\u505a Round B \u624d\u5c0d\u2026\u2026\uff1f\u8003\u616e\u5230\u665a\u5341\u9019\u500b\u6642\u9593\u6211\u57fa\u672c\u4e0a\u61c9\u8a72\u4e0d\u592a\u53ef\u80fd\u975e\u5e38\u5c08\u5fc3\uff0c\u6216\u8a31 Round B \u53ef\u80fd\u624d\u662f\u6b63\u78ba\u7684\u9078\u64c7\u3002(\u800c\u4e14\u78ba\u5be6\u904e\u7a0b\u4e2d\u662f\u4e0d\u600e\u9ebc\u5c08\u5fc3\u6c92\u932f (\u6b7b<\/p>\n\n\n\n<p>\u561b\uff0c\u96d6\u7136\u6211\u9072\u5230 2020 \u624d\u958b\u59cb\u8ddf\u4e0a GCJ\uff0c\u5927\u5b78\u6642\u671f\u5728\u505a ICPC \u90a3\u6bb5\u6642\u9593\u7684\u89e3\u984c\u601d\u8def\u5df2\u7d93\u6389\u7684\u5dee\u4e0d\u591a\uff0c\u4e0d\u904e\u81f3\u5c11\u66fe\u7d93\u5728 2020 \u885d\u9032 R3 \u904e\uff0c\u62ff\u4e86\u4e00\u4ef6 T \u6064\u7b97\u662f\u804a\u52dd\u65bc\u7121\u5427\u3002\u81f3\u65bc\u672a\u4f86\u2026\u2026\u90fd\u5df2\u7d93\u4e0a\u4e86\u9019\u500b\u5e74\u7d00 (\uff01) \u4e86\uff0c\u5c31\u7b97\u53c3\u52a0\u985e\u4f3c\u7684\u6771\u897f\u61c9\u8a72\u76f8\u5c0d\u6ce8\u91cd\u89e3\u984c\u800c\u975e\u7af6\u901f\u4e86\u5427\u3002<\/p>\n\n\n\n<p>\u90a3\u9ebc\uff0c\u672a\u4f86\u6709\u7de3\u518d\u898b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6c92\u60f3\u5230\u4eca\u5e74\u5c31\u662f\u6700\u5f8c\u4e00\u5e74\u7684 GCJ \u4e86\u2026\u2026 \u9019\u6700\u5f8c\u4e00\u5e74\u4e5f\u4e0d\u662f\u4e00\u500b\u5b8c\u6574\u7684\u8cfd\u4e8b\u5e74\uff0c\u800c\u662f\u5c31\u7c21\u55ae\u5730\u5728 4\/15 \u5e73\u884c\u958b\u56db [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,4],"tags":[],"class_list":["post-1376","post","type-post","status-publish","format-standard","hentry","category-gcj","category-programming"],"_links":{"self":[{"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/posts\/1376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1376"}],"version-history":[{"count":6,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/posts\/1376\/revisions"}],"predecessor-version":[{"id":1388,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/posts\/1376\/revisions\/1388"}],"wp:attachment":[{"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}