結果

問題 No.754 畳み込みの和
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2019-02-23 22:51:27
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 530 bytes
コンパイル時間 1,155 ms
コンパイル使用メモリ 144,300 KB
実行使用メモリ 4,988 KB
最終ジャッジ日時 2023-08-21 07:41:00
合計ジャッジ時間 1,759 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
4,988 KB
testcase_01 AC 26 ms
4,936 KB
testcase_02 AC 27 ms
4,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
int gcd(int a,int b){return b?gcd(b,a%b):a;}
#define MOD 1000000007

ll a[100001],b[100001];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    ll c=0,d=0;
    cin >> n;
    rep(i,n+1) {
        cin >> a[i];
    }
    rep(i,n+1) {
        cin >> b[i];
    }
    for(int i=n;i>=0;i--) {
        d=(d+b[n-i]%MOD)%MOD;
        c=(c+a[i]*d%MOD)%MOD;
    }
    cout << c << endl;
    return 0;
}
0