結果

問題 No.206 数の積集合を求めるクエリ
ユーザー bokusunny
提出日時 2022-04-01 22:04:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 913 ms / 7,000 ms
コード長 500 bytes
コンパイル時間 1,817 ms
コンパイル使用メモリ 195,476 KB
最終ジャッジ日時 2025-01-28 14:03:28
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define bokusunny ios::sync_with_stdio(false), cin.tie(nullptr);

void solve() {
  int L, M, N;
  cin >> L >> M >> N;
  bitset<100010> A, B;
  for (int i = 0; i < L; i++) {
    int a;
    cin >> a;
    A.set(a);
  }
  for (int i = 0; i < M; i++) {
    int b;
    cin >> b;
    B.set(b);
  }

  int Q;
  cin >> Q;
  for (int v = 0; v < Q; v++) {
    cout << (A & B).count() << endl;
    B <<= 1;
  }
}

int main() {
  bokusunny;
  solve();

  return 0;
}
0