結果

問題 No.741 AscNumber(Easy)
ユーザー soisusoisu
提出日時 2022-03-20 15:07:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,480 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 255 ms
コンパイル使用メモリ 82,448 KB
実行使用メモリ 226,448 KB
最終ジャッジ日時 2024-04-16 07:57:31
合計ジャッジ時間 22,386 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,564 KB
testcase_01 AC 43 ms
53,808 KB
testcase_02 AC 42 ms
52,252 KB
testcase_03 AC 40 ms
52,404 KB
testcase_04 AC 40 ms
52,628 KB
testcase_05 AC 39 ms
53,088 KB
testcase_06 AC 39 ms
52,944 KB
testcase_07 AC 40 ms
52,256 KB
testcase_08 AC 40 ms
53,388 KB
testcase_09 AC 40 ms
52,364 KB
testcase_10 AC 40 ms
53,944 KB
testcase_11 AC 43 ms
58,776 KB
testcase_12 AC 44 ms
59,876 KB
testcase_13 AC 44 ms
58,716 KB
testcase_14 AC 43 ms
59,368 KB
testcase_15 AC 43 ms
58,596 KB
testcase_16 AC 44 ms
59,916 KB
testcase_17 AC 45 ms
59,688 KB
testcase_18 AC 45 ms
59,500 KB
testcase_19 AC 44 ms
59,764 KB
testcase_20 AC 54 ms
64,916 KB
testcase_21 AC 52 ms
62,332 KB
testcase_22 AC 57 ms
65,216 KB
testcase_23 AC 55 ms
65,412 KB
testcase_24 AC 50 ms
62,288 KB
testcase_25 AC 53 ms
63,484 KB
testcase_26 AC 56 ms
65,640 KB
testcase_27 AC 51 ms
63,248 KB
testcase_28 AC 51 ms
62,952 KB
testcase_29 AC 52 ms
63,776 KB
testcase_30 AC 55 ms
65,860 KB
testcase_31 AC 55 ms
65,528 KB
testcase_32 AC 47 ms
61,200 KB
testcase_33 AC 54 ms
64,436 KB
testcase_34 AC 57 ms
66,316 KB
testcase_35 AC 1,403 ms
219,360 KB
testcase_36 AC 657 ms
138,672 KB
testcase_37 AC 757 ms
149,956 KB
testcase_38 AC 751 ms
148,528 KB
testcase_39 AC 640 ms
137,900 KB
testcase_40 AC 849 ms
159,148 KB
testcase_41 AC 1,293 ms
206,668 KB
testcase_42 AC 727 ms
145,840 KB
testcase_43 AC 543 ms
126,396 KB
testcase_44 AC 1,038 ms
178,360 KB
testcase_45 AC 1,098 ms
186,800 KB
testcase_46 AC 1,340 ms
212,460 KB
testcase_47 AC 283 ms
99,036 KB
testcase_48 AC 1,361 ms
212,868 KB
testcase_49 AC 1,129 ms
190,176 KB
testcase_50 AC 213 ms
91,556 KB
testcase_51 AC 555 ms
129,036 KB
testcase_52 AC 1,480 ms
226,448 KB
testcase_53 AC 1,479 ms
226,220 KB
testcase_54 AC 1,455 ms
225,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
dp=[[0 for j in range(10)] for i in range(N+1)]
dp[0][0]=1
mod=10**9+7

for i in range(N):
    for j in range(10):
        for d in range(1,10):
            if j<=d:
                dp[i+1][d]+=dp[i][j]
                dp[i+1][d]%=mod

ans=1
for i in range(1,N+1):
    ans+=sum(dp[i])
    ans%=mod
print(ans)
0