結果

問題 No.1964 sum = length
ユーザー titiatitia
提出日時 2022-06-07 02:41:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 591 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 81,580 KB
実行使用メモリ 76,248 KB
最終ジャッジ日時 2023-10-21 03:46:13
合計ジャッジ時間 15,414 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
66,192 KB
testcase_01 AC 44 ms
55,412 KB
testcase_02 AC 107 ms
75,800 KB
testcase_03 AC 45 ms
55,412 KB
testcase_04 AC 59 ms
66,192 KB
testcase_05 AC 63 ms
70,440 KB
testcase_06 AC 69 ms
73,216 KB
testcase_07 AC 73 ms
75,784 KB
testcase_08 AC 77 ms
75,788 KB
testcase_09 AC 79 ms
75,776 KB
testcase_10 AC 84 ms
75,784 KB
testcase_11 AC 85 ms
75,784 KB
testcase_12 AC 173 ms
75,828 KB
testcase_13 AC 226 ms
75,860 KB
testcase_14 AC 285 ms
75,884 KB
testcase_15 AC 311 ms
75,928 KB
testcase_16 AC 104 ms
75,800 KB
testcase_17 AC 188 ms
75,840 KB
testcase_18 AC 206 ms
75,848 KB
testcase_19 AC 155 ms
75,820 KB
testcase_20 AC 162 ms
75,832 KB
testcase_21 AC 101 ms
75,800 KB
testcase_22 AC 548 ms
76,188 KB
testcase_23 AC 537 ms
76,176 KB
testcase_24 AC 416 ms
76,024 KB
testcase_25 AC 446 ms
76,064 KB
testcase_26 AC 589 ms
76,200 KB
testcase_27 AC 489 ms
76,104 KB
testcase_28 AC 442 ms
76,064 KB
testcase_29 AC 530 ms
76,140 KB
testcase_30 AC 461 ms
76,064 KB
testcase_31 AC 585 ms
76,200 KB
testcase_32 AC 352 ms
75,944 KB
testcase_33 AC 326 ms
75,944 KB
testcase_34 AC 530 ms
76,164 KB
testcase_35 AC 367 ms
75,984 KB
testcase_36 AC 462 ms
76,084 KB
testcase_37 AC 503 ms
76,144 KB
testcase_38 AC 578 ms
76,220 KB
testcase_39 AC 429 ms
76,060 KB
testcase_40 AC 443 ms
76,060 KB
testcase_41 AC 546 ms
76,184 KB
testcase_42 AC 591 ms
76,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

mod=998244353

n=int(input())

DP={0:1}
# 文字列としての長さ, sum

for i in range(n):
    NDP=Counter()

    for j in DP:
        for k in range(1,411):
            l=len(str(k))

            x=k-l

            if j+x<210:
                NDP[j+x]+=DP[j]
                NDP[j+x]%=mod

    DP=NDP
            
print(DP[n-1])
0