[模板]二分图:匈牙利/增广路算法
1 int find(int k){ 2 for(int i=1;i<=n;i++)if(x[k][i]&&!al[i]){ 3 al[i]=1; 4 if(bj[i]==0||find(bj[i])){ 5 bj[i]=k;return 1; 6 } 7 } 8 return 0; 9 } 10 //in main 11 for(int i=1;i<=n;i++){ 12 memset(al,0,sizeof(al)); 13 if(find(i))ans++; 14 }
$Fate \ is \ Fake$