-
Notifications
You must be signed in to change notification settings - Fork 0
/
C.cpp
46 lines (43 loc) · 914 Bytes
/
C.cpp
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
46
#include<bits/stdc++.h>
#include<string>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
void tokenize(string s, vector<string> &arr, string del = " ")
{
int start = 0;
//int cnt=0;
int end = s.find(del);
while (end != -1) {
arr.push_back(s.substr(start, end - start));
start = end + del.size();
end = s.find(del, start);
//cnt++;
}
arr.push_back(s.substr(start, end - start));
}
int main()
{
fastio;
int n,m,i;
string s,t;
vector<string> s1,t1;
map<string,int> mp;
cin>>n>>m;
cin.get();
getline(cin,s);
tokenize(s,s1);
for(i=0;i<n;i++)
mp[s1[i]]=0;
getline(cin,t);
tokenize(t,t1);
for(i=0;i<m;i++)
mp[t1[i]]++;
for(i=0;i<n;i++)
{
if(mp[s1[i]]==1)
cout<<"Yes\n";
else
cout<<"No\n";
}
return 0;
}