{"id":2931,"date":"2023-05-28T19:17:13","date_gmt":"2023-05-28T11:17:13","guid":{"rendered":"https:\/\/www.shuizilong.com\/house\/?p=2931"},"modified":"2023-05-28T19:17:13","modified_gmt":"2023-05-28T11:17:13","slug":"luogu-p5828-%e8%be%b9%e5%8f%8c%e8%bf%9e%e9%80%9a%e5%9b%be%e8%ae%a1%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/house\/archives\/luogu-p5828-%e8%be%b9%e5%8f%8c%e8%bf%9e%e9%80%9a%e5%9b%be%e8%ae%a1%e6%95%b0\/","title":{"rendered":"Luogu P5828 \u8fb9\u53cc\u8fde\u901a\u56fe\u8ba1\u6570"},"content":{"rendered":"<ul>\n<li><a href=\"https:\/\/www.luogu.com.cn\/problem\/P5828\">https:\/\/www.luogu.com.cn\/problem\/P5828<\/a><\/li>\n<\/ul>\n<p>\u548c <a href=\"https:\/\/www.shuizilong.com\/house\/archives\/luogu-p5827-%e7%82%b9%e5%8f%8c%e8%bf%9e%e9%80%9a%e5%9b%be%e8%ae%a1%e6%95%b0\/\">\u4e0a\u4e00\u9898<\/a> \u51e0\u4e4e\u4e00\u6837\uff0c\u53cc\u500d\u7ecf\u9a8c\uff01<\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\n#include &lt;lastweapon\/poly&gt;\r\nusing namespace lastweapon;\r\n\r\nPoly H, HH;\r\nint n;\r\n\r\nLL C2(LL n) {\r\n    return n*(n-1)\/2;\r\n}\r\n\r\nint b(int n) {\r\n    Poly A(n); REP(i, n) A&#x5B;i] = H&#x5B;i] * -n;\r\n    Poly B = HH.mod(n) * A.exp();\r\n    return (B&#x5B;n-1] * fac&#x5B;n-1] \/ n).x;\r\n}\r\n\r\nint main(){\r\n\r\n#ifndef ONLINE_JUDGE\r\n    freopen(&quot;in.txt&quot;, &quot;r&quot;, stdin);\r\n#endif\r\n\r\n    vector&lt;int&gt; q; DO(5) q.PB(RD()); n = *max_element(ALL(q)) + 1;\r\n    Poly C(n), G(n); REP(i, n) G&#x5B;i] = Mint(2).pow(C2(i)), G&#x5B;i] *= invFac&#x5B;i]; C = G.log();\r\n\r\n    H = C; REP(i, n) H&#x5B;i] *= i; HH = H.D();\r\n\r\n    for (auto i: q) printf(&quot;%d\\n&quot;, b(i));\r\n}\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/www.luogu.com.cn\/problem\/P5828 \u548c \u4e0a\u4e00\u9898 \u51e0\u4e4e\u4e00\u6837\uff0c\u53cc\u500d\u7ecf\u9a8c\uff01 #include &lt;lastweapon\/poly&gt; using namespace lastweapon; Poly H, HH; int n; LL C2(LL n) { return n*(n-1)\/2; } int b(int n) { Poly A(n); REP(i, n) A&#x5B;i] = H&#x5B;i] * -n; Poly B = HH.mod(n) * A.exp(); return (B&#x5B;n-1] * fac&#x5B;n-1] \/ n).x; } int main(){ #ifndef ONLINE_JUDGE freopen(&quot;in.txt&quot;, &quot;r&quot;, stdin); #endif [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[],"class_list":["post-2931","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2tdP7-Lh","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/2931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/comments?post=2931"}],"version-history":[{"count":1,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/2931\/revisions"}],"predecessor-version":[{"id":2932,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/2931\/revisions\/2932"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/media?parent=2931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/categories?post=2931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/tags?post=2931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}