結果

問題 No.2802 Pill Bug in Grid Maze
ユーザー hiro1729
提出日時 2023-10-19 07:44:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 252 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 17,956 KB
最終ジャッジ日時 2024-07-11 19:30:15
合計ジャッジ時間 4,349 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3 RE * 1
other WA * 2 RE * 2 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
	ans += pow(2, (H - 1) * (W - 1) - x - y, mod) * comb(W - 2, x) * comb(H - 2, y) % mod
print(ans)
0