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

测了N组数据,结果还是没发现错在哪儿..不该啊..

Posted by mayp at 2007-03-03 17:58:01 on Problem 2419
#include<iostream>
using namespace std;
int main()
{
     bool watch[102][102]={{false}};
     int set[102];
     int p,t;
     cin>>p>>t;
     int pp,tt;
     while(cin>>pp>>tt)
     {
         watch[pp][tt]=true;
     }
     int setid=1;
     for(int pe=1;pe<=p;pe++)
     {
         bool flag=true; 
         for(int j=1;j<setid;j++)
         {
              int i=1;
              while(i<=t&&watch[pe][i]==watch[j][i]) i++;
              if(i>t) {flag=false;break;}
         }
         if(flag){set[setid++]=pe;}
     }
     cout<<setid-1<<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