{"id":600,"date":"2024-06-22T09:00:00","date_gmt":"2024-06-22T01:00:00","guid":{"rendered":"https:\/\/seanxd.com\/?p=600"},"modified":"2024-06-25T16:55:39","modified_gmt":"2024-06-25T08:55:39","slug":"zerojudge-k645","status":"publish","type":"post","link":"https:\/\/seanxd.com\/zh\/zerojudge-k645\/","title":{"rendered":"ZeroJudge K645: \u6578\u5b78\u5f97\u529b\u5de5\u5177"},"content":{"rendered":"\n\n\n<p>Jasmine \u662f\u5c0f\u5b78\u4e09\u5e74\u7d1a\u7684\u5b78\u751f\u3002\u5979\u6b63\u5728\u5b78\u7fd2\u52a0\u6cd5\u904b\u7b97\u3002<\/p>\n\n\n\n<p>\u8001\u5e2b\u5beb\u4e0b\u4e86\u4e00\u4e32\u7b97\u5f0f\uff0c\u5b78\u751f\u5011\u8981\u8a08\u7b97\u51fa\u7b97\u5f0f\u7684\u7e3d\u548c\u3002\u4e0d\u904e\uff0c\u9019\u5c0d Jasmine \u4f86\u8aaa\u4e0d\u5920\u3002\u5979\u624d\u525b\u525b\u958b\u59cb\u5b78\u6578\u6578\uff0c\u6240\u4ee5\u7576\u52a0\u6578\u4ee5\u975e\u905e\u6e1b\u6392\u5e8f\u6642\uff0cJasmine \u624d\u80fd\u8a08\u7b97\u51fa\u7b97\u5f0f\u7684\u7e3d\u548c\u3002\u4f8b\u5982\uff1a\u5979\u4e0d\u80fd\u8a08\u7b97\u51fa 1+3+2+1\uff0c\u4f46\u5979\u80fd\u8a08\u7b97\u51fa 1+1+2+3\u3002<\/p>\n\n\n\n<p>\u4f60\u5f97\u5230\u4e86\u5beb\u5728\u9ed1\u677f\u4e0a\u7684\u7b97\u5f0f\u3002 \u91cd\u65b0\u6392\u5217\u7b97\u5f0f\u4e26\u4ee5 Jasmine \u53ef\u4ee5\u8a08\u7b97\u7e3d\u548c\u7684\u65b9\u5f0f\u6253\u5370\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>\u8f38\u5165\u662f\u4e00\u500b\u975e\u7a7a\u5b57\u7b26\u4e32 s\uff0c\u9ed1\u677f\u4e0a\u7684\u7b97\u5f0f\uff0c\u5b57\u7b26\u4e32 s \u4e0d\u5305\u542b\u7a7a\u683c\u3002 \u5b83\u53ea\u5305\u542b\u6578\u5b57\u548c\u5b57\u7b26\u300c+\u300d\u3002 \u6b64\u5916\uff0c\u5b57\u7b26\u4e32 s \u662f\u6578\u5b57 1\u30012 \u548c 3 \u7684\u6b63\u78ba\u7e3d\u548c\u3002\u5b57\u7b26\u4e32 s \u7684\u9577\u5ea6\u6700\u591a\u70ba 1000 \u500b\u5b57\u7b26\u3002<\/td><td>\u6253\u5370 Jasmine \u53ef\u4ee5\u8a08\u7b97\u7684\u65b0\u7b97\u5f0f\u3002<\/td><\/tr><tr><td>3+2+1<\/td><td>1+2+3<\/td><\/tr><tr><td>2<\/td><td>2<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e3\u984c\u601d\u8def<\/h2>\n\n\n\n<p>\u4f7f\u7528\u5b57\u4e32\u4f86\u6536\u7b97\u5f0f\uff0c\u4e26\u4e14\u5c07\u6578\u5b57\u7368\u7acb\u51fa\u4f86\u5b58\u5230\u9663\u5217\u4e2d\u3002\u5982\u679c\u9663\u5217\u7684\u8cc7\u6599\u53ea\u6709\u4e00\u500b\u7684\u8a71\u5c31\u53ea\u8f38\u51fa\u9019\u500b\u6578\u5b57\uff0c\u5426\u5247\u5c31\u5c07\u9663\u5217\u6392\u5e8f\u904e\u5f8c\u8f38\u51fa\uff0c\u4e2d\u9593\u8981\u6709\u300c+\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=k645\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge K645: \u6578\u5b78\u5f97\u529b\u5de5\u5177<\/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;\n#include &lt;algorithm&gt;\nusing namespace std;\n\nint toint(string str) {\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    string str, tmp = &quot;&quot;;\n    cin &gt;&gt; str;\n    vector&lt;int&gt;num;\n    for (int i = 0; i&lt;str.length(); i++) {\n        if (str[i] == &#39;+&#39; && tmp.length() &gt; 0) {\n            num.push_back(toint(tmp));\n            tmp = &quot;&quot;;\n        }\n        tmp += str[i];\n    }\n    if (tmp.length() &gt; 0) num.push_back(toint(tmp));\n    sort(num.begin(), num.end());\n    cout &lt;&lt; num[0];\n    if (num.size() &gt; 1) {\n        for (int i = 1; i&lt;num.size(); i++) {\n            cout &lt;&lt; &#39;+&#39; &lt;&lt; num[i];\n        }\n    }\n    cout &lt;&lt; &quot;\\n&quot;;\n}\n\n\/\/ZeroJudge K645\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Jasmine \u662f\u5c0f\u5b78\u4e09\u5e74\u7d1a\u7684\u5b78\u751f\u3002\u5979\u6b63\u5728\u5b78\u7fd2\u52a0\u6cd5\u904b\u7b97\u3002 \u8001\u5e2b\u5beb\u4e0b\u4e86\u4e00\u4e32\u7b97\u5f0f\uff0c\u5b78\u751f\u5011\u8981\u8a08\u7b97\u51fa\u7b97\u5f0f\u7684\u7e3d\u548c\u3002\u4e0d\u904e\uff0c [&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,19,13,9],"class_list":["post-600","post","type-post","status-publish","format-standard","hentry","category-6","tag-8","tag-11","tag-19","tag-13","tag-9"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/600","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=600"}],"version-history":[{"count":2,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/600\/revisions"}],"predecessor-version":[{"id":990,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/600\/revisions\/990"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/media?parent=600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/categories?post=600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/tags?post=600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}