結果

問題 No.741 AscNumber(Easy)
ユーザー tentententen
提出日時 2022-08-12 09:10:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 240 ms / 2,000 ms
コード長 1,287 bytes
コンパイル時間 2,424 ms
コンパイル使用メモリ 77,716 KB
実行使用メモリ 115,104 KB
最終ジャッジ日時 2023-10-23 19:32:46
合計ジャッジ時間 9,920 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
53,432 KB
testcase_01 AC 54 ms
52,500 KB
testcase_02 AC 54 ms
53,432 KB
testcase_03 AC 53 ms
51,388 KB
testcase_04 AC 53 ms
53,440 KB
testcase_05 AC 53 ms
53,444 KB
testcase_06 AC 53 ms
52,480 KB
testcase_07 AC 54 ms
53,424 KB
testcase_08 AC 54 ms
52,456 KB
testcase_09 AC 54 ms
53,432 KB
testcase_10 AC 54 ms
53,432 KB
testcase_11 AC 55 ms
53,428 KB
testcase_12 AC 53 ms
53,440 KB
testcase_13 AC 54 ms
52,488 KB
testcase_14 AC 54 ms
52,512 KB
testcase_15 AC 54 ms
53,436 KB
testcase_16 AC 54 ms
53,436 KB
testcase_17 AC 54 ms
52,492 KB
testcase_18 AC 55 ms
53,428 KB
testcase_19 AC 53 ms
53,428 KB
testcase_20 AC 54 ms
53,432 KB
testcase_21 AC 54 ms
53,428 KB
testcase_22 AC 54 ms
52,464 KB
testcase_23 AC 54 ms
53,440 KB
testcase_24 AC 54 ms
53,428 KB
testcase_25 AC 53 ms
53,428 KB
testcase_26 AC 53 ms
53,440 KB
testcase_27 AC 53 ms
53,432 KB
testcase_28 AC 57 ms
53,432 KB
testcase_29 AC 54 ms
53,432 KB
testcase_30 AC 54 ms
53,444 KB
testcase_31 AC 53 ms
52,480 KB
testcase_32 AC 53 ms
53,436 KB
testcase_33 AC 54 ms
53,436 KB
testcase_34 AC 54 ms
53,428 KB
testcase_35 AC 240 ms
115,104 KB
testcase_36 AC 134 ms
78,508 KB
testcase_37 AC 174 ms
87,968 KB
testcase_38 AC 174 ms
87,456 KB
testcase_39 AC 133 ms
78,548 KB
testcase_40 AC 186 ms
87,976 KB
testcase_41 AC 230 ms
114,956 KB
testcase_42 AC 136 ms
78,512 KB
testcase_43 AC 129 ms
78,472 KB
testcase_44 AC 192 ms
92,200 KB
testcase_45 AC 193 ms
95,920 KB
testcase_46 AC 232 ms
115,008 KB
testcase_47 AC 95 ms
63,496 KB
testcase_48 AC 233 ms
115,028 KB
testcase_49 AC 208 ms
96,956 KB
testcase_50 AC 86 ms
59,056 KB
testcase_51 AC 131 ms
78,524 KB
testcase_52 AC 238 ms
114,952 KB
testcase_53 AC 238 ms
114,956 KB
testcase_54 AC 239 ms
114,916 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][10];
        for (int i = 0; i < 10; i++) {
            dp[0][i] = i + 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 - 1][9]);
    }
}

class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    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