結果
| 問題 | No.1836 Max Matrix |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-26 15:53:30 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 195 ms / 2,000 ms |
| コード長 | 436 bytes |
| 記録 | |
| コンパイル時間 | 236 ms |
| コンパイル使用メモリ | 95,988 KB |
| 実行使用メモリ | 83,428 KB |
| 最終ジャッジ日時 | 2026-07-07 22:26:59 |
| 合計ジャッジ時間 | 3,683 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
MOD = 998244353
H, W, M = map(int, input().split())
result = 0
for m in range(1, M + 1):
# Calculate the number of valid a's for current m
a_count = (pow(M - m + 1, H, MOD) - pow(M - m, H, MOD)) % MOD
# Calculate the number of valid b's for current m
b_count = (pow(M - m + 1, W, MOD) - pow(M - m, W, MOD)) % MOD
# Multiply and add to the result
result = (result + a_count * b_count) % MOD
print(result % MOD)
lam6er