{"id":1027,"date":"2014-10-14T17:17:54","date_gmt":"2014-10-14T09:17:54","guid":{"rendered":"http:\/\/www.shuizilong.com\/house\/?p=1027"},"modified":"2014-10-24T02:12:08","modified_gmt":"2014-10-23T18:12:08","slug":"2014-acmicpc-asia-mudanjiang-regional-contest-onsite","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/house\/archives\/2014-acmicpc-asia-mudanjiang-regional-contest-onsite\/","title":{"rendered":"2014 ACM\/ICPC Asia Mudanjiang Regional Contest Onsite"},"content":{"rendered":"<h2>Problem B. Domination<\/h2>\n<h3>Brief description: <\/h3>\n<p>\u7ed9\u5b9a\u4e00\u68f5\u65e0\u6839\u6811 T \u3002\u5b9a\u4e49\u4ee5 T \u4e0a\u4e00\u5bf9\u70b9 (a, b) \u4e3a\u201c\u590d\u6839\u201d\u7684\u6811\u7684\u9ad8\u5ea6 h(a, b) = max min(dist(x, a), dist(x, b)), for all x on T \u3002<br \/>\n\u73b0\u6c42 H(T) = min h(a, b), for all (a, b) | a != b\u3002<\/p>\n<h3>Analysis: <\/h3>\n<p>\u7ed3\u8bba\uff1a\u4e24\u4e2a\u590d\u6839\u4e00\u5b9a\u5728\u6811\u7684\u76f4\u5f84\u4e0a\u3002<\/p>\n<p>\u5148\u6c42\u76f4\u5f84\uff0c\u5e76\u6c42\u51fa\u76f4\u5f84\u4e0a\u6bcf\u4e2a\u70b9\u4e3a\u6839\u7684\u6811\u6240\u5230\u8fbe\u7684\u6700\u8fdc\u8ddd\u79bb\u3002<br \/>\n\u4e8c\u5206\u7b54\u6848\uff0c\u6bcf\u6b21\u5148\u8d2a\u5fc3\u7684\u5c06\u590d\u6839\u5c3d\u53ef\u80fd\u5411\u4e2d\u95f4\u79fb\u52a8\u3002\u3002\u3002\u7136\u540e\u5728\u5224\u65ad\u4e2d\u95f4\u7684\u90a3\u4e9b\u70b9\u662f\u5426\u4e5f\u5408\u6cd5\u3002<\/p>\n<p><a href=\"http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=2882177\">http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=2882177<\/a><\/p>\n<h2>Problem D. Domination<\/h2>\n<h3>Brief description: <\/h3>\n<p>\u7565\u3002\uff09<\/p>\n<h3>Analysis: <\/h3>\n<p>\u4f3c\u4e4e\u662f\u67d0\u573a CF \u7684 B\u3002<\/p>\n<p><code>f[i][j][k]<\/code>: \u8868\u793a\u5f53\u524d\u6709 i \u884c\u3001j \u5217\u6ca1\u6709\u8986\u76d6\uff0c\u4e14\u4e00\u5171\u8fd8\u6709 k \u4e2a\u683c\u5b50\u6ca1\u586b\u65f6\u7684\u671f\u671b\u3002<br \/>\n\u8f6c\u79fb\u5206\u56db\u79cd\u60c5\u51b5\u8ba8\u8bba\u5373\u53ef\u3002\uff08\u4f3c\u4e4e\u8fd9\u4e2a\u72b6\u6001\u8868\u793a\u4e0d\u662f\u7279\u522b\u597d\u3002\u3002\u8fd9\u6837\u505a\u5fc5\u987b\u8981\u4f7f\u7528 long double\u3002\u3002\uff09<\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\n\/\/}\/* .................................................................................................................................. *\/\r\n\r\nconst int N = 51;\r\nlong double f&#x5B;N]&#x5B;N]&#x5B;N*N];\r\nint n, m;\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    Rush{\r\n        RD(n, m); RST(f);\r\n\r\n#define u f&#x5B;i]&#x5B;j]&#x5B;k]\r\n        REP_2(i, j, n+1, m+1){\r\n            if (!i &amp;&amp; !j) continue;\r\n            REP_1(k, n*m){\r\n                u = (k-i*m-j*n+i*j) * f&#x5B;i]&#x5B;j]&#x5B;k-1];\r\n                if (i &amp;&amp; j) u += i*j * f&#x5B;i-1]&#x5B;j-1]&#x5B;k-1];\r\n                if (i) u += i*(m-j) * f&#x5B;i-1]&#x5B;j]&#x5B;k-1];\r\n                if (j) u += j*(n-i) * f&#x5B;i]&#x5B;j-1]&#x5B;k-1];\r\n                u \/= k, ++u;\r\n            }\r\n        }\r\n\r\n        OT((DB)f&#x5B;n]&#x5B;m]&#x5B;n*m]);\r\n    }\r\n}\r\n\r\n<\/pre>\n<h2>Problem F. Fiber-optic Network<\/h2>\n<h3>Brief description: <\/h3>\n<p>\u7ed9\u5b9a\u4e00\u9897 50 \u4e2a\u7ed3\u70b9\u7684\u65e0\u5411\u6811\uff0c\u6bcf\u4e2a\u7ed3\u70b9\u53ef\u4ee5\u586b [Li, Ri] \u4e4b\u95f4\u7684\u6570\u3002<br \/>\n\u8981\u6c42\u76f8\u90bb\u7ed3\u70b9\u586b\u7684\u6570 co-prime\u3002\u95ee\u4e00\u5171\u6709\u591a\u5c11\u79cd\u65b9\u6848\u3002\uff08\u8981\u6c42\u8f93\u51fa\u6240\u6709\u65b9\u6848\u91cc\u6bcf\u4e2a\u7ed3\u70b9\u6240\u586b\u7684\u6570\u5b57\u548c\uff09<\/p>\n<h3>Analysis: <\/h3>\n<p>\u6811 DP\uff0c\u5bb9\u65a5\u539f\u7406\u8f6c\u79fb\u3002<\/p>\n<p>f1[u][val]\uff1a\u8868\u793a u \u70b9\u586b val \u65f6\u7684\u65b9\u6848\u6570\u3002\u3002\u3002<br \/>\n\u7528\u5bb9\u65a5\u539f\u7406\u8fdb\u884c\u8f6c\u79fb\u3002\u3002\u3002<\/p>\n<p>\u8003\u8651 (u, v) \u7684\u8f6c\u79fb\uff0c\u8bbe f2[v][val] \u4e3a v \u7ed3\u70b9\u6240\u6709\u4ee5 val \u4e3a\u500d\u6570\u7684\u7b54\u6848\u3002\u6211\u4eec\u9884\u5904\u7406\u51fa mu \u51fd\u6570\uff0c\u4ee5\u53ca val \u6240\u6709\u7684 mu \u503c\u4e0d\u4e3a 0 \u7684\u500d\u6570\u3002\u3002<br \/>\n\u90a3\u4e48\u5c31\u662f\uff1a<\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\n    ECH(it, adj&#x5B;u]) if (v != p){\r\n        FOR_1(i, ll&#x5B;u], rr&#x5B;u]){\r\n            Int t = 0; ECH(d, dd&#x5B;i]) t += Int(mu&#x5B;*d])*f2&#x5B;v]&#x5B;*d];            \r\n            f1&#x5B;u]&#x5B;i] *= t;\r\n        }\r\n    }\r\n<\/pre>\n<p>dfs \u4e24\u6b21\u3002\u3002<br \/>\n\u7b2c\u4e00\u6b21\u53ef\u4ee5\u5f97\u5230\u6839\u7ed3\u70b9\u7684\u7b54\u6848\u3002\u3002<br \/>\n\u4e3a\u4e86\u5f97\u5230\u5176\u5b83\u7ed3\u70b9\u7684\u7b54\u6848\u3002\u3002\u9700\u8981\u5c06\u7236\u4eb2\u7ed3\u70b9\u7684\u7ed3\u679c\u9664\u53bb\u4ee5\u67d0\u4e2a v \u4f5c\u4e3a\u5b69\u5b50\u65f6\u7684\u65b9\u6848\u6570\u4f5c\u4e3a\u4e00\u4e2a\u65b0\u7684\u5b69\u5b50\u3002\u3002\u3002\u53c2\u4e0e\u8f6c\u79fb\u3002\u3002<br \/>\n\u5f97\u7528\u4e00\u4e9b\u9ebb\u70e6\u7684\u65b9\u6cd5\u907f\u514d\u9664\u6cd5\u3002\u3002\u3002TLE&#8230;<\/p>\n<p><a href=\"http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=2844775\">http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=2844775<\/a><\/p>\n<p>\u6539\u8fdb\uff1a<br \/>\n\u6309\u7167\u8fb9\u8fdb\u884c DP\u3002\u3002\u3002<br \/>\nf1[i][val]\uff1ai \u8868\u793a (p, u) \u8fd9\u6761\u8fb9\u3002\u3002\u3002<br \/>\n\u3002\u3002u \u70b9\u586b val \u65f6\u7684\u65b9\u6848\u6570\u3002\u3002\u3002\u53ef\u4ee5\u907f\u514d\u9664\u6cd5\u3002\u3002<\/p>\n<p><a href=\"http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=2845448\">http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=2845448<\/a><\/p>\n<h2>Problem K. <\/h2>\n<h3>Brief description: <\/h3>\n<p>&#8230;<\/p>\n<h3>Analysis: <\/h3>\n<p>\u8d2a\u5fc3\u3002\u3002digit \u603b\u662f\u8d8a\u9760\u524d\u8d8a\u597d\u3002\u3002<br \/>\n\u3002\u5148\u5728\u524d\u9762\u8865\u9f50\u5fc5\u8981\u7684 digit\u3002\u3002\u3002\u7136\u540e\u8d2a\u5fc3\u7684\u5c06\u6700\u524d\u7684\u975e\u6cd5 * \u548c\u6700\u540e\u7684 digit \u4ea4\u6362\u3002<\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\n\/\/}\/* .................................................................................................................................. *\/\r\n\r\nstring s;\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    Rush{\r\n        cin &gt;&gt; s; n = s.size();\r\n        int a = 0; REP(i, n) if (s&#x5B;i] == '*') ++a;\r\n        int b = n - a, bb = 0, z = 0; z += max(0, a-(b-1)); bb = z;\r\n        REP(i, n) if (s&#x5B;i] == '*'){\r\n            if (bb &lt; 2) ++bb, ++z;\r\n            else --bb;\r\n        }\r\n        else ++bb;\r\n        cout &lt;&lt; z &lt;&lt; endl;\r\n    }\r\n}\r\n<\/pre>\n<p><a href=\"http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=2845839\">http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=2845839<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem B. Domination Brief description: \u7ed9\u5b9a\u4e00\u68f5\u65e0\u6839\u6811 T \u3002\u5b9a\u4e49\u4ee5 T \u4e0a\u4e00\u5bf9\u70b9 (a, b) \u4e3a\u201c\u590d\u6839\u201d\u7684\u6811\u7684\u9ad8\u5ea6 h(a, b) = max min(dist(x, a), dist(x, b)), for all x on T \u3002 \u73b0\u6c42 H(T) = min h(a, b), for all (a, b) | a != b\u3002 Analysis: \u7ed3\u8bba\uff1a\u4e24\u4e2a\u590d\u6839\u4e00\u5b9a\u5728\u6811\u7684\u76f4\u5f84\u4e0a\u3002 \u5148\u6c42\u76f4\u5f84\uff0c\u5e76\u6c42\u51fa\u76f4\u5f84\u4e0a\u6bcf\u4e2a\u70b9\u4e3a\u6839\u7684\u6811\u6240\u5230\u8fbe\u7684\u6700\u8fdc\u8ddd\u79bb\u3002 \u4e8c\u5206\u7b54\u6848\uff0c\u6bcf\u6b21\u5148\u8d2a\u5fc3\u7684\u5c06\u590d\u6839\u5c3d\u53ef\u80fd\u5411\u4e2d\u95f4\u79fb\u52a8\u3002\u3002\u3002\u7136\u540e\u5728\u5224\u65ad\u4e2d\u95f4\u7684\u90a3\u4e9b\u70b9\u662f\u5426\u4e5f\u5408\u6cd5\u3002 http:\/\/acm.hust.edu.cn\/vjudge\/problem\/viewSource.action?id=2882177 Problem D. Domination Brief description: \u7565\u3002\uff09 Analysis: \u4f3c\u4e4e\u662f\u67d0\u573a CF [&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-1027","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2tdP7-gz","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/1027","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=1027"}],"version-history":[{"count":1,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/1027\/revisions"}],"predecessor-version":[{"id":1050,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/1027\/revisions\/1050"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/media?parent=1027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/categories?post=1027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/tags?post=1027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}