Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

请问哪里有问题??是理解错了??帮忙看下!谢谢!!

Posted by zhouyun at 2008-10-03 18:32:47 on Problem 3692
#include<iostream>
using namespace std;
int girl[201],boy[201];
int main()
{
    int g,b,m,x,y,i,p=1,mm,nn;
    while(1){
         cin>>g>>b>>m;
         if(g==0 && b==0 && m==0) break;
         memset(girl,0,sizeof(girl));
         memset(boy,0,sizeof(boy));
         for(i=1;i<=m;i++){
              cin>>x>>y;
              girl[x]++;
              boy[y]++;
         }
         mm=b;nn=g;
         for(i=1;i<=g;i++)
              if(girl[i]==b) mm++;
         for(i=1;i<=b;i++)
              if(boy[i]==g) nn++;
         if(mm>=nn)
           cout<<"Case "<<p++<<": "<<mm<<endl;
         else
           cout<<"Case "<<p++<<": "<<nn<<endl;
    }
    return 0;
} 

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator