-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2776.cpp
More file actions
32 lines (30 loc) · 592 Bytes
/
2776.cpp
File metadata and controls
32 lines (30 loc) · 592 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include <map>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
for(int i=0;i<t;i++){
int n;
cin >> n;
map<int, int> m;
for(int j=0;j<n;j++){
int x;
cin >> x;
m[x] += 1;
}
int test;
cin >> test;
for(int j=0;j<test;j++){
int x;
cin >> x;
if(m[x]>0){
cout << 1 << '\n';
}else{
cout << 0 << '\n';
}
}
}
}