結果

問題 No.1325 Subsequence Score
ユーザー MisterMister
提出日時 2021-01-05 20:58:37
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 501 bytes
コンパイル時間 593 ms
コンパイル使用メモリ 72,960 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 00:14:39
合計ジャッジ時間 4,380 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 141 ms
5,376 KB
testcase_14 AC 34 ms
5,376 KB
testcase_15 AC 104 ms
5,376 KB
testcase_16 AC 117 ms
5,376 KB
testcase_17 AC 52 ms
5,376 KB
testcase_18 AC 30 ms
5,376 KB
testcase_19 AC 129 ms
5,376 KB
testcase_20 AC 17 ms
5,376 KB
testcase_21 AC 44 ms
5,376 KB
testcase_22 AC 56 ms
5,376 KB
testcase_23 AC 127 ms
5,376 KB
testcase_24 AC 128 ms
5,376 KB
testcase_25 AC 129 ms
5,376 KB
testcase_26 AC 126 ms
5,376 KB
testcase_27 AC 131 ms
5,376 KB
testcase_28 RE -
testcase_29 AC 2 ms
5,376 KB
testcase_30 RE -
権限があれば一括ダウンロードができます

ソースコード

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