結果

問題 No.1552 Simple Dice Game
ユーザー zkouzkou
提出日時 2021-06-18 22:18:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 308 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 87,288 KB
実行使用メモリ 76,464 KB
最終ジャッジ日時 2023-09-04 23:29:36
合計ジャッジ時間 11,485 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,848 KB
testcase_01 AC 71 ms
71,076 KB
testcase_02 AC 73 ms
71,288 KB
testcase_03 AC 715 ms
75,960 KB
testcase_04 AC 71 ms
71,312 KB
testcase_05 AC 70 ms
71,304 KB
testcase_06 AC 71 ms
71,328 KB
testcase_07 WA -
testcase_08 AC 71 ms
71,156 KB
testcase_09 AC 624 ms
75,932 KB
testcase_10 WA -
testcase_11 AC 733 ms
76,000 KB
testcase_12 WA -
testcase_13 AC 609 ms
76,208 KB
testcase_14 AC 397 ms
76,136 KB
testcase_15 WA -
testcase_16 AC 130 ms
75,960 KB
testcase_17 AC 172 ms
76,100 KB
testcase_18 WA -
testcase_19 AC 794 ms
76,136 KB
testcase_20 AC 808 ms
75,852 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353

half = pow(2, MOD - 2, MOD)

N, M = map(int, input().split())

s = M * pow(M, N, MOD) % MOD
for i in range(M):
    s -= pow(i, N, MOD)
    s %= MOD

# print(s)

answer = N * (M + 1) % MOD * s % MOD
answer -= pow(M, N, MOD) * (M + 1) % MOD * N % MOD * (1 + M) % MOD * half % MOD
print(answer)
0