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

终于在两年之后寻得了答案。即使退役我也瞑目了。

Posted by coffeeandtea at 2008-12-14 20:50:06 on Problem 2028
In Reply To:Re:巨挫人求这题的500K左右的代码?谢谢呀~~~~^^^^^^^^不到500 呵呵 Posted by:wangfengtian at 2008-12-14 19:22: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:
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