結果

問題 No.206 数の積集合を求めるクエリ
ユーザー mamekinmamekin
提出日時 2016-10-09 13:16:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 845 ms / 7,000 ms
コード長 882 bytes
コンパイル時間 1,049 ms
コンパイル使用メモリ 101,092 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-14 02:46:02
合計ジャッジ時間 8,597 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 3 ms
4,384 KB
testcase_09 AC 2 ms
4,384 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,384 KB
testcase_12 AC 26 ms
4,380 KB
testcase_13 AC 21 ms
4,384 KB
testcase_14 AC 25 ms
4,384 KB
testcase_15 AC 25 ms
4,384 KB
testcase_16 AC 25 ms
4,384 KB
testcase_17 AC 45 ms
4,380 KB
testcase_18 AC 22 ms
4,384 KB
testcase_19 AC 40 ms
4,380 KB
testcase_20 AC 23 ms
4,380 KB
testcase_21 AC 30 ms
4,380 KB
testcase_22 AC 28 ms
4,380 KB
testcase_23 AC 41 ms
4,384 KB
testcase_24 AC 827 ms
4,384 KB
testcase_25 AC 828 ms
4,380 KB
testcase_26 AC 815 ms
4,384 KB
testcase_27 AC 593 ms
4,384 KB
testcase_28 AC 806 ms
4,380 KB
testcase_29 AC 845 ms
4,384 KB
testcase_30 AC 808 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

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-1] = true;
    }
    for(int i=0; i<m; ++i){
        int x;
        cin >> x;
        b[x-1] = true;
    }

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

    return 0;
}
0