結果
問題 | No.287 場合の数 |
ユーザー |
![]() |
提出日時 | 2015-10-16 13:08:59 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 152 ms / 5,000 ms |
コード長 | 399 bytes |
コンパイル時間 | 2,224 ms |
コンパイル使用メモリ | 73,876 KB |
実行使用メモリ | 41,444 KB |
最終ジャッジ日時 | 2024-11-08 00:01:21 |
合計ジャッジ時間 | 6,724 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
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]); } }