結果

問題 No.1552 Simple Dice Game
ユーザー trineutrontrineutron
提出日時 2021-06-18 23:24:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 824 ms / 2,500 ms
コード長 186 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 76,224 KB
最終ジャッジ日時 2023-09-05 00:16:10
合計ジャッジ時間 11,520 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,532 KB
testcase_01 AC 73 ms
71,116 KB
testcase_02 AC 72 ms
71,360 KB
testcase_03 AC 707 ms
75,980 KB
testcase_04 AC 73 ms
71,152 KB
testcase_05 AC 73 ms
71,248 KB
testcase_06 AC 72 ms
71,372 KB
testcase_07 AC 78 ms
71,124 KB
testcase_08 AC 73 ms
71,064 KB
testcase_09 AC 624 ms
75,988 KB
testcase_10 AC 699 ms
76,088 KB
testcase_11 AC 731 ms
75,988 KB
testcase_12 AC 272 ms
75,952 KB
testcase_13 AC 619 ms
76,032 KB
testcase_14 AC 400 ms
76,176 KB
testcase_15 AC 464 ms
75,996 KB
testcase_16 AC 131 ms
76,116 KB
testcase_17 AC 170 ms
76,224 KB
testcase_18 AC 582 ms
76,092 KB
testcase_19 AC 790 ms
75,800 KB
testcase_20 AC 812 ms
76,196 KB
testcase_21 AC 810 ms
75,940 KB
testcase_22 AC 803 ms
76,080 KB
testcase_23 AC 824 ms
76,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
n, m = map(int, input().split())
ans = (m - 1) * pow(m, n, mod)
for i in range(1, m):
    ans -= 2 * pow(i, n, mod)
print(ans * n * (m + 1) * pow(2, mod - 2, mod) % mod)
0