题目链接:https://codeforces.com/problemset/problem/2032/A
题解代码:
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
int count0 = 0, count1 = 0;
for (int i = 0; i < n * 2; i++) {
int x;
cin >> x;
if (x == 0) count0++;
else count1++;
}
int mi = (count0 % 2 + count1 % 2) / 2;
int ma = min(count0, count1);
cout << mi << " " << ma << endl;
}
int main() {
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
标签:int,983,Codeforces,++,count1,count0,Div
From: https://www.cnblogs.com/chhh31/p/18539606