結果

問題 No.1325 Subsequence Score
ユーザー tktk_snsn
提出日時 2020-12-22 02:48:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 153,976 KB
最終ジャッジ日時 2024-09-21 13:40:38
合計ジャッジ時間 4,093 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
mod = 998244353

ans = 0
cnt = pow(2, N - 1, mod)
d = pow(2, N - 2, mod)
for a in A:
    ans += a * cnt
    ans %= mod
    cnt += d
    cnt %= mod

print(ans)
0