結果

問題 No.741 AscNumber(Easy)
ユーザー tentententen
提出日時 2020-11-19 08:37:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 328 ms / 2,000 ms
コード長 609 bytes
コンパイル時間 3,961 ms
コンパイル使用メモリ 71,232 KB
実行使用メモリ 120,816 KB
最終ジャッジ日時 2023-09-30 15:44:27
合計ジャッジ時間 16,504 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,928 KB
testcase_01 AC 129 ms
55,512 KB
testcase_02 AC 129 ms
55,748 KB
testcase_03 AC 128 ms
55,512 KB
testcase_04 AC 130 ms
55,816 KB
testcase_05 AC 127 ms
55,900 KB
testcase_06 AC 127 ms
55,712 KB
testcase_07 AC 128 ms
55,680 KB
testcase_08 AC 127 ms
55,724 KB
testcase_09 AC 128 ms
58,024 KB
testcase_10 AC 128 ms
55,820 KB
testcase_11 AC 128 ms
55,816 KB
testcase_12 AC 128 ms
55,716 KB
testcase_13 AC 127 ms
56,068 KB
testcase_14 AC 126 ms
55,516 KB
testcase_15 AC 129 ms
55,928 KB
testcase_16 AC 129 ms
55,520 KB
testcase_17 AC 136 ms
55,864 KB
testcase_18 AC 129 ms
55,440 KB
testcase_19 AC 129 ms
55,956 KB
testcase_20 AC 130 ms
56,044 KB
testcase_21 AC 130 ms
55,424 KB
testcase_22 AC 132 ms
55,520 KB
testcase_23 AC 128 ms
55,664 KB
testcase_24 AC 127 ms
55,780 KB
testcase_25 AC 128 ms
55,648 KB
testcase_26 AC 131 ms
55,780 KB
testcase_27 AC 129 ms
55,648 KB
testcase_28 AC 130 ms
56,244 KB
testcase_29 AC 127 ms
55,660 KB
testcase_30 AC 128 ms
55,672 KB
testcase_31 AC 125 ms
55,572 KB
testcase_32 AC 127 ms
55,720 KB
testcase_33 AC 128 ms
56,032 KB
testcase_34 AC 129 ms
55,760 KB
testcase_35 AC 328 ms
120,324 KB
testcase_36 AC 215 ms
80,080 KB
testcase_37 AC 258 ms
87,384 KB
testcase_38 AC 259 ms
87,784 KB
testcase_39 AC 213 ms
79,696 KB
testcase_40 AC 261 ms
87,384 KB
testcase_41 AC 321 ms
120,548 KB
testcase_42 AC 253 ms
87,028 KB
testcase_43 AC 207 ms
79,496 KB
testcase_44 AC 271 ms
94,228 KB
testcase_45 AC 289 ms
97,892 KB
testcase_46 AC 325 ms
120,816 KB
testcase_47 AC 165 ms
64,356 KB
testcase_48 AC 326 ms
120,556 KB
testcase_49 AC 288 ms
97,488 KB
testcase_50 AC 152 ms
59,940 KB
testcase_51 AC 207 ms
79,816 KB
testcase_52 AC 323 ms
115,240 KB
testcase_53 AC 323 ms
114,944 KB
testcase_54 AC 323 ms
114,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    static final int MOD = 1000000007;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] dp = new int[n + 1][10];
        Arrays.fill(dp[0], 1);
        for (int i = 1; i <= n; i++) {
            for (int j = 0; j < 10; j++) {
                if (j  > 0) {
                    dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % MOD;
                } else {
                    dp[i][j] = dp[i - 1][j];
                }
            }
        }
        System.out.println(dp[n][9]);
    }
}
0