結果
| 問題 | 
                            No.1325 Subsequence Score
                             | 
                    
| コンテスト | |
| ユーザー | 
                             tktk_snsn
                         | 
                    
| 提出日時 | 2020-12-22 02:54:18 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 149 ms / 2,000 ms | 
| コード長 | 256 bytes | 
| コンパイル時間 | 244 ms | 
| コンパイル使用メモリ | 81,924 KB | 
| 実行使用メモリ | 154,048 KB | 
| 最終ジャッジ日時 | 2024-09-21 13:40:57 | 
| 合計ジャッジ時間 | 4,080 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 28 | 
ソースコード
N = int(input())
A = list(map(int, input().split()))
mod = 998244353
if N == 1:
    print(A[0] % mod)
    exit()
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)
            
            
            
        
            
tktk_snsn