-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1152A.cpp
47 lines (38 loc) · 892 Bytes
/
1152A.cpp
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
42
43
44
45
46
47
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int n,m;
cin >> n >> m;
long long int chest[n],key[m];
long long int even_ch =0,odd_ch=0;
for(int i=0; i<n; i++)
{
cin >> chest[i];
if(chest[i]%2==0)
{
even_ch++;
}
else
{
odd_ch++;
}
}
long long int even_ke=0,odd_ke=0;
for(int i=0; i<m; i++)
{
cin >> key[i];
if(key[i]%2==0)
{
even_ke++;
}
else
{
odd_ke++;
}
}
long long int res = min(odd_ch,even_ke);
long long int res1 = min(even_ch,odd_ke);
cout << res + res1 << endl;
return 0;
}