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呢?HELP!

Posted by novice at 2005-08-14 17:22:58 on Problem 2533
#include<iostream.h>
#include<stdio.h>
int main()
{
	int i,j,n,a[1010];
	double s[1010]={0},max;
	cin>>n;
	for(i=1;i<=n;i++)
		cin>>a[i];
	s[1]=1;max=0;
	for(i=2;i<=n;i++)
		for(j=1;j<i;j++)
			 if(s[j]+1>s[i]&&a[j]<a[i])
				s[i]=s[j]+1;
	for(i=1;i<=n;i++)
		cout<<s[i]<<" "; 
	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