結果

問題 No.754 畳み込みの和
ユーザー kpinkcatkpinkcat
提出日時 2023-08-21 20:48:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 573 bytes
コンパイル時間 931 ms
コンパイル使用メモリ 103,740 KB
実行使用メモリ 13,572 KB
最終ジャッジ日時 2023-08-21 20:49:13
合計ジャッジ時間 13,533 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
using namespace std;


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