結果

問題 No.1299 Random Array Score
ユーザー roarisroaris
提出日時 2020-11-27 22:45:53
言語 PyPy3
(7.3.13)
結果
RE  
実行時間 -
コード長 322 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 105,164 KB
最終ジャッジ日時 2023-10-09 20:48:25
合計ジャッジ時間 14,207 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
71,284 KB
testcase_01 RE -
testcase_02 AC 60 ms
71,312 KB
testcase_03 AC 604 ms
100,620 KB
testcase_04 AC 637 ms
100,456 KB
testcase_05 AC 498 ms
100,036 KB
testcase_06 AC 442 ms
97,536 KB
testcase_07 AC 454 ms
97,892 KB
testcase_08 AC 591 ms
100,136 KB
testcase_09 AC 84 ms
76,480 KB
testcase_10 AC 277 ms
87,568 KB
testcase_11 AC 124 ms
77,908 KB
testcase_12 AC 451 ms
95,164 KB
testcase_13 AC 577 ms
99,972 KB
testcase_14 AC 434 ms
95,360 KB
testcase_15 AC 459 ms
97,556 KB
testcase_16 AC 470 ms
97,652 KB
testcase_17 AC 147 ms
79,432 KB
testcase_18 AC 283 ms
88,736 KB
testcase_19 AC 345 ms
91,592 KB
testcase_20 AC 220 ms
83,328 KB
testcase_21 AC 79 ms
76,576 KB
testcase_22 AC 153 ms
79,800 KB
testcase_23 AC 431 ms
97,692 KB
testcase_24 AC 494 ms
100,184 KB
testcase_25 AC 418 ms
95,336 KB
testcase_26 AC 79 ms
76,764 KB
testcase_27 AC 160 ms
80,528 KB
testcase_28 AC 137 ms
78,752 KB
testcase_29 AC 186 ms
81,808 KB
testcase_30 AC 396 ms
95,156 KB
testcase_31 AC 193 ms
81,608 KB
testcase_32 AC 555 ms
100,056 KB
testcase_33 AC 642 ms
100,304 KB
testcase_34 AC 584 ms
105,164 KB
testcase_35 RE -
testcase_36 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
A = list(map(int, input().split()))

if K==0:
    print(sum(A)%MOD)
    exit()
    
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