結果

問題 No.741 AscNumber(Easy)
ユーザー tentententen
提出日時 2022-10-19 10:27:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 235 ms / 2,000 ms
コード長 1,289 bytes
コンパイル時間 2,092 ms
コンパイル使用メモリ 74,856 KB
実行使用メモリ 114,356 KB
最終ジャッジ日時 2023-09-12 00:41:05
合計ジャッジ時間 9,766 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,468 KB
testcase_01 AC 43 ms
49,408 KB
testcase_02 AC 43 ms
49,748 KB
testcase_03 AC 45 ms
49,520 KB
testcase_04 AC 43 ms
50,076 KB
testcase_05 AC 43 ms
49,492 KB
testcase_06 AC 43 ms
49,616 KB
testcase_07 AC 44 ms
49,784 KB
testcase_08 AC 41 ms
50,052 KB
testcase_09 AC 43 ms
49,408 KB
testcase_10 AC 43 ms
49,320 KB
testcase_11 AC 42 ms
49,308 KB
testcase_12 AC 42 ms
49,312 KB
testcase_13 AC 42 ms
49,408 KB
testcase_14 AC 44 ms
49,412 KB
testcase_15 AC 44 ms
49,516 KB
testcase_16 AC 42 ms
49,352 KB
testcase_17 AC 43 ms
49,776 KB
testcase_18 AC 43 ms
49,452 KB
testcase_19 AC 43 ms
49,376 KB
testcase_20 AC 43 ms
49,368 KB
testcase_21 AC 44 ms
47,516 KB
testcase_22 AC 44 ms
49,528 KB
testcase_23 AC 43 ms
47,768 KB
testcase_24 AC 44 ms
49,420 KB
testcase_25 AC 43 ms
49,376 KB
testcase_26 AC 44 ms
49,368 KB
testcase_27 AC 43 ms
49,420 KB
testcase_28 AC 43 ms
49,504 KB
testcase_29 AC 43 ms
49,372 KB
testcase_30 AC 42 ms
49,492 KB
testcase_31 AC 43 ms
47,444 KB
testcase_32 AC 44 ms
49,536 KB
testcase_33 AC 43 ms
49,696 KB
testcase_34 AC 43 ms
49,608 KB
testcase_35 AC 235 ms
112,668 KB
testcase_36 AC 128 ms
75,832 KB
testcase_37 AC 170 ms
84,904 KB
testcase_38 AC 169 ms
84,696 KB
testcase_39 AC 128 ms
76,308 KB
testcase_40 AC 181 ms
84,788 KB
testcase_41 AC 225 ms
113,996 KB
testcase_42 AC 167 ms
82,844 KB
testcase_43 AC 122 ms
76,120 KB
testcase_44 AC 186 ms
89,224 KB
testcase_45 AC 191 ms
93,228 KB
testcase_46 AC 230 ms
112,712 KB
testcase_47 AC 83 ms
60,416 KB
testcase_48 AC 228 ms
112,716 KB
testcase_49 AC 214 ms
114,356 KB
testcase_50 AC 76 ms
56,008 KB
testcase_51 AC 124 ms
75,868 KB
testcase_52 AC 234 ms
112,468 KB
testcase_53 AC 235 ms
112,876 KB
testcase_54 AC 234 ms
113,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

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

}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    
}
0