結果

問題 No.1299 Random Array Score
ユーザー roarisroaris
提出日時 2020-11-27 22:45:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 318 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 105,192 KB
最終ジャッジ日時 2023-10-09 20:47:16
合計ジャッジ時間 14,067 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
71,448 KB
testcase_01 AC 61 ms
71,552 KB
testcase_02 AC 61 ms
71,652 KB
testcase_03 AC 652 ms
100,504 KB
testcase_04 AC 627 ms
100,416 KB
testcase_05 AC 508 ms
100,404 KB
testcase_06 AC 437 ms
97,500 KB
testcase_07 AC 458 ms
97,796 KB
testcase_08 AC 588 ms
100,080 KB
testcase_09 AC 84 ms
76,920 KB
testcase_10 AC 273 ms
87,440 KB
testcase_11 AC 127 ms
78,100 KB
testcase_12 AC 460 ms
95,444 KB
testcase_13 AC 597 ms
99,964 KB
testcase_14 AC 435 ms
95,316 KB
testcase_15 AC 459 ms
97,616 KB
testcase_16 AC 475 ms
97,640 KB
testcase_17 AC 144 ms
79,436 KB
testcase_18 AC 279 ms
88,936 KB
testcase_19 AC 348 ms
91,632 KB
testcase_20 AC 221 ms
83,524 KB
testcase_21 AC 81 ms
76,884 KB
testcase_22 AC 157 ms
80,076 KB
testcase_23 AC 420 ms
97,732 KB
testcase_24 AC 480 ms
100,376 KB
testcase_25 AC 412 ms
95,456 KB
testcase_26 AC 79 ms
76,900 KB
testcase_27 AC 165 ms
80,476 KB
testcase_28 AC 139 ms
78,912 KB
testcase_29 AC 178 ms
82,012 KB
testcase_30 AC 401 ms
95,284 KB
testcase_31 AC 191 ms
81,864 KB
testcase_32 AC 550 ms
100,028 KB
testcase_33 AC 637 ms
100,456 KB
testcase_34 AC 591 ms
105,192 KB
testcase_35 WA -
testcase_36 AC 92 ms
103,608 KB
権限があれば一括ダウンロードができます

ソースコード

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))
    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