結果

問題 No.1552 Simple Dice Game
ユーザー titiatitia
提出日時 2021-06-19 02:20:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,487 ms / 2,500 ms
コード長 217 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 77,428 KB
最終ジャッジ日時 2023-09-05 00:38:54
合計ジャッジ時間 30,436 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,176 KB
testcase_01 AC 71 ms
71,312 KB
testcase_02 AC 69 ms
71,616 KB
testcase_03 AC 2,171 ms
77,116 KB
testcase_04 AC 68 ms
71,496 KB
testcase_05 AC 69 ms
71,448 KB
testcase_06 AC 70 ms
71,464 KB
testcase_07 AC 69 ms
71,168 KB
testcase_08 AC 70 ms
71,356 KB
testcase_09 AC 1,889 ms
77,100 KB
testcase_10 AC 2,137 ms
76,884 KB
testcase_11 AC 2,221 ms
76,988 KB
testcase_12 AC 707 ms
77,236 KB
testcase_13 AC 1,855 ms
77,044 KB
testcase_14 AC 1,138 ms
76,960 KB
testcase_15 AC 1,350 ms
76,996 KB
testcase_16 AC 253 ms
77,104 KB
testcase_17 AC 394 ms
76,960 KB
testcase_18 AC 1,745 ms
77,100 KB
testcase_19 AC 2,446 ms
76,904 KB
testcase_20 AC 2,452 ms
77,428 KB
testcase_21 AC 2,452 ms
77,316 KB
testcase_22 AC 2,438 ms
77,212 KB
testcase_23 AC 2,487 ms
77,120 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*((1+1+s)+(M+M-s))*N*INV*INV
    ANS%=mod

print(ANS)
0