結果
問題 | No.2550 MORE! JUMP! MORE! |
ユーザー |
|
提出日時 | 2024-09-18 00:30:16 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 470 bytes |
コンパイル時間 | 2,296 ms |
コンパイル使用メモリ | 202,508 KB |
実行使用メモリ | 6,400 KB |
最終ジャッジ日時 | 2024-09-18 00:30:22 |
合計ジャッジ時間 | 5,246 ms |
ジャッジサーバー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; }