結果

問題 No.1964 sum = length
ユーザー EguyEguy
提出日時 2022-06-03 21:41:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 277 ms / 2,000 ms
コード長 540 bytes
コンパイル時間 1,342 ms
コンパイル使用メモリ 81,368 KB
実行使用メモリ 75,156 KB
最終ジャッジ日時 2023-10-21 01:43:01
合計ジャッジ時間 6,354 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,344 KB
testcase_01 AC 38 ms
53,344 KB
testcase_02 AC 51 ms
61,920 KB
testcase_03 AC 38 ms
53,344 KB
testcase_04 AC 39 ms
53,344 KB
testcase_05 AC 40 ms
53,344 KB
testcase_06 AC 43 ms
59,680 KB
testcase_07 AC 44 ms
59,796 KB
testcase_08 AC 43 ms
59,680 KB
testcase_09 AC 43 ms
59,680 KB
testcase_10 AC 45 ms
59,680 KB
testcase_11 AC 45 ms
59,760 KB
testcase_12 AC 53 ms
68,064 KB
testcase_13 AC 65 ms
75,140 KB
testcase_14 AC 77 ms
75,144 KB
testcase_15 AC 84 ms
75,144 KB
testcase_16 AC 47 ms
61,928 KB
testcase_17 AC 54 ms
72,160 KB
testcase_18 AC 57 ms
73,708 KB
testcase_19 AC 50 ms
66,016 KB
testcase_20 AC 51 ms
66,016 KB
testcase_21 AC 46 ms
61,920 KB
testcase_22 AC 226 ms
75,144 KB
testcase_23 AC 220 ms
75,144 KB
testcase_24 AC 125 ms
75,144 KB
testcase_25 AC 147 ms
75,144 KB
testcase_26 AC 247 ms
75,148 KB
testcase_27 AC 172 ms
75,144 KB
testcase_28 AC 141 ms
75,144 KB
testcase_29 AC 196 ms
75,144 KB
testcase_30 AC 146 ms
75,144 KB
testcase_31 AC 247 ms
75,148 KB
testcase_32 AC 93 ms
75,140 KB
testcase_33 AC 90 ms
75,140 KB
testcase_34 AC 215 ms
75,144 KB
testcase_35 AC 107 ms
75,144 KB
testcase_36 AC 156 ms
75,144 KB
testcase_37 AC 191 ms
75,144 KB
testcase_38 AC 265 ms
75,152 KB
testcase_39 AC 143 ms
75,144 KB
testcase_40 AC 148 ms
75,144 KB
testcase_41 AC 240 ms
75,144 KB
testcase_42 AC 277 ms
75,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, math
sys.setrecursionlimit(1000000)
INF = 1 << 100
#mod = 1000000007
mod = 998244353
input = lambda: sys.stdin.readline().rstrip()
li = lambda: list(map(int, input().split()))

N = int(input())

dp = [0] * (N)
dp[-1] = 1
for i in range(N):
    ndp = [0] * N
    for j in range(N):
        if not dp[j]:
            continue
        for k in range(1, N+100):
            idx = j-k + len(str(k))
            if idx < 0:
                continue
            ndp[idx] += dp[j]
            ndp[idx] %= mod
    dp = ndp

print(dp[0])
0