結果

問題 No.1897 Sum of 2nd Max
ユーザー googol_S0googol_S0
提出日時 2022-04-08 22:04:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 236 ms / 2,000 ms
コード長 161 bytes
コンパイル時間 654 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 76,348 KB
最終ジャッジ日時 2023-08-19 00:38:43
合計ジャッジ時間 6,039 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
71,440 KB
testcase_01 AC 55 ms
71,584 KB
testcase_02 AC 57 ms
71,160 KB
testcase_03 AC 196 ms
76,168 KB
testcase_04 AC 200 ms
76,112 KB
testcase_05 AC 133 ms
76,124 KB
testcase_06 AC 134 ms
76,124 KB
testcase_07 AC 155 ms
76,244 KB
testcase_08 AC 137 ms
76,124 KB
testcase_09 AC 204 ms
76,060 KB
testcase_10 AC 196 ms
75,972 KB
testcase_11 AC 197 ms
76,348 KB
testcase_12 AC 198 ms
76,204 KB
testcase_13 AC 197 ms
76,112 KB
testcase_14 AC 94 ms
76,028 KB
testcase_15 AC 92 ms
76,016 KB
testcase_16 AC 113 ms
75,752 KB
testcase_17 AC 103 ms
75,976 KB
testcase_18 AC 110 ms
75,996 KB
testcase_19 AC 59 ms
71,376 KB
testcase_20 AC 58 ms
71,324 KB
testcase_21 AC 58 ms
71,536 KB
testcase_22 AC 56 ms
71,420 KB
testcase_23 AC 57 ms
71,412 KB
testcase_24 AC 56 ms
71,416 KB
testcase_25 AC 57 ms
71,560 KB
testcase_26 AC 56 ms
71,316 KB
testcase_27 AC 58 ms
71,260 KB
testcase_28 AC 58 ms
71,608 KB
testcase_29 AC 58 ms
71,468 KB
testcase_30 AC 198 ms
76,204 KB
testcase_31 AC 211 ms
76,124 KB
testcase_32 AC 178 ms
76,084 KB
testcase_33 AC 236 ms
75,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
mod=998244353
ANS=0
for i in range(1,K+1):
  ANS=(ANS+pow(K-i,N,mod)+(N*i%mod)*pow(K-i,N-1,mod))%mod
print((K*pow(K,N,mod)-ANS)%mod)
0