邻接矩阵超时,只能用邻接表,注意范围
#include<stdio.h>
#include<string.h>
const int nv=1001;
const int ne=10001;
struct maxmatch{
int n,size;
int head[nv];
int mark[nv];
int aug[nv];
struct edge
{
int v,w,next;
edge(){}
edge(int v,int next,int w):v(v),next(next),w(w){}
}e[ne];
inline void init(int nx)
{
n=nx;size=0;
for(int i=1;i<=n;i++)
head[i]=-1;
}
inline void insert(int u,int v,int w=0)
{
e[size]=edge(v,head[u],w);
head[u]=size++;
}
inl......
阅读全文