[Offer收割]编程练习赛96 register

Ended

Participants:98

Verdict:Accepted
Score:100 / 100
Submitted:2019-03-17 12:50:34

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <bits/stdc++.h>
using namespace std;
double dp[2100];
int main(int argc, char const *argv[])
{
    int n;scanf("%d",&n);
    for(int i=2000;i<=2019;i++)dp[i] = 1;
    double ans =0;
    for(int i=1999;i>=1;i--)
    {
        for(int j=i+1;j<=i+100;j++)
        {
            dp[i]+=dp[j]*0.01;
        }
    }
    printf("%.1f\n",dp[n]*100 );
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX