結果

問題 No.741 AscNumber(Easy)
ユーザー lllllll88938494lllllll88938494
提出日時 2022-10-07 22:42:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 478 ms / 2,000 ms
コード長 288 bytes
コンパイル時間 1,015 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 227,772 KB
最終ジャッジ日時 2023-09-03 14:14:00
合計ジャッジ時間 12,239 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,096 KB
testcase_01 AC 71 ms
71,080 KB
testcase_02 AC 71 ms
71,044 KB
testcase_03 AC 70 ms
71,128 KB
testcase_04 AC 71 ms
71,096 KB
testcase_05 AC 73 ms
71,096 KB
testcase_06 AC 73 ms
71,204 KB
testcase_07 AC 69 ms
71,120 KB
testcase_08 AC 70 ms
71,204 KB
testcase_09 AC 70 ms
71,072 KB
testcase_10 AC 71 ms
71,016 KB
testcase_11 AC 71 ms
71,016 KB
testcase_12 AC 70 ms
70,980 KB
testcase_13 AC 70 ms
71,124 KB
testcase_14 AC 71 ms
70,832 KB
testcase_15 AC 71 ms
71,096 KB
testcase_16 AC 71 ms
71,288 KB
testcase_17 AC 71 ms
70,928 KB
testcase_18 AC 71 ms
71,160 KB
testcase_19 AC 70 ms
70,840 KB
testcase_20 AC 76 ms
76,252 KB
testcase_21 AC 76 ms
75,840 KB
testcase_22 AC 78 ms
76,312 KB
testcase_23 AC 78 ms
76,248 KB
testcase_24 AC 75 ms
75,632 KB
testcase_25 AC 76 ms
75,992 KB
testcase_26 AC 79 ms
76,252 KB
testcase_27 AC 77 ms
75,636 KB
testcase_28 AC 77 ms
75,800 KB
testcase_29 AC 77 ms
75,940 KB
testcase_30 AC 80 ms
76,344 KB
testcase_31 AC 79 ms
76,112 KB
testcase_32 AC 73 ms
71,160 KB
testcase_33 AC 77 ms
76,112 KB
testcase_34 AC 76 ms
76,216 KB
testcase_35 AC 452 ms
220,748 KB
testcase_36 AC 251 ms
140,168 KB
testcase_37 AC 271 ms
150,816 KB
testcase_38 AC 264 ms
150,076 KB
testcase_39 AC 237 ms
138,540 KB
testcase_40 AC 304 ms
160,724 KB
testcase_41 AC 412 ms
208,296 KB
testcase_42 AC 259 ms
146,864 KB
testcase_43 AC 212 ms
126,428 KB
testcase_44 AC 338 ms
179,860 KB
testcase_45 AC 371 ms
187,848 KB
testcase_46 AC 433 ms
213,676 KB
testcase_47 AC 147 ms
100,652 KB
testcase_48 AC 441 ms
213,664 KB
testcase_49 AC 379 ms
191,140 KB
testcase_50 AC 119 ms
89,480 KB
testcase_51 AC 221 ms
129,888 KB
testcase_52 AC 478 ms
227,772 KB
testcase_53 AC 472 ms
227,764 KB
testcase_54 AC 465 ms
226,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for i in range(1,n+2):
    for j in range(1,10):
        dp[i][j] = dp[i-1][j-1] + dp[i-1][j]
        dp[i][j]%=mod
        dp[i-1][j] += dp[i-1][j-1]
        dp[i-1][j]%=mod
    dp[i][0] = 1

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