QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#711523#8511. Greek CasinoAngelOlanWA 0ms3940kbC++20412b2024-11-05 11:42:432024-11-05 11:42:44

Judging History

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

  • [2024-11-05 11:42:44]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3940kb
  • [2024-11-05 11:42:43]
  • 提交

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'