結果
問題 | No.287 場合の数 |
ユーザー |
![]() |
提出日時 | 2015-10-09 22:35:07 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 143 ms / 5,000 ms |
コード長 | 492 bytes |
コンパイル時間 | 3,392 ms |
コンパイル使用メモリ | 73,816 KB |
実行使用メモリ | 41,496 KB |
最終ジャッジ日時 | 2024-11-07 23:54:28 |
合計ジャッジ時間 | 6,882 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
package no287;import java.util.Scanner;public class Main {public static final int N = 8;public static void main(String[] args) {Scanner sc = new Scanner(System.in);int x = sc.nextInt();int y = x * 6;long[] dp = new long[y+1];dp[0] = 1;for(int i=0;i<N;i++) {long[] next = new long[y+1];for(int j=0;j<=y;j++) {for(int k=0;k<=x;k++) {if (j + k <= y) {next[j+k] += dp[j];}}}dp = next;}System.out.println(dp[y]);}}