hiho week 174 register

Ended

Participants:302

Verdict:Accepted
Score:100 / 100
Submitted:2017-10-30 09:36:56

Lang:Java

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n,m;
        float[] nums;
        int start,end;
        while(sc.hasNext()){
            n = sc.nextInt();
            m = sc.nextInt();
            nums = new float[n*6+1];
            if(m < n || m > 6*n){
                System.out.println("0.00");
            }
            else{
                for(int i = 0i < (n*6+1); i++){
                    nums[i= 0;
                }
                for(int i = 1i < 7i++){
                    nums[i= ((float)1)/6;
                }
                for(int i = 1i < ni++){
                    start = i+1;
                    end = 6 * start;
                    for(int j = endj >= startj--){
                        nums[j= 0;
                        for(int k = 1k <= 6k++){
                            if(j - k > 0 && j-k >= start-1){
                                nums[j+= nums[j-k] / 6;
                            }
                        }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX