結果

問題 No.754 畳み込みの和
コンテスト
ユーザー ミドリムシ
提出日時 2018-12-02 08:00:50
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 470 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 415 ms
コンパイル使用メモリ 79,024 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-16 12:19:34
合計ジャッジ時間 972 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
    int n;
    cin >> n;
    n++;
    long a_sum = 0;
    long a_sums[n];
    for(int i = 0; i < n; i++){
        long a;
        cin >> a;
        a_sum += a;
        a_sums[i] = a_sum;
    }
    long ans = 0;
    for(int i = 0; i < n; i++){
        int b;
        cin >> b;
        ans += a_sums[n - i - 1] * b;
        ans %= long(1e9 + 7);
    }
    cout << ans << endl;
}
0