結果

問題 No.741 AscNumber(Easy)
ユーザー ninja-kidninja-kid
提出日時 2022-06-07 22:59:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,540 ms / 2,000 ms
コード長 531 bytes
コンパイル時間 498 ms
コンパイル使用メモリ 81,780 KB
実行使用メモリ 227,808 KB
最終ジャッジ日時 2023-10-21 03:56:14
合計ジャッジ時間 23,468 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
55,524 KB
testcase_01 AC 40 ms
55,524 KB
testcase_02 AC 38 ms
55,524 KB
testcase_03 AC 39 ms
55,524 KB
testcase_04 AC 41 ms
55,524 KB
testcase_05 AC 41 ms
55,524 KB
testcase_06 AC 41 ms
55,524 KB
testcase_07 AC 41 ms
55,524 KB
testcase_08 AC 40 ms
55,524 KB
testcase_09 AC 41 ms
55,524 KB
testcase_10 AC 40 ms
55,524 KB
testcase_11 AC 40 ms
55,524 KB
testcase_12 AC 39 ms
55,524 KB
testcase_13 AC 39 ms
55,524 KB
testcase_14 AC 37 ms
55,524 KB
testcase_15 AC 43 ms
55,524 KB
testcase_16 AC 41 ms
55,524 KB
testcase_17 AC 39 ms
55,524 KB
testcase_18 AC 41 ms
61,324 KB
testcase_19 AC 41 ms
61,376 KB
testcase_20 AC 47 ms
64,152 KB
testcase_21 AC 45 ms
64,148 KB
testcase_22 AC 46 ms
64,152 KB
testcase_23 AC 50 ms
64,152 KB
testcase_24 AC 48 ms
64,148 KB
testcase_25 AC 48 ms
64,152 KB
testcase_26 AC 49 ms
64,152 KB
testcase_27 AC 44 ms
64,148 KB
testcase_28 AC 46 ms
64,148 KB
testcase_29 AC 47 ms
64,152 KB
testcase_30 AC 48 ms
64,152 KB
testcase_31 AC 50 ms
64,152 KB
testcase_32 AC 47 ms
62,100 KB
testcase_33 AC 49 ms
64,152 KB
testcase_34 AC 49 ms
64,152 KB
testcase_35 AC 1,524 ms
220,748 KB
testcase_36 AC 675 ms
139,460 KB
testcase_37 AC 790 ms
150,596 KB
testcase_38 AC 794 ms
149,532 KB
testcase_39 AC 659 ms
138,216 KB
testcase_40 AC 877 ms
160,212 KB
testcase_41 AC 1,345 ms
208,116 KB
testcase_42 AC 741 ms
146,284 KB
testcase_43 AC 547 ms
126,992 KB
testcase_44 AC 1,067 ms
179,540 KB
testcase_45 AC 1,135 ms
187,660 KB
testcase_46 AC 1,411 ms
213,712 KB
testcase_47 AC 301 ms
99,520 KB
testcase_48 AC 1,424 ms
213,728 KB
testcase_49 AC 1,187 ms
191,164 KB
testcase_50 AC 215 ms
91,856 KB
testcase_51 AC 568 ms
129,540 KB
testcase_52 AC 1,540 ms
227,808 KB
testcase_53 AC 1,540 ms
227,808 KB
testcase_54 AC 1,506 ms
226,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

from collections import deque
from heapq import heappop, heappush


dpos4 = ((1, 0), (0, 1), (-1, 0), (0, -1))
def main():
  N = int(input())
  S = "9" * N
  mod = 10 ** 9 + 7
  # i桁目まで確定していて、最後の数字がjのAscNumberの数
  dp = [[0] * 10 for _ in range(N + 1)]
  dp[0][0] = 1
  for i in range(N):
    for j in range(10):
      for d in range(j, 10):
        dp[i + 1][d] += dp[i][j]
        dp[i + 1][d] %= mod

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

if __name__ == '__main__':
  main()
0