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 dengwenbing2012 at 2011-07-22 16:46:33 on Problem 1323
#include <stdio.h>
int main()
{
	int m,n,a[1000];
	int num,i,j,k,z,b[1000];
	int max,flag;
	int count=0;
 
	while(scanf("%d%d",&m,&n)&&(m&&n))
	{
		num=0;
		z=0;
		
		for(i=0;i<n;i++)
		{
			scanf("%d",&a[i]);		
		}
		for(j=n*m;j>0;j--)
		{	
			flag=0;
			for(k=0;k<n;k++)
			{
				if(j==a[k])
				{
					num++;
					b[z]=num;
					z++;
					flag=1;
		
				}				
			}
			if(flag==0)
			{
				num--;
				b[z]=num;
				z++;
			}
		}

		max=b[0];
		for(k=0;k<n;k++)
		{
			if(max<b[k])
				max=b[k];
		}
		
		printf("Case %d: %d\n",++count,max);
	}
	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