結果
問題 | No.2111 Sum of Diff |
ユーザー |
![]() |
提出日時 | 2022-10-28 22:32:17 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 499 bytes |
コンパイル時間 | 1,789 ms |
コンパイル使用メモリ | 195,608 KB |
最終ジャッジ日時 | 2025-02-08 14:45:10 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | WA * 20 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)#define ALL(v) v.begin(),v.end()typedef long long ll;#include<bits/stdc++.h>using namespace std;const int MOD=998244353;int main(){ios::sync_with_stdio(false);std::cin.tie(nullptr);int n;cin>>n;vector<ll> A(n);rep(i,n) cin>>A[i];ll ans=0;vector<ll> B(200200);B[0]=1LL;for(int i=1;i<200200;i++) B[i]=B[i-1]*2;rep(i,n){ans=(ans+A[i]*(B[n-1-i]-B[i]+MOD)%MOD)%MOD;}cout<<ans<<endl;return 0;}