QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#622615#8242. V-DiagramgggggggWA 0ms3844kbC++14555b2024-10-08 23:19:102024-10-08 23:19:10

Judging History

你现在查看的是最新测评结果

  • [2024-10-08 23:19:10]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3844kb
  • [2024-10-08 23:19:10]
  • 提交

answer

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define ll long long
using namespace std;
const int N=300005;
int n,a[N];
void solve(){
    scanf("%d",&n);
    rep(i,1,n) scanf("%d",&a[i]);
    ll s1=0,s2=0;
    int p=min_element(a+1,a+n+1)-a;
    rep(i,1,p) s1+=a[i];
    rep(i,p,n) s2+=a[i];
    double as=max(1.0*s1/p,1.0*s2/(n-p+1));
    as=max(as,1.0*(s1+s2-a[p])/n);
    printf("%lf\n",as);
}
int main(){
    int T;
    scanf("%d",&T);
    while(T--) solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3844kb

input:

2
4
8 2 7 10
6
9 6 5 3 4 8

output:

6.750000
5.833333

result:

wrong answer 2nd numbers differ - expected: '5.8333333', found: '5.8333330', error = '0.0000001'