Submission #375513

#TimeUsernameProblemLanguageResultExecution timeMemory
375513marat0210Prosjek (COCI18_prosjek)C++14
50 / 50
1 ms512 KiB
#include <bits/stdc++.h> using namespace std; int main() { long double n; cin >>n; vector <long double> a(n); for (int i = 0; i < n; ++i) { cin >>a[i]; } sort(a.begin(), a.end()); vector <long double> av(20); av[0] = (a[0] + a[1]) / 2; for (int i = 1; i < n - 1; ++i) { long double cur = (a[i + 1] + av[i - 1]) / 2; av[i] = cur; } cout <<fixed<<setprecision(7)<<av[n - 2]<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...