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

为什么会WA呢?高手指点啊,给个测试数据吧

Posted by 00 at 2005-06-30 18:27:11 on Problem 2419
#include<iostream.h>
void main()
{
	int P,T,a,b,i,j;
	cin>>P>>T;
	int pt[101][101];
	for(i=0;i<101;i++)
	{
		for(j=0;j<101;j++)
			pt[i][j]=0;
	}
	while(cin>>a>>b)
	{
		for(i=0;i<P;i++)
		{
			if(i==a-1)
			{
				pt[i][b-1]=1;
				break;
			}
		}
	}
	int r=P;
	for(i=0;i<P;i++)
	{
		for(j=i+1;j<P;j++)
		{
			for(int k=0;k<P;k++)
			{
				if(pt[i][k]!=pt[j][k])
					break;
			}
			if(k==P)
				r--;
		}
	}
	cout<<r<<endl;
}

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