QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#711519#8511. Greek CasinoAngelOlanWA 0ms3948kbC++20402b2024-11-05 11:41:512024-11-05 11:41:53

Judging History

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

  • [2024-11-05 11:41:53]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3948kb
  • [2024-11-05 11:41:51]
  • 提交

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'