結果
| 問題 | No.1552 Simple Dice Game |
| コンテスト | |
| ユーザー |
nok0
|
| 提出日時 | 2021-06-18 20:33:24 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 314 bytes |
| 記録 | |
| コンパイル時間 | 689 ms |
| コンパイル使用メモリ | 20,956 KB |
| 実行使用メモリ | 68,404 KB |
| 最終ジャッジ日時 | 2026-03-07 01:52:19 |
| 合計ジャッジ時間 | 36,479 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 TLE * 1 |
| other | AC * 13 TLE * 7 |
ソースコード
n, m = map(int, input().split())
res, mod = 0, 998244353
pow_t = []
for i in range(m + 1):
pow_t.append(pow(i, n, mod))
for d in range(1, m):
res += (pow_t[d + 1] - pow_t[d] * 2 + pow_t[d - 1]) * d * (m - d)
res %= mod
res *= n
res %= mod
res *= m + 1
res %= mod
res *= 499122177
res %= mod
print(res)
nok0