結果

問題 No.1618 Convolution?
ユーザー monnumonnu
提出日時 2021-07-23 19:07:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 498 ms / 2,000 ms
コード長 540 bytes
コンパイル時間 6,174 ms
コンパイル使用メモリ 226,536 KB
実行使用メモリ 25,448 KB
最終ジャッジ日時 2023-09-25 18:01:21
合計ジャッジ時間 17,659 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 401 ms
21,124 KB
testcase_03 AC 420 ms
23,864 KB
testcase_04 AC 268 ms
16,888 KB
testcase_05 AC 26 ms
4,376 KB
testcase_06 AC 452 ms
21,988 KB
testcase_07 AC 456 ms
22,036 KB
testcase_08 AC 270 ms
16,916 KB
testcase_09 AC 488 ms
25,256 KB
testcase_10 AC 422 ms
18,816 KB
testcase_11 AC 477 ms
24,016 KB
testcase_12 AC 496 ms
25,448 KB
testcase_13 AC 495 ms
25,328 KB
testcase_14 AC 495 ms
25,416 KB
testcase_15 AC 495 ms
25,296 KB
testcase_16 AC 498 ms
25,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll=long long;
using Graph=vector<vector<pair<int,int>>>;
#define MAX 100
#define MOD 998244353
#define INF 1000000000

int main(){
  int N;
  cin>>N;
  vector<ll> A(N+1,0),B(N+1,0),C(N+1,0);
  for(int i=1;i<=N;i++){
    cin>>A[i];
  }
  for(int i=1;i<=N;i++){
    cin>>B[i];
    C[i]=(ll)i;
  }
  vector<ll> a=convolution_ll(A,C);
  vector<ll> b=convolution_ll(B,C);
  for(int i=1;i<=2*N;i++){
    cout<<a[i]+b[i]<<" ";
  }
  cout<<endl;
}
0