結果

問題 No.2631 Rectangle Grid Game
ユーザー nikoro256nikoro256
提出日時 2024-02-16 23:49:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 256 bytes
コンパイル時間 572 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 53,460 KB
最終ジャッジ日時 2024-02-16 23:51:00
合計ジャッジ時間 2,985 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 35 ms
53,460 KB
testcase_08 AC 35 ms
53,460 KB
testcase_09 AC 35 ms
53,460 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 35 ms
53,460 KB
testcase_31 AC 35 ms
53,460 KB
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

p=998244353
H,W=map(int,input().split())
ans=H*W*(H*W-1)
#右下にいると仮定
nH=H//2
nW=W//2
sub=(1+nH)*nH//2*(1+nW)*nW//2*4
if H%2==1:
    sub+=W*(H-1)
else:
    sub+=W*2*(H-1)
if W%2==1:
    sub+=H*(W-1)
else:
    sub+=H*2*(W-1)
print((ans-sub)%p)
0