結果

問題 No.754 畳み込みの和
ユーザー pyttknpyttkn
提出日時 2018-12-06 00:23:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 689 bytes
コンパイル時間 755 ms
コンパイル使用メモリ 83,664 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-29 17:31:24
合計ジャッジ時間 17,442 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<iomanip>
#include<cassert>
#include<functional>

int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);

	const int subtract = 1000000007;
	int n;
	long long ans = 0;

	std::cin >> n;

	std::vector<int> a(n + 1);
	std::vector<int> b(n + 1);

	for (int i = 0; i < n + 1; i++){
		std::cin >> a[i];
	}
	for (int i = 0; i < n + 1; i++){
		std::cin >> b[i];
	}
	//入力終わり

	for (int i = 0; i < n + 1; i++){
		for (int j = 0; j < n + 1 - i; j++){
			ans += static_cast<long long>(a[i] * b[j]);
		}
	}

	std::cout << ans % subtract << '\n';

	return 0;
}
0