ZOJ 2182 Cable TV Network(无向图点割-最大流)
2020-12-13 16:27
标签:style class blog code http tar 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2182 题意:给出一个无向图,问最少删掉多少个顶点之后图变得不连通? 思路:将原图每个点拆点(i,i+n),连边,对原图的边(u,v),连边, ZOJ 2182 Cable TV Network(无向图点割-最大流),搜素材,soscw.com ZOJ 2182 Cable TV Network(无向图点割-最大流) 标签:style class blog code http tar 原文地址:http://www.cnblogs.com/jianglangcaijin/p/3799816.htmlstruct node
{
int v,cap,next;
};
node edges[N*10];
int head[N],e;
int curedge[N],h[N],num[N],pre[N];
int s,t;
void add(int u,int v,int cap)
{
edges[e].v=v;
edges[e].cap=cap;
edges[e].next=head[u];
head[u]=e++;
}
void Add(int u,int v,int cap)
{
add(u,v,cap);
add(v,u,0);
}
int Maxflow(int s,int t,int n)
{
clr(h,0); clr(num,0);
int i;
FOR0(i,n+1) curedge[i]=head[i];
int u=s,Min,k,x,ans=0;
while(h[u]
文章标题:ZOJ 2182 Cable TV Network(无向图点割-最大流)
文章链接:http://soscw.com/essay/36149.html