Submission #1299715

#TimeUsernameProblemLanguageResultExecution timeMemory
1299715mefe123Prosjek (COCI18_prosjek)C++20
50 / 50
1 ms580 KiB
#include <bits/stdc++.h> #define int long long #define pb push_back #define be begin() #define en end() #define fi first #define se second #define makep make_pair #define nn int n; cin>>n #define mm int m; cin>>m #define kk int k; cin>>k using namespace std; int mod=1e9+7; void ai(vector<int> &v){ for(auto &go : v){ cin>>go; } } void yesno(int k){ if(k==1){ cout<<"Yes"; } else{ cout<<"No"; } } void solve(){ int n; cin>>n; priority_queue<float,vector<float>,greater<float>> pq; for(int i=0;i<n;i++){ float x; cin>>x; pq.push(x); } while(pq.size()>1){ float x=pq.top(); pq.pop(); float y=pq.top(); pq.pop(); float z=float((x+y)/float(2)); pq.push(z); } float cevap=pq.top(); printf("%6f\n",cevap); } signed main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int t=1; //cin>>t; while(t--){ solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...