結果
問題 |
No.206 数の積集合を求めるクエリ
|
ユーザー |
|
提出日時 | 2016-10-09 13:16:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,020 ms / 7,000 ms |
コード長 | 882 bytes |
コンパイル時間 | 971 ms |
コンパイル使用メモリ | 102,256 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-21 20:46:02 |
合計ジャッジ時間 | 9,292 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
#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; }