結果

問題 No.206 数の積集合を求めるクエリ
ユーザー nCk_cvnCk_cv
提出日時 2015-12-22 18:20:33
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 741 bytes
コンパイル時間 1,448 ms
コンパイル使用メモリ 74,112 KB
実行使用メモリ 8,060 KB
最終ジャッジ日時 2023-10-18 22:39:01
合計ジャッジ時間 26,428 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
7,280 KB
testcase_01 AC 6 ms
7,280 KB
testcase_02 AC 9 ms
7,280 KB
testcase_03 AC 6 ms
7,280 KB
testcase_04 AC 5 ms
7,280 KB
testcase_05 AC 6 ms
7,280 KB
testcase_06 AC 7 ms
7,292 KB
testcase_07 AC 6 ms
7,292 KB
testcase_08 AC 7 ms
7,296 KB
testcase_09 AC 7 ms
7,296 KB
testcase_10 AC 34 ms
7,280 KB
testcase_11 AC 148 ms
7,280 KB
testcase_12 AC 2,847 ms
7,304 KB
testcase_13 AC 2,412 ms
7,296 KB
testcase_14 AC 2,849 ms
7,296 KB
testcase_15 AC 2,856 ms
7,292 KB
testcase_16 AC 3,055 ms
7,292 KB
testcase_17 AC 63 ms
8,060 KB
testcase_18 AC 35 ms
7,672 KB
testcase_19 AC 56 ms
7,984 KB
testcase_20 AC 34 ms
7,672 KB
testcase_21 AC 42 ms
7,768 KB
testcase_22 AC 40 ms
7,768 KB
testcase_23 AC 57 ms
8,004 KB
testcase_24 TLE -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <map>
#include <queue>
#include <memory.h>
#include <bitset>
using namespace std;
const int INF = 2 << 27;

typedef pair<int,int> P;

int main() {
  int l,m,n;
  cin >> l >> m >> n;
  int a[l];
  int b[m];
  for(int i = 0; i < l; i++) {
    cin >> a[i];
  }
  for(int i = 0; i < m; i++) {
    cin >> b[i];
  }
  bitset<10000000> A;
  bitset<10000000> B;
  for(int i = 0; i < l; i++) {
    A.set(a[i]);
  }
  for(int i = 0; i < m; i++) {
    B.set(b[i]);
  }

  int q;
  cin >> q;
  for(int i = 0; i < q; i++) {
    int count = 0;
    count += (A & B).count();
    B <<= 1;
    std::cout << count << std::endl;
  }


}
0