Submission #1210895

#TimeUsernameProblemLanguageResultExecution timeMemory
1210895lucasantunesProsjek (COCI18_prosjek)C++20
50 / 50
0 ms328 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector <float> G; for(int i = 0; i < n; ++i){ int x; cin >> x; G.push_back(x); } sort(G.begin(), G.end()); reverse(G.begin(), G.end()); while(G.size() > 1){ int s = G.size()-1; float middle = G[s] + (G[s-1] - G[s])/2.0; G.pop_back(); G.pop_back(); G.push_back(middle); } cout << G[0] << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...