Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define loop(i,b,e) for(int i=b;i<=e;i++)
- #define reloop(i,e,b) for(int i=e;i>=b;i--)
- #define all(x) x.begin(),x.end()
- #define pb push_back
- #define ll long long
- #define pf printf
- #define sf scanf
- int n,m;
- string s;
- map<string,int> f;
- int main() {
- sf("%d%d",&n,&m);
- loop(i,0,n-1) cin >> s,f[s]++;
- loop(i,1,m) {
- cin >> s;
- if(f[s] != 0)
- f[s] = 0;
- }
- for(auto it = f.begin() ; it != f.end() ; it++) {
- if(it->second != 0)
- cout << it->first << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement