{"id":494,"date":"2024-05-20T09:00:00","date_gmt":"2024-05-20T01:00:00","guid":{"rendered":"https:\/\/seanxd.com\/?p=494"},"modified":"2024-05-04T12:32:41","modified_gmt":"2024-05-04T04:32:41","slug":"zerojudge-k678","status":"publish","type":"post","link":"https:\/\/seanxd.com\/zh\/zerojudge-k678\/","title":{"rendered":"ZeroJudge K678: \u80a5\u4f59\u6b77\u96aa\u8a18&#8212;(\u53cd\u6578\u5b78\u57ce1)"},"content":{"rendered":"\n\n\n<p class=\"\">\u80a5\u4f59\u6210\u529f\u8d70\u51fa\u4ed6\u8ff7\u8def\u7684\u8def\u53e3\uff0c\u4f46\u662f! \u80a5\u4f59\u6c92\u6709\u6230\u6597\u80fd\u529b\uff0c\u4ed6\u53ea\u80fd\u53bb\u6578\u5b78\u57ce\u7684\u5546\u5e97\u8cfc\u8cb7\u6728\u528d\u3002<\/p>\n\n\n\n<p class=\"\">\u53c8\u4f46\u662f\uff01 \u4ed6\u73fe\u5728\u4e0d\u5728\u6578\u5b78\u57ce \u4ed6\u5728\u53cd\u6578\u5b78\u57ce \u3002<\/p>\n\n\n\n<p class=\"\">\u80a5\u4f59\u53ea\u80fd\u6253\u6557\u53cd\u6578\u5b78\u602a\u7378 \u624d\u80fd\u8d70\u51fa\u53cd\u6578\u5b78\u57ce!!!<\/p>\n\n\n\n<p class=\"\">\u80a5\u4f59\u9047\u5230\u5728\u53cd\u6578\u5b78\u57ce\u7684\u7b2c\u4e00\u96bb\u602a\u7378\u662f &#8212;&#8211; \u53cd\u52a0\u6cd5\u7378!!!<\/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>\u7b2c\u4e00\u884c\u70ba\u5c0f\u602a\u6578\u91cf (\u53cd\u52a0\u6cd5\u7378)<br>\u7136\u5f8c\u91cd\u8986 (\u7b2c\u4e00\u884c) \u6b21<br>\u8f38\u5165\u4e00\u500b\u52a0\u6cd5\u7b97\u5f0f<br>\u548c\u7b54\u6848<\/td><td>\u7b54\u5c0d\u8f38\u51fa\u300cyes\u300d<br>\u7b54\u932f\u8f38\u51fa\u300cno\u300d<\/td><\/tr><tr><td>3<br>1+1<br>2<br>2+4<br>5<br>5+8<br>4<\/td><td>yes<br>no<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=\"\">\u4f7f\u7528<strong>\u5b57\u4e32\u4f86\u6536\u52a0\u6cd5\u7684\u7b97\u5f0f<\/strong>\uff0c\u8dd1\u5b57\u4e32\u7684 For\u8ff4\u5708\uff0c\u5ba3\u544a\u4e00\u500b\u7a7a\u7684\u5b57\u4e32\uff0c\u6bcf\u6b21\u90fd<strong>\u628a\u76ee\u524d\u5b57\u5143\u52a0\u5230\u7a7a\u7684\u5b57\u4e32\u4e2d<\/strong>\uff0c\u5982\u679c\u76ee\u524d\u5b57\u4e32\u662f\u300c+\u300d\uff0c\u5247\u5c07\u52a0\u8d77\u4f86\u7684\u5b57\u4e32\u8f49\u6210\u6574\u6578\u4e26\u4e14\u5c07 \u5b57\u4e32.substr(\u76ee\u524d\u4f4d\u7f6e +1, \u5b57\u4e32.length()) \u4e5f\u8b8a\u6210\u6574\u6578\u9032\u884c\u76f8\u52a0\u3002<\/p>\n\n\n\n<p class=\"\">\u5982\u679c\u7b97\u51fa\u4f86\u7684\u7b54\u6848\u548c\u8f38\u5165\u4e00\u6a23\uff0c\u5247\u8f38\u51fa\u300cyes\u300d\uff0c\u53cd\u4e4b\u5247\u8f38\u51fa\u300cno\u300d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\uff0d<a href=\"https:\/\/zerojudge.tw\/ShowProblem?problemid=k678\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge K678: \u80a5\u4f59\u6b77\u96aa\u8a18&#8212;(\u53cd\u6578\u5b78\u57ce1)<\/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 toint(string str)\n{\n    if (str.length() == 1) return int(str[0] - &#39;0&#39;);\n    return stoi(str);\n}\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, tmp = &quot;&quot;;\n        cin &gt;&gt; str;\n        int sum = 0;\n        for (int j = 0; j&lt;str.length(); j++)\n        {\n            if (str[j] == &#39;+&#39;)\n            {\n                sum += toint(tmp);\n                sum += toint(str.substr(j+1, str.length()));\n                break;\n            }\n            tmp += str[j];\n        }\n        int ans;\n        cin &gt;&gt; ans;\n        if (sum == ans) cout &lt;&lt; &quot;yes\\n&quot;;\n        else cout &lt;&lt; &quot;no\\n&quot;;\n    }\n}\n\n\/\/ZeroJudge K678\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u80a5\u4f59\u6210\u529f\u8d70\u51fa\u4ed6\u8ff7\u8def\u7684\u8def\u53e3\uff0c\u4f46\u662f! \u80a5\u4f59\u6c92\u6709\u6230\u6597\u80fd\u529b\uff0c\u4ed6\u53ea\u80fd\u53bb\u6578\u5b78\u57ce\u7684\u5546\u5e97\u8cfc\u8cb7\u6728\u528d\u3002 \u53c8\u4f46\u662f\uff01 \u4ed6\u73fe\u5728\u4e0d\u5728\u6578\u5b78\u57ce [&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":[8,11,13,9],"class_list":["post-494","post","type-post","status-publish","format-standard","hentry","category-6","tag-8","tag-11","tag-13","tag-9"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/494","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=494"}],"version-history":[{"count":1,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/494\/revisions"}],"predecessor-version":[{"id":495,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/494\/revisions\/495"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/media?parent=494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/categories?post=494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/tags?post=494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}