{"id":297,"date":"2024-04-27T16:45:44","date_gmt":"2024-04-27T08:45:44","guid":{"rendered":"https:\/\/seanxd.com\/?p=297"},"modified":"2024-04-27T16:45:46","modified_gmt":"2024-04-27T08:45:46","slug":"zerojudge-f418","status":"publish","type":"post","link":"https:\/\/seanxd.com\/zh\/zerojudge-f418\/","title":{"rendered":"ZeroJudge F418: Word Search Puzzle"},"content":{"rendered":"\n\n\n<p class=\"\">Word Search Puzzle \u662f\u4e00\u7a2e\u5e38\u898b\u7684\u82f1\u6587\u5b57\u8b0e\uff0c\u901a\u5e38\u7531\u4e00\u500b\u77e9\u5f62\u7684\u65b9\u683c\u6240\u69cb\u6210\uff0c\u6bcf\u4e00\u500b\u65b9\u683c\u4e2d\u6709\u4e00\u500b\u5b57\u6bcd\u3002\u73a9\u5bb6\u53ef\u4ee5\u7531\u5de6\u81f3\u53f3\u3001\u7531\u4e0a\u81f3\u4e0b\uff0c\u6216\u662f\u7531\u5de6\u4e0a\u81f3\u53f3\u4e0b\u627e\u5230\u9023\u7e8c\u7684\u5b57\u6bcd\u62fc\u6210\u6307\u5b9a\u7684\u55ae\u5b57\u3002<\/p>\n\n\n\n<p class=\"\">\u6587\u6587\u5df2\u7d93\u627e\u5230\u4e86\u4e00\u500b\u55ae\u5b57\uff0c<strong>\u7d66\u4f60\u8d77\u59cb\u53ca\u7d50\u675f\u7684\u4f4d\u7f5d\uff0c\u9ebb\u7169\u4f60\u628a\u9019\u500b\u55ae\u5b57\u62fc\u51fa\u4f86<\/strong>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"539\" height=\"341\" loading=\"lazy\" src=\"https:\/\/seanxd.com\/wp-content\/uploads\/2024\/04\/Word-Search-Puzzle.png\" alt=\"ZeroJudge F418\n\u984c\u76ee\u793a\u610f\u5716\" class=\"wp-image-298\" srcset=\"https:\/\/seanxd.com\/wp-content\/uploads\/2024\/04\/Word-Search-Puzzle.png 539w, https:\/\/seanxd.com\/wp-content\/uploads\/2024\/04\/Word-Search-Puzzle-300x190.png 300w\" sizes=\"auto, (max-width: 539px) 100vw, 539px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u7bc4\u4f8b\u6e2c\u8cc7<\/h2>\n\n\n\n<figure class=\"wp-block-table nfd-wb-animate nfd-wb-fade-in-bottom-short\"><table class=\"has-fixed-layout\"><thead><tr><th>\u7bc4\u4f8b\u8f38\u5165<\/th><th>\u7bc4\u4f8b\u8f38\u51fa<\/th><\/tr><\/thead><tbody><tr><td>\u8f38\u5165\u7684\u7b2c\u4e00\u884c\u6709\u516d\u500b\u6574\u6578 H (1 \u2264 H \u2264 20) \u548c W (1 \u2264 W \u2264 50)\uff0c\u4ee3\u8868\u5b57\u8b0e\u7684\u9ad8\u8207\u5bec\u5ea6\uff0c<br><strong>R1\u3001C1 \u53ca R2\u3001C2 \u5206\u5225\u70ba\u8d77\u59cb\u53ca\u7d50\u675f\u4f4d\u7f6e<\/strong>\uff0cR1 \u548c R2 \u662f\u7531\u4e0a\u800c\u4e0b\u7b2c\u5e7e\u5217\uff0cC1 \u548c C2 \u662f\u7531\u5de6\u800c\u53f3\u7b2c\u5e7e\u500b\u5b57\u5143\u3002(1 \u2264 R1 \u2264 R2 \u2264 H\uff0c1 \u2264 C1 \u2264 C2 \u2264 W)<br>\u63a5\u4e0b\u4f86\u7684 H \u884c\uff0c\u6bcf\u884c\u6709 W \u500b<strong>\u5927\u5beb\u5b57\u6bcd<\/strong>\uff0c\u4ee3\u8868\u9019\u500b\u5b57\u8b0e\u7684\u5167\u5bb9\u3002<\/td><td>\u8f38\u51fa\u7531\u8d77\u59cb\u4f4d\u7f6e\u5230\u7d50\u675f\u4f4d\u7f6e\u7684\u9023\u7e8c\u5b57\u5143\u6240\u62fc\u6210\u7684\u55ae\u5b57\u3002<\/td><\/tr><tr><td>10  14  <strong>4  3  10  9<\/strong><br>VBREEFISHRACHP<br>ANACROCODILEEB<br>AOSTRICHTEGRDA<br>IADDHCHEETAHGD<br>BHRODRAVENENEG<br>EYWDLSAMOLELHE<br>ARTPVPRCBOLROR<br>RHTOAAHCROWAGH<br>CCANNORIAZEBRA<br>HANYTAEKNINAWA<br>(\u672c\u6e2c\u8cc7\u8acb\u898b\u4e0a\u5716)<\/td><td>DOLPHIN<\/td><\/tr><tr><td>3  4  <strong>1  1  3  1<\/strong><br>(\u8acb\u898b\u4e0b\u65b9\u8868\u683c)<\/td><td>ROW<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u7bc4\u4f8b\u8f38\u5165\/\u8f38\u51fa (\u8868\u683c)<\/h3>\n\n\n\n<figure class=\"wp-block-table nfd-wb-animate nfd-wb-fade-in-bottom-short\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>R<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\">O<\/td><td class=\"has-text-align-center\" data-align=\"center\">A<\/td><td class=\"has-text-align-center\" data-align=\"center\">R<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>O<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\">I<\/td><td class=\"has-text-align-center\" data-align=\"center\">N<\/td><td class=\"has-text-align-center\" data-align=\"center\">K<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>W<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\">O<\/td><td class=\"has-text-align-center\" data-align=\"center\">O<\/td><td class=\"has-text-align-center\" data-align=\"center\">F<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e3\u984c\u601d\u8def<\/h2>\n\n\n\n<p class=\"\">\u9019\u984c\u53ef\u4ee5\u76f4\u63a5\u7528For\u8ff4\u5708\u5c07\u5b57\u5143\u52a0\u8d77\u4f86\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\u8981<strong>\u5148\u5224\u65b7\u7b54\u6848\u7684\u5b57\u4e32\u662f\u8981\u6c42\u5de6\u5230\u53f3\u5e73\u884c\u3001\u4e0a\u5230\u4e0b\u5782\u76f4\u3001\u9084\u662f\u5de6\u4e0a\u5230\u53f3\u4e0b\u659c<\/strong>\u7684\u3002<\/p>\n\n\n\n<p class=\"\"><strong>\u300c\u5de6\u5230\u53f3\u300d<\/strong>\u5c31\u662f R \u662f\u56fa\u5b9a\u7684\u53ea\u9700\u8981\u8dd1 <strong>For\u8ff4\u5708 \u5f9e C1\uff5eC2<\/strong>\u3002<\/p>\n\n\n\n<p class=\"\"><strong>\u300c\u4e0a\u5230\u4e0b\u300d<\/strong>\u5c31\u662f C \u662f\u56fa\u5b9a\u7684\u53ea\u9700\u8981\u8dd1 <strong>For \u8ff4\u5708 \u5f9e R1\uff5eR2<\/strong>\u3002<\/p>\n\n\n\n<p class=\"\"><strong>\u300c\u659c\u8457\u8d70\u300d<\/strong>\u5c31\u662f\u8dd1<strong> For \u8ff4\u5708 \u5f9e R1\uff5eR2<\/strong>\uff0c\u4f46\u662f\u540c\u6642\u52a0\u5b57\u5143\u7684\u6642\u5019<strong>\u4e5f\u8981\u4e00\u76f4\u5c07 C1 \u9032\u884c +1<\/strong>\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\uff0d<a href=\"https:\/\/zerojudge.tw\/ShowProblem?problemid=f418\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge F418: Word Search Puzzle<\/a><\/h3>\n\n\n\n<div class=\"hcb_wrap nfd-wb-animate nfd-wb-reveal-right nfd-delay-50\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>#include &lt;iostream&gt;\n#include &lt;vector&gt;\nusing namespace std;\n\nint main() {\n    int N, M;\n    cin &gt;&gt; N &gt;&gt; M;\n    int R1, C1, R2, C2;\n    cin &gt;&gt; R1 &gt;&gt; C1 &gt;&gt; R2 &gt;&gt; C2;\n    vector&lt;string&gt;v;\n    for (int i = 0; i&lt;N; i++)\n    {\n        string str;\n        cin &gt;&gt; str;\n        v.push_back(str);\n    }\n    string ans = &quot;&quot;;\n    if (R1 == R2)\n    {\n        for (int i = C1-1; i&lt;C2; i++)\n        {\n            ans += v[R1-1][i];\n        }\n    }\n    else if (C1 == C2)\n    {\n        for (int i = R1-1; i&lt;R2; i++)\n        {\n            ans += v[i][C1-1];\n        }\n    }\n    else\n    {\n        for (int i = R1-1; i&lt;R2; i++)\n        {\n            ans += v[i][C1-1];\n            C1++;\n        }\n    }\n    cout &lt;&lt; ans &lt;&lt; &quot;\\n&quot;;\n}\n\n\/\/ZeroJudge F418\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Word Search Puzzle \u662f\u4e00\u7a2e\u5e38\u898b\u7684\u82f1\u6587\u5b57\u8b0e\uff0c\u901a\u5e38\u7531\u4e00\u500b\u77e9\u5f62\u7684\u65b9\u683c\u6240\u69cb\u6210\uff0c\u6bcf\u4e00\u500b\u65b9\u683c\u4e2d\u6709\u4e00\u500b\u5b57\u6bcd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","footnotes":""},"categories":[6],"tags":[20,8,11,9],"class_list":["post-297","post","type-post","status-publish","format-standard","hentry","category-6","tag-20","tag-8","tag-11","tag-9"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/comments?post=297"}],"version-history":[{"count":1,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/297\/revisions"}],"predecessor-version":[{"id":299,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/297\/revisions\/299"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/media?parent=297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/categories?post=297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/tags?post=297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}