QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#622615 | #8242. V-Diagram | ggggggg | WA | 0ms | 3844kb | C++14 | 555b | 2024-10-08 23:19:10 | 2024-10-08 23:19:10 |
Judging History
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'