結果

問題 No.1299 Random Array Score
ユーザー kohei2019kohei2019
提出日時 2020-12-12 23:18:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 11,936 KB
実行使用メモリ 32,660 KB
最終ジャッジ日時 2023-10-20 02:45:50
合計ジャッジ時間 3,688 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,192 KB
testcase_01 AC 28 ms
10,192 KB
testcase_02 AC 31 ms
10,192 KB
testcase_03 AC 95 ms
31,872 KB
testcase_04 AC 88 ms
31,196 KB
testcase_05 AC 76 ms
26,584 KB
testcase_06 AC 68 ms
24,920 KB
testcase_07 AC 73 ms
25,344 KB
testcase_08 AC 89 ms
31,120 KB
testcase_09 AC 30 ms
10,832 KB
testcase_10 AC 52 ms
18,556 KB
testcase_11 AC 35 ms
12,132 KB
testcase_12 AC 69 ms
23,816 KB
testcase_13 AC 91 ms
30,892 KB
testcase_14 AC 69 ms
24,360 KB
testcase_15 AC 70 ms
24,612 KB
testcase_16 AC 69 ms
24,916 KB
testcase_17 AC 37 ms
12,776 KB
testcase_18 AC 55 ms
19,200 KB
testcase_19 AC 60 ms
20,712 KB
testcase_20 AC 45 ms
15,672 KB
testcase_21 AC 29 ms
10,572 KB
testcase_22 AC 38 ms
13,292 KB
testcase_23 AC 71 ms
24,396 KB
testcase_24 AC 78 ms
26,524 KB
testcase_25 AC 71 ms
24,324 KB
testcase_26 AC 29 ms
10,512 KB
testcase_27 AC 40 ms
13,892 KB
testcase_28 AC 36 ms
12,624 KB
testcase_29 AC 41 ms
14,520 KB
testcase_30 AC 68 ms
23,772 KB
testcase_31 AC 43 ms
14,816 KB
testcase_32 AC 91 ms
30,532 KB
testcase_33 AC 93 ms
32,660 KB
testcase_34 AC 65 ms
14,160 KB
testcase_35 AC 93 ms
32,660 KB
testcase_36 AC 64 ms
14,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10**7)
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)
#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