Advertisement
amine99

Untitled

Mar 15th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define loop(i,b,e) for(int i=b;i<=e;i++)
  5. #define reloop(i,e,b) for(int i=e;i>=b;i--)
  6. #define all(x) x.begin(),x.end()
  7. #define pb push_back
  8. #define ll long long
  9. #define pf printf
  10. #define sf scanf
  11.  
  12. int n,m;
  13. string s;
  14. map<string,int> f;
  15.  
  16. int main() {
  17.    sf("%d%d",&n,&m);
  18.    loop(i,0,n-1) cin >> s,f[s]++;
  19.    loop(i,1,m) {
  20.       cin >> s;
  21.       if(f[s] != 0)
  22.          f[s] = 0;
  23.    }
  24.    for(auto it = f.begin() ; it != f.end() ; it++) {
  25.       if(it->second != 0)
  26.          cout << it->first << " ";
  27.    }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement