結果
| 問題 | No.1552 Simple Dice Game |
| コンテスト | |
| ユーザー |
nok0
|
| 提出日時 | 2021-06-18 20:11:46 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 336 bytes |
| 記録 | |
| コンパイル時間 | 339 ms |
| コンパイル使用メモリ | 82,348 KB |
| 実行使用メモリ | 71,040 KB |
| 最終ジャッジ日時 | 2024-06-22 19:38:52 |
| 合計ジャッジ時間 | 36,592 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 TLE * 1 |
| other | AC * 13 TLE * 7 |
ソースコード
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