{"id":245,"date":"2026-07-31T18:31:31","date_gmt":"2026-07-31T10:31:31","guid":{"rendered":"https:\/\/huxiaole.cloud\/?p=245"},"modified":"2026-07-31T18:34:53","modified_gmt":"2026-07-31T10:34:53","slug":"d-%e6%99%ba%e8%83%9c%e5%af%b9%e6%89%8b","status":"publish","type":"post","link":"https:\/\/huxiaole.cloud\/index.php\/2026\/07\/31\/d-%e6%99%ba%e8%83%9c%e5%af%b9%e6%89%8b\/","title":{"rendered":"D. \u667a\u80dc\u5bf9\u624b"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">D. \u667a\u80dc\u5bf9\u624b<\/h1>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6bcf\u6b21\u6d4b\u8bd5\u65f6\u95f4\u9650\u5236\uff1a1 \u79d2<\/li>\n\n\n\n<li>\u5185\u5b58\u9650\u5236\uff1a256 MB<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u9898\u76ee\u63cf\u8ff0<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u7231\u4e3d\u4e1d\u548c\u9c8d\u52c3\u5728\u73a9\u4e00\u4e2a\u4e0e\u5b57\u7b26\u4e32\u6709\u5173\u7684\u6e38\u620f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6bcf\u573a\u6e38\u620f\u5f00\u59cb\u65f6\uff0c\u7231\u4e3d\u4e1d\u5148\u9009\u62e9\u4e00\u4e2a\u957f\u5ea6\u4e3a $n$\u3001\u4ec5\u7531\u5b57\u7b26 <code>H<\/code> \u548c <code>T<\/code> \u7ec4\u6210\u7684\u5b57\u7b26\u4e32 $A$\uff0c\u5e76\u5c06\u5176\u5c55\u793a\u7ed9\u9c8d\u52c3\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u63a5\u4e0b\u6765\u7684\u6e38\u620f\u6309\u4ee5\u4e0b\u987a\u5e8f\u8fdb\u884c\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u9c8d\u52c3\u9009\u62e9\u4e00\u4e2a\u957f\u5ea6\u4e3a $n$\u3001\u4ec5\u7531\u5b57\u7b26 <code>H<\/code> \u548c <code>T<\/code> \u7ec4\u6210\u7684\u5b57\u7b26\u4e32 $B$\uff0c\u4e14\u6ee1\u8db3 $A \\neq B$\uff0c\u5e76\u5c06\u5176\u5c55\u793a\u7ed9\u7231\u4e3d\u4e1d\u3002<\/li>\n\n\n\n<li>\u7136\u540e\u7231\u4e3d\u4e1d\u548c\u9c8d\u52c3\u5171\u540c\u6784\u9020\u4e00\u4e2a\u540c\u6837\u4ec5\u7531 <code>H<\/code> \u548c <code>T<\/code> \u7ec4\u6210\u7684\u65b0\u5b57\u7b26\u4e32 $S$\u3002\u9c8d\u52c3\u5148\u9009\u62e9 $S$ \u7684\u7b2c\u4e00\u4e2a\u5b57\u7b26\u3002<\/li>\n\n\n\n<li>\u4e4b\u540e\uff0c\u7231\u4e3d\u4e1d\u4e0d\u65ad\u5728 $S$ \u7684\u672b\u5c3e\u8ffd\u52a0\u4e00\u4e2a\u65b0\u5b57\u7b26\uff08<code>H<\/code> \u6216 <code>T<\/code>\uff09\uff0c\u76f4\u5230\u6e38\u620f\u7ed3\u675f\u3002<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u6e38\u620f\u4f1a\u5728\u4ee5\u4e0b\u60c5\u51b5\u4e4b\u4e00\u53d1\u751f\u65f6\u7acb\u5373\u7ed3\u675f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5982\u679c $A$ \u4f5c\u4e3a $S$ \u7684<strong>\u5b50\u4e32<\/strong>\u51fa\u73b0\uff0c\u5219\u7231\u4e3d\u4e1d\u83b7\u80dc\u3002<\/li>\n\n\n\n<li>\u5982\u679c $B$ \u4f5c\u4e3a $S$ \u7684\u5b50\u4e32\u51fa\u73b0\uff0c\u5219\u9c8d\u52c3\u83b7\u80dc\u3002<\/li>\n\n\n\n<li>\u5982\u679c $S$ \u7684\u957f\u5ea6\u8fbe\u5230 $10^{100}$\uff0c\u5219\u9c8d\u52c3\u83b7\u80dc\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u53cc\u65b9\u90fd\u77e5\u9053\u6e38\u620f\u89c4\u5219\uff0c\u5e76\u4e14\u6bcf\u4e00\u6b65\u884c\u52a8\u90fd\u4f1a\u7acb\u5373\u88ab\u5bf9\u65b9\u770b\u5230\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u73b0\u5728\uff0c\u7231\u4e3d\u4e1d\u5df2\u7ecf\u9009\u62e9\u5e76\u516c\u5f00\u4e86\u5b57\u7b26\u4e32 $A$\u3002\u7ed9\u5b9a $n$ \u548c $A$\uff0c\u8bf7\u5224\u65ad\u5728\u53cc\u65b9\u90fd\u91c7\u53d6\u6700\u4f18\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\uff0c\u4ece\u6b64\u65f6\u5f00\u59cb\u8c01\u4f1a\u83b7\u80dc\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b50\u4e32\u5b9a\u4e49<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b57\u7b26\u4e32 $a$ \u662f\u5b57\u7b26\u4e32 $b$ \u7684\u5b50\u4e32\uff0c\u5982\u679c $a$ \u53ef\u4ee5\u901a\u8fc7\u5220\u9664 $b$ \u5f00\u5934\u82e5\u5e72\uff08\u53ef\u80fd\u4e3a\u96f6\uff09\u4e2a\u5b57\u7b26\u548c\u7ed3\u5c3e\u82e5\u5e72\uff08\u53ef\u80fd\u4e3a\u96f6\uff09\u4e2a\u5b57\u7b26\u5f97\u5230\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f93\u5165\u683c\u5f0f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e00\u884c\u5305\u542b\u4e00\u4e2a\u6574\u6570 $t$\uff08$1 \\le t \\le 10^4$\uff09\u2014\u2014 \u6e38\u620f\u6570\u91cf\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u63a5\u4e0b\u6765\u6bcf\u7ec4\u6570\u636e\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7b2c\u4e00\u884c\u5305\u542b\u4e00\u4e2a\u6574\u6570 $n$\uff08$1 \\le n \\le 3 \\cdot 10^5$\uff09\u2014\u2014 \u5b57\u7b26\u4e32\u957f\u5ea6\u3002<\/li>\n\n\n\n<li>\u7b2c\u4e8c\u884c\u5305\u542b\u4e00\u4e2a\u957f\u5ea6\u4e3a $n$\u3001\u4ec5\u7531 <code>H<\/code> \u548c <code>T<\/code> \u7ec4\u6210\u7684\u5b57\u7b26\u4e32 $A$\u2014\u2014 \u7231\u4e3d\u4e1d\u9009\u62e9\u7684\u5b57\u7b26\u4e32\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u4fdd\u8bc1\u6240\u6709\u6e38\u620f $n$ \u7684\u603b\u548c\u4e0d\u8d85\u8fc7 $3 \\cdot 10^5$\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f93\u51fa\u683c\u5f0f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u6bcf\u7ec4\u6570\u636e\uff0c\u8f93\u51fa\u4e00\u884c\uff1a\u5982\u679c\u7231\u4e3d\u4e1d\u83b7\u80dc\uff0c\u8f93\u51fa <code>Alice<\/code>\uff1b\u5426\u5219\u8f93\u51fa <code>Bob<\/code>\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u6837\u4f8b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f93\u5165<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>5\n2\nHT\n3\nTHT\n4\nTTHT\n3\nHHH\n1\nT<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f93\u51fa<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Bob\nAlice\nAlice\nBob\nBob<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u6837\u4f8b\u89e3\u91ca<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e00\u7ec4\u6570\u636e\u4e2d\uff0c$A = \\text{HT}$\u3002\u9c8d\u52c3\u53ef\u4ee5\u9009\u62e9 $B = \\text{TH}$\uff0c\u5e76\u5c06 $S$ \u7684\u7b2c\u4e00\u4e2a\u5b57\u7b26\u8bbe\u4e3a <code>T<\/code>\u3002\u4e4b\u540e\u65e0\u8bba\u7231\u4e3d\u4e1d\u5982\u4f55\u8ffd\u52a0\u5269\u4f59\u5b57\u7b26\uff0c\u9c8d\u52c3\u90fd\u4fdd\u8bc1\u83b7\u80dc\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e3\u9898\u601d\u8def<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6ce8\u610f\u5230\uff0cBob \u64cd\u4f5c\u4e00\u6b21\uff08\u9009\u62e9 $B$ \u548c\u8bbe\u7f6e $S$ \u7684\u9996\u5b57\u7b26\uff09\uff0c\u800c Alice \u53ef\u4ee5\u64cd\u4f5c\u65e0\u6570\u6b21\uff08\u4e0d\u65ad\u8ffd\u52a0\u5b57\u7b26\uff09\u3002\u56e0\u6b64\uff0c\u53ea\u8981\u524d $n-1$ \u4e2a\u5b57\u7b26\u6a21\u4eff Bob \u8bbe\u7f6e\u7684\u9996\u5b57\u7b26\uff0c\u6700\u540e\u4e00\u4e2a\u5b57\u7b26\u4e0e Bob \u4e0d\u540c\uff0cAlice \u5c31\u80fd\u8d62\u3002<br>\u4ec0\u4e48\u60c5\u51b5\u4e0b Bob \u80fd\u8d62\u5462\uff1f\u53ea\u8981\u524d $n-1$ \u4e2a\u5b57\u7b26\u5f7c\u6b64\u76f8\u540c\uff0c\u5373\u6574\u4e2a\u5b57\u7b26\u4e32 $A$ \u7684\u6240\u6709\u5b57\u7b26\u90fd\u76f8\u540c\uff0cBob \u5c31\u80fd\u8d62\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003\u4ee3\u7801<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Sunshine sunshine ladybugs awake,\n\/\/Clap your hooves and do a little shack.\n\n#include&lt;bits\/stdc++.h&gt;\n\n#define int long long\n#define endl \"\\n\"\n\nusing namespace std;\n\nusing PII=pair&lt;int,int&gt;;\nconst int MAXN=300005;\nconst int mod=998244353;\nconst int INF=0x3f3f3f3f3f3f3f3f;\n\nvoid solve(){\n    int n; cin &gt;&gt; n;\n    string s; cin &gt;&gt; s;\n\n    for(int i = 1; i &lt; n - 1; i++){\n        if(s&#91;i] != s&#91;0]){\n            cout &lt;&lt; \"Alice\" &lt;&lt; endl;\n            return;\n        }\n    }\n\n    cout &lt;&lt; \"Bob\" &lt;&lt; endl;\n}\n\nsigned main() {\n    ios::sync_with_stdio(false);\n    cin.tie(nullptr);\n    int t; cin &gt;&gt; t;\n    while(t--) solve();\n    return 0;\n}\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>D. \u667a\u80dc\u5bf9\u624b \u9898\u76ee\u63cf\u8ff0 \u7231\u4e3d\u4e1d\u548c\u9c8d\u52c3\u5728\u73a9\u4e00\u4e2a\u4e0e\u5b57\u7b26\u4e32\u6709\u5173\u7684\u6e38\u620f\u3002 \u6bcf\u573a\u6e38\u620f\u5f00\u59cb\u65f6\uff0c\u7231\u4e3d\u4e1d\u5148\u9009\u62e9\u4e00\u4e2a\u957f\u5ea6\u4e3a $ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":210,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,16,10],"tags":[],"class_list":["post-245","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-codeforces","category-16","category-10"],"_links":{"self":[{"href":"https:\/\/huxiaole.cloud\/index.php\/wp-json\/wp\/v2\/posts\/245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/huxiaole.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/huxiaole.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/huxiaole.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/huxiaole.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=245"}],"version-history":[{"count":3,"href":"https:\/\/huxiaole.cloud\/index.php\/wp-json\/wp\/v2\/posts\/245\/revisions"}],"predecessor-version":[{"id":248,"href":"https:\/\/huxiaole.cloud\/index.php\/wp-json\/wp\/v2\/posts\/245\/revisions\/248"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/huxiaole.cloud\/index.php\/wp-json\/wp\/v2\/media\/210"}],"wp:attachment":[{"href":"https:\/\/huxiaole.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/huxiaole.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/huxiaole.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}