标签:oss source map sign http 输出 double lib href
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 22693 Accepted Submission(s): 9797
1 #include<iostream> 2 #include<cstdio> 3 #include<algorithm> 4 #include<cstring> 5 #include<cstdlib> 6 #include<string.h> 7 #include<set> 8 #include<vector> 9 #include<queue> 10 #include<stack> 11 #include<map> 12 #include<cmath> 13 typedef long long ll; 14 typedef unsigned long long LL; 15 using namespace std; 16 const double PI=acos(-1.0); 17 const double eps=0.0000000001; 18 const int INF=0x3f3f3f3f; 19 const int N=1000+100; 20 int mp[N][N]; 21 int vis1[N],vis2[N]; 22 int fun(int x,int m){ 23 for(int i=1;i<=m;i++){ 24 if(mp[x][i]&&vis1[i]==0){ 25 vis1[i]=1; 26 if(vis2[i]==0||fun(vis2[i],m)){ 27 vis2[i]=x; 28 return 1; 29 } 30 } 31 } 32 return 0; 33 } 34 int main(){ 35 int k,m,n; 36 while(scanf("%d",&k)!=EOF){ 37 if(k==0)break; 38 scanf("%d%d",&n,&m); 39 memset(mp,0,sizeof(mp)); 40 memset(vis2,0,sizeof(vis2)); 41 for(int i=1;i<=k;i++){ 42 int x,y; 43 scanf("%d%d",&x,&y); 44 mp[x][y]=1; 45 } 46 int ans=0; 47 for(int i=1;i<=n;i++){ 48 memset(vis1,0,sizeof(vis1)); 49 if(fun(i,m))ans++; 50 } 51 cout<<ans<<endl; 52 } 53 }
标签:oss source map sign http 输出 double lib href
原文地址:http://www.cnblogs.com/Aa1039510121/p/7219721.html