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

2338

Posted by superrx at 2006-07-11 15:45:37
#include<stdio.h>
int main()
{
	int i,j,n,temp;
	long int a[10001];
	while(scanf("%d\n",&n))
	{
		for(i=0;i<=n-1;i++)
		{
			scanf("%ld/n",&a[i]);
		}
		for(i=0;i<=n-2;i++)
		{
			for(j=i+1;j<=n-1;j++)
			{
				if(a[i]>a[j])
				{
					temp=a[i];a[i]=a[j];a[j]=temp;
				}
			}
		}
		printf("%d",a[n/2]);
	}
	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