結果

問題 No.1552 Simple Dice Game
ユーザー nok0nok0
提出日時 2021-06-18 20:11:46
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 336 bytes
コンパイル時間 412 ms
コンパイル使用メモリ 86,508 KB
実行使用メモリ 76,284 KB
最終ジャッジ日時 2023-09-04 22:12:43
合計ジャッジ時間 36,657 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,224 KB
testcase_01 AC 74 ms
71,192 KB
testcase_02 AC 73 ms
71,256 KB
testcase_03 TLE -
testcase_04 AC 74 ms
70,940 KB
testcase_05 AC 76 ms
71,192 KB
testcase_06 AC 76 ms
71,192 KB
testcase_07 AC 75 ms
71,144 KB
testcase_08 AC 74 ms
71,248 KB
testcase_09 AC 2,304 ms
75,768 KB
testcase_10 TLE -
testcase_11 TLE -
testcase_12 AC 867 ms
75,824 KB
testcase_13 AC 2,268 ms
76,236 KB
testcase_14 AC 1,387 ms
75,940 KB
testcase_15 AC 1,641 ms
76,176 KB
testcase_16 AC 305 ms
76,020 KB
testcase_17 AC 468 ms
76,044 KB
testcase_18 AC 2,149 ms
75,972 KB
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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