結果
| 問題 | No.754 畳み込みの和 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-12-12 18:29:57 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 24 ms / 5,000 ms | 
| コード長 | 520 bytes | 
| コンパイル時間 | 1,483 ms | 
| コンパイル使用メモリ | 169,356 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-25 03:38:47 | 
| 合計ジャッジ時間 | 2,404 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 3 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<ll> a(n + 1);
    ll s = 0;
    for (int i = 0; i <= n; i++) {
        cin >> a[i];
        (s += a[i]) %= MOD;
    }
    ll ans = 0;
    for (int i = 0; i <= n; i++) {
        ll x;
        cin >> x;
        (ans += x * s % MOD) %= MOD;
        (s += MOD - a[n - i]) %= MOD;
    }
    cout << ans << endl;
    return 0;
}
            
            
            
        