摘要: 题意:在一个网络图中有n个点,其中有np个发电站,nc个用户,m条电线;每个发电站,用户,和电线都对应有一个最大的电流;让求出该网络中最大的电流;添加一个源点为(0)和一个汇点(n+1),源点与发电站相连,电流量为发电站的最大电流;用户与汇点相连,电流量为用户需要的最大电流。EK算法模版:10944604xinghan02191459Accepted768K625MSG++1290B2012-10-22 23:17:50View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring&g 阅读全文
posted @ 2012-10-22 23:22 Missa 阅读(450) 评论(0) 推荐(0) 编辑
摘要: 1 //poj 1273 2 #include <iostream> 3 #include <cstdio> 4 #include <cstring> 5 #include <queue> 6 7 using namespace std; 8 #define MAXN 202 9 #define inf 0x7ffffff10 #define Min(x,y) (x>y?y:x)11 int n;//顶点数12 int flow[MAXN][MAXN];//残量网络13 int maxflow;//最大流14 int st,en;//源点, 阅读全文
posted @ 2012-10-22 22:22 Missa 阅读(212) 评论(0) 推荐(0) 编辑