結果

問題 No.741 AscNumber(Easy)
ユーザー Daiki OkayamaDaiki Okayama
提出日時 2022-10-30 09:23:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,235 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 531 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 227,616 KB
最終ジャッジ日時 2023-09-21 09:03:52
合計ジャッジ時間 21,976 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,452 KB
testcase_01 AC 73 ms
71,292 KB
testcase_02 AC 73 ms
71,372 KB
testcase_03 AC 73 ms
71,488 KB
testcase_04 AC 75 ms
71,328 KB
testcase_05 AC 74 ms
71,416 KB
testcase_06 AC 73 ms
71,252 KB
testcase_07 AC 74 ms
71,568 KB
testcase_08 AC 73 ms
71,520 KB
testcase_09 AC 74 ms
71,224 KB
testcase_10 AC 72 ms
71,396 KB
testcase_11 AC 76 ms
71,256 KB
testcase_12 AC 75 ms
71,284 KB
testcase_13 AC 75 ms
71,284 KB
testcase_14 AC 76 ms
71,488 KB
testcase_15 AC 74 ms
71,296 KB
testcase_16 AC 73 ms
71,328 KB
testcase_17 AC 75 ms
71,264 KB
testcase_18 AC 81 ms
76,316 KB
testcase_19 AC 76 ms
76,120 KB
testcase_20 AC 84 ms
76,724 KB
testcase_21 AC 85 ms
76,760 KB
testcase_22 AC 88 ms
76,688 KB
testcase_23 AC 86 ms
76,464 KB
testcase_24 AC 83 ms
76,332 KB
testcase_25 AC 84 ms
76,288 KB
testcase_26 AC 86 ms
76,600 KB
testcase_27 AC 84 ms
76,328 KB
testcase_28 AC 84 ms
76,332 KB
testcase_29 AC 84 ms
76,596 KB
testcase_30 AC 84 ms
76,528 KB
testcase_31 AC 84 ms
76,620 KB
testcase_32 AC 83 ms
76,572 KB
testcase_33 AC 86 ms
76,344 KB
testcase_34 AC 87 ms
76,336 KB
testcase_35 AC 1,188 ms
220,448 KB
testcase_36 AC 570 ms
139,740 KB
testcase_37 AC 651 ms
150,836 KB
testcase_38 AC 646 ms
149,748 KB
testcase_39 AC 561 ms
138,268 KB
testcase_40 AC 721 ms
160,556 KB
testcase_41 AC 1,085 ms
207,956 KB
testcase_42 AC 625 ms
146,564 KB
testcase_43 AC 471 ms
127,384 KB
testcase_44 AC 871 ms
179,448 KB
testcase_45 AC 924 ms
187,612 KB
testcase_46 AC 1,117 ms
213,468 KB
testcase_47 AC 263 ms
100,420 KB
testcase_48 AC 1,120 ms
213,608 KB
testcase_49 AC 950 ms
191,120 KB
testcase_50 AC 208 ms
92,876 KB
testcase_51 AC 486 ms
129,888 KB
testcase_52 AC 1,223 ms
227,616 KB
testcase_53 AC 1,224 ms
227,556 KB
testcase_54 AC 1,235 ms
226,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
n = int(input())

# dp[i][j] := i桁目まで確定時,桁の末尾がjのもの
dp = [[0 for _ in range(10)] for _ in range(n + 1)]
dp[0][0] = 1

for i in range(n):
    for j in range(10):
        for x in range(j, 10):
            dp[i+1][x] += dp[i][j]
            dp[i+1][x] %= MOD

print(sum(dp[-1]) % MOD)
0