結果

問題 No.287 場合の数
ユーザー kou6839kou6839
提出日時 2015-10-16 13:08:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 399 bytes
コンパイル時間 1,852 ms
コンパイル使用メモリ 73,768 KB
実行使用メモリ 41,412 KB
最終ジャッジ日時 2024-04-25 12:34:03
合計ジャッジ時間 5,547 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
40,284 KB
testcase_01 AC 112 ms
41,192 KB
testcase_02 AC 111 ms
41,052 KB
testcase_03 AC 120 ms
40,448 KB
testcase_04 AC 112 ms
40,564 KB
testcase_05 AC 120 ms
41,400 KB
testcase_06 AC 108 ms
39,976 KB
testcase_07 AC 116 ms
40,952 KB
testcase_08 AC 104 ms
40,372 KB
testcase_09 AC 118 ms
41,312 KB
testcase_10 AC 117 ms
40,400 KB
testcase_11 AC 109 ms
40,140 KB
testcase_12 AC 121 ms
41,316 KB
testcase_13 AC 102 ms
40,000 KB
testcase_14 AC 102 ms
40,292 KB
testcase_15 AC 117 ms
41,184 KB
testcase_16 AC 110 ms
40,332 KB
testcase_17 AC 123 ms
41,248 KB
testcase_18 AC 118 ms
41,040 KB
testcase_19 AC 109 ms
40,364 KB
testcase_20 AC 129 ms
41,116 KB
testcase_21 AC 118 ms
41,412 KB
testcase_22 AC 117 ms
41,088 KB
testcase_23 AC 118 ms
41,012 KB
testcase_24 AC 110 ms
40,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int d = sc.nextInt();
		long[][] dp = new long[10][6*d+1];
		dp[0][0] = 1;
		for(int i=0;i<8;i++){
			for(int j=0;j<6*d+1;j++){
				for(int x = 0;x<d+1;x++){
					if(j+x<=6*d){
						dp[i+1][j+x] += dp[i][j];
					}
				}
			}
		}
		System.out.println(dp[8][6*d]);
	}
}
0