# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
959031 | 2024-04-07T11:53:23 Z | MilosMilutinovic | Prosjek (COCI18_prosjek) | C++14 | 1 ms | 600 KB |
#include<bits/stdc++.h> #define pb push_back #define fi first #define se second #define mp make_pair using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef long double ld; template <typename T> bool chkmin(T &x,T y){return x>y?x=y,1:0;} template <typename T> bool chkmax(T &x,T y){return x<y?x=y,1:0;} ll readint(){ ll x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } int n; int main(){ n=readint(); vector<ld> vec; for(int i=1;i<=n;i++){ int x=readint(); vec.pb(x); } while(vec.size()>1){ sort(vec.rbegin(),vec.rend()); ld x=vec[vec.size()-1],y=vec[vec.size()-2]; vec.pop_back(); vec.pop_back(); vec.pb((x+y)/2.00); } printf("%.6lf\n",vec[0]); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 428 KB | Output isn't correct |
2 | Incorrect | 1 ms | 348 KB | Output isn't correct |
3 | Incorrect | 0 ms | 348 KB | Output isn't correct |
4 | Incorrect | 1 ms | 348 KB | Output isn't correct |
5 | Incorrect | 1 ms | 348 KB | Output isn't correct |
6 | Incorrect | 0 ms | 432 KB | Output isn't correct |
7 | Incorrect | 0 ms | 348 KB | Output isn't correct |
8 | Incorrect | 1 ms | 348 KB | Output isn't correct |
9 | Incorrect | 1 ms | 348 KB | Output isn't correct |
10 | Incorrect | 0 ms | 600 KB | Output isn't correct |