Advertisement
Guest User

Untitled

a guest
Jan 31st, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <cstdio>
  2. #include <cstring>
  3. #include <iostream>
  4. #include <cmath>
  5. #include <vector>
  6. using namespace std;
  7.  
  8. long long n,m,a[3000],b[3000],ans = 0,x = 0;
  9. bool used[3000], check;
  10.  
  11. int main()
  12. {
  13. cin >> n >> m;
  14.  
  15. for (int i = 0; i < n; i++)
  16. cin >> a[i];
  17. for (int j = 0; j < m; j++)
  18. cin >> b[j];
  19.  
  20.  
  21. for (int i=0; i < n; i++)
  22. {
  23. check = false;
  24. for (int j = 0; j < m; j++)
  25. {
  26. if (a[i] == b[j] && used[j] == false)
  27. {
  28. check = true;
  29. used[j] = true;
  30. break;
  31. }
  32. }
  33.  
  34. if (!check)
  35. ans++;
  36. }
  37.  
  38. cout << ans;
  39.  
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement