結果

問題 No.1325 Subsequence Score
ユーザー flippergo
提出日時 2020-12-31 00:14:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 664 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 154,036 KB
最終ジャッジ日時 2024-10-08 08:30:21
合計ジャッジ時間 4,881 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

p = 998244353
N = int(input())
A = list(map(int,input().split()))
A.insert(0,0)
if N==1:
    ans = A[1]%p
else:
    a = 1
    i = 0
    while i<N-2:
        a = (a*2)%p
        i += 1
    b = 0
    for i in range(1,N+1):
        b = (b+(i+1)*A[i])%p
    ans = (a*b)%p
print(ans)
0