結果

問題 No.1325 Subsequence Score
ユーザー Mister
提出日時 2021-01-05 20:58:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 501 bytes
コンパイル時間 546 ms
コンパイル使用メモリ 70,280 KB
最終ジャッジ日時 2025-01-17 09:49:19
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#line 1 "main.cpp"
#include <atcoder/modint>
#include <iostream>

using namespace std;

using mint = atcoder::modint998244353;

void solve() {
    int n;
    cin >> n;

    mint ans = 0;
    for (int i = 0; i < n; ++i) {
        int a;
        cin >> a;
        mint x = a;

        ans += x * (mint(2).pow(n - 1) +
                    mint(2).pow(n - 2) * i);
    }

    cout << ans.val() << "\n";
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    solve();

    return 0;
}
0