记录编号 |
274255 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[USACO Mar08] 自动统计机 |
最终得分 |
100 |
用户昵称 |
MistyEye |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.002 s |
提交时间 |
2016-06-27 16:41:49 |
内存使用 |
0.32 MiB |
显示代码纯文本
- #include <cstdio>
- #include <iostream>
- #include <cstring>
- #include <algorithm>
- #include <queue>
- using namespace std;
- int read(){
- int x=0, f=1; char ch;
- while(ch<'0'||ch>'9'){
- if(ch=='-')f=-1;
- ch=getchar();
- }
- while(ch>='0'&&ch<='9')
- x =x*10+ch-'0', ch=getchar();
- return x*f;
- }
- const int maxn = 510;
- int N, n[maxn];
-
- int main(){
- freopen("stats.in","r",stdin);
- freopen("stats.out","w",stdout);
- N = read();
- double sum = 0;
- for(int i=1; i<=N; ++i) n[i] = read(), sum += (double)n[i];
- printf("%.6lf\n", sum/N);
- sort(n+1, n+N+1);
- if(N%2==1) printf("%.6lf", (double)n[N/2+1]);
- else printf("%.6lf", (double)(n[N/2]+n[N/2+1])/2.0);
- /// while(1);
- return 0;
- }