結果

問題 No.287 場合の数
ユーザー GrenacheGrenache
提出日時 2015-10-09 22:46:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 545 bytes
コンパイル時間 4,502 ms
コンパイル使用メモリ 72,088 KB
実行使用メモリ 57,480 KB
最終ジャッジ日時 2023-08-07 18:54:37
合計ジャッジ時間 7,611 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
55,844 KB
testcase_01 AC 123 ms
55,552 KB
testcase_02 AC 124 ms
55,600 KB
testcase_03 AC 139 ms
55,900 KB
testcase_04 AC 138 ms
55,524 KB
testcase_05 AC 135 ms
55,768 KB
testcase_06 AC 123 ms
55,832 KB
testcase_07 AC 134 ms
55,680 KB
testcase_08 AC 133 ms
55,748 KB
testcase_09 AC 133 ms
55,516 KB
testcase_10 AC 138 ms
56,068 KB
testcase_11 AC 139 ms
55,720 KB
testcase_12 AC 133 ms
55,328 KB
testcase_13 AC 123 ms
56,048 KB
testcase_14 AC 131 ms
53,764 KB
testcase_15 AC 131 ms
55,668 KB
testcase_16 AC 133 ms
55,856 KB
testcase_17 AC 131 ms
57,480 KB
testcase_18 AC 133 ms
55,996 KB
testcase_19 AC 134 ms
55,812 KB
testcase_20 AC 132 ms
55,520 KB
testcase_21 AC 132 ms
55,716 KB
testcase_22 AC 131 ms
55,648 KB
testcase_23 AC 132 ms
55,348 KB
testcase_24 AC 133 ms
56,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder287 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        long[][] dp = new long[9][6 * n + 1];
        dp[0][0] = 1;
        for (int i = 1; i <= 8; i++) {
        	for (int j = 0; j <= 6 * n; j++) {
        		for (int k = Math.max(0, j - n); k <= j; k++) {
            		dp[i][j] += dp[i - 1][k];
        		}
        	}
        }
        
        System.out.println(dp[8][6 * n]);

        sc.close();
    }
}
0