結果

問題 No.2683 Two Sheets
ユーザー rlangevinrlangevin
提出日時 2024-03-25 12:12:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 277 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 74,892 KB
最終ジャッジ日時 2024-03-25 12:12:46
合計ジャッジ時間 5,368 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 64 ms
74,880 KB
testcase_03 AC 364 ms
74,880 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 386 ms
74,880 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 294 ms
74,880 KB
testcase_13 WA -
testcase_14 AC 233 ms
74,892 KB
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(x, N):
    v = 0
    inv = pow(N - x + 1, mod - 2, mod)
    for i in range(1, N + 1):
        v += (min(i, x, N - i + 1) * inv) ** 2
        v %= mod
    return v

H, W, A, B = map(int, input().split())
mod = 998244353
ans = 2 * A * B - f(A, H) * f(B, W)
print(ans % mod)
0