結果

問題 No.1964 sum = length
ユーザー roarisroaris
提出日時 2022-06-03 22:21:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 414 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 81,564 KB
実行使用メモリ 66,156 KB
最終ジャッジ日時 2023-10-21 02:00:04
合計ジャッジ時間 4,535 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
55,456 KB
testcase_01 AC 43 ms
55,456 KB
testcase_02 AC 55 ms
64,268 KB
testcase_03 AC 42 ms
55,456 KB
testcase_04 AC 43 ms
55,456 KB
testcase_05 AC 45 ms
59,364 KB
testcase_06 AC 45 ms
59,364 KB
testcase_07 AC 47 ms
61,420 KB
testcase_08 AC 46 ms
61,420 KB
testcase_09 AC 47 ms
61,420 KB
testcase_10 AC 48 ms
61,420 KB
testcase_11 AC 49 ms
61,628 KB
testcase_12 AC 55 ms
64,108 KB
testcase_13 AC 58 ms
64,108 KB
testcase_14 AC 62 ms
64,108 KB
testcase_15 AC 65 ms
64,108 KB
testcase_16 AC 52 ms
64,080 KB
testcase_17 AC 57 ms
64,108 KB
testcase_18 AC 57 ms
64,108 KB
testcase_19 AC 55 ms
64,108 KB
testcase_20 AC 55 ms
64,108 KB
testcase_21 AC 51 ms
62,032 KB
testcase_22 AC 102 ms
66,156 KB
testcase_23 AC 100 ms
66,156 KB
testcase_24 AC 74 ms
66,156 KB
testcase_25 AC 79 ms
66,156 KB
testcase_26 AC 109 ms
66,156 KB
testcase_27 AC 89 ms
66,156 KB
testcase_28 AC 78 ms
66,156 KB
testcase_29 AC 94 ms
66,156 KB
testcase_30 AC 80 ms
66,156 KB
testcase_31 AC 107 ms
66,156 KB
testcase_32 AC 69 ms
64,108 KB
testcase_33 AC 68 ms
64,108 KB
testcase_34 AC 100 ms
66,156 KB
testcase_35 AC 74 ms
66,156 KB
testcase_36 AC 82 ms
66,156 KB
testcase_37 AC 93 ms
66,156 KB
testcase_38 AC 112 ms
66,156 KB
testcase_39 AC 79 ms
66,156 KB
testcase_40 AC 80 ms
66,156 KB
testcase_41 AC 104 ms
66,156 KB
testcase_42 AC 115 ms
66,156 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