{"id":85,"date":"2024-04-26T00:33:55","date_gmt":"2024-04-25T16:33:55","guid":{"rendered":"https:\/\/seanxd.com\/?p=85"},"modified":"2024-06-18T17:30:32","modified_gmt":"2024-06-18T09:30:32","slug":"zerojudge-a263","status":"publish","type":"post","link":"https:\/\/seanxd.com\/zh\/zerojudge-a263\/","title":{"rendered":"ZeroJudge A263: \u65e5\u671f\u5dee\u5e7e\u5929"},"content":{"rendered":"\n\n\n<p>\u7d66\u4f60\u5169\u500b\u65e5\u671f\uff0c\u554f\u9019\u5169\u500b\u65e5\u671f\u76f8\u5dee\u5e7e\u5929\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\u6709\u591a\u7b46\u6e2c\u8cc7\uff0c<strong>\u6bcf\u7b46\u6e2c\u8cc7\u6709\u5169\u884c<\/strong>\uff0c\u6bcf\u884c\u6709\u4e09\u500b\u6574\u6578\u4f9d\u5e8f\u662f<strong>\u5e74\u3001\u6708\u3001\u65e5<\/strong>\u3002\u8f38\u5165\u4ee5 <strong>EOF<\/strong> \u4f5c\u70ba\u7d50\u675f\uff0c\u984c\u76ee\u4fdd\u8b49\u4e0d\u6703\u6709\u4e0d\u7b26\u5408\u7684\u6e2c\u8cc7\u51fa\u73fe\u3002<\/td><td>\u8f38\u51fa\u5169\u500b\u65e5\u671f\u5dee\u5e7e\u5929\u3002<\/td><\/tr><tr><td>2011  10  19<br>2011  10  18<\/td><td>1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e3\u984c\u601d\u8def<\/h2>\n\n\n\n<p>\u5c07\u5169\u500b\u65e5\u671f\u63db\u7b97\u6210\u300c\u5929\u300d\u9019\u500b\u6700\u5c0f\u55ae\u4f4d\u3002\u8981\u6ce8\u610f\u7684\u662f\u9700\u8981<strong>\u5224\u65b7\u958f\u5e74<\/strong>\u51fa\u73fe\u7684\u6b21\u6578\uff0c\u4e5f\u8981\u5224\u65b7\u7576\u524d\u7684\u6708\u4efd\u9700\u4e0d\u9700\u8981\u8a08\u7b97\u958f\u5e74\u7684\u591a\u4e00\u5929\u3002\u6700\u5f8c\u8f38\u51fa\u5169\u500b\u5929\u6578\u76f8\u6e1b\u7684\u7d55\u5c0d\u503c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\uff0d<a href=\"https:\/\/zerojudge.tw\/ShowProblem?problemid=a263\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge A263: \u65e5\u671f\u5dee\u5e7e\u5929<\/a><\/h3>\n\n\n\n<div class=\"hcb_wrap nfd-wb-animate nfd-wb-reveal-right\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>#include &lt;iostream&gt;\nusing namespace std;\n\nint main()\n{\n    int y1, m1, d1;\n    int y2, m2, d2;\n    int month[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };\n    while (cin &gt;&gt; y1 &gt;&gt; m1 &gt;&gt; d1 &gt;&gt; y2 &gt;&gt; m2 &gt;&gt; d2) {\n        int temp = d1;\n        int temp1 = d2;\n        int ld1, ld2;\n        if (m1 &gt; 2) {\n            ld1 = (y1 \/ 4 - y1 \/ 100 + y1 \/ 400);\n        }\n        else {\n            ld1 = ((y1 - 1) \/ 4 - (y1 - 1) \/ 100 + (y1 - 1) \/ 400);\n        }\n        if (m2 &gt; 2) {\n            ld2 = (y2 \/ 4 - y2 \/ 100 + y2 \/ 400);\n        }\n        else {\n            ld2 = ((y2 - 1) \/ 4 - (y2 - 1) \/ 100 + (y2 - 1) \/ 400);\n        }\n        d1 += y1 * 365 + ld1;\n        for (int i = 1; i &lt; m1; i++) {\n            d1 += month[i];\n        }\n        d2 += y2 * 365 + ld2;\n        for (int i = 1; i &lt; m2; i++) {\n            d2 += month[i];\n        }\n        cout &lt;&lt; abs(d1 - d2) &lt;&lt; endl;\n    }\n    return 0;\n}\n\n\/\/ZeroJudge A263\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7d66\u4f60\u5169\u500b\u65e5\u671f\uff0c\u554f\u9019\u5169\u500b\u65e5\u671f\u76f8\u5dee\u5e7e\u5929\u3002 \u7bc4\u4f8b\u6e2c\u8cc7 \u7bc4\u4f8b\u8f38\u5165 \u7bc4\u4f8b\u8f38\u51fa \u8f38\u5165\u6709\u591a\u7b46\u6e2c\u8cc7\uff0c\u6bcf\u7b46\u6e2c\u8cc7\u6709\u5169\u884c\uff0c\u6bcf\u884c\u6709\u4e09\u500b [&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,17,9],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-6","tag-8","tag-17","tag-9"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/85","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=85"}],"version-history":[{"count":3,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"predecessor-version":[{"id":956,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/85\/revisions\/956"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}