結果

問題 No.2802 Pill Bug in Grid Maze
ユーザー hiro1729
提出日時 2023-10-19 07:45:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 284 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 21,760 KB
最終ジャッジ日時 2024-07-11 19:30:15
合計ジャッジ時間 4,282 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other WA * 3 RE * 1 TLE * 1 -- * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import comb
H, W = map(int, input().split())
mod = 998244353
ans = 0
for i in range(min(H, W) * 2 + (H != W)):
	x = i // 2 + (i % 2)
	y = i // 2
	if x <= W - 2 and y <= H - 1:
		ans += pow(2, (H - 1) * (W - 1) - x - y, mod) * comb(W - 2, x) * comb(H - 2, y) % mod
print(ans)
0