{"id":3032,"date":"2023-06-14T04:16:41","date_gmt":"2023-06-13T20:16:41","guid":{"rendered":"https:\/\/www.shuizilong.com\/house\/?p=3032"},"modified":"2023-06-14T04:18:16","modified_gmt":"2023-06-13T20:18:16","slug":"luogu-p2050-noi2012-%e7%be%8e%e9%a3%9f%e8%8a%82","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/house\/archives\/luogu-p2050-noi2012-%e7%be%8e%e9%a3%9f%e8%8a%82\/","title":{"rendered":"Luogu P2050. [NOI2012] \u7f8e\u98df\u8282"},"content":{"rendered":"<ul>\n<li><a href=\"https:\/\/www.luogu.com.cn\/problem\/P2050\">https:\/\/www.luogu.com.cn\/problem\/P2050<\/a><\/li>\n<\/ul>\n<p>\u7528 <a href=\"https:\/\/www.shuizilong.com\/house\/archives\/luogu-p2053-scoi2007-%e4%bf%ae%e8%bd%a6\/\">\u4e0a\u4e00\u9898<\/a> \u7684\u505a\u6cd5\u53ef\u4ee5\u62ff 60 \u5206\uff0c\u8003\u8651\u4f18\u5316\u3002\u6211\u4eec\u53d1\u73b0\u5bf9\u4e8e\u6bcf\u4e2a\u53a8\u5e08\uff0c\u5b83\u6240\u88ab\u5229\u7528\u7684\u8fb9\u4e00\u5b9a\u662f\u4e00\u7ec4\u524d\u7f00\uff0c\u56e0\u6b64\u53ef\u4ee5\u8d2a\u5fc3\u6bcf\u8fdb\u884c\u4e00\u6b21\u589e\u5e7f\u540e\u518d\u52a8\u6001\u52a0\u5165\u65b0\u7684\u8fb9\u3002<\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\n#include &lt;lastweapon\/io&gt;\r\n#include &lt;lastweapon\/mincostflow&gt;\r\nusing namespace lastweapon;\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    int n, m, p; RD(n, m); p = 800; int s = n+m*p, t = s+1, nn = 0;\r\n    mcf_graph&lt;int, int&gt; G(t+1);\r\n\r\n    REP(i, n) G.add_edge(s, i, RD(), 0);\r\n    REP(i, p) REP(j, m) G.add_edge(n+p*j+i, t, 1, 0);\r\n\r\n    REP(i, n) REP(j, m) {\r\n        int c; RD(c); REP(k, p) G.add_edge(i, n+p*j+k, 1, (k+1)*c);\r\n    }\r\n\r\n    printf(&quot;%d\\n&quot;, G.flow(s, t).se);\r\n}\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/www.luogu.com.cn\/problem\/P2050 \u7528 \u4e0a\u4e00\u9898 \u7684\u505a\u6cd5\u53ef\u4ee5\u62ff 60 \u5206\uff0c\u8003\u8651\u4f18\u5316\u3002\u6211\u4eec\u53d1\u73b0\u5bf9\u4e8e\u6bcf\u4e2a\u53a8\u5e08\uff0c\u5b83\u6240\u88ab\u5229\u7528\u7684\u8fb9\u4e00\u5b9a\u662f\u4e00\u7ec4\u524d\u7f00\uff0c\u56e0\u6b64\u53ef\u4ee5\u8d2a\u5fc3\u6bcf\u8fdb\u884c\u4e00\u6b21\u589e\u5e7f\u540e\u518d\u52a8\u6001\u52a0\u5165\u65b0\u7684\u8fb9\u3002 #include &lt;lastweapon\/io&gt; #include &lt;lastweapon\/mincostflow&gt; using namespace lastweapon; int main() { #ifndef ONLINE_JUDGE freopen(&quot;in.txt&quot;, &quot;r&quot;, stdin); \/\/freopen(&quot;out.txt&quot;, &quot;w&quot;, stdout); #endif int n, m, p; RD(n, m); p = 800; int s = n+m*p, t = s+1, nn = 0; mcf_graph&lt;int, int&gt; G(t+1); REP(i, n) G.add_edge(s, i, RD(), 0); REP(i, p) [&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-3032","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2tdP7-MU","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/3032","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=3032"}],"version-history":[{"count":3,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/3032\/revisions"}],"predecessor-version":[{"id":3035,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/3032\/revisions\/3035"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/media?parent=3032"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/categories?post=3032"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/tags?post=3032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}