题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1845
#include
#include
#include
#include
#include
#define MAXN 5001
using namespace std;
int nx,ny,distx[MAXN],disty[MAXN];
int visited[MAXN],mx[MAXN],my[MAXN];
vector graphics[MAXN];
queue Q;
int Scan()
{
char ch;
int ret=0;
while((ch=getchar())<'0'||ch>'9');
while(ch>='0'&&ch<='9')
{
ret=ret*10+(ch-'0');
ch=getchar();
}
return ret;
}
int find(int u)
{//寻找增广路
int i,temp;
for(i=0;i>1)*3;
for(int i=0;i<=n;++i)
graphics[i].clear();
while(N--)
{
//scanf("%d %d",&u,&v);
u=Scan();
v=Scan();
graphics[u].push_back(v); //用邻接表
graphics[v].push_back(u); //建双向图
}
nx=ny=n;
sum=matching();
printf("%d\n",sum/2);
}
return 0;
}
#include
int main()
{
int t,n,i,x,y;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
for(i=0;i