結果

問題 No.741 AscNumber(Easy)
ユーザー moharan627moharan627
提出日時 2021-08-10 17:39:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 830 ms / 2,000 ms
コード長 885 bytes
コンパイル時間 480 ms
コンパイル使用メモリ 81,636 KB
実行使用メモリ 226,328 KB
最終ジャッジ日時 2023-10-24 02:12:17
合計ジャッジ時間 15,411 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,452 KB
testcase_01 AC 37 ms
53,452 KB
testcase_02 AC 37 ms
53,452 KB
testcase_03 AC 37 ms
53,452 KB
testcase_04 AC 37 ms
53,452 KB
testcase_05 AC 37 ms
53,452 KB
testcase_06 AC 36 ms
53,452 KB
testcase_07 AC 37 ms
53,452 KB
testcase_08 AC 38 ms
53,452 KB
testcase_09 AC 38 ms
53,452 KB
testcase_10 AC 38 ms
53,452 KB
testcase_11 AC 38 ms
53,452 KB
testcase_12 AC 37 ms
53,452 KB
testcase_13 AC 38 ms
53,452 KB
testcase_14 AC 39 ms
53,452 KB
testcase_15 AC 38 ms
53,452 KB
testcase_16 AC 38 ms
53,452 KB
testcase_17 AC 38 ms
53,452 KB
testcase_18 AC 41 ms
59,364 KB
testcase_19 AC 41 ms
59,364 KB
testcase_20 AC 46 ms
61,956 KB
testcase_21 AC 43 ms
59,756 KB
testcase_22 AC 46 ms
61,956 KB
testcase_23 AC 46 ms
61,956 KB
testcase_24 AC 43 ms
59,756 KB
testcase_25 AC 46 ms
61,956 KB
testcase_26 AC 46 ms
61,956 KB
testcase_27 AC 45 ms
59,768 KB
testcase_28 AC 43 ms
59,756 KB
testcase_29 AC 46 ms
61,956 KB
testcase_30 AC 46 ms
61,956 KB
testcase_31 AC 46 ms
61,956 KB
testcase_32 AC 43 ms
59,756 KB
testcase_33 AC 46 ms
61,956 KB
testcase_34 AC 46 ms
61,956 KB
testcase_35 AC 809 ms
219,304 KB
testcase_36 AC 381 ms
138,536 KB
testcase_37 AC 435 ms
149,608 KB
testcase_38 AC 438 ms
148,548 KB
testcase_39 AC 375 ms
137,304 KB
testcase_40 AC 484 ms
159,284 KB
testcase_41 AC 745 ms
206,748 KB
testcase_42 AC 421 ms
145,316 KB
testcase_43 AC 314 ms
126,144 KB
testcase_44 AC 582 ms
178,396 KB
testcase_45 AC 625 ms
186,428 KB
testcase_46 AC 754 ms
212,308 KB
testcase_47 AC 175 ms
98,936 KB
testcase_48 AC 767 ms
212,332 KB
testcase_49 AC 643 ms
189,912 KB
testcase_50 AC 134 ms
91,312 KB
testcase_51 AC 326 ms
128,688 KB
testcase_52 AC 830 ms
226,328 KB
testcase_53 AC 828 ms
226,320 KB
testcase_54 AC 819 ms
224,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
INF = float('inf')
#10**20,2**63,float('inf')
MOD = 10**9 + 7
MOD2 = 998244353
#from collections import defaultdict
def solve():
    def II(): return int(sys.stdin.readline())
    def LI(): return list(map(int, sys.stdin.readline().split()))
    def LC(): return list(input())
    def IC(): return [int(c) for c in input()]
    def MI(): return map(int, sys.stdin.readline().split())
    N = II()
    Less = [[0] * 10 for _ in range(N + 1)]
    Less[0][0] = 1
    for i in range(N):
        # Less[i+1] += Less[i]の遷移
        # (i-1桁までの数)+(0~9)
        for n in range(10):
            for s in range(0,n+1):
                Less[i + 1][n] += Less[i][s]
                Less[i+1][n] %= MOD
        #print("Less:",Less[i+1])
    print(sum(Less[N]) % MOD)
    return
solve()
#sys.setrecursionlimit(10 ** 6)#再帰関数ではコメントにしないこと!!
0