hiho week 174 register

Ended

Participants:302

Verdict:Accepted
Score:100 / 100
Submitted:2017-11-02 13:23:52

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include<cstdio>
double p[601];
int main(){
    int n, m;
    scanf("%d%d", &n, &m);
    for(int i=1; i<7; i++)p[i]=1.0/6;
    for(int i=2; i<=n; i++){
        for(int j=i*6; j>=i-1; j--){
            double s=0.0;
            for(int k=j-1; k>=j-6 && k>=i-1; k--)s+=p[k]; 
            p[j]=s/6;
        }
    }
    printf("%.2f\n", 100*p[m]);
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX