結果
問題 | No.1761 Sequence Distance |
ユーザー | NyaanNyaan |
提出日時 | 2021-10-24 22:43:45 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 678 bytes |
コンパイル時間 | 350 ms |
コンパイル使用メモリ | 87,124 KB |
実行使用メモリ | 266,672 KB |
最終ジャッジ日時 | 2023-09-01 23:49:58 |
合計ジャッジ時間 | 22,910 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 90 ms
76,532 KB |
testcase_01 | AC | 87 ms
71,712 KB |
testcase_02 | AC | 5,382 ms
262,280 KB |
testcase_03 | AC | 91 ms
72,088 KB |
testcase_04 | AC | 89 ms
71,544 KB |
testcase_05 | AC | 88 ms
71,532 KB |
testcase_06 | AC | 160 ms
79,036 KB |
testcase_07 | AC | 133 ms
79,072 KB |
testcase_08 | AC | 154 ms
78,084 KB |
testcase_09 | AC | 137 ms
78,960 KB |
testcase_10 | AC | 160 ms
78,388 KB |
testcase_11 | AC | 180 ms
78,208 KB |
testcase_12 | AC | 137 ms
79,068 KB |
testcase_13 | AC | 139 ms
78,416 KB |
testcase_14 | AC | 128 ms
78,344 KB |
testcase_15 | AC | 156 ms
78,360 KB |
testcase_16 | AC | 155 ms
78,584 KB |
testcase_17 | AC | 135 ms
78,960 KB |
testcase_18 | AC | 184 ms
78,432 KB |
testcase_19 | AC | 147 ms
78,484 KB |
testcase_20 | AC | 141 ms
78,104 KB |
testcase_21 | AC | 3,661 ms
111,864 KB |
testcase_22 | AC | 340 ms
80,008 KB |
testcase_23 | TLE | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
ソースコード
from math import sqrt from copy import deepcopy mod = 998244353 N, M = map(int, input().split()) sq = int(sqrt(2 * M) + 3) init = [[0] * (M + 1) for _ in range(sq)] dp = deepcopy(init) dp[0][0] = 1 for _ in range(N): nx = deepcopy(init) for i in range(sq): for j in range(M + 1): if dp[i][j] == 0: continue im1 = abs(i - 1) if j + im1 <= M: nx[im1][j + im1] += dp[i][j] nx[im1][j + im1] %= mod if j + i <= M: nx[i][j + i] += dp[i][j] * 2 nx[i][j + i] %= mod if i != sq - 1 and j + i + 1 <= M: nx[i + 1][j + i + 1] += dp[i][j] nx[i + 1][j + i + 1] %= mod dp = nx print(dp[0][M])