| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
2338#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator