{"id":1086,"date":"2015-01-07T17:55:34","date_gmt":"2015-01-07T09:55:34","guid":{"rendered":"http:\/\/www.shuizilong.com\/house\/?p=1086"},"modified":"2015-01-09T04:32:27","modified_gmt":"2015-01-08T20:32:27","slug":"bestcoder-25","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/house\/archives\/bestcoder-25\/","title":{"rendered":"BestCoder #25"},"content":{"rendered":"<p><!--more--><\/p>\n<p>Problem A. Harry and Magical Computer<br \/>\ndfs()\u3002<br \/>\n<a href=\"http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=3135139\">http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=3135139<\/a><br \/>\n\u8d2a\u5fc3\u3002<br \/>\n<a href=\"http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=3135141\">http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=3135141<\/a><\/p>\n<p>Problem B. Harry And Magic Box<\/p>\n<p>\u7ed9\u5b9a\u4e00\u4e2a n*m \u4e2a\u77e9\u9635\uff0c\u95ee\u5176\u4e2d\u6709\u591a\u5c11 0\/1 \u65b9\u6848\u662f\u7684\u6bcf\u4e00\u884c\uff0c\u6bcf\u4e00\u5217\u81f3\u5c11\u6709\u4e00\u4e2a 1\u3002<\/p>\n<p>\u66b4\u529b\u5197\u65a5\u3002<\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\nconst int N = int(50) + 9;\r\nInt C&#x5B;N]&#x5B;N], A&#x5B;N]&#x5B;N];\r\nint 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    REP(i, N){\r\n        C&#x5B;i]&#x5B;0] = 1;\r\n        REP_1(j, i) C&#x5B;i]&#x5B;j] = C&#x5B;i-1]&#x5B;j-1] + C&#x5B;i-1]&#x5B;j];\r\n    }\r\n\r\n    REP_1(i, N){\r\n        REP_1(j, N){\r\n            A&#x5B;i]&#x5B;j] = pow(2, i*j) - 1;\r\n            REP_1(ii, i) REP_1(jj, j) if (ii != i || jj != j){\r\n                A&#x5B;i]&#x5B;j] -= A&#x5B;ii]&#x5B;jj] * C&#x5B;i]&#x5B;ii] * C&#x5B;j]&#x5B;jj];\r\n            }\r\n        }\r\n    }\r\n\r\n    int n, m;\r\n    while (~scanf(&quot;%d%d&quot;, &amp;n, &amp;m)){\r\n        OT(int(A&#x5B;n]&#x5B;m]));\r\n    }\r\n}\r\n<\/pre>\n<p>\u6b63\u5e38\u5411\u5197\u65a5\uff1a<br \/>\nf(i) \u8868\u793a\uff1a\u81f3\u5c11 i \u884c\u662f\u7a7a\u7684\u65b9\u6848\u6570\u3002<\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\n\/\/}\/* .................................................................................................................................. *\/\r\n\r\nconst int N = int(50) + 9;\r\nInt C&#x5B;N]&#x5B;N];\r\nint n, m;\r\n\r\nInt f(int i){\r\n    return pow(pow(Int(2), n-i)-1, m) * C&#x5B;n]&#x5B;i];\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    REP(i, N){\r\n        C&#x5B;i]&#x5B;0] = 1;\r\n        REP_1(j, i) C&#x5B;i]&#x5B;j] = C&#x5B;i-1]&#x5B;j-1] + C&#x5B;i-1]&#x5B;j];\r\n    }\r\n\r\n    while (~scanf(&quot;%d%d&quot;, &amp;n, &amp;m)){\r\n        Int z = 0; REP(i, n+1){\r\n            if (i&amp;1) z -= f(i);\r\n            else z += f(i);;\r\n        }\r\n        OT(int(z));\r\n    }\r\n}\r\n\r\n<\/pre>\n<p>Problem C.<\/p>\n<p><a href=\"http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=3135282\">http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=3135282<\/a><\/p>\n<p>Problem D.<\/p>\n<p><a href=\"http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=3135430\">http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=3135430<\/a><\/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":[1],"tags":[],"class_list":["post-1086","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2tdP7-hw","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/1086","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=1086"}],"version-history":[{"count":1,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/1086\/revisions"}],"predecessor-version":[{"id":1088,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/1086\/revisions\/1088"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/media?parent=1086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/categories?post=1086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/tags?post=1086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}