fork download
  1. #include <bits/stdc++.h>
  2. #define fi first
  3. #define se second
  4. #define pb push_back
  5. #define ll long long
  6. #define endl "\n"
  7. #define __WaffledCookies__ signed main
  8. using namespace std;
  9.  
  10. const int N = 2e5 + 5, mod = 1e9 + 7, base = 167;
  11. int tc, n, m;
  12. bool a[105];
  13. void solve()
  14. {
  15. cin >> n >> m;
  16. for(int i = 1; i <= n; ++i) {
  17. int tp;
  18. cin >> tp;
  19. a[tp] = 1;
  20. }
  21. for(int i = 1; i<= m; ++i) {
  22. int x, y;
  23. cin >> x >> y;
  24. a[x] = 0;
  25. a[y] = 1;
  26. }
  27. for(int i = 1; i <= 100; ++i) if(a[i]) cout << i << ' ';
  28. return;
  29. }
  30. __WaffledCookies__()
  31. {
  32.  
  33. ios_base::sync_with_stdio(0);
  34. cin.tie(0); cout.tie(0);
  35. tc = 1;
  36. //cin >> tc;
  37. while(tc--) solve();
  38. return 0;
  39. }
  40.  
Success #stdin #stdout 0s 544KB
stdin
Standard input is empty
stdout
Standard output is empty