forked from Mohammed-Shoaib/Coding-Problems
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB0054.cpp
More file actions
43 lines (39 loc) · 738 Bytes
/
B0054.cpp
File metadata and controls
43 lines (39 loc) · 738 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
// Problem Code: RRJOKE
#include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;
void forgottenLanguage(vector<string> N, unordered_set<string> K) {
for(int i=0 ; i<N.size() ; i++) {
if(K.find(N[i]) != K.end())
cout << "YES ";
else
cout << "NO ";
}
cout << endl;
}
int main() {
int T, N, K, L;
string s;
vector<string> dictionary;
unordered_set<string> modern;
cin >> T;
while(T--) {
cin >> N >> K;
for(int i=0 ; i<N ; i++) {
cin >> s;
dictionary.push_back(s);
}
for(int i=0 ; i<K ; i++) {
cin >> L;
for(int j=0 ; j<L ; j++) {
cin >> s;
modern.insert(s);
}
}
forgottenLanguage(dictionary, modern);
dictionary.clear();
modern.clear();
}
return 0;
}