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 |
483B优化不动了 求大牛优化# include<stdio.h> int n,q,m,a,f[999],s; int main() { while (scanf("%d%d",&n,&q),n!=0) { for (s=800;s>0;s--) f[s]=0; while (n--) { scanf("%d",&m); while (m--) { scanf("%d",&a); f[a]++; } } for (m=0;m<800;m++) if (f[m]>=q&&f[m]>f[s]) s=m; printf("%d\n",s); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator