結果

問題 No.206 数の積集合を求めるクエリ
ユーザー umezo
提出日時 2021-12-11 02:37:26
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 174 ms / 7,000 ms
コード長 545 bytes
コンパイル時間 4,486 ms
コンパイル使用メモリ 256,748 KB
最終ジャッジ日時 2025-01-26 07:39:03
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

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