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

483B优化不动了 求大牛优化

Posted by Sayakiss at 2010-06-26 16:37:26 on Problem 2028
# 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:
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