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 kenhuang at 2008-05-07 23:43:08 on Problem 2419
#include <iostream>
using namespace std;
int main()
{
    int p,t,m,n,difp,a[103][103]={};     
          //用一个二维数组标示,元素值标示第p个人推测第t棵树倒了
    cin>>p>>t;
    difp=p;
    while(cin>>m>>n){
        a[m-1][n-1]=1;                   
        }
    for(int i=0;i<p;i++)
      for(int j=i+1,k;j<p;j++)
      {
         for(k=0;k<t;k++)
         {
           if(a[i][k]!=a[j][k])  break;  
           else continue;
            }  
           if(k==t)   {i++;difp--;}            
         }    
    cout<<difp<<endl; 
     system("pause");
    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