結果

問題 No.206 数の積集合を求めるクエリ
ユーザー uenokuuenoku
提出日時 2017-01-14 00:49:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,789 ms / 7,000 ms
コード長 1,048 bytes
コンパイル時間 976 ms
コンパイル使用メモリ 94,920 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-23 10:27:20
合計ジャッジ時間 15,569 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 3 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 3 ms
4,376 KB
testcase_09 AC 3 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 5 ms
4,380 KB
testcase_12 AC 57 ms
4,376 KB
testcase_13 AC 47 ms
4,376 KB
testcase_14 AC 57 ms
4,376 KB
testcase_15 AC 56 ms
4,380 KB
testcase_16 AC 56 ms
4,376 KB
testcase_17 AC 52 ms
4,380 KB
testcase_18 AC 27 ms
4,376 KB
testcase_19 AC 47 ms
4,380 KB
testcase_20 AC 27 ms
4,380 KB
testcase_21 AC 33 ms
4,376 KB
testcase_22 AC 33 ms
4,376 KB
testcase_23 AC 48 ms
4,380 KB
testcase_24 AC 1,780 ms
4,376 KB
testcase_25 AC 1,789 ms
4,376 KB
testcase_26 AC 1,759 ms
4,380 KB
testcase_27 AC 1,294 ms
4,500 KB
testcase_28 AC 1,755 ms
4,376 KB
testcase_29 AC 1,763 ms
4,380 KB
testcase_30 AC 1,730 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "math.h"
#include <algorithm>
#include <bitset>
#include <complex>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
#define ifor(i, a, b) for (int i = (a); i < (b); i++)
#define rfor(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
using namespace std;
typedef long double ld;
typedef long long int lli;
typedef complex<double> P;
const double eps = 1e-11;
int vex[4] = {1, 0, -1, 0};
int vey[4] = {0, 1, 0, -1};
typedef vector<double> Vec;
typedef vector<int> vec;
typedef vector<Vec> MAT;
typedef vector<vec> mat;
lli MOD = 1000000007;

bitset<200005> A;
bitset<200005> B;
int main()
{
    int l, m, n;
    int a, b;
    cin >> l >> m >> n;
    rep(i, l)
    {
        cin >> a;
        A[a] = 1;
    }
    rep(i, m)
    {
        cin >> a;
        B[a] = 1;
    }
    int q;
    cin >> q;
    rep(i, q)
    {
        cout << (A & (B << i)).count() << endl;
    }
}
0