結果

問題 No.741 AscNumber(Easy)
ユーザー Chihaya_chanChihaya_chan
提出日時 2020-06-14 13:28:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 583 ms / 2,000 ms
コード長 503 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 227,404 KB
最終ジャッジ日時 2023-09-09 13:24:32
合計ジャッジ時間 12,735 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,252 KB
testcase_01 AC 71 ms
71,076 KB
testcase_02 AC 71 ms
71,056 KB
testcase_03 AC 70 ms
71,188 KB
testcase_04 AC 74 ms
71,140 KB
testcase_05 AC 72 ms
71,180 KB
testcase_06 AC 75 ms
71,076 KB
testcase_07 AC 71 ms
71,252 KB
testcase_08 AC 74 ms
71,344 KB
testcase_09 AC 71 ms
71,196 KB
testcase_10 AC 70 ms
71,212 KB
testcase_11 AC 71 ms
71,200 KB
testcase_12 AC 69 ms
71,064 KB
testcase_13 AC 71 ms
71,332 KB
testcase_14 AC 70 ms
71,184 KB
testcase_15 AC 70 ms
71,316 KB
testcase_16 AC 70 ms
71,268 KB
testcase_17 AC 71 ms
71,236 KB
testcase_18 AC 71 ms
71,052 KB
testcase_19 AC 71 ms
71,060 KB
testcase_20 AC 79 ms
76,408 KB
testcase_21 AC 75 ms
76,044 KB
testcase_22 AC 79 ms
76,552 KB
testcase_23 AC 79 ms
76,356 KB
testcase_24 AC 76 ms
75,888 KB
testcase_25 AC 77 ms
75,972 KB
testcase_26 AC 79 ms
76,328 KB
testcase_27 AC 77 ms
75,952 KB
testcase_28 AC 80 ms
76,136 KB
testcase_29 AC 77 ms
75,892 KB
testcase_30 AC 79 ms
76,352 KB
testcase_31 AC 79 ms
76,516 KB
testcase_32 AC 71 ms
71,144 KB
testcase_33 AC 79 ms
76,440 KB
testcase_34 AC 81 ms
76,128 KB
testcase_35 AC 514 ms
219,852 KB
testcase_36 AC 315 ms
139,552 KB
testcase_37 AC 309 ms
150,492 KB
testcase_38 AC 294 ms
149,420 KB
testcase_39 AC 254 ms
138,216 KB
testcase_40 AC 319 ms
160,356 KB
testcase_41 AC 449 ms
207,828 KB
testcase_42 AC 279 ms
146,352 KB
testcase_43 AC 228 ms
127,172 KB
testcase_44 AC 366 ms
179,556 KB
testcase_45 AC 398 ms
187,112 KB
testcase_46 AC 468 ms
213,240 KB
testcase_47 AC 152 ms
98,788 KB
testcase_48 AC 447 ms
213,328 KB
testcase_49 AC 395 ms
190,800 KB
testcase_50 AC 126 ms
89,364 KB
testcase_51 AC 232 ms
129,424 KB
testcase_52 AC 529 ms
227,228 KB
testcase_53 AC 583 ms
227,404 KB
testcase_54 AC 495 ms
225,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
if N==1:
    print(10)
    exit()
else:
    ans=10
    dp=[[0 for i in range(10)] for j in range(N+1)]
    #dp[K][i]   = K桁めまで見て末尾がi以下のもの
    mod =10**9 + 7
    for i in range(10):
        if i==0:
            dp[2][i]=i
        else:
            dp[2][i]=i+dp[2][i-1]
    for i in range(3,N+1):
        for j in range(1,10):
            dp[i][j]=(dp[i][j-1]+dp[i-1][j])%mod
    for i in range(2,N+1):
        ans+=dp[i][9]
        ans%=mod
    print(ans)
    
0