# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
253212 | 2020-07-27T12:20:04 Z | nandonathaniel | Prosjek (COCI18_prosjek) | C++14 | 0 ms | 256 KB |
#include<bits/stdc++.h> using namespace std; double a[25]; int main(){ int n; double ans; scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%lf",&a[i]); } sort(a+1,a+n+1); ans=(a[1]+a[2])/2.0; for(int i=3;i<=n;i++){ ans=(ans+a[i])/2.0; } printf("%.6lf\n",ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 0 ms | 256 KB | Output is correct |
4 | Correct | 0 ms | 256 KB | Output is correct |
5 | Correct | 0 ms | 256 KB | Output is correct |
6 | Correct | 0 ms | 256 KB | Output is correct |
7 | Correct | 0 ms | 256 KB | Output is correct |
8 | Correct | 0 ms | 256 KB | Output is correct |
9 | Correct | 0 ms | 256 KB | Output is correct |
10 | Correct | 0 ms | 256 KB | Output is correct |