# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
782342 | 2023-07-13T20:21:58 Z | alenter | Prosjek (COCI18_prosjek) | C++14 | 1 ms | 304 KB |
#include<bits/stdc++.h> using namespace std; int main(){ int N; scanf("%d",&N); int v[N]; for(int i=0;i<N;i++){ scanf("%d",&v[i]); } sort(v,v+N); int b; int aux = 1; double ans; if(N<2){ printf("%d",v[0]); }else{ ans = (v[0]+v[1]); ans = ans/2; while(aux<N-1){ b = v[aux+1]; ans = (ans+b)/2; aux++; } printf("%f",ans); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 1 ms | 212 KB | Output is correct |
6 | Correct | 1 ms | 212 KB | Output is correct |
7 | Correct | 1 ms | 304 KB | Output is correct |
8 | Correct | 1 ms | 212 KB | Output is correct |
9 | Correct | 1 ms | 212 KB | Output is correct |
10 | Correct | 1 ms | 212 KB | Output is correct |