結果
問題 |
No.2802 Pill Bug in Grid Maze
|
ユーザー |
|
提出日時 | 2023-10-19 07:46:19 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 265 bytes |
コンパイル時間 | 207 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 82,304 KB |
最終ジャッジ日時 | 2024-07-11 19:30:19 |
合計ジャッジ時間 | 4,496 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 2 WA * 2 TLE * 1 -- * 26 |
ソースコード
from math import comb H, W = map(int, input().split()) mod = 998244353 ans = 0 for i in range(H + W): x = i // 2 y = i // 2 + i % 2 if x <= H - 2 and y <= W - 1: ans += pow(2, (H - 1) * (W - 1) - i, mod) * comb(H - 2, x) * comb(W - 1, y) % mod print(ans % mod)