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 huzuosheng at 2007-07-31 01:48:07 on Problem 2092
#include <stdio.h>
#include <string.h>

int flag[10001];

int main()
{
	int n,m,max;
	int i,j,x;
	while(scanf("%d%d",&n,&m)!=EOF&&n)
	{
		memset(flag,0,sizeof(flag));
		max=0;
		for(i=0;i<n;i++)
			for(j=0;j<m;j++)
			{
				scanf("%d",&x);
				flag[x]++;
				if(max<flag[x])    max=flag[x];
			}
		for(i=1;i<10001;i++)
			if(flag[i]==max-1)
				printf("%d ",i);
		printf("\n");
	}
	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