結果
問題 | No.1552 Simple Dice Game |
ユーザー |
![]() |
提出日時 | 2021-06-18 20:33:24 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 314 bytes |
コンパイル時間 | 195 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 37,536 KB |
最終ジャッジ日時 | 2024-06-22 19:37:42 |
合計ジャッジ時間 | 4,611 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 TLE * 1 |
other | -- * 20 |
ソースコード
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)