{"id":630,"date":"2024-07-03T09:00:00","date_gmt":"2024-07-03T01:00:00","guid":{"rendered":"https:\/\/seanxd.com\/?p=630"},"modified":"2024-05-28T19:42:55","modified_gmt":"2024-05-28T11:42:55","slug":"zerojudge-k847","status":"publish","type":"post","link":"https:\/\/seanxd.com\/zh\/zerojudge-k847\/","title":{"rendered":"ZeroJudge K847: \u79df\u8eca\u8cbb\u7528 (Rent)"},"content":{"rendered":"\n\n\n<p class=\"\">\u5c0f\u82b1\u4e00\u5bb6\u4eba\u79df\u8eca\u53bb\u90ca\u904a\uff0c<strong>\u79df\u8eca\u4e00\u5929\u7684\u8cbb\u7528\u70ba 100 \u5143<\/strong>\uff0c<strong>\u79df\u8eca\u7576\u65e5\u548c\u8eca\u8f1b\u6b78\u9084\u65e5\u7686\u8a08\u7b97\u5728\u5167<\/strong>\u3002<br>\u7531\u65bc\u79df\u8eca\u516c\u53f8\u525b\u525b\u958b\u5e55\uff0c\u70ba\u4e86\u5438\u5f15\u66f4\u591a\u9867\u5ba2\uff0c\u5728\u958b\u5e55\u671f\u9593\u63a8\u51fa\u512a\u60e0\u79df\u8eca\u65b9\u6848\uff1a\u79df\u8eca\u5929\u6578<strong>\u6bcf 10<br>\u5929\u9001 1 \u5929<\/strong>\uff0c\u4e5f\u5c31\u662f\u8aaa\u79df 10 \u5929\u53ea\u9700\u8981\u4ed8 9 \u5929\u7684\u50f9\u9322\u3001\u79df 20 \u5929\u53ea\u9700\u4ed8 18 \u5929\u7684\u8cbb\u7528\uff0c\u4ee5<br>\u6b64\u985e\u63a8\u3002<br>\u5c0f\u82b1\u6392\u5b9a\u597d\u51fa\u53bb\u73a9\u7684\u65e5\u671f\u5f8c\uff0c\u8acb\u4f60\u5e6b\u4ed6\u5011\u4e00\u5bb6\u4eba\u8a08\u7b97\u7e3d\u79df\u8eca\u8cbb\u7528\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\u7e3d\u5171\u5169\u884c\uff0c\u7b2c\u4e00\u884c\u6709\u5169\u500b\u6574\u6578 M1 \u548c D1 (1 \u2264 M1 \u2264 12\uff0c1 \u2264 D1 \u2264 31) \u8868\u793a\u79df\u8eca\u65e5<br>\u671f\uff0c\u7b2c\u4e8c\u884c\u6709\u5169\u500b\u6574\u6578 M2 \u548c D2 (1 \u2264 M2 \u2264 12\uff0c1 \u2264 D2 \u2264 31)\u8868\u793a\u8eca\u8f1b\u6b78\u9084\u65e5\u671f\u3002<strong>\u4fdd\u8b49\u79df\u8eca\u671f\u9593\u4e0d\u6703\u8de8\u5e74\u4efd\u4e14 \uff0c\u5176\u4e2d\u4e8c\u6708\u4efd\u56fa\u5b9a\u4ee5 28 \u5929\u8a08\u7b97\u3002<\/strong><\/td><td>\u8f38\u51fa\u4e00\u884c\u70ba\u7e3d\u79df\u8eca\u8cbb\u7528\u3002<\/td><\/tr><tr><td>7 16<br>7 31<\/td><td>1500<\/td><\/tr><tr><td>2 13<br>4 1<\/td><td>4400<\/td><\/tr><tr><td>11 18<br>11 27<\/td><td>900<\/td><\/tr><tr><td>10 29<br>11 17<\/td><td>1800<\/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=\"\">\u5c07\u5169\u500b\u65e5\u671f\u90fd\u63db\u7b97\u6210\u5929\u6578\uff0c\u4e26\u9032\u884c\u76f8\u6e1b\u5f8c +1\uff0c\u56e0\u70ba\u6b78\u9084\u65e5\u4e5f\u7b97\u3002\u5c07\u5929\u6578 -= \u5929\u6578\/10 \u4e4b\u5f8c\u8f38\u51fa \u5929\u6578*100\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\uff0d<a href=\"https:\/\/zerojudge.tw\/ShowProblem?problemid=k847\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge K847: \u79df\u8eca\u8cbb\u7528 (Rent)<\/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;map&gt;\nusing namespace std;\n\nint main() {\n    cin.sync_with_stdio(0);\n    cin.tie(0);\n    map&lt;int, int&gt;MAP;\n    MAP[0] = 0;\n    MAP[1] = 31;\n    MAP[2] = MAP[1] + 28;\n    MAP[3] = MAP[2] + 31;\n    MAP[4] = MAP[3] + 30;\n    MAP[5] = MAP[4] + 31;\n    MAP[6] = MAP[5] + 30;\n    MAP[7] = MAP[6] + 31;\n    MAP[8] = MAP[7] + 31;\n    MAP[9] = MAP[8] + 30;\n    MAP[10] = MAP[9] + 31;\n    MAP[11] = MAP[10] + 30;\n    MAP[12] = MAP[11] + 31;\n    int M, D;\n    cin &gt;&gt; M &gt;&gt; D;\n    int a = MAP[M-1]+D;\n    cin &gt;&gt; M &gt;&gt; D;\n    int b = MAP[M-1]+D;\n    if (a &gt; b) b += 365;\n    int diff = b - a + 1;\n    diff -= diff\/10;\n    cout &lt;&lt; diff*100 &lt;&lt; &quot;\\n&quot;;\n}\n\n\/\/ZeroJudge K847\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5c0f\u82b1\u4e00\u5bb6\u4eba\u79df\u8eca\u53bb\u90ca\u904a\uff0c\u79df\u8eca\u4e00\u5929\u7684\u8cbb\u7528\u70ba 100 \u5143\uff0c\u79df\u8eca\u7576\u65e5\u548c\u8eca\u8f1b\u6b78\u9084\u65e5\u7686\u8a08\u7b97\u5728\u5167\u3002\u7531\u65bc\u79df\u8eca\u516c\u53f8\u525b\u525b\u958b\u5e55\uff0c\u70ba\u4e86 [&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":[25],"tags":[14,8,13],"class_list":["post-630","post","type-post","status-publish","format-standard","hentry","category-ioi-apcs","tag-map","tag-8","tag-13"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/630","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=630"}],"version-history":[{"count":2,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/630\/revisions"}],"predecessor-version":[{"id":632,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/630\/revisions\/632"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/media?parent=630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/categories?post=630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/tags?post=630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}