結果

問題 No.206 数の積集合を求めるクエリ
ユーザー kyuna
提出日時 2020-02-06 15:15:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1,126 ms / 7,000 ms
コード長 474 bytes
コンパイル時間 663 ms
コンパイル使用メモリ 72,184 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-25 06:49:01
合計ジャッジ時間 10,108 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <vector>
#include <bitset>
using namespace std;

int main() {
    int L, M, N; cin >> L >> M >> N;
    bitset<100000> as, bs;
    for (int i = 0; i < L; i++) {
        int a; cin >> a;
        as[a - 1] = 1;
    }
    for (int i = 0; i < M; i++) {
        int b; cin >> b;
        bs[b - 1] = 1;
    }
    int q; cin >> q;
    for (int i = 0; i < q; i++) {
        cout << (as & bs << i).count() << endl;
    }
	return 0;
}
0