結果

問題 No.1836 Max Matrix
ユーザー lloyzlloyz
提出日時 2022-02-11 22:48:08
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 497 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 86,788 KB
実行使用メモリ 76,316 KB
最終ジャッジ日時 2023-09-10 05:01:58
合計ジャッジ時間 5,251 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,356 KB
testcase_01 AC 69 ms
71,084 KB
testcase_02 AC 362 ms
76,288 KB
testcase_03 AC 381 ms
76,280 KB
testcase_04 AC 236 ms
76,164 KB
testcase_05 AC 330 ms
75,944 KB
testcase_06 AC 268 ms
76,288 KB
testcase_07 AC 378 ms
76,192 KB
testcase_08 AC 166 ms
76,164 KB
testcase_09 AC 383 ms
76,148 KB
testcase_10 AC 268 ms
76,296 KB
testcase_11 AC 73 ms
71,324 KB
testcase_12 AC 497 ms
76,316 KB
testcase_13 AC 202 ms
76,200 KB
testcase_14 AC 218 ms
76,028 KB
testcase_15 AC 84 ms
76,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w, m = map(int, input().split())
mod = 998244353

ans = 0
for i in range(1, m):
    r = (pow(m - i + 1, h, mod) - pow(m - i, h, mod)) % mod
    c = (pow(m - i + 1, w, mod) - pow(m - i, w, mod)) % mod
    ans += r * c % mod
    ans %= mod
ans += 1
print(ans % mod)
0