結果

問題 No.206 数の積集合を求めるクエリ
ユーザー lumc_lumc_
提出日時 2018-03-21 19:26:56
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 940 ms / 7,000 ms
コード長 493 bytes
コンパイル時間 2,499 ms
コンパイル使用メモリ 145,672 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-07 01:02:12
合計ジャッジ時間 11,861 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,388 KB
testcase_11 AC 4 ms
4,376 KB
testcase_12 AC 30 ms
4,376 KB
testcase_13 AC 25 ms
4,376 KB
testcase_14 AC 29 ms
4,380 KB
testcase_15 AC 30 ms
4,376 KB
testcase_16 AC 30 ms
4,376 KB
testcase_17 AC 18 ms
4,380 KB
testcase_18 AC 10 ms
4,380 KB
testcase_19 AC 16 ms
4,380 KB
testcase_20 AC 10 ms
4,376 KB
testcase_21 AC 12 ms
4,380 KB
testcase_22 AC 12 ms
4,380 KB
testcase_23 AC 16 ms
4,380 KB
testcase_24 AC 937 ms
4,380 KB
testcase_25 AC 940 ms
4,380 KB
testcase_26 AC 928 ms
4,384 KB
testcase_27 AC 679 ms
4,380 KB
testcase_28 AC 922 ms
4,380 KB
testcase_29 AC 928 ms
4,384 KB
testcase_30 AC 929 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;

const int N = 1e5;
bitset<N> a, b;
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int l, m, n; cin >> l >> m >> n;
  for(int i = 0; i < l; i++) {
    int x = 0; cin >> x; x--;
    a[x] = 1;
  }
  for(int i = 0; i < m; i++) {
    int x = 0; cin >> x; x--;
    b[x] = 1;
  }
  int q; cin >> q;
  cout << (a & b).count() << endl;
  for(int i = 1; i < q; i++) {
    b <<= 1;
    cout << (a & b).count() << endl;
  }
}
0