結果

問題 No.2111 Sum of Diff
ユーザー kyushu1996
提出日時 2022-11-03 19:18:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 528 bytes
コンパイル時間 745 ms
コンパイル使用メモリ 96,728 KB
最終ジャッジ日時 2025-02-08 17:00:38
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>
#include <map>
#define ll long long
#define endl '\n'
using namespace std;
// category : 

int main() {
    ios_base::sync_with_stdio(false);
    
    int n; cin>>n;
    ll a[n+1], ans=0;

    for(int i=1;i<=n;i++) cin>>a[i];

    for(int i=1;i<=n;i++){
        ans += a[i] * (pow(2,n-i) - pow(2,i-1));
    }
    cout<<(ans+998244353)%998244353<<endl;

	return 0;
}
0