結果

問題 No.741 AscNumber(Easy)
ユーザー nebukuro09nebukuro09
提出日時 2018-10-05 21:29:11
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 331 ms / 2,000 ms
コード長 584 bytes
コンパイル時間 653 ms
コンパイル使用メモリ 99,532 KB
実行使用メモリ 118,584 KB
最終ジャッジ日時 2023-09-03 21:09:37
合計ジャッジ時間 6,806 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 1 ms
4,380 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 1 ms
4,380 KB
testcase_35 AC 311 ms
112,496 KB
testcase_36 AC 134 ms
50,952 KB
testcase_37 AC 157 ms
59,460 KB
testcase_38 AC 155 ms
58,108 KB
testcase_39 AC 132 ms
50,692 KB
testcase_40 AC 188 ms
68,072 KB
testcase_41 AC 284 ms
103,020 KB
testcase_42 AC 148 ms
57,556 KB
testcase_43 AC 109 ms
41,016 KB
testcase_44 AC 227 ms
81,540 KB
testcase_45 AC 242 ms
87,324 KB
testcase_46 AC 297 ms
107,992 KB
testcase_47 AC 49 ms
21,220 KB
testcase_48 AC 298 ms
107,456 KB
testcase_49 AC 252 ms
91,264 KB
testcase_50 AC 35 ms
16,936 KB
testcase_51 AC 114 ms
44,024 KB
testcase_52 AC 328 ms
118,584 KB
testcase_53 AC 331 ms
118,208 KB
testcase_54 AC 321 ms
116,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

immutable long MOD = 10^^9 + 7;

void main() {
    auto L = readln.chomp.to!int;
    auto dp = new long[][](L+1, 10);
    dp[0][0] = 1;

    foreach (i; 0..L) {
        foreach (j; 0..10) {
            foreach (k; j..10) {
                (dp[i+1][k] += dp[i][j]) %= MOD;
            }
        }
    }

    long ans = 0;
    foreach (i; 0..10) (ans += dp[L][i]) %= MOD;

    ans.writeln;
}
0