求的最大流后依次从源点和汇点开始dfs 如果能搜到的点数之和等于总的点数,最小割唯一,否则不唯一View Code #include<stdio.h>#include<string.h>const int MAX=100005;const int INF=1000000000;struct{ int v,c,next;}edge[1000000];int E,head[MAX];int gap[MAX],cur[MAX];int pre[MAX],dis[MAX];void add_edge(int s,int t,int c,int cc){/*加边的时候同时加两条, Read More
posted @ 2012-02-27 16:28 Because Of You Views(356) Comments(0) Diggs(0) Edit
由行向列建图,增加两个源汇点,源点向行连边,容量为该行的花费,列向汇点连边,容量为该列的代价,一个伞兵的位置为x,y,则从x行向y列连一天容量为无穷大的边,最后求最大流(最小割的容量)即可View Code #include<cstdio>#include<cstring>#include<cmath>const int MAX=100005;const double INF=1000000000;struct{ int v,next; double c;}edge[1000000];int E,head[MAX];int gap[MAX],cur[MAX] Read More
posted @ 2012-02-27 15:50 Because Of You Views(237) Comments(0) Diggs(0) Edit