結果

問題 No.1964 sum = length
ユーザー terasaterasa
提出日時 2022-06-03 22:47:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,191 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 81,656 KB
実行使用メモリ 370,972 KB
最終ジャッジ日時 2023-10-21 02:12:49
合計ジャッジ時間 34,616 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
81,132 KB
testcase_01 AC 80 ms
79,036 KB
testcase_02 AC 228 ms
103,452 KB
testcase_03 AC 84 ms
79,036 KB
testcase_04 AC 118 ms
81,132 KB
testcase_05 AC 125 ms
83,052 KB
testcase_06 AC 135 ms
84,332 KB
testcase_07 AC 140 ms
86,052 KB
testcase_08 AC 153 ms
87,048 KB
testcase_09 AC 158 ms
88,408 KB
testcase_10 AC 166 ms
89,788 KB
testcase_11 AC 175 ms
91,400 KB
testcase_12 AC 426 ms
140,128 KB
testcase_13 AC 564 ms
167,568 KB
testcase_14 AC 733 ms
199,892 KB
testcase_15 AC 810 ms
215,804 KB
testcase_16 AC 234 ms
102,152 KB
testcase_17 AC 466 ms
148,296 KB
testcase_18 AC 514 ms
157,812 KB
testcase_19 AC 364 ms
129,372 KB
testcase_20 AC 409 ms
134,220 KB
testcase_21 AC 218 ms
100,468 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 1,056 ms
270,584 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 861 ms
230,136 KB
testcase_33 AC 843 ms
225,912 KB
testcase_34 WA -
testcase_35 AC 973 ms
249,408 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import pypyjit
import itertools
import heapq
import math
from collections import deque, defaultdict
import bisect

input = sys.stdin.readline
# sys.setrecursionlimit(10 ** 6)
# pypyjit.set_param('max_unroll_recursion=-1')


N = int(input())
mod = 998_244_353

dp = [[[0 for _ in range(610)] for _ in range(150)] for _ in range(N + 1)]
S = [[[0 for _ in range(610)] for _ in range(150)] for _ in range(N + 1)]
dp[0][0][0] = 1
for k in range(610):
    S[0][0][k] = 1

for i in range(1, N + 1):
    for j in range(1, 150):
        for k in range(1, 600):
            if j >= 1 and k >= 1:
                dp[i][j][k] += S[i - 1][j - 1][k - 1] - (S[i - 1][j - 1][k - 10] if k >= 10 else 0)
            if j >= 2 and k >= 10:
                dp[i][j][k] += S[i - 1][j - 2][k - 10] - (S[i - 1][j - 2][k - 100] if k >= 100 else 0)
            if j >= 3 and k >= 100:
                dp[i][j][k] += S[i - 1][j - 3][k - 100]
            dp[i][j][k] %= mod

            S[i][j][k] += S[i][j][k - 1] + dp[i][j][k]
            S[i][j][k] %= mod

ans = 0
for j in range(150):
    for k in range(600):
        if j + N - 1 == k:
            ans += dp[N][j][k]
            ans %= mod
print(ans)
0