Submission #410673

#TimeUsernameProblemLanguageResultExecution timeMemory
410673snasibov05Prosjek (COCI18_prosjek)C++14
50 / 50
1 ms300 KiB
#include <iostream> #include <vector> #include <set> using namespace std; int main() { int n; cin >> n; multiset<double> st; for (int i = 0; i < n; ++i){ int x; cin >> x; st.insert(x*1.0); } while (st.size() > 1){ auto it1 = st.begin(); auto it2 = ++st.begin(); double k = (*it1 + *it2) / 2.0; st.erase(it1); st.erase(it2); st.insert(k); } double ans = *st.begin(); cout.precision(6); cout << fixed << ans << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...