Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. long long a[10005], b[10005];
  7.  
  8. int main()
  9. {
  10. int n, m, odda = 0, oddb = 0, nodda = 0, noddb = 0;
  11. cin >> n >> m;
  12. for (int i = 0; i != n; i++) {
  13. cin >> a[i];
  14. if (a[i] % 2 == 0)
  15. odda++;
  16. else
  17. nodda++;
  18. }
  19.  
  20. for (int i = 0; i != m; i++) {
  21. cin >> b[i];
  22. if (a[i] % 2 == 0)
  23. oddb++;
  24. else
  25. noddb++;
  26. }
  27. cout << min(odda, noddb) + min(oddb, nodda);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement