{"id":327,"date":"2024-04-27T23:38:38","date_gmt":"2024-04-27T15:38:38","guid":{"rendered":"https:\/\/seanxd.com\/?p=327"},"modified":"2024-04-27T23:38:40","modified_gmt":"2024-04-27T15:38:40","slug":"zerojudge-e624","status":"publish","type":"post","link":"https:\/\/seanxd.com\/en\/zerojudge-e624\/","title":{"rendered":"ZeroJudge E624: All in All"},"content":{"rendered":"\n\n\n<h4 class=\"wp-block-heading\">\u540c\u984c\uff1aUVa 10340 &#8211; All in All<\/h4>\n\n\n\n<p class=\"\">\u4f60\u8a2d\u8a08\u4e86\u4e00\u7a2e\u65b0\u7684\u52a0\u5bc6\u6280\u8853\uff0c\u8a72\u6280\u8853\u901a\u904e\u5728\u8a0a\u606f\u5b57\u4e32\u4e4b\u9593\u63d2\u5165\u96a8\u6a5f\u751f\u6210\u7684\u5b57\u4e32\u4f86\u5c0d\u6d88\u606f\u9032\u884c\u7de8\u78bc\u3002<br>\u7531\u65bc\u672a\u89e3\u6c7a\u5c08\u5229\u554f\u984c\uff0c\u6211\u5011\u5c07\u4e0d\u8a73\u7d30\u8a0e\u8ad6\u5982\u4f55\u751f\u6210\u5b57\u4e32\u3002\u4f46\u662f\uff0c\u8981\u9a57\u8b49\u60a8\u7684\u65b9\u6cd5\uff0c\u6709\u5fc5\u8981\u5beb\u4e00\u500b\u7a0b\u5f0f\u4f86\u6aa2\u67e5\u8a0a\u606f\u662f\u5426\u771f\u6b63\u7de8\u78bc\u5728\u6700\u7d42\u5b57\u4e32\u4e2d\u3002<br>\u7d66\u5b9a\u5169\u500b\u5b57\u4e32 S \u548c T\uff0c\u60a8\u5fc5\u9808\u78ba\u5b9a <strong>S \u662f\u5426\u70ba T \u7684\u539f\u59cb\u8a0a\u606f\u5b57\u4e32<\/strong>\uff0c\u5373\u662f\u5426\u53ef\u4ee5\u5f9et\u4e2d\u522a\u9664\u5b57\u5143\u4ee5\u4f7f\u5176\u5269\u9918\u5b57\u5143\u4e32\u806f\u7232 S\u3002<\/p>\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><strong>EOF<\/strong> \u8f38\u5165\uff0c\u6bcf\u884c\u5169\u500b\u5b57\u4e32 S \u548c T\uff0cS \u548c T \u53ea\u6703\u6709\u82f1\u6587\u5b57\u6bcd\u3002<\/td><td>\u5c0d\u65bc\u6bcf\u884c\u8f38\u5165<br>\u5982\u679c S \u662f T \u7684\u539f\u59cb\u8a0a\u606f\u5b57\u4e32<br>\u8f38\u51fa\u300cYes\u300d<br>\u5426\u5247<br>\u8f38\u51fa\u300cNo\u300d<\/td><\/tr><tr><td>sequence  subsequence<br>person  compression<br>VERDI  vivaVittorioEmanueleReDiItalia<br>caseDoesMatter  CaseDoesMatter<\/td><td>Yes<br>No<br>Yes<br>No<\/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=\"\"><strong>\u8dd1\u7b2c\u4e8c\u500b\u5b57\u4e32\u7684 For\u8ff4\u5708<\/strong> \u7136\u5f8c<strong>\u8a2d\u5b9a\u4e00\u500b Count \u7684\u8b8a\u6578<\/strong> (\u9810\u8a2d\u70ba 0)\uff0c\u7576\u7b2c\u4e8c\u500b\u5b57\u4e32\u7684\u7b2c i \u500b\u5b57\u5143\u7b49\u65bc\u7b2c\u4e00\u500b\u5b57\u4e32\u7684\u7b2cCount\u500b\u5b57\u5143\u6642\uff0cCount++\u3002\u6700\u5f8c\u5224\u65b7Count\u662f\u5426\u7b49\u65bc\u7b2c\u4e00\u500b\u5b57\u4e32\u7684\u9577\u5ea6\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=e624\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge E624: All in All<\/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    string a, b;\n    while (cin &gt;&gt; a &gt;&gt; b)\n    {\n        int count = 0;\n        for (int i = 0; i&lt;b.length(); i++)\n        {\n            if (b[i] == a[count]) count++;\n            if (count == a.length()) break;\n        }\n        if (count == a.length()) cout &lt;&lt; &quot;Yes\\n&quot;;\n        else cout &lt;&lt; &quot;No\\n&quot;;\n    }\n}\n\n\/\/ZeroJudge E624\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u540c\u984c\uff1aUVa 10340 &#8211; All in All \u4f60\u8a2d\u8a08\u4e86\u4e00\u7a2e\u65b0\u7684\u52a0\u5bc6\u6280\u8853\uff0c\u8a72\u6280\u8853\u901a\u904e\u5728\u8a0a\u606f\u5b57\u4e32 [&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":[1,18],"tags":[8,11,9],"class_list":["post-327","post","type-post","status-publish","format-standard","hentry","category-uncategorized","category-uva","tag-8","tag-11","tag-9"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/comments?post=327"}],"version-history":[{"count":1,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/327\/revisions"}],"predecessor-version":[{"id":328,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/327\/revisions\/328"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/media?parent=327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/categories?post=327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/tags?post=327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}