Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- const int N = 1e5 + 6;
- int n, m;
- string a[N], b[N];
- int main(){
- cin >> n >> m;
- for (int i = 1; i <= n; i++) {
- cin >> a[i];
- }
- map <string, int> mp;
- for (int i = 1; i <= m; i++) {
- cin >> b[i];
- mp[b[i]] = 1;
- }
- for (int i = 1; i <= n; i++) {
- if (mp[a[i]] == 1) {
- cout << "Yes" << endl;
- } else {
- cout << "No" << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement