Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
28468 | baka24 | 【BJ】T1 | C++ | 运行超时 | 11 | 2000 MS | 8088 KB | 589 | 2024-04-14 18:36:42 |
#include<bits/stdc++.h> #define int long long #define doub long double using namespace std; const int maxn=1e6+7; int n; int a[maxn]; int tmp[maxn]; signed main(){ cin>>n; for(int i=1;i<=n;i++)cin>>a[i]; doub ans=0; for(int l=n;l>=1;l--){ for(int r=l;r<=n;r++){ tmp[r]=a[r]; int t=r; while(tmp[t-1]>tmp[t])swap(tmp[t-1],tmp[t]),t--; doub f=0; for(int i=l;i<=r;i++){ f=(f+tmp[i])/2; } ans+=f; } } cout<<ans*1.0/(n*n)<<endl; }