結果

問題 No.1681 +-*
ユーザー 259_Momone259_Momone
提出日時 2021-09-17 21:38:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 719 bytes
コンパイル時間 2,167 ms
コンパイル使用メモリ 201,444 KB
実行使用メモリ 6,484 KB
最終ジャッジ日時 2023-09-12 07:03:27
合計ジャッジ時間 5,002 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>

int main(){
    using namespace std;
    constexpr unsigned long MOD{1000000007};
    unsigned long N;
    cin >> N;
    const auto mul_mod{[](auto a, auto b){return a * b % MOD;}};
    vector<unsigned long> A(N);
    for(auto&& i : A)cin >> i;
    inclusive_scan(begin(A), end(A), begin(A), mul_mod);
    vector<unsigned long> coef(N, 3);
    coef.back() = 1;
    coef.rbegin()[1] = 2;
    inclusive_scan(rbegin(coef), rend(coef), rbegin(coef), mul_mod);
    for(const auto& i : A)cout << i << " ";
    cout << endl;
    for(const auto& i : coef)cout << i << " ";
    cout << endl;
    cout << inner_product(begin(A), end(A), begin(coef), 0UL, plus<>{}, mul_mod) % MOD << endl;
    return 0;
}
0