# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1210895 | lucasantunes | Prosjek (COCI18_prosjek) | C++20 | 0 ms | 328 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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |