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 |
Re:次大值不见的是max-1In Reply To:好像很简单啊 没疑问啊 怎么wa呢? Posted by:huzuosheng at 2007-07-31 01:48:07 > #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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator