結果

問題 No.1552 Simple Dice Game
ユーザー titiatitia
提出日時 2022-10-12 04:28:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,403 ms / 2,500 ms
コード長 237 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 86,844 KB
実行使用メモリ 76,884 KB
最終ジャッジ日時 2023-09-08 05:07:06
合計ジャッジ時間 29,243 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,336 KB
testcase_01 AC 71 ms
71,120 KB
testcase_02 AC 70 ms
71,132 KB
testcase_03 AC 2,077 ms
76,640 KB
testcase_04 AC 73 ms
71,272 KB
testcase_05 AC 71 ms
71,352 KB
testcase_06 AC 73 ms
71,276 KB
testcase_07 AC 70 ms
71,192 KB
testcase_08 AC 72 ms
71,368 KB
testcase_09 AC 1,812 ms
76,700 KB
testcase_10 AC 2,045 ms
76,808 KB
testcase_11 AC 2,125 ms
76,820 KB
testcase_12 AC 683 ms
76,756 KB
testcase_13 AC 1,773 ms
76,596 KB
testcase_14 AC 1,088 ms
76,776 KB
testcase_15 AC 1,290 ms
76,884 KB
testcase_16 AC 249 ms
75,968 KB
testcase_17 AC 371 ms
76,792 KB
testcase_18 AC 1,674 ms
76,608 KB
testcase_19 AC 2,356 ms
76,700 KB
testcase_20 AC 2,386 ms
76,740 KB
testcase_21 AC 2,381 ms
76,784 KB
testcase_22 AC 2,357 ms
76,824 KB
testcase_23 AC 2,403 ms
76,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ANS=0
INV=pow(2,mod-2,mod)

for s in range(M):
    ko=(pow(s+1,N,mod)-pow(s,N,mod)*2+pow(s-1,N,mod))*(M-s)
    ANS+=ko*s%mod*((1+1+s)+(M+M-s))%mod*N%mod*INV%mod*INV%mod
    ANS%=mod

print(ANS)
0