結果
問題 | No.1552 Simple Dice Game |
ユーザー |
![]() |
提出日時 | 2021-06-18 20:34:21 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 830 ms / 2,500 ms |
コード長 | 320 bytes |
コンパイル時間 | 214 ms |
コンパイル使用メモリ | 82,384 KB |
実行使用メモリ | 111,964 KB |
最終ジャッジ日時 | 2024-06-22 19:38:11 |
合計ジャッジ時間 | 10,981 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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]) % mod * d * (m - d)res %= modres *= nres %= modres *= m + 1res %= modres *= 499122177res %= modprint(res)