結果

問題 No.1299 Random Array Score
ユーザー roarisroaris
提出日時 2020-11-27 22:43:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 647 ms / 2,000 ms
コード長 274 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 105,160 KB
最終ジャッジ日時 2023-10-09 20:46:54
合計ジャッジ時間 14,073 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
71,456 KB
testcase_01 AC 60 ms
71,276 KB
testcase_02 AC 58 ms
71,320 KB
testcase_03 AC 612 ms
100,496 KB
testcase_04 AC 645 ms
100,408 KB
testcase_05 AC 495 ms
100,116 KB
testcase_06 AC 435 ms
97,796 KB
testcase_07 AC 447 ms
97,904 KB
testcase_08 AC 587 ms
100,156 KB
testcase_09 AC 83 ms
76,552 KB
testcase_10 AC 268 ms
87,508 KB
testcase_11 AC 123 ms
77,956 KB
testcase_12 AC 452 ms
95,372 KB
testcase_13 AC 576 ms
100,080 KB
testcase_14 AC 435 ms
95,360 KB
testcase_15 AC 453 ms
97,820 KB
testcase_16 AC 464 ms
97,868 KB
testcase_17 AC 140 ms
79,388 KB
testcase_18 AC 284 ms
88,900 KB
testcase_19 AC 350 ms
91,516 KB
testcase_20 AC 219 ms
83,548 KB
testcase_21 AC 79 ms
76,740 KB
testcase_22 AC 151 ms
79,764 KB
testcase_23 AC 421 ms
97,676 KB
testcase_24 AC 477 ms
100,140 KB
testcase_25 AC 425 ms
95,392 KB
testcase_26 AC 83 ms
76,876 KB
testcase_27 AC 160 ms
80,472 KB
testcase_28 AC 140 ms
78,736 KB
testcase_29 AC 184 ms
81,908 KB
testcase_30 AC 397 ms
95,328 KB
testcase_31 AC 196 ms
81,728 KB
testcase_32 AC 620 ms
99,996 KB
testcase_33 AC 647 ms
100,292 KB
testcase_34 AC 621 ms
105,160 KB
testcase_35 AC 172 ms
100,320 KB
testcase_36 AC 159 ms
104,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
A = list(map(int, input().split()))
MOD = 998244353
S = sum(A)*pow(N, K, MOD)

for Ai in A:
    S = (S+N*(pow(2, K, MOD)-1)*Ai*pow(N, K-1, MOD))%MOD

S = (S*pow(pow(N, K, MOD), MOD-2, MOD))%MOD
print(S)
0