摘要: http://poj.org/problem?id=3422最小费用最大流 求的时候把边加为负的 输出的时候再负回来 就变成求的最大费用了拆点 一个点拆为 i i' i->i'连两条边 一条cap为0 cost为给出的值 另一条cap为INF cost为0,i'到右和下分别设置一条边cap为INF cost为0设置超级源点到1节点 cap为K cost为0View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<alg 阅读全文
posted @ 2013-03-23 15:08 _雨 阅读(304) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2195模板题 超级源点-》men->house->超级汇点 坐标差值为两点的cost值 cap为1View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<algorithm> 5 #include<queue> 6 #include<stdlib.h> 7 #define INF 0xfffffff 8 using namespace std; 9 s 阅读全文
posted @ 2013-03-23 00:46 _雨 阅读(236) 评论(0) 推荐(0) 编辑