QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#711519 | #8511. Greek Casino | AngelOlan | WA | 0ms | 3948kb | C++20 | 402b | 2024-11-05 11:41:51 | 2024-11-05 11:41:53 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int a[105];
double dp[105];
int main()
{
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&a[i]);
dp[n]=a[n];
for(int i=n-1;i>=1;i--)
{
int num=min(6,n-i);
dp[i]=a[i];
for(int j=i+1;j<=i+6;j++)
{
dp[i]+=dp[j]/num;
}
}
printf("%.10lf\n",dp[1]);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3948kb
input:
3 1 1 1
output:
2.5000000000
result:
wrong answer 1st numbers differ - expected: '3.5000000', found: '2.5000000', error = '0.2857143'