結果

問題 No.1618 Convolution?
ユーザー atjh16atjh16
提出日時 2021-10-20 21:20:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 2,342 ms
コンパイル使用メモリ 201,316 KB
実行使用メモリ 5,292 KB
最終ジャッジ日時 2023-10-20 11:09:19
合計ジャッジ時間 9,514 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int n, t;
int a[200000], b[200000];

int main()
{
	cin >> n;

	for (int i = 0; i < n; i++)
		cin >> a[i];

	for (int i = 0; i < n; i++) {
		cin >> t;
		a[i] += t;

		if (i == 0)
			b[i] = a[i];
		else
			b[i] = b[i - 1] + a[i];
	}

	for (int i = 0; i < n * 2; i++) {
		if (i == 0)
			t = 0;
		else if (i < n + 1)
			t = t + b[i - 1];
		else
			t = t + b[n - 1] - b[i - n - 1] - n * a[i - n - 1];

		cout << t;

		if (i < n * 2 - 1)
			cout << " ";
		else
			cout << endl;
	}
}
0