{"id":196,"date":"2024-04-26T17:29:09","date_gmt":"2024-04-26T09:29:09","guid":{"rendered":"https:\/\/seanxd.com\/?p=196"},"modified":"2024-04-26T17:29:11","modified_gmt":"2024-04-26T09:29:11","slug":"zerojudge-l960","status":"publish","type":"post","link":"https:\/\/seanxd.com\/en\/zerojudge-l960\/","title":{"rendered":"ZeroJudge L960: Which Day?"},"content":{"rendered":"\n\n\n<p class=\"\">\u6587\u6587\u4e0d\u559c\u6b61\u82f1\u6587\uff0c\u82f1\u6587\u6709\u592a\u591a\u7684\u540d\u5b57\u4e86\uff01\u6708\u4efd\u6709\u540d\u5b57 (January, February, \u2026)\uff0c\u661f\u671f\u6709\u540d\u5b57 (Sunday, Monday, \u2026)\uff0c\u9023\u9285\u677f\u4e5f\u6709\u540d\u5b57 (Penny, Dime, \u2026)\u3002<\/p>\n\n\n\n<p class=\"\"><strong>\u4eca\u5929\u4ed6\u53c8\u88ab\u4e00\u5806 Sunday, Monday, \u4ec0\u9ebc\u4ec0\u9ebc day \u7684\u7d66\u5f04\u7cca\u5857\u4e86\uff0c\u4f60\u53ef\u4ee5\u5e6b\u4ed6\u8f49\u6210\u6578\u5b57\u55ce\uff1f<\/strong><\/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\u53ea\u6709\u4e00\u884c\uff0c\u542b\u6709\u4e00\u500b\u8981\u8f49\u63db\u7684\u5b57\u4e32\u3002<\/td><td>\u5982\u679c\u8f38\u5165\u7684\u662f\u300cSunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday\u300d\u7b49\u5176\u4e2d\u4e00\u500b\u5b57\u4e32\uff0c\u8acb\u4f9d\u5e8f\u8f49\u6210 0, 1, 2, 3, 4, 5, 6 \u7684\u6574\u6578\u3002<strong>\u5982\u679c\u4e0d\u662f\u4e0a\u8ff0\u7684\u5b57\u4e32\u4e4b\u4e00\uff0c\u8acb\u8f38\u51fa\u300cerror\u300d\u3002<\/strong><\/td><\/tr><tr><td>Sunday<\/td><td>0<\/td><\/tr><tr><td>Twosday<\/td><td>error<\/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\u7528Map\u5c07\u6bcf\u500b\u65e5\u671f\u7684\u7d22\u5f15\u503c\u5b58\u8d77\u4f86\uff0c\u5982\u679c\u8b80\u5230\u7684\u5b57\u4e32\u5728Map\u4e2d\u6c92\u6709\u503c (\u6c92\u6709\u503c\u7684\u8a71\u53d6 Value \u7684\u6642\u5019\u6703\u56de\u50b3 0) \u7684\u8a71\u5c31\u8f38\u51faerror\uff0c\u53cd\u4e4b\u5247\u8f38\u51faMap\u7684\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=l960\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge L960: \u661f\u671f\u5e7e\uff1f<\/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    map&lt;string, int&gt;MAP;\n    MAP[&quot;Sunday&quot;] = 1;\n    MAP[&quot;Monday&quot;] = 2;\n    MAP[&quot;Tuesday&quot;] = 3;\n    MAP[&quot;Wednesday&quot;] = 4;\n    MAP[&quot;Thursday&quot;] = 5;\n    MAP[&quot;Friday&quot;] = 6;\n    MAP[&quot;Saturday&quot;] = 7;\n    string str;\n    cin &gt;&gt; str;\n    if (MAP[str] != 0) cout &lt;&lt; MAP[str]-1 &lt;&lt; endl;\n    else cout &lt;&lt; &quot;error&quot; &lt;&lt; endl;\n}\n\n\/\/ZeroJudge L960\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u6587\u4e0d\u559c\u6b61\u82f1\u6587\uff0c\u82f1\u6587\u6709\u592a\u591a\u7684\u540d\u5b57\u4e86\uff01\u6708\u4efd\u6709\u540d\u5b57 (January, February, \u2026)\uff0c\u661f\u671f\u6709\u540d\u5b57 (S [&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":[14,8,11],"class_list":["post-196","post","type-post","status-publish","format-standard","hentry","category-6","tag-map","tag-8","tag-11"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/196","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=196"}],"version-history":[{"count":1,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/196\/revisions"}],"predecessor-version":[{"id":197,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/196\/revisions\/197"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/media?parent=196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/categories?post=196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/tags?post=196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}