{"id":488,"date":"2023-05-24T20:58:41","date_gmt":"2023-05-24T12:58:41","guid":{"rendered":"https:\/\/vite66.cn\/?p=488"},"modified":"2025-01-11T16:56:06","modified_gmt":"2025-01-11T08:56:06","slug":"%e8%93%9d%e6%a1%a5%e6%9d%af-%e7%89%b9%e6%ae%8a%e6%97%b6%e9%97%b4","status":"publish","type":"post","link":"https:\/\/vite66.cn\/?p=488","title":{"rendered":"\u84dd\u6865\u676f-\u7279\u6b8a\u65f6\u95f4"},"content":{"rendered":"<p><a href=\"https:\/\/www.lanqiao.cn\/problems\/2119\/learning\/?page=1&amp;first_category_id=1&amp;sort=students_count&amp;tags=2022\">\u8865\u9898\u94fe\u63a5<\/a><\/p>\n<p>\u65f6\u95f4\u66b4\u529b\u95ee\u9898\u8f6c\u6362\u6210\u5e8f\u5217\u66b4\u529b\u95ee\u9898<\/p>\n<p>\u5206\u522b\u751f\u6210\u5e74\u4efd\uff0c\u65e5\u6708\uff0c\u65f6\u95f4\u7684 4 \u4e2a\u6570\u5b57\u5e8f\u5217\uff0c\u518d\u5206\u522b\u5224\u65ad\u662f\u5426\u5408\u6cd5<\/p>\n<pre><code>#include&lt;bits\/stdc++.h&gt;\nusing namespace std;\n\nint day[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n\/\/ \u5224\u65ad\u662f\u5426\u95f0\u5e74 \nbool is_run(int y) {\n    if ((y % 4 == 0 &amp;&amp; y % 100 != 0) || y % 400 == 0) return true;\n    return false; \n}\n\n\/\/ \u83b7\u5f97\u6570\u5b57\u5e8f\u5217 \nvector&lt;string&gt; get(char a, char c) {\n    vector&lt;string&gt; tot;\n\/\/  cout &lt;&lt; a &lt;&lt; &quot; &quot; &lt;&lt; c &lt;&lt; endl;\n\/\/  string aa = to_string(a), cc = to_string(c);\n    string aa, cc;\n    aa += a;\n    cc += c;\n\/\/  cout &lt;&lt; aa &lt;&lt; &quot; &quot; &lt;&lt; cc &lt;&lt; endl;\n    tot.push_back(aa + cc + cc + cc);\n    tot.push_back(cc + aa + cc + cc);\n    tot.push_back(cc + cc + aa + cc);\n    tot.push_back(cc + cc + cc + aa);\n    return tot;\n}\n\n\/\/ \u5e74\u4efd\u5fc5\u5b9a\u5408\u6cd5\uff0c\u4e0d\u7528\u5224\u65ad\n\n\/\/ \u5224\u65ad\u65e5\u6708\u662f\u5426\u5408\u6cd5 \nbool check_m(string s1, string s) {\n\n    int m = (s[0] - &#039;0&#039;) * 10 + s[1] - &#039;0&#039;;\n    int d = (s[2] - &#039;0&#039;) * 10 + s[3] - &#039;0&#039;;\n\/\/  cout &lt;&lt; m &lt;&lt; &quot; &quot; &lt;&lt; d &lt;&lt; endl;\n    if (m &gt; 12 || m &lt;= 0) return false;\n    int y = (s1[0] - &#039;0&#039;) * 1000 + (s1[1] - &#039;0&#039;) * 100 + (s1[2] - &#039;0&#039;) * 10 + s1[3] - &#039;0&#039;;\n    if (is_run(y)) {\n        day[2] = 29;\n    }else day[2] = 28;\n    if (d &lt;= 0 || d &gt; day[m]) return false;\n    return true;\n}\n\n\/\/ \u5224\u65ad\u65f6\u95f4\u662f\u5426\u5408\u6cd5 \nbool check_s(string s) {\n    int h = (s[0] - &#039;0&#039;) * 10 + s[1] - &#039;0&#039;;\n    int f = (s[2] - &#039;0&#039;) * 10 + s[3] - &#039;0&#039;;\n\n    if (h &lt; 0 || h &gt; 24) return false;\n    if (f &lt; 0 || f &gt; 60) return false;\n    return true;\n}\n\nint main() {\n    int ans = 0;\n\/\/  vector&lt;string&gt; t = get(&#039;1&#039;, &#039;2&#039;);\n\/\/  for (string s : t) cout &lt;&lt; s &lt;&lt; endl;\n\n    for (char i = &#039;0&#039;; i &lt;= &#039;9&#039;; ++ i) {\n        for (char j = &#039;0&#039;; j &lt;= &#039;9&#039;; ++ j) {\n            if (i == j) continue;\n            vector&lt;string&gt; tot = get(i, j);\n\/\/          for (string s : tot) cout &lt;&lt; s &lt;&lt; endl;\n            for (int y = 0; y &lt; tot.size(); ++ y) {\n                for (int m = 0; m &lt; tot.size(); ++ m) {\n                    for (int d = 0; d &lt; tot.size(); ++ d) {\n                        if (check_m(tot[y], tot[m]) &amp;&amp; check_s(tot[d])) ++ ans;\n                    }\n                }\n            }\n\n        }\n    }\n    cout &lt;&lt; ans &lt;&lt; endl;\n\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8865\u9898\u94fe\u63a5 \u65f6\u95f4\u66b4\u529b\u95ee\u9898\u8f6c\u6362\u6210\u5e8f\u5217\u66b4\u529b\u95ee\u9898 \u5206\u522b\u751f\u6210\u5e74\u4efd\uff0c\u65e5\u6708\uff0c\u65f6\u95f4\u7684 4 \u4e2a\u6570\u5b57\u5e8f\u5217\uff0c\u518d\u5206\u522b\u5224\u65ad\u662f\u5426\u5408\u6cd5 #i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[50,49],"class_list":["post-488","post","type-post","status-publish","format-standard","hentry","category-science-and-engineering","tag-50","tag-49"],"_links":{"self":[{"href":"https:\/\/vite66.cn\/index.php?rest_route=\/wp\/v2\/posts\/488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vite66.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vite66.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vite66.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vite66.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=488"}],"version-history":[{"count":2,"href":"https:\/\/vite66.cn\/index.php?rest_route=\/wp\/v2\/posts\/488\/revisions"}],"predecessor-version":[{"id":667,"href":"https:\/\/vite66.cn\/index.php?rest_route=\/wp\/v2\/posts\/488\/revisions\/667"}],"wp:attachment":[{"href":"https:\/\/vite66.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vite66.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vite66.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}