結果
問題 | No.1964 sum = length |
ユーザー | rlangevin |
提出日時 | 2023-10-11 20:50:14 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,422 bytes |
コンパイル時間 | 517 ms |
コンパイル使用メモリ | 82,440 KB |
実行使用メモリ | 206,608 KB |
最終ジャッジ日時 | 2024-09-13 19:41:52 |
合計ジャッジ時間 | 39,411 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 118 ms
81,732 KB |
testcase_01 | AC | 81 ms
74,504 KB |
testcase_02 | AC | 256 ms
90,776 KB |
testcase_03 | AC | 78 ms
74,240 KB |
testcase_04 | AC | 122 ms
81,548 KB |
testcase_05 | AC | 134 ms
81,732 KB |
testcase_06 | AC | 141 ms
81,552 KB |
testcase_07 | AC | 155 ms
86,984 KB |
testcase_08 | AC | 161 ms
87,316 KB |
testcase_09 | AC | 171 ms
86,788 KB |
testcase_10 | AC | 177 ms
86,928 KB |
testcase_11 | AC | 184 ms
86,724 KB |
testcase_12 | AC | 466 ms
107,028 KB |
testcase_13 | AC | 622 ms
117,616 KB |
testcase_14 | AC | 811 ms
133,648 KB |
testcase_15 | AC | 903 ms
138,948 KB |
testcase_16 | AC | 246 ms
90,632 KB |
testcase_17 | AC | 521 ms
112,448 KB |
testcase_18 | AC | 565 ms
112,648 KB |
testcase_19 | AC | 408 ms
101,816 KB |
testcase_20 | AC | 442 ms
107,288 KB |
testcase_21 | AC | 238 ms
90,764 KB |
testcase_22 | AC | 1,655 ms
196,360 KB |
testcase_23 | AC | 1,604 ms
192,244 KB |
testcase_24 | AC | 1,197 ms
160,056 KB |
testcase_25 | AC | 1,305 ms
170,820 KB |
testcase_26 | AC | 1,677 ms
196,240 KB |
testcase_27 | AC | 1,427 ms
181,376 KB |
testcase_28 | AC | 1,267 ms
165,572 KB |
testcase_29 | AC | 1,531 ms
186,752 KB |
testcase_30 | AC | 1,320 ms
170,688 KB |
testcase_31 | AC | 1,714 ms
196,160 KB |
testcase_32 | AC | 988 ms
144,316 KB |
testcase_33 | AC | 962 ms
144,324 KB |
testcase_34 | AC | 1,603 ms
192,316 KB |
testcase_35 | AC | 1,083 ms
154,768 KB |
testcase_36 | AC | 1,362 ms
176,396 KB |
testcase_37 | AC | 1,525 ms
187,076 KB |
testcase_38 | WA | - |
testcase_39 | AC | 1,293 ms
170,816 KB |
testcase_40 | AC | 1,330 ms
170,816 KB |
testcase_41 | AC | 1,673 ms
196,116 KB |
testcase_42 | WA | - |
ソースコード
N = int(input()) M = 405 mod = 998244353 pre = [[0] * M for _ in range(M)] pre[0][0] = 1 for _ in range(N): dp = [[0] * M for _ in range(M)] Ac = [[0] * M for _ in range(M)] for i in range(M): for j in range(M): if i + 1 <= M - 1 and j + 2 <= M - 1: dp[i + 1][j + 2] += pre[i][j] dp[i + 1][j + 2] %= mod if i + 10 <= M - 1 and j + 2 <= M - 1: dp[i + 10][j + 2] -= pre[i][j] dp[i + 10][j + 2] %= mod if i + 10 <= M - 1 and j + 3 <= M - 1: dp[i + 10][j + 3] += pre[i][j] dp[i + 10][j + 3] %= mod if i + 100 <= M - 1 and j + 3 <= M - 1: dp[i + 100][j + 3] -= pre[i][j] dp[i + 100][j + 3] %= mod if i + 100 <= M - 1 and j + 4 <= M - 1: dp[i + 100][j + 4] += pre[i][j] dp[i + 100][j + 4] %= mod # for n in range(1, M): # num = len(str(n)) # if i + n <= M - 1 and j + num + 1 <= M - 1: # dp[i + n][j + num + 1] += pre[i][j] # dp[i + n][j + num + 1] %= mod for i in range(1, M): for j in range(M): Ac[i][j] = (Ac[i - 1][j] + dp[i][j]) % mod Ac, pre = pre, Ac ans = 0 for i in range(M - 1): ans += pre[i][i + 1] ans %= mod print(ans)