結果

問題 No.206 数の積集合を求めるクエリ
ユーザー umezoumezo
提出日時 2021-12-11 02:37:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 163 ms / 7,000 ms
コード長 545 bytes
コンパイル時間 4,519 ms
コンパイル使用メモリ 267,032 KB
実行使用メモリ 7,076 KB
最終ジャッジ日時 2023-09-26 06:32:06
合計ジャッジ時間 8,469 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 7 ms
4,380 KB
testcase_13 AC 5 ms
4,380 KB
testcase_14 AC 6 ms
4,380 KB
testcase_15 AC 6 ms
4,384 KB
testcase_16 AC 6 ms
4,380 KB
testcase_17 AC 39 ms
7,060 KB
testcase_18 AC 30 ms
7,032 KB
testcase_19 AC 37 ms
6,932 KB
testcase_20 AC 30 ms
7,012 KB
testcase_21 AC 32 ms
6,904 KB
testcase_22 AC 32 ms
6,940 KB
testcase_23 AC 37 ms
6,968 KB
testcase_24 AC 163 ms
6,912 KB
testcase_25 AC 162 ms
7,024 KB
testcase_26 AC 155 ms
6,900 KB
testcase_27 AC 120 ms
6,904 KB
testcase_28 AC 159 ms
7,076 KB
testcase_29 AC 157 ms
6,896 KB
testcase_30 AC 152 ms
7,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;

#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int l,m,n;
  cin>>l>>m>>n;
  vector<int> A(n+1),B(n+1);
  rep(i,l){
    int a;
    cin>>a;
    A[a]=1;
  }
  rep(i,m){
    int b;
    cin>>b;
    B[n+1-b]=1;
  }
  int q;
  cin>>q;
  vector<int> C=convolution(A,B);
  for(int i=n+1;i<=n+q;i++) cout<<C[i]<<endl;

  return 0;
}
0