-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2776.cpp
More file actions
45 lines (40 loc) · 721 Bytes
/
2776.cpp
File metadata and controls
45 lines (40 loc) · 721 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
33
34
35
36
37
38
39
40
41
42
43
44
45
// 2776. 암기왕
// 2022.03.13
// 자료구조
#include<iostream>
#include<set>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
int n, m, k;
set<int> note;
while (t-- > 0)
{
note.clear();
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> k;
note.insert(k);
}
cin >> m;
for (int i = 0; i < m; i++)
{
cin >> k;
if (note.find(k) == note.end())
{
cout << 0 << "\n";
}
else
{
cout << 1 << "\n";
}
}
}
return 0;
}