| ||||||||||
| 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 | |||||||||
快速读入 110ms#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
#define N 250001
int a[N];
int n;
void readln(int &x){
x = 0;
char ch;
do{
ch = getchar();
if (ch != EOF && ch != '\n') x = 10 * x + ch - 48;
}while (ch != EOF && ch != '\n');
}
int main(){
readln(n);
for (int i = 1; i<=n; i++) readln(a[i]);
sort(a + 1,a + n + 1);
if (n & 1){
printf("%d",a[(1 + n) >> 1]);
puts(".0");
}
else{
double t = a[n >> 1]/2.0 + a[(n >> 1) + 1]/2.0;
printf("%.1f\n",t);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator