結果

問題 No.1618 Convolution?
ユーザー 沙耶花沙耶花
提出日時 2021-07-22 21:36:11
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 427 ms / 2,000 ms
コード長 675 bytes
コンパイル時間 5,727 ms
コンパイル使用メモリ 261,152 KB
実行使用メモリ 29,232 KB
最終ジャッジ日時 2023-09-24 16:01:29
合計ジャッジ時間 13,957 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 377 ms
23,984 KB
testcase_03 AC 397 ms
27,476 KB
testcase_04 AC 227 ms
18,952 KB
testcase_05 AC 23 ms
4,468 KB
testcase_06 AC 403 ms
25,256 KB
testcase_07 AC 400 ms
25,156 KB
testcase_08 AC 231 ms
19,392 KB
testcase_09 AC 422 ms
28,932 KB
testcase_10 AC 378 ms
19,992 KB
testcase_11 AC 419 ms
27,660 KB
testcase_12 AC 426 ms
29,104 KB
testcase_13 AC 427 ms
29,232 KB
testcase_14 AC 421 ms
29,088 KB
testcase_15 AC 424 ms
28,924 KB
testcase_16 AC 427 ms
28,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001

vector<long long> c;

void go(vector<long long> a){
	vector<long long> b(a.size());
	rep(i,b.size())b[i] = i;
	
	auto ret = convolution_ll(a,b);
	
	rep(i,ret.size())c[i] += ret[i];
	
}

int main(){
	
	int N;
	cin>>N;
	
	vector<long long> a(N+1),b(N+1);
	rep(i,N){
		scanf("%lld",&a[i+1]);
	}
	rep(i,N){
		scanf("%lld",&b[i+1]);
	}
	c.resize(N*2+1,0LL);
	
	go(a);
	go(b);
	
	for(int i=1;i<=2*N;i++){
		if(i!=1)printf(" ");
		printf("%lld",c[i]);
	}

	return 0;
}
0