{"id":94,"date":"2023-03-24T20:21:04","date_gmt":"2023-03-24T12:21:04","guid":{"rendered":"https:\/\/solost.cn\/?p=94"},"modified":"2023-03-24T20:21:04","modified_gmt":"2023-03-24T12:21:04","slug":"187","status":"publish","type":"post","link":"https:\/\/solost.cn\/?p=94","title":{"rendered":"USACO 2011 November Contest Bronze Division &#8211; 2058 &#8211; \u7b28\u62d9\u7684\u624b\u6307"},"content":{"rendered":"<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/11\/image-12.png\" alt=\"image.png\" title=\"image.png\"><\/p>\n<h2>\u9898\u76ee\u94fe\u63a5<\/h2>\n<p><a href=\"https:\/\/www.acwing.com\/problem\/content\/2060\/\">\u9898\u76ee\u94fe\u63a5<\/a><\/p>\n<h2>\u9898\u89e3<\/h2>\n<p>\u8fd9\u9053\u9898\u76ee\u7684\u5751\u597d\u591a\uff0c\u6765\u6d45\u6d45\u5217\u4e3e\u4e00\u4e0b\u7136\u540e\u5c31\u80fdac\u4e86<\/p>\n<ul>\n<li>\u9996\u4f4d\u662f0\u90a3\u4e48\u80af\u5b9a\u53ea\u80fd\u4fee\u6539\u9996\u4f4d\uff0c\u56e0\u4e3a\u539f\u6570\u80af\u5b9a\u4e0d\u5b58\u5728\u524d\u5bfc\u96f6<\/li>\n<li>\u5982\u679c\u53ea\u6709\u4e00\u4f4d\u90a3\u4e48\u662f\u5141\u8bb8\u628a\u9996\u4f4d\u6539\u62100\u7684\uff0c\u56e0\u4e3a0\u53ea\u6709\u4e00\u4e2a\u662f\u4e0d\u5b58\u5728\u524d\u5bfc\u96f6\u7684<\/li>\n<li>\u5fc5\u987b\u8981\u5bf9\u539f\u4e32\u8fdb\u884c\u4fee\u6539\u7684\uff0c\u5982\u679c\u4fee\u6539\u7ed3\u679c\u548c\u539f\u6765\u7684\u662f\u4e00\u6837\u7684\u90a3\u4e48\u80af\u5b9a\u662f\u4e0d\u884c\u7684\uff0c\u5c31\u76f8\u5f53\u4e8e\u6ca1\u4fee\u6539<\/li>\n<li>\u9996\u4f4d\u80af\u5b9a\u4e0d\u80fd\u628a\u975e0\u6539\u62100\uff0c\u56e0\u4e3a\u8fd9\u6837\u5c31\u8981\u51fa\u73b0\u524d\u5bfc0\u4e86<\/li>\n<\/ul>\n<p>\u8ff7\u60d1\u7684\u5730\u65b9\u5c31\u662f\u6211\u5df2\u7ecf\u5224\u65ad<code>j == s[i]<\/code>\u65f6\u5019continue\u4e86\uff0c\u4e3a\u5565\u8fd8\u662f\u4f1a\u91cd\u590d\u539f\u4e32\u3001<\/p>\n<p>\u5c55\u793a\u4ee3\u7801<\/p>\n<pre><code class=\"lang-cpp\">#include &lt;algorithm&gt;\n#include &lt;bitset&gt;\n#include &lt;cmath&gt;\n#include &lt;cstdio&gt;\n#include &lt;cstdlib&gt;\n#include &lt;cstring&gt;\n#include &lt;fstream&gt;\n#include &lt;iostream&gt;\n#include &lt;map&gt;\n#include &lt;queue&gt;\n#include &lt;set&gt;\n#include &lt;stack&gt;\n#include &lt;unordered_map&gt;\n#include &lt;vector&gt;\n\nusing namespace std;\n#define x first\n#define y second\n#define endl &#039;\\n&#039;\n#define IOS                       \\\n    ios_base::sync_with_stdio(0); \\\n    cin.tie(0);                   \\\n    cout.tie(0);\ntypedef long long ll;\ntypedef pair&lt;int, int&gt; PII;\ntypedef unsigned long long ull;\nconst int INF = 0x3f3f3f3f, mod = 1000000007;\nconst int N = 2e5 + 10;\n\nmap&lt;int, int&gt; a[10];\n\nint check(string s, int op){\n    reverse(s.begin(), s.end());\n    int res = 0;\n    for(int i = 0; i &lt; s.size(); i++){\n        res += (s[i] - &#039;0&#039;) * pow(op, i);\n    }\n    return res;\n}\n\nvoid op(string res, int op)\n{\n    string s = res;\n    char ed;\n    if(s[0] == &#039;0&#039;) ed = 1;\n    else ed = s.size();\n    for (int i = 0; i &lt; ed; i++) {\n        for (char j = &#039;0&#039;; j &lt; op + &#039;0&#039;; j++) {\n            if((i == 0 &amp;&amp; j == &#039;0&#039; &amp;&amp; s.size() &gt; 1) || j == s[i]) continue;\n            \/\/ s = res;\n            s[i] = j;\n            if(s == res) continue;\n            \/\/ cout &lt;&lt; s &lt;&lt; &quot; &quot; &lt;&lt; check(s, op) &lt;&lt; endl;\n            a[op][check(s, op)]++;\n            s[i] = res[i];\n        }\n    }\n}\nvoid solve()\n{\n    string s1, s2;\n    cin &gt;&gt; s1 &gt;&gt; s2;\n    op(s1, 2), op(s2, 3);\n    for(auto x : a[2]){\n        for(auto y : a[3]){\n            if(x.first == y.first){\n                cout &lt;&lt; x.first &lt;&lt; endl;\n                return;\n            }\n        }\n    }\n}\nint main()\n{\n    \/\/ IOS;\n    int t = 1;\n    \/\/ cin &gt;&gt; t;\n    while (t--) {\n        solve();\n    }\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9898\u76ee\u94fe\u63a5 \u9898\u76ee\u94fe\u63a5 \u9898\u89e3 \u8fd9\u9053\u9898\u76ee\u7684\u5751\u597d\u591a\uff0c\u6765\u6d45\u6d45\u5217\u4e3e\u4e00\u4e0b\u7136\u540e\u5c31\u80fdac\u4e86 \u9996\u4f4d\u662f0\u90a3\u4e48\u80af\u5b9a\u53ea\u80fd\u4fee\u6539\u9996\u4f4d\uff0c\u56e0\u4e3a\u539f\u6570\u80af\u5b9a\u4e0d\u5b58\u5728\u524d\u5bfc\u96f6 \u5982\u679c\u53ea\u6709\u4e00\u4f4d\u90a3\u4e48\u662f\u5141\u8bb8\u628a\u9996\u4f4d\u6539\u62100\u7684\uff0c\u56e0\u4e3a0\u53ea\u6709\u4e00\u4e2a\u662f\u4e0d\u5b58\u5728\u524d\u5bfc\u96f6\u7684 \u5fc5\u987b\u8981\u5bf9\u539f\u4e32\u8fdb\u884c\u4fee\u6539\u7684\uff0c\u5982\u679c\u4fee\u6539\u7ed3\u679c\u548c\u539f\u6765\u7684\u662f\u4e00\u6837\u7684\u90a3\u4e48\u80af\u5b9a\u662f\u4e0d\u884c\u7684\uff0c\u5c31\u76f8\u5f53\u4e8e\u6ca1\u4fee\u6539 \u9996\u4f4d\u80af\u5b9a\u4e0d\u80fd\u628a\u975e0\u6539\u62100\uff0c\u56e0\u4e3a\u8fd9\u6837\u5c31\u8981\u51fa\u73b0\u524d\u5bfc0\u4e86 \u8ff7\u60d1\u7684\u5730\u65b9\u5c31\u662f\u6211\u5df2\u7ecf\u5224\u65adj == s[i]\u65f6\u5019continue\u4e86\uff0c\u4e3a\u5565\u8fd8\u662f\u4f1a\u91cd\u590d\u539f\u4e32\u3001 \u5c55\u793a\u4ee3\u7801 #include &lt;algorithm&gt; #include &lt;bitset&gt; #include &lt;cmath&gt; #include &lt;cstdio&gt; #include &lt;cstdlib&gt; #include &lt;cstring&gt; #include &lt;fstream&gt; #include &lt;iostream&gt; #include &lt;map&gt; #include &lt;queue&gt; #include &lt;set&gt; #include &lt;stack&gt; #include &lt;unordered_map&gt; #include &lt;vector&gt; using namespace std; #define x first #define y second #define endl &#039;\\n&#039; #define IOS \\ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[9],"class_list":["post-94","post","type-post","status-publish","format-standard","hentry","category-solution","tag-9"],"_links":{"self":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=94"}],"version-history":[{"count":0,"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts\/94\/revisions"}],"wp:attachment":[{"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}