結果

問題 No.1964 sum = length
ユーザー ああいいああいい
提出日時 2022-06-03 23:35:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 487 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 81,880 KB
実行使用メモリ 75,492 KB
最終ジャッジ日時 2023-10-21 02:30:48
合計ジャッジ時間 5,343 ms
ジャッジサーバーID
(参考情報)
judge9 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,356 KB
testcase_01 AC 39 ms
53,356 KB
testcase_02 AC 54 ms
64,040 KB
testcase_03 AC 39 ms
53,356 KB
testcase_04 AC 40 ms
53,356 KB
testcase_05 AC 43 ms
59,684 KB
testcase_06 AC 44 ms
59,816 KB
testcase_07 AC 46 ms
59,716 KB
testcase_08 AC 45 ms
59,716 KB
testcase_09 AC 45 ms
59,716 KB
testcase_10 AC 46 ms
59,832 KB
testcase_11 AC 46 ms
59,704 KB
testcase_12 AC 59 ms
66,248 KB
testcase_13 AC 64 ms
68,304 KB
testcase_14 AC 68 ms
68,304 KB
testcase_15 AC 70 ms
68,304 KB
testcase_16 AC 54 ms
64,024 KB
testcase_17 AC 62 ms
66,248 KB
testcase_18 AC 64 ms
66,248 KB
testcase_19 AC 59 ms
66,244 KB
testcase_20 AC 60 ms
66,244 KB
testcase_21 AC 52 ms
61,968 KB
testcase_22 AC 139 ms
75,480 KB
testcase_23 AC 135 ms
74,044 KB
testcase_24 AC 105 ms
72,456 KB
testcase_25 AC 111 ms
72,456 KB
testcase_26 AC 147 ms
75,488 KB
testcase_27 AC 123 ms
72,768 KB
testcase_28 AC 110 ms
72,456 KB
testcase_29 AC 128 ms
73,484 KB
testcase_30 AC 110 ms
72,456 KB
testcase_31 AC 144 ms
75,488 KB
testcase_32 AC 77 ms
70,384 KB
testcase_33 AC 75 ms
70,372 KB
testcase_34 AC 133 ms
73,984 KB
testcase_35 AC 95 ms
70,516 KB
testcase_36 AC 112 ms
72,456 KB
testcase_37 AC 126 ms
73,364 KB
testcase_38 AC 145 ms
75,488 KB
testcase_39 AC 109 ms
72,456 KB
testcase_40 AC 112 ms
72,456 KB
testcase_41 AC 143 ms
75,476 KB
testcase_42 AC 149 ms
75,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

P = 998244353
dp = [0] * n
dp[0] = 1
for _ in range(n):
    nx = [0] * n
    for i in range(n):
        for j in range(1,10):
            if i + j - 1 < n:
                nx[i + j - 1] += dp[i]
        for j in range(10,100):
            if i + j - 2 < n:
                nx[i + j - 2] += dp[i]
        for j in range(100,230):
            if i + j - 3 < n:
                nx[i + j - 3] += dp[i]
    for i in range(n):
        nx[i] %= P
    dp = nx
print(dp[n - 1])
0