{"id":231,"date":"2024-04-26T21:41:54","date_gmt":"2024-04-26T13:41:54","guid":{"rendered":"https:\/\/seanxd.com\/?p=231"},"modified":"2024-04-26T21:41:56","modified_gmt":"2024-04-26T13:41:56","slug":"zerojudge-a466","status":"publish","type":"post","link":"https:\/\/seanxd.com\/zh\/zerojudge-a466\/","title":{"rendered":"ZeroJudge A466: One-Two-Three"},"content":{"rendered":"\n\n\n<h4 class=\"wp-block-heading\">\u540c\u984c\uff1aUVa 12289 &#8211; One-Two-Three<\/h4>\n\n\n\n<p class=\"\">\u4f60\u7684\u5f1f\u5f1f\u525b\u5b78\u6703\u5beb\u82f1\u6587\u7684\u4e00\u4e8c\u4e09\u3002\u4ed6\u5728\u4e00\u5f35\u7d19\u4e0a\u5beb\u4e86\u5f88\u591a\u9019\u5e7e\u500b\u5b57\uff0c\u800c\u4f60\u7684\u5de5\u4f5c\u4fbf\u662f\u8fa8\u8a8d\u5b83\u5011\u3002<\/p>\n\n\n\n<p class=\"\">\u8981\u6ce8\u610f\u7684\u662f\u4f60\u5f1f\u5f1f\u4e0d\u904e\u662f\u500b\u5c0f\u5b69\u5b50\uff0c\u56e0\u6b64\u4ed6\u6703\u72af\u4e9b\u5c0f\u932f\u8aa4\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"\">\u81f3\u591a\u4e00\u500b\u932f\u8aa4\u7684\u5b57\u6bcd<\/li>\n\n\n\n<li class=\"\">\u55ae\u5b57\u9577\u5ea6\u4e00\u5b9a\u662f\u6b63\u78ba\u7684<\/li>\n\n\n\n<li class=\"\">\u4ed6\u6240\u5beb\u7684\u4e00\u5b9a\u662f\u5c0f\u5beb\u5b57\u6bcd<\/li>\n\n\n\n<li class=\"\">\u6bcf\u500b\u55ae\u5b57\u53ea\u53ef\u80fd\u6709\u4e00\u7a2e\u5408\u7406\u89e3\u91cb<\/li>\n<\/ul>\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>\u7b2c\u4e00\u884c\u5305\u542b\u4f60\u5f1f\u5f1f\u6240\u5beb\u55ae\u5b57\u6578\u3002\u63a5\u4e0b\u4f86\u7684\u6bcf\u4e00\u884c\u542b\u6709\u4e00\u500b\u5c0f\u5beb\u5b57\u6bcd\u7d44\u6210\u7684\u55ae\u5b57\u3002\u55ae\u5b57\u5fc5\u7b26\u5408\u4e0a\u8ff0\u9650\u5236\uff1a\u81f3\u591a\u4e00\u500b\u932f\u8aa4\u7684\u5b57\u6bcd\uff0c\u4f46\u662f\u55ae\u5b57\u9577\u5ea6\u6c38\u9060\u6b63\u78ba\u3002\u8f38\u5165\u4e2d\u6700\u591a\u6709 10 \u500b\u55ae\u5b57\u3002<\/td><td>\u5c0d\u6bcf\u7b46\u6e2c\u8cc7\uff0c\u8f38\u51fa\u55ae\u5b57\u7684\u6578\u503c\u3002<\/td><\/tr><tr><td>3<br>owe<br>too<br>theee<\/td><td>1<br>2<br>3<\/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=\"\">\u300cThree\u300d\u9019\u500b\u7b54\u6848\u53ef\u4ee5\u76f4\u63a5\u5224\u65b7\u5b57\u4e32\u9577\u5ea6\u662f\u5426\u70ba 5 \u76f4\u63a5\u8f38\u51fa\u3002\u5269\u4e0b\u7684\u5169\u500b\u5176\u5be6\u7d44\u5408\u65b9\u5f0f\u53ea\u6709 6 \u7a2e\uff0c\u5c07\u9019\u516d\u7a2e\u5beb\u6210 <strong>If<\/strong> \u5224\u65b7\u5f0f\u5373\u53ef\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\uff0d<a href=\"https:\/\/zerojudge.tw\/ShowProblem?problemid=a466\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge A466: One-Two-Three<\/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;\nusing namespace std;\n\nint main() {\n    cin.sync_with_stdio(0);\n    cin.tie(0);\n    int N;\n    cin &gt;&gt; N;\n    for (int i = 0; i&lt;N; i++)\n    {\n        string str;\n        cin &gt;&gt; str;\n        if (str.length() == 5) cout &lt;&lt; 3 &lt;&lt; &quot;\\n&quot;;\n        else\n        {\n            if (str[0] == &#39;o&#39; && str[1] == &#39;n&#39;) cout &lt;&lt; 1 &lt;&lt; &quot;\\n&quot;;\n            else if (str[1] == &#39;n&#39; && str[2] == &#39;e&#39;) cout &lt;&lt; 1 &lt;&lt; &quot;\\n&quot;;\n            else if (str[2] == &#39;e&#39; && str[0] == &#39;o&#39;) cout &lt;&lt; 1 &lt;&lt; &quot;\\n&quot;;\n            if (str[0] == &#39;t&#39; && str[1] == &#39;w&#39;) cout &lt;&lt; 2 &lt;&lt; &quot;\\n&quot;;\n            else if (str[1] == &#39;w&#39; && str[2] == &#39;o&#39;) cout &lt;&lt; 2 &lt;&lt; &quot;\\n&quot;;\n            else if (str[2] == &#39;o&#39; && str[0] == &#39;t&#39;) cout &lt;&lt; 2 &lt;&lt; &quot;\\n&quot;;\n        }\n    }\n}\n\n\/\/ZeroJudge A466\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u540c\u984c\uff1aUVa 12289 &#8211; One-Two-Three \u4f60\u7684\u5f1f\u5f1f\u525b\u5b78\u6703\u5beb\u82f1\u6587\u7684\u4e00\u4e8c\u4e09\u3002\u4ed6\u5728\u4e00\u5f35\u7d19 [&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":[18],"tags":[8,11,9],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-uva","tag-8","tag-11","tag-9"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/231","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=231"}],"version-history":[{"count":2,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":233,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/231\/revisions\/233"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/media?parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/categories?post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/tags?post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}