結果
| 問題 | No.1552 Simple Dice Game |
| コンテスト | |
| ユーザー |
nok0
|
| 提出日時 | 2021-06-18 20:11:46 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 906 ms / 2,500 ms |
| + 398µs | |
| コード長 | 336 bytes |
| 記録 | |
| コンパイル時間 | 83 ms |
| コンパイル使用メモリ | 64,708 KB |
| 実行使用メモリ | 60,016 KB |
| 最終ジャッジ日時 | 2026-10-20 00:10:54 |
| 合計ジャッジ時間 | 12,995 ms |
|
ジャッジサーバーID (参考情報) |
judge6_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
n, m = map(int, input().split())
res, mod = 0, 998244353
for r in range(1, m + 1):
res += (pow(r, n, mod) - pow(r - 1, n, mod)) * r
res %= mod
for l in range(1, m + 1):
res -= (pow(m - l + 1, n, mod) - pow(m - l, n, mod)) * l
res %= mod
res *= n
res %= mod
res *= m + 1
res %= mod
res *= 499122177
res %= mod
print(res)
nok0