| ||||||||||
| 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:巨挫人求这题的500K左右的代码?谢谢呀~~~~^^^^^^^^不到500 呵呵In Reply To:巨挫人求这题的500K左右的代码?谢谢呀~~~~^^^^^^^^ Posted by:coffeeandtea at 2006-12-05 00:20:23 > 如题
#include<stdio.h>
void main()
{
int n,p,m,a[1000]={0},i,k,t,max;
while(1)
{
t=0;
scanf("%d%d",&n,&p);
if(n==0&&p==0)
break;
while(n--)
{
scanf("%d",&m);
while(m--)
{
scanf("%d",&k);
a[k]++;
}
}
for(i=0,max=a[0];i<1000;i++)
if(a[i]>max)
{
max=a[i];
k=i;
}
if(max>=p)
printf("%d\n",k);
else
printf("0\n");
for(i=0;i<1000;i++)
a[i]=0;
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator