Submission #793180

#TimeUsernameProblemLanguageResultExecution timeMemory
793180peijarProsjek (COCI18_prosjek)C++17
50 / 50
1 ms368 KiB
#include <bits/stdc++.h> #define int long long using namespace std; string to_string(string s) { return s; } template <typename T> string to_string(T v) { bool first = true; string res = "["; for (const auto &x : v) { if (!first) res += ", "; first = false; res += to_string(x); } res += "]"; return res; } void dbg_out() { cout << endl; } template <typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cout << ' ' << to_string(H); dbg_out(T...); } #ifdef DEBUG #define dbg(...) cout << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__) #else #define dbg(...) #endif template <class T> using min_pq = priority_queue<T, vector<T>, greater<T>>; signed main(void) { ios_base::sync_with_stdio(false); cin.tie(0); int N; cin >> N; min_pq<double> pq; for (int i = 0; i < N; ++i) { int x; cin >> x; pq.push(x); } while (pq.size() > 1) { double a = pq.top(); pq.pop(); double b = pq.top(); pq.pop(); pq.push((a + b) / 2); } cout << setprecision(15) << fixed << pq.top() << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...