A. Neko Finds Grapes
代码:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int N, M; int a[maxn], b[maxn]; int odda = 0, evea = 0, oddb = 0, eveb = 0; int main() { scanf("%d%d", &N, &M); for(int i = 0; i < N; i ++) { scanf("%d", &a[i]); if(a[i] % 2) odda ++; else evea ++; } for(int i = 0; i < M; i ++) { scanf("%d", &b[i]); if(b[i] % 2) oddb ++; else eveb ++; } int ans = min(odda, eveb) + min(evea, oddb); printf("%d ", ans); return 0; }
我再吃凉的我就是狗 含泪写代码