結果

問題 No.1964 sum = length
ユーザー roarisroaris
提出日時 2022-06-03 22:21:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 414 bytes
コンパイル時間 575 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 68,500 KB
最終ジャッジ日時 2024-09-21 02:53:05
合計ジャッジ時間 4,061 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
54,668 KB
testcase_01 AC 38 ms
54,680 KB
testcase_02 AC 49 ms
63,748 KB
testcase_03 AC 38 ms
54,124 KB
testcase_04 AC 41 ms
53,540 KB
testcase_05 AC 41 ms
61,512 KB
testcase_06 AC 41 ms
60,444 KB
testcase_07 AC 43 ms
61,292 KB
testcase_08 AC 42 ms
61,136 KB
testcase_09 AC 46 ms
61,808 KB
testcase_10 AC 42 ms
59,928 KB
testcase_11 AC 45 ms
61,240 KB
testcase_12 AC 53 ms
64,160 KB
testcase_13 AC 53 ms
64,888 KB
testcase_14 AC 59 ms
65,280 KB
testcase_15 AC 61 ms
66,176 KB
testcase_16 AC 48 ms
63,312 KB
testcase_17 AC 50 ms
64,084 KB
testcase_18 AC 52 ms
65,540 KB
testcase_19 AC 50 ms
64,984 KB
testcase_20 AC 55 ms
64,404 KB
testcase_21 AC 47 ms
63,244 KB
testcase_22 AC 94 ms
66,876 KB
testcase_23 AC 92 ms
66,316 KB
testcase_24 AC 71 ms
65,364 KB
testcase_25 AC 73 ms
67,108 KB
testcase_26 AC 102 ms
67,720 KB
testcase_27 AC 82 ms
66,064 KB
testcase_28 AC 72 ms
66,728 KB
testcase_29 AC 91 ms
67,536 KB
testcase_30 AC 74 ms
66,416 KB
testcase_31 AC 99 ms
67,036 KB
testcase_32 AC 64 ms
65,736 KB
testcase_33 AC 62 ms
65,136 KB
testcase_34 AC 92 ms
66,716 KB
testcase_35 AC 67 ms
65,620 KB
testcase_36 AC 76 ms
66,660 KB
testcase_37 AC 85 ms
66,464 KB
testcase_38 AC 102 ms
68,500 KB
testcase_39 AC 74 ms
65,788 KB
testcase_40 AC 73 ms
67,208 KB
testcase_41 AC 98 ms
67,324 KB
testcase_42 AC 109 ms
67,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

n = int(input())
dp = [0]*n
dp[0] = 1
keta = [len(str(i)) for i in range(210)]
MOD = 998244353

for _ in range(n):
    ndp = [0]*n
    
    for i in range(n-1, -1, -1):
        for j in range(1, 210):
            if i+j-keta[j]<n:
                ndp[i+j-keta[j]] += dp[i]
                ndp[i+j-keta[j]] %= MOD
    
    dp = ndp
    
print(dp[-1])
0