結果

問題 No.206 数の積集合を求めるクエリ
ユーザー pekempey
提出日時 2015-05-12 19:47:19
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2,078 ms / 7,000 ms
コード長 565 bytes
コンパイル時間 1,730 ms
コンパイル使用メモリ 158,952 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-06 00:52:39
合計ジャッジ時間 17,712 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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<200000> 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