結果

問題 No.1964 sum = length
ユーザー pitPpitP
提出日時 2022-06-03 21:38:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 974 ms
コンパイル使用メモリ 80,920 KB
実行使用メモリ 65,236 KB
最終ジャッジ日時 2023-10-21 01:41:31
合計ジャッジ時間 4,981 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,928 KB
testcase_01 AC 34 ms
51,740 KB
testcase_02 AC 55 ms
60,576 KB
testcase_03 AC 39 ms
51,744 KB
testcase_04 AC 36 ms
51,932 KB
testcase_05 AC 39 ms
57,424 KB
testcase_06 AC 38 ms
57,456 KB
testcase_07 AC 39 ms
57,964 KB
testcase_08 AC 41 ms
58,016 KB
testcase_09 AC 39 ms
58,088 KB
testcase_10 AC 40 ms
58,176 KB
testcase_11 AC 41 ms
58,856 KB
testcase_12 AC 48 ms
61,956 KB
testcase_13 AC 51 ms
62,200 KB
testcase_14 AC 59 ms
62,532 KB
testcase_15 AC 58 ms
62,720 KB
testcase_16 AC 43 ms
60,376 KB
testcase_17 AC 51 ms
62,036 KB
testcase_18 AC 52 ms
62,084 KB
testcase_19 AC 46 ms
61,452 KB
testcase_20 AC 47 ms
61,528 KB
testcase_21 AC 45 ms
60,360 KB
testcase_22 AC 114 ms
64,756 KB
testcase_23 AC 118 ms
64,648 KB
testcase_24 AC 75 ms
63,444 KB
testcase_25 AC 82 ms
63,704 KB
testcase_26 AC 122 ms
64,948 KB
testcase_27 AC 89 ms
64,052 KB
testcase_28 AC 80 ms
63,616 KB
testcase_29 AC 108 ms
64,412 KB
testcase_30 AC 86 ms
63,724 KB
testcase_31 AC 126 ms
64,952 KB
testcase_32 AC 65 ms
63,156 KB
testcase_33 AC 64 ms
62,844 KB
testcase_34 AC 115 ms
64,628 KB
testcase_35 AC 67 ms
63,152 KB
testcase_36 AC 87 ms
63,876 KB
testcase_37 AC 105 ms
64,360 KB
testcase_38 AC 130 ms
65,116 KB
testcase_39 AC 87 ms
63,660 KB
testcase_40 AC 86 ms
63,748 KB
testcase_41 AC 127 ms
64,812 KB
testcase_42 AC 134 ms
65,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
n = int(input())
if n == 1:
    print(1)
    exit()
dp = [[0 for _ in range(n)] for _ in range(n+1)]
dp[0][0] = 1

table = [k - len(str(k)) for k in range(300)]

for i in range(n):
    for j in range(n):
        for k in range(1,220):
            nxt = j+table[k]
            if nxt < n:
                dp[i+1][nxt] += dp[i][j]
                dp[i+1][nxt] %= mod

print(dp[n][n-1])
0