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

无语了,,这题都WA,,先B4自己,,再大声喊,,HELP.....喊错了,,B4 again

Posted by Essence_me at 2005-08-25 12:55:19 on Problem 2533
#include <stdio.h>
#include <memory.h>
void main()
{
	long i,j,n,num[1001],step[1001],max;
	scanf("%ld",&n);
	memset(step,0,sizeof(int)*1001);
	num[0]=-1;
	for(i=1;i<=n;i++)
	{
		scanf("%ld",&num[i]);
	}
	for(i=1;i<=n;i++)
		for(j=0;j<i;j++)
		{
			if(num[j]<num[i]&&step[j]+1>step[i])step[i]=step[j]+1;
		}
	max=0;
	for(i=1;i<=n;i++)
	{
		if(max<step[i])max=step[i];
	}
	if(max==1)printf("0\n");
	else 
	printf("%ld\n",max);
}

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