Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <algorithm>
- using namespace std;
- long long a[10005], b[10005];
- int main()
- {
- int n, m, odda = 0, oddb = 0, nodda = 0, noddb = 0;
- cin >> n >> m;
- for (int i = 0; i != n; i++) {
- cin >> a[i];
- if (a[i] % 2 == 0)
- odda++;
- else
- nodda++;
- }
- for (int i = 0; i != m; i++) {
- cin >> b[i];
- if (a[i] % 2 == 0)
- oddb++;
- else
- noddb++;
- }
- cout << min(odda, noddb) + min(oddb, nodda);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement