QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#344394 | #8242. V-Diagram | mendicillin2# | WA | 0ms | 3884kb | C++17 | 792b | 2024-03-04 13:38:51 | 2024-03-04 13:38:52 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
inline int read()
{
int x=0,f=1;
char c=getchar();
while(c<'0' || c>'9')
{
if(c=='-') f=-1;
c=getchar();
}
while(c>='0' && c<='9')
{
x=x*10+c-'0';
c=getchar();
}
return x*f;
}
const int N=3e5+5;
int n;
int a[N];
int main()
{
int T=read();
while(T--)
{
n=read();
for(int i=1;i<=n;i++) a[i]=read();
double minn=1e9+1;
int pos=-1;
for(int i=1;i<=n;i++)
if(a[i]<minn)
minn=a[i], pos=i;
long long s1=0, s2=0, s3=0;
for(int i=pos-1;i<=n;i++) s1+=a[i];
for(int i=1;i<=pos+1;i++) s2+=a[i];
for(int i=1;i<=n;i++) s3+=a[i];
double ans=(double)s1/(n-pos+2);
ans=max(ans,(double)s2/(pos+1));
ans=max(ans,(double)s3/n);
printf("%.20f",ans);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3884kb
input:
2 4 8 2 7 10 6 9 6 5 3 4 8
output:
6.750000000000000000005.83333333333333303727
result:
wrong output format Expected double, but "6.750000000000000000005.83333333333333303727" found