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 wtthappy at 2007-07-19 11:57:10 on Problem 2419
#include <stdio.h>
int main()
{
	int array[100][100]={0};
	int P,T;
	int p,t;
	int i,j;
	int flag =0;
	scanf("%d%d",&P,&T);
	while ( scanf("%d%d",&p,&t)!=EOF )
	{
		array[p-1][t-1] = 1;
	}

	for ( i=0; i<P;++i )
		for ( j=i+1; j<P ;++j )
		{
			for ( t=0;t<T;++t )
				if ( array[i][t] != array[j][t] )
					break;
			if(t==T)	
				++flag;
		}
	
	printf("%d",(P-flag));
	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