結果

問題 No.1964 sum = length
ユーザー 👑 KazunKazun
提出日時 2022-06-03 22:11:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 81,820 KB
実行使用メモリ 64,336 KB
最終ジャッジ日時 2023-10-21 01:55:17
合計ジャッジ時間 4,797 ms
ジャッジサーバーID
(参考情報)
judge15 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
59,676 KB
testcase_01 AC 36 ms
53,572 KB
testcase_02 AC 44 ms
59,972 KB
testcase_03 AC 36 ms
53,572 KB
testcase_04 AC 41 ms
59,676 KB
testcase_05 AC 42 ms
59,692 KB
testcase_06 AC 42 ms
59,692 KB
testcase_07 AC 43 ms
59,692 KB
testcase_08 AC 46 ms
59,692 KB
testcase_09 AC 43 ms
59,692 KB
testcase_10 AC 42 ms
59,692 KB
testcase_11 AC 43 ms
60,104 KB
testcase_12 AC 46 ms
62,288 KB
testcase_13 AC 52 ms
62,296 KB
testcase_14 AC 54 ms
62,288 KB
testcase_15 AC 57 ms
62,288 KB
testcase_16 AC 43 ms
59,972 KB
testcase_17 AC 47 ms
62,288 KB
testcase_18 AC 47 ms
62,288 KB
testcase_19 AC 44 ms
62,288 KB
testcase_20 AC 45 ms
62,288 KB
testcase_21 AC 44 ms
59,972 KB
testcase_22 AC 112 ms
64,336 KB
testcase_23 AC 107 ms
64,336 KB
testcase_24 AC 72 ms
62,288 KB
testcase_25 AC 78 ms
64,336 KB
testcase_26 AC 117 ms
64,336 KB
testcase_27 AC 90 ms
64,336 KB
testcase_28 AC 76 ms
62,288 KB
testcase_29 AC 99 ms
64,336 KB
testcase_30 AC 80 ms
64,336 KB
testcase_31 AC 120 ms
64,336 KB
testcase_32 AC 60 ms
62,288 KB
testcase_33 AC 59 ms
62,288 KB
testcase_34 AC 109 ms
64,336 KB
testcase_35 AC 67 ms
62,288 KB
testcase_36 AC 84 ms
64,336 KB
testcase_37 AC 98 ms
64,336 KB
testcase_38 AC 126 ms
64,336 KB
testcase_39 AC 78 ms
64,336 KB
testcase_40 AC 81 ms
64,336 KB
testcase_41 AC 114 ms
64,336 KB
testcase_42 AC 131 ms
64,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())

Mod=998244353

K=max(30,N+20)
d=[0]*K
for i in range(K):
    d[i]=len(str(i))

DP=[[0]*K for _ in range(N+1)]
DP[0][0]=1

for i in range(1,N+1):
    for j in range(K):
        for k in range(1,K):
            if j+k-d[k]<K:
                DP[i][j+k-d[k]]+=DP[i-1][j]
    for j in range(1,K):
        DP[i][j]%=Mod

print(DP[N][N-1])
0