-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode1152A.cpp
More file actions
41 lines (30 loc) · 745 Bytes
/
Copy pathcode1152A.cpp
File metadata and controls
41 lines (30 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Contest : Codeforces
* Problem : 1152A - Neko Finds Grapes
* Link : https://codeforces.com/contest/1152/problem/A
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fastio ios::sync_with_stdio(0); cin.tie(0);
int main() {
fastio
int n, m, x;
scanf("%i%i", &n, &m);
int odd_chests, even_chests, odd_keys, even_keys;
odd_chests = even_chests = odd_keys = even_keys = 0;
for (int i = 0; i < n; i++) {
scanf("%i", &x);
if (x % 2) odd_chests++;
else
even_chests++;
}
for (int i = 0; i < m; i++) {
scanf("%i", &x);
if (x % 2) odd_keys++;
else
even_keys++;
}
printf("%i\n", min(odd_chests, even_keys) + min(even_chests, odd_keys));
return 0;
}