标签:ref scanf 地址 mod set div ack acm ==
题目地址:http://acm.hdu.edu.cn/showproblem.php?
pid=2063
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; int n,m,k; int link[505][505]; int used[505]; int boy[505]; int find(int x){ int i; for(i=1;i<=n;i++){ if(link[x][i]&&!used[i]){ used[i]=1; if(boy[i]==0||find(boy[i])){ boy[i]=x; return true; } } } return false; } int main() { int i,g,b,all; while(scanf("%d",&k)&&k) { memset(link,0,sizeof(link)); memset(boy,0,sizeof(boy)); all=0; scanf("%d%d",&m,&n); for(i=0; i<k; i++) { scanf("%d%d",&g,&b); link[g][b]=1; } for(i=1;i<=m;i++){ memset(used,0,sizeof(used)); all+=find(i); } printf("%d\n",all); } return 0; }
标签:ref scanf 地址 mod set div ack acm ==
原文地址:http://www.cnblogs.com/jzdwajue/p/7198629.html