/*匈牙利算法DFS版*/
const int MAXN=300; //最大顶点数
bool bmap[MAXN][MAXN]; //二分图
bool bmask[MAXN]; //寻找增广路径时的标志数组
int nx,ny; //nx为左集合的顶点数目,ny为右集合的顶点数目。
int cx[MAXN], cy[MAXN]; //cx[i]表示左集合i顶点所匹配到的右集合的顶点序号,cy[i]同理。
//寻找增广路径
int findPath(int u){
rep(i,1,ny){
if(bmap[u][i]&&!bmask[i]){
bmask[i]=true;
if(cy[i]==-1||findPath(cy[i])){
cy[i]=u;
cx[u]=i;
return 1;
}
}
}
return 0;
}
//求最大匹配
int MaxMatch(){
int ans = 0;
rep(i,1,n) cx[i]=cy[i ]=-1;
rep(i,1,n) if(cx[i]==-1){
mem(bmask,false);
ans += findPath(i);
}
return ans;
}
int main(){
/*
根据题意构图..
*/
return 0;
}