結果

問題 No.206 数の積集合を求めるクエリ
ユーザー tsugutsugutsugutsugu
提出日時 2023-06-15 01:01:59
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,547 ms / 7,000 ms
コード長 734 bytes
コンパイル時間 3,139 ms
コンパイル使用メモリ 246,588 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-05 09:37:11
合計ジャッジ時間 16,284 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 4 ms
4,376 KB
testcase_12 AC 48 ms
4,380 KB
testcase_13 AC 41 ms
4,380 KB
testcase_14 AC 48 ms
4,380 KB
testcase_15 AC 48 ms
4,380 KB
testcase_16 AC 48 ms
4,380 KB
testcase_17 AC 19 ms
4,376 KB
testcase_18 AC 10 ms
4,380 KB
testcase_19 AC 17 ms
4,384 KB
testcase_20 AC 10 ms
4,380 KB
testcase_21 AC 12 ms
4,380 KB
testcase_22 AC 13 ms
4,376 KB
testcase_23 AC 17 ms
4,376 KB
testcase_24 AC 1,545 ms
4,380 KB
testcase_25 AC 1,545 ms
4,376 KB
testcase_26 AC 1,547 ms
4,380 KB
testcase_27 AC 1,120 ms
4,380 KB
testcase_28 AC 1,543 ms
4,380 KB
testcase_29 AC 1,547 ms
4,376 KB
testcase_30 AC 1,538 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include "debug.hpp"
#else
#define debug(...) 1
#endif

const int mxN = 100005 * 2;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int L, M, N;
    cin >> L >> M >> N;
    vector<int> A(L), B(M);
    for (int i = 0; i < L; i++) {
        cin >> A[i];
        A[i]--;
    }
    for (int i = 0; i < M; i++) {
        cin >> B[i];
        B[i]--;
    }
    bitset<mxN> X, Y;
    for (int i = 0; i < L; i++) {
        X.set(A[i], 1);
    }
    for (int i = 0; i < M; i++) {
        Y.set(B[i], 1);
    }
    int Q;
    cin >> Q;
    for (int i = 0; i < Q; i++) {
        int ans = (X & Y).count();
        cout << ans << '\n';
        Y <<= 1;
    }
}
0