QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#711523 | #8511. Greek Casino | AngelOlan | WA | 0ms | 3940kb | C++20 | 412b | 2024-11-05 11:42:43 | 2024-11-05 11:42:44 |
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;
}
}
dp[1]++;
printf("%.10lf\n",dp[1]);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3940kb
input:
3 1 1 1
output:
3.5000000000
result:
ok found '3.500000000', expected '3.500000000', error '0.000000000'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3932kb
input:
3 1 1 2
output:
4.5000000000
result:
wrong answer 1st numbers differ - expected: '3.6666667', found: '4.5000000', error = '0.2272727'