Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <cstring>
- #include <iostream>
- #include <cmath>
- #include <vector>
- using namespace std;
- long long n,m,a[3000],b[3000],ans = 0,x = 0;
- bool used[3000], check;
- int main()
- {
- cin >> n >> m;
- for (int i = 0; i < n; i++)
- cin >> a[i];
- for (int j = 0; j < m; j++)
- cin >> b[j];
- for (int i=0; i < n; i++)
- {
- check = false;
- for (int j = 0; j < m; j++)
- {
- if (a[i] == b[j] && used[j] == false)
- {
- check = true;
- used[j] = true;
- break;
- }
- }
- if (!check)
- ans++;
- }
- cout << ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement