結果

問題 No.1681 +-*
ユーザー 👑 hitonanodehitonanode
提出日時 2021-08-08 16:37:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 664 ms
コンパイル使用メモリ 74,148 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-12 06:18:13
合計ジャッジ時間 2,715 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 39 ms
4,376 KB
testcase_06 AC 40 ms
4,376 KB
testcase_07 AC 39 ms
4,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 38 ms
4,376 KB
testcase_14 AC 74 ms
4,376 KB
testcase_15 WA -
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 74 ms
4,380 KB
testcase_18 AC 74 ms
4,376 KB
testcase_19 AC 74 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// WA
#include <iostream>
#include <vector>
using namespace std;
#include <atcoder/modint>
using mint = atcoder::modint1000000007;

int main() {
    int N;
    cin >> N;
    mint ret = 0, prod = 1;

    const mint d23 = mint(2) / 3;
    for (int i = 0; i < N; i++) {
        ret *= 3;
        int a;
        cin >> a;
        prod *= mint(a);
        ret += prod * d23;
    }
    cout << ret.val() << '\n';
}
0