結果

問題 No.206 数の積集合を求めるクエリ
ユーザー pekempey
提出日時 2016-04-01 18:02:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1,153 ms / 7,000 ms
コード長 489 bytes
コンパイル時間 1,297 ms
コンパイル使用メモリ 160,984 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-02 08:50:50
合計ジャッジ時間 10,630 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define fr(i, a, b) for (int i = (a); i < (b); i++)
using namespace std;
typedef long long ll;
const ll inf = 1e9;
const ll mod = 1e9 + 7;

typedef bitset<101010> BIT;

int L, M, N;
BIT A, B;
int Q;

int main() {
	cin >> L >> M >> N;

	rep(i, L) {
		int a;
		cin >> a;
		A[a] = true;
	}

	rep(i, M) {
		int b;
		cin >> b;
		B[b] = true;
	}

	cin >> Q;

	rep(i, Q) {
		cout << (A & B).count() << endl;
		B <<= 1;
	}
}
0