제출 #83314

#제출 시각아이디문제언어결과실행 시간메모리
83314josiftepeProsjek (COCI18_prosjek)C++14
50 / 50
2 ms640 KiB
#include <iostream>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <iomanip>
#include <fstream>
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = (1 << 30);
const ll inf = (1LL << 60LL);
const int maxn = 1e5 + 10;
int n;
int arr[maxn];
int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    cin >> n;
    for(int i =0 ; i < n; i ++){
        cin >> arr[i];
    }
    sort(arr, arr + n);
    if(n == 1){
        cout << arr[0] << endl;
        return 0;
    }
    double ret = ((double)arr[0] + (double)arr[1]) / (double)2;
    for(int i = 2; i < n; i ++){
        ret += (double)arr[i];
        ret /= (double)2;
    }
    printf("%.6f\n", ret);
        return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...