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 |
mafan daniumen le#include<stdio.h> int xx[10002]; int main() { int n,m,i,j,a,max,dier; while(scanf("%d%d",&n,&m)&&(n||m)){ max=0;dier=0; for(i=0;i<10002;i++)xx[i]=0; for(i=0;i<n;i++)for(j=0;j<m;j++) { scanf("%d",&a);xx[a]++; if(xx[a]>max){dier=max;max=xx[a];} } for(i=0;i<10001;i++)if(xx[i]==dier){printf("%d",i);break;} for(i++;i<10001;i++)if(xx[i]==dier)printf(" %d",i); printf("\n"); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator