Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
初学者,wa在哪儿了?还有什么应该改进的地方吗?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator