結果

問題 No.206 数の積集合を求めるクエリ
ユーザー mamekinmamekin
提出日時 2016-10-09 13:15:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 878 bytes
コンパイル時間 831 ms
コンパイル使用メモリ 102,380 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-01 15:41:40
合計ジャッジ時間 9,022 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 3 ms
5,376 KB
testcase_12 AC 29 ms
5,376 KB
testcase_13 AC 25 ms
5,376 KB
testcase_14 AC 30 ms
5,376 KB
testcase_15 AC 30 ms
5,376 KB
testcase_16 AC 30 ms
5,376 KB
testcase_17 AC 56 ms
5,376 KB
testcase_18 AC 28 ms
5,376 KB
testcase_19 AC 49 ms
5,376 KB
testcase_20 AC 28 ms
5,376 KB
testcase_21 AC 34 ms
5,376 KB
testcase_22 AC 36 ms
5,376 KB
testcase_23 AC 50 ms
5,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 920 ms
5,376 KB
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

const int MAX = 100000;

int main()
{
    int l, m, n;
    cin >> l >> m >> n;

    bitset<MAX> a, b;
    for(int i=0; i<l; ++i){
        int x;
        cin >> x;
        a[x] = true;
    }
    for(int i=0; i<m; ++i){
        int x;
        cin >> x;
        b[x] = true;
    }

    int q;
    cin >> q;
    while(--q >= 0){
        int ans = (a & b).count();
        cout << ans << endl;
        b <<= 1;
    }

    return 0;
}
0