結果

問題 No.1299 Random Array Score
ユーザー uni_pythonuni_python
提出日時 2020-12-11 22:47:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 732 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 81,584 KB
実行使用メモリ 105,112 KB
最終ジャッジ日時 2023-10-20 01:45:59
合計ジャッジ時間 4,239 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,288 KB
testcase_01 AC 36 ms
53,288 KB
testcase_02 AC 37 ms
53,288 KB
testcase_03 AC 94 ms
99,332 KB
testcase_04 AC 86 ms
105,068 KB
testcase_05 AC 71 ms
95,236 KB
testcase_06 AC 67 ms
90,256 KB
testcase_07 AC 69 ms
92,516 KB
testcase_08 AC 85 ms
105,112 KB
testcase_09 AC 40 ms
59,352 KB
testcase_10 AC 53 ms
75,916 KB
testcase_11 AC 42 ms
62,172 KB
testcase_12 AC 65 ms
87,920 KB
testcase_13 AC 79 ms
103,660 KB
testcase_14 AC 66 ms
88,032 KB
testcase_15 AC 66 ms
90,292 KB
testcase_16 AC 66 ms
90,256 KB
testcase_17 AC 44 ms
65,448 KB
testcase_18 AC 56 ms
79,532 KB
testcase_19 AC 57 ms
81,436 KB
testcase_20 AC 49 ms
72,052 KB
testcase_21 AC 41 ms
59,352 KB
testcase_22 AC 45 ms
66,008 KB
testcase_23 AC 67 ms
90,208 KB
testcase_24 AC 71 ms
95,208 KB
testcase_25 AC 65 ms
88,012 KB
testcase_26 AC 40 ms
59,352 KB
testcase_27 AC 45 ms
66,668 KB
testcase_28 AC 43 ms
64,992 KB
testcase_29 AC 47 ms
68,096 KB
testcase_30 AC 64 ms
87,840 KB
testcase_31 AC 48 ms
68,192 KB
testcase_32 AC 81 ms
103,532 KB
testcase_33 AC 92 ms
99,504 KB
testcase_34 AC 70 ms
95,228 KB
testcase_35 AC 93 ms
99,500 KB
testcase_36 AC 69 ms
95,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

"""
i回目に選ばれたものは,そのあとK回まで追加で加算され続ける

aが選ばれたとして,
数列+a
数列+3a
数列+7a

後i回でaが選ばれたとすると,全ての要素に+a*2^(i-1)かな,
毎回aが選ばれたとして
1+2+4+...+2^(K-1) = 2^K - 1なので,
K2=(2^K-1)として
a*K2だけ全ての要素に足される

a=ave(A)として
合計の増分がave(A)*K2 * N = sum(A)*K2

わー,sample合わないと思ってたらmodし忘れ...
"""
mod=998244353


N,K=MI()
A=LI()


P=pow(2,K,mod)

S=(sum(A)%mod * P)

print(S%mod)
0