CodeForces Round #554 Div.2

A. Neko Finds Grapes

代码:

#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\n", ans);

    return 0;
}
View Code

 

 

我再吃凉的我就是狗 含泪写代码

posted @ 2019-04-25 10:52  丧心病狂工科女  阅读(201)  评论(0编辑  收藏  举报