結果

問題 No.1299 Random Array Score
ユーザー kohei2019
提出日時 2020-12-12 23:09:10
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 32,696 KB
最終ジャッジ日時 2024-09-19 22:32:18
合計ジャッジ時間 4,149 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 WA * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K =map(int,input().split())
lsA = list(map(int,input().split()))
#1回目で増える期待値,∑1/N*lsA[i]*N=sum(lsA)
mod = 998244353
sumA = sum(lsA)%mod
#1,2,4,8倍.....
#modpow
def modPow(a,n,mod):#繰り返し二乗法 a**n % mod
    if n==0:
        return 1
    if n==1:
        return a%mod
    if n % 2 == 1:
        return (a*modPow(a,n-1,mod)) % mod
    t = modPow(a,n/2,mod)
    return (t*t)%mod
ans = sumA*modPow(2,K,mod)
ans %= mod
print(ans)
0