{"id":809,"date":"2021-08-23T22:55:08","date_gmt":"2021-08-23T14:55:08","guid":{"rendered":"https:\/\/blog.cruciferslab.net\/?p=809"},"modified":"2021-08-23T22:55:42","modified_gmt":"2021-08-23T14:55:42","slug":"gks-2021-round-e","status":"publish","type":"post","link":"https:\/\/blog.cruciferslab.net\/?p=809","title":{"rendered":"GKS 2021 Round E"},"content":{"rendered":"\n<p>\u9019\u6b21\u662f\u56e0\u70ba\u6709\u5225\u7684\u4e8b\u6240\u4ee5\u665a\u4e86\u4e00\u5929\u624d\u4f86\u6574\u7406\u7684 Round E\u3002<\/p>\n\n\n\n<p>\u7a0d\u5fae\u63d0\u4e00\u4e0b\u4e0a\u6b21\u7684\u4e8b\uff1a\u539f\u672c\u6211\u4ee5\u70ba Round D \u7684\u6642\u9593\u6211\u6709\u4e8b\u4e86\uff0c\u4f46\u90a3\u5169\u500b\u6708\u4e8b\u60c5\u6709\u9ede\u8b8a\u5316\uff0c\u539f\u672c\u6392\u5728\u9019\u5929\u7684\u4e8b\u4e0d\u898b\u4e86\uff1b\u53ea\u4e0d\u904e\u56e0\u70ba\u4e00\u4e9b\u5176\u4ed6\u7684\u539f\u56e0\uff0cRound D \u6700\u5f8c\u4ecd\u7136\u6c92\u6709\u53c3\u6230\u3002<\/p>\n\n\n\n<p>Round E \u6700\u5f8c\u662f 248 \u540d, \u505a\u4e86 1 3 4 \u984c\u3002\u5206\u6578\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=\"159\" src=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-1024x159.png\" alt=\"\" class=\"wp-image-810\" srcset=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-1024x159.png 1024w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-300x46.png 300w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-150x23.png 150w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-768x119.png 768w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image.png 1460w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Q1. Shuffled Anagrams<\/h2>\n\n\n\n<p>\u6211\u5176\u5be6\u5f88\u5feb\u5c31\u60f3\u5230\u5230\u984c\u89e3\u505a\u7684\u79fb\u4f4d\u89e3\uff0c\u4e0d\u904e\u5012\u662f\u6c92\u6709\u7d30\u60f3\u5230 \\(\\lfloor\\frac{N}{2}\\rfloor\\) \u9019\u500b\u95dc\u9375\u503c\uff0c\u800c\u662f\u76f4\u63a5\u6383\u904e\u4e00\u904d\u627e\u51fa\u6700\u591a\u5b57\u6bcd\u7684\u662f\u8ab0\uff0c\u79fb\u90a3\u9ebc\u591a\u4f4d\u3002\u610f\u601d\u5176\u5be6\u662f\u4e00\u6a23\u7684\u5566\uff0c\u5c31\u6211\u591a\u505a\u4e86\u7121\u7528\u529f\u800c\u5df2\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Q3. Palindromic Crossword<\/h2>\n\n\n\n<p>\u770b\u904e Q2 \u5f8c\u89ba\u5f97\u9019\u984c\u6709\u9ede\u8a0e\u53ad\uff0c\u6240\u4ee5\u5148\u8df3\u984c\u5230 Q3 \u4f86\u3002<\/p>\n\n\n\n<p>\u984c\u89e3\u63d0\u5230\u7684\u7b49\u50f9\u985e\u5f88\u5feb\u5c31\u89c0\u5bdf\u5230\u4e86\uff0c\u53ea\u662f\u6211\u4e26\u6c92\u6709\u628a\u7b49\u50f9\u985e\u7d66\u5efa\u7acb\u8d77\u4f86\uff0c\u800c\u662f\u76f4\u63a5\u4e0b\u53bb\u6383\u6bcf\u500b\u683c\u5b50\uff0c\u5982\u679c\u5b83\u6709\u5b57\u4e14\u5b83\u7684\u5c0d\u7a31\u4f4d\u7f6e\u6c92\u5b57\u5c31\u628a\u5b57\u4e1f\u904e\u53bb\uff0c\u7136\u5f8c\u905e\u8ff4\u3002<\/p>\n\n\n\n<p>\u4f8b\u5982\u7bc4\u4f8b\u8f38\u5165 2\uff0c\u4e00\u958b\u59cb\u770b\u5230 r1c1 \u7684 A \u6aa2\u67e5\u5b83\u7684\u5c0d\u7a31\u683c (r1c4 \u548c r4c1)\uff0c\u767c\u73fe r1c4 \u662f\u7a7a\u7684\uff0c\u6240\u4ee5\u586b r1c4 \u70ba A\uff0c\u7136\u5f8c\u63db r1c4 \u7e7c\u7e8c\u3002<\/p>\n\n\n\n<p>\u2026\u2026\u53ea\u662f\u5728 \\(N\\times M\\leq10^6\\) \u7684\u9019\u500b\u5927\u5c0f\u6211\u5176\u5be6\u6709\u9ede\u64d4\u5fc3\u905e\u8ff4\u6703\u7206\u5806\u758a\u5c31\u662f\u4e86\u3002\u597d\u5728\u9019\u500b\u905e\u8ff4\u662f\u500b\u5c3e\u905e\u8ff4\uff0c\u624b\u52d5\u6539\u5beb\u6210\u8ff4\u5708\u5f0f\u4e26\u6c92\u6709\u82b1\u592a\u591a\u6642\u9593\u3002\u6642\u9593\u8907\u96dc\u5ea6\u65b9\u9762\uff0c\u4e00\u7d44\u5c0d\u7a31\u9023\u7dda\u81f3\u591a\u6703\u88ab\u8d70\u5169\u6b21\uff0c\u800c\u5217\u51fa\u5c0d\u7a31\u683c\u5982\u984c\u89e3\u8aaa\u660e\u8ddf\u76e4\u9762\u4e00\u6a23\u662f \\(O(N\\times M)\\)\uff0c\u6240\u4ee5\u7e3d\u6642\u9593\u4ecd\u7136\u662f \\(O(N\\times M)\\)\u3002\u6211\u662f\u4e0d\u592a\u78ba\u5b9a\u8ab0\u7684\u5e38\u6578\u6703\u6bd4\u8f03\u5927\u5c31\u662f\u4e86\u2026\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Q4. Increasing Sequence Card Game<\/h2>\n\n\n\n<p>\u2026\u2026\u5dee\u9ede\u5c31\u88ab\u9019\u984c\u7d66\u64fa\u4e86\u4e00\u9053\u3002<\/p>\n\n\n\n<p>\u6211\u63a8\u7684\u905e\u8ff4\u95dc\u4fc2\u5f0f\u5176\u5be6\u548c\u984c\u89e3\u4e0d\u592a\u4e00\u6a23\uff1a\u4ee4\u6709 \\(N\\) \u5f35\u5361\uff0c\u4e14\u6bd4\u76ee\u524d\u5df2\u9078\u64c7\u7684\u5361\u5c0f\u7684\u7684\u5361\u7247\u6709 \\(k\\) \u5f35\uff0c\u5247\u5269\u4e0b\u9019\u90e8\u4efd\u7684\u671f\u671b\u5f35\u6578\u662f<\/p>\n\n\n\n<p>$$V(N,k)=1+\\sum_{i=0}^k\\left(\\frac{k!}{(k-i)!}\\cdot\\left(\\sum_{m=0}^{N-k-1} V(N-i-1,k-i+m)\\right)\\bigg\/\\frac{n!}{(n-i-1)!}\\right)$$<\/p>\n\n\n\n<p>\u4e2d\u9593\u7684\u548c\u5f0f\u662f\u9019\u6a23\u7684\uff1a\u8a2d\u4e0b\u4e00\u5f35\u5927\u5361\u524d\u6709 \\(i\\) \u5f35\u5c0f\u5361\uff0c\u5148\u9078\u9019 \\(i\\) \u5f35\uff1b\u518d\u8a2d\u4e0b\u4e00\u5f35\u5927\u5361\u662f\u5269\u4e0b\u7684 \\(N-k\\) \u5f35\u5927\u5361\u4e2d\u7b2c \\(m+1\\) \u5c0f\u7684\uff0c\u9019\u6a23\u5269\u4e0b\u7684\u72c0\u6cc1\u5c31\u662f \\(N-i-1\\) \u5f35\u5361\uff0c\u7576\u4e2d\u5c0f\u5361\u6709 \\(k-i+m\\) \u5f35\u3002\u9019\u6a23\u7684\u6a5f\u7387\uff0c\u524d \\(i\\) \u5f35\u9078\u6cd5\u6709 \\(P(k,i)=\\frac{k!}{(k-i)!}\\) \u7a2e\uff0c\u800c \\(N\\) \u5f35\u724c\u88e1\u56fa\u5b9a\u4e86 \\(i+1\\) \u5f35\u724c\u7684\u6a5f\u7387\u662f \\(\\frac{1}{P(N,i+1)}=1\\big\/\\frac{n!}{(n-i-1)!}\\)\u3002\u628a\u9019\u4e9b\u6240\u6709\u72c0\u6cc1\u52a0\u8d77\u4f86\uff0c\u518d +1 (\u5373\u662f\u90a3\u4e0b\u4e00\u5f35\u5927\u5361) \u5c31\u662f\u6240\u6c42\u4e86\u3002\u908a\u754c\u689d\u4ef6\u662f \\(V(N,N)=0\\)\uff0c\u4e0d\u904e\u8a66\u7b97\u4e86\u524d\u5e7e\u500b\u5206\u6578\u770b\u8457\u6709\u9ede\u773c\u719f\u2026\u2026<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"414\" height=\"489\" src=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-1.png\" alt=\"\" class=\"wp-image-826\" srcset=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-1.png 414w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-1-254x300.png 254w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-1-127x150.png 127w\" sizes=\"auto, (max-width: 414px) 100vw, 414px\" \/><\/figure><\/div>\n\n\n\n<p>\u9664\u4e86\u770b\u8d77\u4f86\u7d50\u679c\u53ea\u8ddf \\(N-k\\) \u6709\u95dc\u4e4b\u5916\uff0c\u9019\u500b\u6578\u5217\uff1a\\(1,\\frac32,\\frac{11}6,\\frac{25}{12},\\frac{137}{60}\\) \u662f\u500b\u975e\u5e38\u773c\u719f\u7684\u6771\u897f\uff0d\uff0d\u679c\u7136\u4e00\u6e1b\u5c31\u767c\u73fe\u6211\u7684\u76f4\u89ba\u6c92\u932f\u4e86\uff1a\u9019\u7d50\u679c\u662f<a href=\"https:\/\/zh.wikipedia.org\/wiki\/%E8%AA%BF%E5%92%8C%E6%95%B8\" data-type=\"URL\" data-id=\"https:\/\/zh.wikipedia.org\/wiki\/%E8%AA%BF%E5%92%8C%E6%95%B8\">\u8abf\u548c\u6578<\/a>\uff0c\u4e5f\u5c31\u662f<a href=\"https:\/\/zh.wikipedia.org\/wiki\/%E8%B0%83%E5%92%8C%E7%BA%A7%E6%95%B0\">\u8abf\u548c\u7d1a\u6578<\/a>\u7684\u90e8\u4efd\u548c\u3002\u6240\u4ee5\u9019\u984c\u7b54\u6848\u5c31\u5f88\u7c21\u55ae\u4e86\uff1a\u628a\u7dad\u57fa\u767e\u79d1\u4e0a\u7684\u8abf\u548c\u6578\u8fd1\u4f3c\u5c55\u958b\u5f0f\u6284\u9032\u53bb\u5c31\u597d\u4e86\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"622\" height=\"123\" src=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-2.png\" alt=\"\" class=\"wp-image-827\" srcset=\"https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-2.png 622w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-2-300x59.png 300w, https:\/\/blog.cruciferslab.net\/wp-content\/uploads\/2021\/08\/image-2-150x30.png 150w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/><\/figure><\/div>\n\n\n\n<p>\u56e0\u70ba\u53ea\u5728 \\(n\\) \u5f88\u5927\u6642\u624d\u4ee3\u516c\u5f0f\uff0c\\(n^4\\) \u8db3\u5920\u5c07\u7cbe\u78ba\u5ea6\u7b97\u5230\u6240\u8981\u6c42\u7684\u76f8\u5c0d \\(10^{-6}\\)\u3002\u81f3\u65bc\u90a3\u500b +1\u2026\u2026\u662f\u56e0\u70ba\u9810\u8a2d\u8f38\u51fa\u7cbe\u78ba\u5ea6\u662f\u516d\u4f4d\u6709\u6548\u4f4d\u6578\uff0c\u4e0d\u8db3\u4ee5\u88ab\u5224\u5b9a\u70ba\u8db3\u5920\u8fd1\u3002\u52a0\u4e86\u500b <code>setprecision(10)<\/code> \u5c31\u904e\u4e86\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Q2. Birthday Cake<\/h2>\n\n\n\n<p>\u9019\u984c\u984c\u76ee\u4e0d\u96e3\uff0c\u4f46\u56e0\u70ba\u7d30\u7bc0\u5f88\u591a\u7684\u95dc\u4fc2\u4e0d\u5bb9\u6613\u4e00\u6b21\u5beb\u5c0d\uff0c\u9700\u8981\u4e00\u9ede\u5c08\u6ce8\u624d\u884c\uff0d\uff0d\u800c\u6211\u7576\u6642\u5c31\u8a55\u4f30\u9019\u984c\u6211\u8981\u505a\u7684\u8a71\u6703\u9700\u8981\u597d\u597d\u4ed4\u7d30\u7d30\u7b97\u4e00\u4e0b\u5404\u7a2e\u8f38\u5165\u7684\u908a\u754c\u689d\u4ef6 (\u5169\u7a2e\u610f\u5473\u4e0a\u7684\uff0c\u56e0\u70ba\u7576\u8981\u5207\u4e0b\u4f86\u7684\u86cb\u7cd5\u5728\u5927\u86cb\u7cd5\u908a\u4e0a\u6642\u6703\u6709\u7279\u6b8a\u72c0\u6cc1\uff0c\u9ebb\u7169\u7684\u9ede\u5c31\u5728\u9019\u88e1)\uff0c\u6240\u4ee5\u5c31\u5148\u8df3\u904e\u53bb\u505a\u5f8c\u9762\u6bd4\u8f03\u4e0d\u90a3\u9ebc\u9700\u8981\u7d30\u7bc0\u7684\u5169\u984c\u4e86\u3002<\/p>\n\n\n\n<p>\u4e5f\u8a31\u662f\u592a\u6025\u4e86\u5427\uff0c\u5b8c\u5168\u6c92\u6ce8\u610f\u5230\u7576\u76ee\u6a19\u5207\u4e0b\u4f86\u4e4b\u5f8c\u88e1\u9762\u5207\u6210\u5c0f\u584a\u5fc5\u7136\u6703\u7528\u6389\u6070\u597d \\(NM-1\\) \u5200\u2026\u2026\u8a73\u7d30\u8b49\u660e\u548c\u5207\u51fa\u76ee\u6a19\u7684\u5206\u6790\u5c31\u8acb\u770b\u984c\u89e3\u5427\u3002\u6216\u8a31\u9019\u984c\u6700\u5f8c\u6c92\u505a\u51fa\u4f86\u5176\u5be6\u662f\u597d\u4e8b\u5462\u2026\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c0f\u7d50<\/h2>\n\n\n\n<p>\u9019\u5169\u500b\u6708\u6211\u6709\u5728\u958b\u59cb\u5617\u8a66\u4e00\u4e9b\u5176\u4ed6\u6771\u897f (Round D \u6c92\u6709\u53c3\u6230\u6709\u90e8\u4efd\u539f\u56e0\u662f\u9019\u500b)\uff0c\u6240\u4ee5\u9019\u7bc7\u96e2\u4e0a\u7bc7\u624d\u6703\u96e2\u9019\u9ebc\u4e45\u2026\u2026\u4e0d\u904e\u4e0d\u77e5\u9053\u662f\u4e0d\u662f\u53c8\u662f\u60f0\u6027\u767c\u4f5c\uff0c\u5617\u8a66\u7684\u6771\u897f\u90fd\u6c92\u80fd\u5728\u6642\u9593\u5230\u4e4b\u524d\u505a\u5b8c\u3002\u9019\u5834\u6bd4\u8cfd\u6216\u8a31\u53ef\u4ee5\u7b97\u662f\u7576\u505a\u5fc3\u60c5\u6574\u7406\u5427\uff1f\u4e4b\u5f8c\u518d\u4f86\u770b\u770b\u5427\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9019\u6b21\u662f\u56e0\u70ba\u6709\u5225\u7684\u4e8b\u6240\u4ee5\u665a\u4e86\u4e00\u5929\u624d\u4f86\u6574\u7406\u7684 Round E\u3002 \u7a0d\u5fae\u63d0\u4e00\u4e0b\u4e0a\u6b21\u7684\u4e8b\uff1a\u539f\u672c\u6211\u4ee5\u70ba Round D \u7684 [&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-809","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\/809","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=809"}],"version-history":[{"count":20,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/posts\/809\/revisions"}],"predecessor-version":[{"id":834,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=\/wp\/v2\/posts\/809\/revisions\/834"}],"wp:attachment":[{"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cruciferslab.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}