随笔分类 - 最小费用最大流
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3435 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define inf 0x3f3f3f3f 7 #define maxn 54444 8 using namespace std; 9 10 queueq; 11 struct node 12 { 13 int u,v,next,val,f; 14 } p[maxn]; 15 int head[maxn]; 16 bool vis[maxn]; 17...
阅读全文
摘要:http://poj.org/problem?id=3422 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define maxn 100000 7 using namespace std; 8 9 const int inf=1q; 34 q.push(s); 35 vis[s]=true; 36 while(!q.empty()) 37 { 38 int u=q.front();q.pop(); 39 ...
阅读全文
摘要:http://poj.org/problem?id=2195 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define maxn 500 8 using namespace std; 9 int n,mm; 10 char g[maxn][maxn]; 11 const int inf=1q; 73 int d[maxn]; 74 memset(flow,0,sizeof(flow)); 75 int c=0,f=0; 76 ...
阅读全文
摘要:http://poj.org/problem?id=2516 1 #include 2 #include 3 #include 4 #include 5 #define maxn 110 6 using namespace std; 7 8 int need[maxn][maxn]; 9 int sup[maxn][maxn]; 10 int cost[maxn][maxn][maxn]; 11 int cap[maxn][maxn]; 12 int flow[maxn][maxn]; 13 int cost1[maxn][maxn]; 14 int d[maxn]; 15...
阅读全文

浙公网安备 33010602011771号