結果
| 問題 | 
                            No.2550 MORE! JUMP! MORE!
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-09-18 00:30:16 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 470 bytes | 
| コンパイル時間 | 1,925 ms | 
| コンパイル使用メモリ | 194,856 KB | 
| 最終ジャッジ日時 | 2025-02-24 09:11:42 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge6 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 20 WA * 20 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll N,mod=998244353;;
    cin>>N;
    vector<ll> A(N),P(N+1,1);
    for(int i=0;i<N;i++){
        cin>>A[i];
        P[i+1]=(P[i]*2)%mod;
    }
    ll an=0;
    for(int i=0;i<N;i++){
        ll res=A[i]*(i*P[i-1]+P[i]);
        res%=mod;
        if(i<N-1)res=(res*P[N-i-2])%mod;
        an+=res;
    }
    cout<<an%mod<<endl;
}