結果
| 問題 | No.1836 Max Matrix |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-26 15:53:30 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 480 ms / 2,000 ms |
| コード長 | 436 bytes |
| 記録 | |
| コンパイル時間 | 397 ms |
| コンパイル使用メモリ | 82,040 KB |
| 実行使用メモリ | 62,896 KB |
| 最終ジャッジ日時 | 2025-03-26 15:54:18 |
| 合計ジャッジ時間 | 4,650 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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