結果
| 問題 | No.3571 Sigma Problems Problem |
| ユーザー |
|
| 提出日時 | 2026-06-11 21:53:49 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 352 ms / 2,000 ms |
| コード長 | 227 bytes |
| 記録 | |
| コンパイル時間 | 1,366 ms |
| コンパイル使用メモリ | 84,736 KB |
| 実行使用メモリ | 81,280 KB |
| 最終ジャッジ日時 | 2026-06-11 21:54:01 |
| 合計ジャッジ時間 | 6,285 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 20 |
ソースコード
mod = 998244353 inv2 = mod + 1 >> 1 t = int(input()) for i in range(t): n, m = map(int, input().split()) if n == 1: print(0) continue p = n * (n - 1) // 2 c = pow(m, n, mod) * ((m - 1) * inv2) % mod print(c * p % mod)