{"id":1055,"date":"2014-10-28T02:25:32","date_gmt":"2014-10-27T18:25:32","guid":{"rendered":"http:\/\/www.shuizilong.com\/house\/?p=1055"},"modified":"2023-05-23T22:04:38","modified_gmt":"2023-05-23T14:04:38","slug":"sgu-282-isomorphism","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/house\/archives\/sgu-282-isomorphism\/","title":{"rendered":"SGU 282. Isomorphism"},"content":{"rendered":"<p><!--more--><br \/>\n<a href=\"http:\/\/endlesscount.blog.163.com\/blog\/static\/8211978720122154253812\/\">http:\/\/endlesscount.blog.163.com\/blog\/static\/8211978720122154253812\/<\/a><\/p>\n<p>\u601d\u8def<\/p>\n<p>\u540c <a href=\"https:\/\/www.shuizilong.com\/house\/archives\/poj-2154-color\/\">https:\/\/www.shuizilong.com\/house\/archives\/poj-2154-color\/<\/a><br \/>\n\u3002\u3002\u3002\u7f6e\u6362\u592a\u591a\u3002\u3002\u600e\u4e48\u529e\uff01\u5206\u7ec4\u8ba1\u6570\uff01\uff01\u3002\u3002Pattern \u4e3a\u5206\u62c6\u6570\u3002\u3002\u3002<a href=\"http:\/\/en.wikipedia.org\/wiki\/Partition_(number_theory)\">http:\/\/en.wikipedia.org\/wiki\/Partition_(number_theory)<\/a><\/p>\n<p>\u90a3\u4e48\u5bf9\u4e8e\u6bcf\u7c7b Pattern\uff1a<\/p>\n<p>\u5bf9\u5e94\u591a\u5c11\u7f6e\u6362\u3002\u3002\u3002 c()\u3002\u3002<br \/>\n\u5faa\u73af\u7684\u603b\u6570\uff1ag()\u3002\u3002<\/p>\n<p>\u524d\u8005\u591a\u9879\u5f0f\u7cfb\u6570\u3002\u3002\u4e58\u4ee5\u73af\u6392\u5217\u3002\u3002\u9664\u4ee5\u76f8\u540c\u957f\u5ea6\u7684\u73af\u5373\u53ef\u3002\u3002\u6bd4\u8f83\u5bb9\u6613\u3002\u3002<br \/>\n\u96be\u70b9\u662f g()\uff1a<br \/>\n\u5728\u8fd9\u9898\u4e2d\u3002\u3002\u5c31\u662f\u4ece<br \/>\n\u70b9\u7f6e\u6362\u7684\u5faa\u73af\u6570 \u53bb\u63a8 \u8fb9\u7f6e\u6362\u7684\u5faa\u73af\u6570\u3002\u3002\u3002<\/p>\n<p>\u5206\u7c7b\u8ba8\u8bba\uff1a<\/p>\n<ol>\n<li>\u5bf9\u4e8e\u8fb9\u6240\u5173\u8054\u7684\u4e24\u70b9\u3002\u3002\u4e0d\u518d\u540c\u4e00\u4e2a\u5faa\u73af\u4e2d\uff1a<\/li>\n<\/ol>\n<p>\u3002\u3002\u3002\u8bbe\u8fd9\u4e24\u4e2a\u5faa\u73af\u7684\u957f\u5ea6\u5206\u522b\u4e3a a, b \u3002\u3002\u3002<br \/>\n\u90a3\u4e48\u8fd9\u7c7b\u8fb9\u4e00\u5171\u6709 ab \u4e2a\u3002\u3002\u6240\u5728\u8fb9\u5faa\u73af\u7684\u957f\u5ea6\u4e3a lcm(a, b)\u3002\u3002\u3002<br \/>\n\u56e0\u6b64\u8fb9\u5faa\u73af\u7684\u6570\u76ee\u4e3a ab \/ lcm(a, b) = gcd(a, b)\u3002\u3002\u3002\u3002<\/p>\n<p>2.\u3002\u3002\u3002\u3002\u5728\u540c\u4e00\u4e2a\u5faa\u73af\u4e2d\u3002\u3002<\/p>\n<p>\u6b64\u5904\u5e94\u6709\u63d2\u56fe\u3002\u3002\u3002<\/p>\n<p>\u603b\u5171\u5bf9\u5e94 \\binom{n}{2} \u4e2a\u8fb9\u7f6e\u6362\u3002\u3002\u3002<\/p>\n<p>\u51e0\u4e4e\u6240\u6709\u7684\u8fb9\u90fd\u662f\u7ecf\u8fc7 n \u6b21\u624d\u4f1a\u56de\u5230\u81ea\u5df1\u3002\u3002\u3002<br \/>\n\u9664\u4e86\u5728\u5076\u6570\u7684\u60c5\u51b5\u4e0b\u3002\u3002\u6700\u957f\u7684\u90a3\u79cd\u8fb9\u3002\u3002\u6070\u597d n\/2 \u6b21\u5c31\u4f1a\u56de\u5230\u81ea\u5df1\u3002\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5faa\u73af\u6570 +1\u3002\u3002\u3002<\/p>\n<p>\u56e0\u6b64\u5faa\u73af\u7684\u4e2a\u6570\u4e3a\uff1a<\/p>\n<p>\u5947\u6570\uff1a<br \/>\n\\binom{n}{2} \/ n = (n-1)\/2 = \\floor{n\/2}<br \/>\n\u5076\u6570\uff1a<br \/>\n\\binom{n}{2} \/ n + 1\u3002\u3002\u3002(n-1) \/ 2 + 1 = \\floor{n\/2}<\/p>\n<p><a href=\"https:\/\/vjudge.net\/solution\/43124199\">https:\/\/vjudge.net\/solution\/43124199<\/a><\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\n#include &lt;lastweapon\/number&gt;\r\n\r\nusing namespace lastweapon;\r\n\r\nconst int N = int(5e1) + 9;\r\nInt Fact&#x5B;N]; VVI Partition; VI cur;\r\nint n, m;\r\n\r\nvoid gen(int n = ::n, int s = 1){\r\n    if (!n){\r\n        Partition.PB(cur);\r\n    }\r\n    else if (n &gt;= s){\r\n        cur.PB(s); gen(n-s, s); cur.pop_back();\r\n        gen(n, s+1);\r\n    }\r\n}\r\n\r\nInt c(const VI P){\r\n\r\n    Int z = Fact&#x5B;n]; int c = 0, l = P.front();\r\n\r\n    ECH(it, P){\r\n        z \/= *it; if (*it != l){\r\n            z \/= Fact&#x5B;c]; l = *it;\r\n            c = 1;\r\n        }\r\n        else{\r\n            ++c;\r\n        }\r\n    }\r\n\r\n    z \/= Fact&#x5B;c];\r\n    return z;\r\n}\r\nint g(const VI P){\r\n    int z = 0; REP(i, SZ(P)){\r\n        z += P&#x5B;i] \/ 2; REP(j, i) z += __gcd(P&#x5B;i], P&#x5B;j]);\r\n    }\r\n    return z;\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    \/\/freopen(&quot;out.txt&quot;, &quot;w&quot;, stdout);\r\n#endif\r\n\r\n    RD(n, m, MOD); Fact&#x5B;0] = 1; REP_1(i, n) Fact&#x5B;i] = Fact&#x5B;i-1] * i;\r\n\r\n    gen();\r\n\r\n    Int res = 0; ECH(it, Partition){\r\n        res += c(*it) * pow(m, g(*it));\r\n        \/\/cout &lt;&lt; c(*it) &lt;&lt; &quot; &quot; &lt;&lt;  pow(m, g(*it)) &lt;&lt; &quot; &quot; &lt;&lt; res &lt;&lt; endl;\r\n    }\r\n    res \/= Fact&#x5B;n];\r\n    cout &lt;&lt; res &lt;&lt; endl;\r\n}\r\n\r\n<\/pre>\n<p>Ext:<br \/>\n\u53cd\u8fc7\u6765\u4ece\u8fb9\u7f6e\u6362\u63a8\u70b9\u7f6e\u6362\u600e\u4e48\u505a\uff1f\uff1f\uff1f\uff1f<\/p>\n","protected":false},"excerpt":{"rendered":"","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":[61],"tags":[139],"class_list":["post-1055","post","type-post","status-publish","format-standard","hentry","category-sgu","tag-polya-"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2tdP7-h1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/1055","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=1055"}],"version-history":[{"count":1,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/1055\/revisions"}],"predecessor-version":[{"id":2874,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/1055\/revisions\/2874"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/media?parent=1055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/categories?post=1055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/tags?post=1055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}