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

Re:371b贴代码报复社会

Posted by shine4u at 2012-07-31 22:37:15 on Problem 2028
In Reply To:Re:371b贴代码报复社会 Posted by:jndx20111221395 at 2012-04-07 15:42:10
> #include<stdio.h>
> int main()
> {
> 	int n,q,num,d,i,j;
> 	while(scanf("%d%d",&n,&q),n!=0)
> 	{
> 		int a[100]={0},m=0,s=0;
> 		for(i=0;i<n;i++)
> 		{
> 			scanf("%d",&num);
> 			if(num==0)continue;
> 			for(j=0;j<num;j++)
> 			{
> 				scanf("%d",&d);
> 				a[d-1]++;
> 			}	
> 		}
> 		for(i=0;i<100;i++)
> 			if(a[i]>m)
> 				m=a[i],s=i+1;
> 		printf("%d\n",m>=q?s:0);	
> 	}
> 	return 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