Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include<iostream>#include<stdio.h>#include<string.h>using namespace std;int M,N,cnt;int head[600],visit[600],match[600];//match初始化也都为-1struct Edge{int to,next;}edge[20050];void addedge(int u,int v){edge[cnt].to=v;edge[cnt].next=head[u];head[u]=cnt++;}bool find(int a){ //找第a个顶点for(int p=head[a];p>0;p=edge[p].next){ //初始化p.next=-1int v=edge[p].to;if(visit[v]==-1){visit[v]=1;if(match[v]==-1||find(match[v])){match[v]=a;return true;}}}return false;}int maxmatch(){ //返回最大匹配数int ans=0;