完全没思绪,看了大牛博客的构图才慢慢懂了。。太想不到啊
#include<cstdio>
#include<cstring>
const int inf=99999999;
int t,n,m,s,cnt,G,S,sum,T;
int a[60][60],b[60][60],head[10000],gap[10000],d[10000];
struct EDGE
{
int to,f,nxt;
}edge[500000];
int min(int x,int y)
{
return x<y?x:y;
}
void init()
{
cnt=sum=0;
memset(head,-1,sizeof(head));
memset(gap,0,sizeof(gap));
memset(d,0,sizeof(d));
}
void add(int x,int y,int c)
{
edge[cnt].to=y;
edge[cnt].f=c;
edge[cnt].nxt=head[......
阅读全文