結果
| 問題 | No.206 数の積集合を求めるクエリ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-04-01 22:04:41 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 913 ms / 7,000 ms |
| コード長 | 500 bytes |
| 記録 | |
| コンパイル時間 | 1,817 ms |
| コンパイル使用メモリ | 195,476 KB |
| 最終ジャッジ日時 | 2025-01-28 14:03:28 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define bokusunny ios::sync_with_stdio(false), cin.tie(nullptr);
void solve() {
int L, M, N;
cin >> L >> M >> N;
bitset<100010> A, B;
for (int i = 0; i < L; i++) {
int a;
cin >> a;
A.set(a);
}
for (int i = 0; i < M; i++) {
int b;
cin >> b;
B.set(b);
}
int Q;
cin >> Q;
for (int v = 0; v < Q; v++) {
cout << (A & B).count() << endl;
B <<= 1;
}
}
int main() {
bokusunny;
solve();
return 0;
}