結果
問題 | No.1552 Simple Dice Game |
ユーザー |
![]() |
提出日時 | 2021-06-18 20:33:41 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 822 ms / 2,500 ms |
コード長 | 314 bytes |
コンパイル時間 | 153 ms |
コンパイル使用メモリ | 82,244 KB |
実行使用メモリ | 112,168 KB |
最終ジャッジ日時 | 2024-06-22 19:39:10 |
合計ジャッジ時間 | 10,549 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
n, m = map(int, input().split())res, mod = 0, 998244353pow_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 %= modres *= nres %= modres *= m + 1res %= modres *= 499122177res %= modprint(res)