結果

問題 No.741 AscNumber(Easy)
ユーザー tentententen
提出日時 2021-11-02 15:52:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 210 ms / 2,000 ms
コード長 1,359 bytes
コンパイル時間 2,104 ms
コンパイル使用メモリ 77,456 KB
実行使用メモリ 112,300 KB
最終ジャッジ日時 2024-04-20 01:24:58
合計ジャッジ時間 7,921 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
50,384 KB
testcase_01 AC 48 ms
50,564 KB
testcase_02 AC 47 ms
50,260 KB
testcase_03 AC 46 ms
50,228 KB
testcase_04 AC 47 ms
50,364 KB
testcase_05 AC 46 ms
50,204 KB
testcase_06 AC 46 ms
50,020 KB
testcase_07 AC 47 ms
50,588 KB
testcase_08 AC 46 ms
50,504 KB
testcase_09 AC 47 ms
50,448 KB
testcase_10 AC 46 ms
50,012 KB
testcase_11 AC 48 ms
50,552 KB
testcase_12 AC 47 ms
50,520 KB
testcase_13 AC 46 ms
50,440 KB
testcase_14 AC 47 ms
50,388 KB
testcase_15 AC 50 ms
50,364 KB
testcase_16 AC 51 ms
50,132 KB
testcase_17 AC 46 ms
50,160 KB
testcase_18 AC 47 ms
50,396 KB
testcase_19 AC 47 ms
50,472 KB
testcase_20 AC 47 ms
50,112 KB
testcase_21 AC 51 ms
50,380 KB
testcase_22 AC 49 ms
50,376 KB
testcase_23 AC 48 ms
50,452 KB
testcase_24 AC 47 ms
50,236 KB
testcase_25 AC 46 ms
50,244 KB
testcase_26 AC 46 ms
50,412 KB
testcase_27 AC 49 ms
50,024 KB
testcase_28 AC 49 ms
50,716 KB
testcase_29 AC 50 ms
50,444 KB
testcase_30 AC 46 ms
50,468 KB
testcase_31 AC 49 ms
50,104 KB
testcase_32 AC 47 ms
50,436 KB
testcase_33 AC 47 ms
50,468 KB
testcase_34 AC 49 ms
50,468 KB
testcase_35 AC 200 ms
112,204 KB
testcase_36 AC 112 ms
75,336 KB
testcase_37 AC 151 ms
84,500 KB
testcase_38 AC 147 ms
84,648 KB
testcase_39 AC 111 ms
75,376 KB
testcase_40 AC 151 ms
85,264 KB
testcase_41 AC 199 ms
112,004 KB
testcase_42 AC 117 ms
75,796 KB
testcase_43 AC 116 ms
75,508 KB
testcase_44 AC 163 ms
88,968 KB
testcase_45 AC 162 ms
93,056 KB
testcase_46 AC 194 ms
112,016 KB
testcase_47 AC 78 ms
60,692 KB
testcase_48 AC 196 ms
111,772 KB
testcase_49 AC 165 ms
93,440 KB
testcase_50 AC 75 ms
56,244 KB
testcase_51 AC 111 ms
75,360 KB
testcase_52 AC 210 ms
111,796 KB
testcase_53 AC 210 ms
111,816 KB
testcase_54 AC 206 ms
112,300 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];
        dp[0][0] = 1;
        for (int i = 1; i <= n; i++) {
            int value = 0;
            for (int j = 0; j < 10; j++) {
                value += dp[i - 1][j];
                value %= MOD;
                dp[i][j] = value;
            }
        }
        int ans = 0;
        for (int i = 0; i < 10; i++) {
            ans += dp[n][i];
            ans %= MOD;
        }
        System.out.println(ans);
    }
}
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 String nextLine() throws Exception {
        return br.readLine();
    }
    
    public String next() throws Exception {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0