#include #include #include #include #include using namespace std; struct node{ int s,t,nxt ; }e[2500005] ; int m,n,head[5005],cnt,match[5005],vis[5005] ; int find(int s) { for(int i=head[s] ;i!=-1 ;i=e[i].nxt) { int tt=e[i].t ; if(!vis[tt]) { vis[tt]=1 ; if(match[tt]==-1 || find(match[tt])) { match[tt]=s ; return 1 ; } } } return 0 ; } int cr,cc; int max_match() { int ans=0 ; memset(match,-1,sizeof(match)) ; for(int i=1 ;i