{"id":271,"date":"2023-10-05T20:02:28","date_gmt":"2023-10-05T12:02:28","guid":{"rendered":"https:\/\/solost.cn\/?p=271"},"modified":"2023-10-05T20:02:28","modified_gmt":"2023-10-05T12:02:28","slug":"402","status":"publish","type":"post","link":"https:\/\/solost.cn\/?p=271","title":{"rendered":"\u767e\u5ea6\u4e4b\u661f\u7b2c\u4e09\u573a &#8211; BD202317 \u77f3\u7891\u6587"},"content":{"rendered":"<h2>\u9898\u76ee\u94fe\u63a5<\/h2>\n<p><a href=\"https:\/\/www.matiji.net\/exam\/brushquestion\/17\/4347\/179CE77A7B772D15A8C00DD8198AAC74\">\u9898\u76ee\u94fe\u63a5<\/a><\/p>\n<h2>\u9898\u76ee\u5927\u610f<\/h2>\n<p>\u7ed9\u4f60\u4e00\u4e2a\u957f\u5ea6\u4e3an\u7684\u5b57\u7b26\u4e32\uff0c\u95ee\u4f60\u6709\u591a\u5c11\u4e2a\u8fde\u7eedshs\u4e09\u4e2a\u53ca\u4e09\u4e2a\u4ee5\u4e0a\u7684\u5b57\u7b26\u4e32\u79cd\u7c7b<\/p>\n<h2>\u9898\u89e3<\/h2>\n<p>\u72b6\u6001\u538b\u7f29dp<\/p>\n<p>dp\u72b6\u6001\u4e3adp[i,j]\u542b\u4e49\u4e3a\u7b2ci\u4e2a\u5b57\u7b26\uff0c\u51d1\u4e86j\u4e2ashsshsshs\u7684\u7b2c\u51e0\u4e2a\u5b57\u7b26<\/p>\n<p>\u7ed3\u5c3e\u4e3as\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u52a0s\u51d1\u6210s\u7ed3\u5c3e\uff0c\u52a0h\u51d1\u6210sh,\u968f\u4fbf\u52a0\u51d1\u6210\u7a7a\u96c6<\/p>\n<p>\u7ed3\u5c3e\u4e3ash\uff0c\u52a0s\u53ef\u4ee5\u51d1\u6210\u4e00\u4e2a\u7a7a\u96c6\uff0c\u5e76\u4e14\u6570\u91cf\u52a0\u4e00\uff0c\u968f\u4fbf\u52a0\u51d1\u6210\u7a7a\u96c6<\/p>\n<p>\u5df2\u7ecf\u6ee13\u4e2a\u4ee5\u540e\u968f\u4fbf\u52a0\uff0c\u90fd\u4e0d\u4f1a\u5f71\u54cd\u7b54\u6848<\/p>\n<h2>\u4ee3\u7801<\/h2>\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;unordered_set&gt;\n#include &lt;vector&gt;\n\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);\n#define fp(i, a, b) for (int i = a, i##_ = b; i &lt;= i##_; ++i)\n#define fd(i, a, b) for (int i = a, i##_ = b; i &gt;= i##_; --i)\n\nusing namespace std;\n\nusing ll = long long;\nusing pll = pair&lt;ll, ll&gt;;\nusing pii = pair&lt;int, int&gt;;\nusing ull = unsigned long long;\n\nconst int INF = 0x3f3f3f3f, mod = 1e9 + 7;\nconst int N = 2e6 + 10;\nll f[N][20];\nvoid solve() {\n    int n;\n    cin &gt;&gt; n;\n    f[0][0] = 1;\n    for (int i = 0; i &lt; n; i++) {\n        for (int j = 0; j &lt; 10; j++) {\n            if (j == 9)\n                f[i + 1][j] = (f[i + 1][j] + 26 * f[i][j]) % mod;\/\/\u5df2\u7ecf\u6ee13\u4e2a\n            else if (j % 3 == 1) {\n                f[i + 1][j] = (f[i + 1][j] + f[i][j]) % mod;\/\/s\u52a0\u4e86\u81ea\u5df1\n                f[i + 1][j + 1] = (f[i + 1][j + 1] + f[i][j]) % mod;\/\/\u52a0\u4e86h\n                f[i + 1][j - 1] = (f[i + 1][j - 1] + 24 * f[i][j]) % mod;\/\/\u968f\u4fbf\u52a0\n            } else {\n                f[i + 1][j + 1] = (f[i + 1][j + 1] + f[i][j]) % mod;\/\/sh\u52a0\u4e86s\n                f[i + 1][j \/ 3 * 3] = (f[i + 1][j \/ 3 * 3] + 25 * f[i][j]) % mod;\/\/sh\u52a0\u4e86\u4efb\u610f\u5b57\u7b26\n            }\n        }\n    }\n    cout &lt;&lt; f[n][9] &lt;&lt; &#039;\\n&#039;;\n}\n\nint main() {\n    IOS;\n    int _ = 1;\n    \/\/ cin &gt;&gt; _;\n    while (_--) {\n        solve();\n    }\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9898\u76ee\u94fe\u63a5 \u9898\u76ee\u94fe\u63a5 \u9898\u76ee\u5927\u610f \u7ed9\u4f60\u4e00\u4e2a\u957f\u5ea6\u4e3an\u7684\u5b57\u7b26\u4e32\uff0c\u95ee\u4f60\u6709\u591a\u5c11\u4e2a\u8fde\u7eedshs\u4e09\u4e2a\u53ca\u4e09\u4e2a\u4ee5\u4e0a\u7684\u5b57\u7b26\u4e32\u79cd\u7c7b \u9898\u89e3 \u72b6\u6001\u538b\u7f29dp dp\u72b6\u6001\u4e3adp[i,j]\u542b\u4e49\u4e3a\u7b2ci\u4e2a\u5b57\u7b26\uff0c\u51d1\u4e86j\u4e2ashsshsshs\u7684\u7b2c\u51e0\u4e2a\u5b57\u7b26 \u7ed3\u5c3e\u4e3as\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u52a0s\u51d1\u6210s\u7ed3\u5c3e\uff0c\u52a0h\u51d1\u6210sh,\u968f\u4fbf\u52a0\u51d1\u6210\u7a7a\u96c6 \u7ed3\u5c3e\u4e3ash\uff0c\u52a0s\u53ef\u4ee5\u51d1\u6210\u4e00\u4e2a\u7a7a\u96c6\uff0c\u5e76\u4e14\u6570\u91cf\u52a0\u4e00\uff0c\u968f\u4fbf\u52a0\u51d1\u6210\u7a7a\u96c6 \u5df2\u7ecf\u6ee13\u4e2a\u4ee5\u540e\u968f\u4fbf\u52a0\uff0c\u90fd\u4e0d\u4f1a\u5f71\u54cd\u7b54\u6848 \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;unordered_set&gt; #include &lt;vector&gt; #define x first #define y second #define endl &#039;\\n&#039; #define IOS \\ ios_base::sync_with_stdio(0); \\ [&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":[40,61],"class_list":["post-271","post","type-post","status-publish","format-standard","hentry","category-solution","tag-dp","tag-61"],"_links":{"self":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts\/271","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=271"}],"version-history":[{"count":0,"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts\/271\/revisions"}],"wp:attachment":[{"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}