結果

問題 No.754 畳み込みの和
ユーザー ミドリムシミドリムシ
提出日時 2018-12-02 08:00:50
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 470 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 60,516 KB
実行使用メモリ 4,400 KB
最終ジャッジ日時 2023-09-10 11:08:09
合計ジャッジ時間 1,541 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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