{"id":28,"date":"2025-11-09T20:42:34","date_gmt":"2025-11-09T12:42:34","guid":{"rendered":"https:\/\/tblog.zeabur.app\/?p=28"},"modified":"2025-11-09T20:54:10","modified_gmt":"2025-11-09T12:54:10","slug":"%e9%a2%98%e8%a7%a3-cf677c-vanya-and-label","status":"publish","type":"post","link":"https:\/\/tblog.zeabur.app\/?p=28","title":{"rendered":"\u9898\u89e3 CF677C Vanya and Label"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u9898\u76ee\u5927\u610f<\/h2>\n\n\n\n<p>\u627e\u5230\u6ee1\u8db3 $s_1\\operatorname{and}s_2=s$ \u7684\u5b57\u7b26\u4e32\u5bf9 $(s_1,s_2)$ \u7684\u6570\u91cf\uff0c\u4e14 $s_1$ \u548c $s_2$ \u7684\u957f\u5ea6\u90fd\u8981\u4e0e $s$ \u76f8\u540c\uff0c\u5e76\u7ed9\u51fa\u4e86\u5b57\u7b26\u8f6c\u4e3a\u6570\u5b57\uff0c\u8fdb\u884c\u6bd4\u8f83\u7684\u89c4\u5219\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e3\u9898\u601d\u8def<\/h2>\n\n\n\n<p>\u7531\u4e8e\u5b57\u7b26\u4e32 $s_1$ \u548c $s_2$ \u7684\u6bcf\u4e00\u4f4d\u8fdb\u884c\u4e0e\u8fd0\u7b97\u7684\u7ed3\u679c\u90fd\u5bf9\u5e94\u7740 $s$ \u7684\u76f8\u5e94\u4f4d\u7f6e\uff0c\u56e0\u6b64\u6211\u4eec\u53ef\u4ee5\u5bf9 $s$ \u7684\u6bcf\u4e00\u4f4d\u8fdb\u884c\u5355\u72ec\u5206\u6790\u3002<\/p>\n\n\n\n<p>\u9488\u5bf9 $s$ \u7684\u6bcf\u4e00\u4f4d\uff0c\u53ea\u6709\u4e24\u79cd\u60c5\u51b5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8be5\u4f4d\u4e8c\u8fdb\u5236\u4e3a $1$\uff0c\u5219 $s_1$ \u548c $s_2$ \u7684\u5bf9\u5e94\u4f4d\u90fd\u4e3a $1$\u3002<\/li>\n\n\n\n<li>\u8be5\u4f4d\u4e8c\u8fdb\u5236\u4e3a $0$\uff0c\u5219 $s_1$ \u548c $s_2$ \u7684\u5bf9\u5e94\u4f4d\u4e3a $00$\uff0c$01$ \u6216 $10$\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u56e0\u6b64\uff0c\u5bf9\u4e8e $s$ \u7684\u6bcf\u4e00\u4f4d\uff0c\u6211\u4eec\u53ea\u9700\u8981\u7edf\u8ba1\u8be5\u4f4d\u8868\u793a\u4e3a\u6570\u5b57\u540e\uff0c\u4e8c\u8fdb\u5236\u8868\u793a\u4e2d $0$ \u7684\u4e2a\u6570\u603b\u548c\uff0c\u8bb0\u4e3a $sum$\uff0c\u5bf9\u4e8e\u6bcf\u4e00\u4e2a $0$ \u6700\u591a\u6709\u4e09\u79cd\u60c5\u51b5\uff0c\u6839\u636e\u4e58\u6cd5\u539f\u7406\uff0c\u6700\u7ec8\u7b54\u6848\u4e3a $3^{sum}$\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4ee3\u7801<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>#include&lt;bits\/stdc++.h&gt;\n#include&lt;ext\/pb_ds\/assoc_container.hpp&gt;\n#include&lt;ext\/pb_ds\/hash_policy.hpp&gt;\n#define int long long\n#define endl \"\\n\"\nusing namespace __gnu_cxx;\nusing namespace __gnu_pbds;\nusing namespace std;\nconst int MOD=1e9+7;\/\/\u8bb0\u5f97\u6a211e9+7\nint ans;\ninline int check(int n)\/\/\u68c0\u67e5\u51fd\u6570\uff0c\u8ba1\u7b97\u4e8c\u8fdb\u5236\u8868\u793a\u4e0b 0 \u7684\u7684\u4e2a\u6570\n{\n    int sum=0;\n    for(int i=1;i&lt;=6;i++)\/\/\u6570\u6700\u5927\u4e3a 64\uff0c\u5219\u4e8c\u8fdb\u5236\u6700\u591a\u6709 6 \u4f4d\uff0c\u53ea\u9700\u68c0\u67e5 6 \u4f4d\n    {\n        if(n&amp;1)n&gt;&gt;=1;\/\/\u5f53\u524d\u672b\u5c3e\u4e3a 1\uff0c\u53f3\u79fb\u4e00\u4f4d\n        else n&gt;&gt;=1,sum++;\/\/\u672b\u5c3e\u4e3a 0\uff0c\u8ba1\u6570\u5668\u52a0 1\uff0c\u53f3\u79fb\u4e00\u4f4d\n    }\n    return sum;\n}\ninline int fastpow(int b,int a)\/\/\u6b64\u9898\u9700\u8981\u7528\u5230\u5feb\u901f\u5e42\n{\n    int res=1;\n    while(b)\n    {\n        if(b&amp;1) res=res*a%MOD;\n        a=a*a%MOD;\n        b&gt;&gt;=1;\n    }\n    return res;\n}\nsigned main()\n{    \n    string s;\n    cin&gt;&gt;s;\n    for(char c:s)\n    {\n        int n;\n        if(c&gt;='0'&amp;&amp;c&lt;='9')n=c-'0';\/\/\u6309\u9898\u76ee\u8981\u6c42\u8fdb\u884c\u5b57\u7b26\u4e0e\u6570\u5b57\u95f4\u8f6c\u6362\n        if(c&gt;='A'&amp;&amp;c&lt;='Z')n=c-'A'+10;\n        if(c&gt;='a'&amp;&amp;c&lt;='z')n=c-'a'+36;\n        if(c=='-')n=62;\n        if(c=='_')n=63;\n        ans+=check(n);\/\/\u7d2f\u52a0 0 \u7684\u4e2a\u6570\n    }\n    cout&lt;&lt;fastpow(ans,3);\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u65f6\u95f4\u590d\u6742\u5ea6<\/h3>\n\n\n\n<p>$O(|s|\\log |s|)$\uff0c\u5176\u4e2d $|s|$ \u8868\u793a\u5b57\u7b26\u4e32 $s$ \u7684\u957f\u5ea6\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7a7a\u95f4\u590d\u6742\u5ea6<\/h3>\n\n\n\n<p>$O(|s|)$\uff0c\u6240\u9700\u5b58\u50a8\u7a7a\u95f4\u53d6\u51b3\u4e8e\u5b57\u7b26\u4e32 $s$ \u7684\u957f\u5ea6\uff0c\u5e76\u968f\u7740 $s$ \u957f\u5ea6\u7684\u589e\u52a0\u800c\u7ebf\u6027\u589e\u52a0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9898\u76ee\u5927\u610f \u627e\u5230\u6ee1\u8db3 $s_1\\operatorname{and}s_2=s$ \u7684\u5b57\u7b26\u4e32\u5bf9 $(s_1,s_2) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[3],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-oi","tag-oi"],"featured_image_src":null,"author_info":{"display_name":"CaelumRadish_c","author_link":"https:\/\/tblog.zeabur.app\/?author=1"},"_links":{"self":[{"href":"https:\/\/tblog.zeabur.app\/index.php?rest_route=\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tblog.zeabur.app\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tblog.zeabur.app\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tblog.zeabur.app\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tblog.zeabur.app\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28"}],"version-history":[{"count":1,"href":"https:\/\/tblog.zeabur.app\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":29,"href":"https:\/\/tblog.zeabur.app\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions\/29"}],"wp:attachment":[{"href":"https:\/\/tblog.zeabur.app\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tblog.zeabur.app\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tblog.zeabur.app\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}