# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
86836 | jovitre | Prosjek (COCI18_prosjek) | C++14 | 2 ms | 672 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define MAXN 25
#define MAXSZ 2050
#define INF 999999999
#define pb push_back
typedef long long ll;
typedef pair <int, int> pii;
typedef vector <ll> vi;
int in[MAXN];
int main(){
int n;
scanf("%d", &n);
for(int i = 1; i <= n; i++) scanf("%d", in + i);
sort(in + 1, in + n + 1);
if(n == 1) printf("%d\n", in[1]);
else {
double atual = (double)(in[1] + in[2]) / 2.00;
for(int i = 3; i <= n; i++) atual = (double)(atual + in[i]) / 2.00;
printf("%lf\n", atual);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |