結果

問題 No.1552 Simple Dice Game
ユーザー nok0nok0
提出日時 2021-06-18 20:33:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 314 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 10,748 KB
実行使用メモリ 27,980 KB
最終ジャッジ日時 2023-09-04 22:11:28
合計ジャッジ時間 4,235 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,400 KB
testcase_01 AC 16 ms
7,796 KB
testcase_02 AC 15 ms
7,848 KB
testcase_03 TLE -
testcase_04 AC 15 ms
7,864 KB
testcase_05 AC 16 ms
7,856 KB
testcase_06 AC 16 ms
7,916 KB
testcase_07 AC 16 ms
7,824 KB
testcase_08 AC 17 ms
7,916 KB
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0