0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 21:08:47 +00:00

A - Beat The Odds

https://codeforces.com/contest/1691/submission/158991681
This commit is contained in:
Baoshuo Ren 2022-05-31 22:39:45 +08:00
parent 58d4590e18
commit bb793f7806
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

35
Codeforces/1691/A/A.cpp Normal file
View File

@ -0,0 +1,35 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 1e5 + 5;
int t, n;
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> t;
while (t--) {
cin >> n;
int cnt1 = 0, cnt2 = 0;
for (int i = 0, x; i < n; i++) {
cin >> x;
if (x & 1) {
cnt1++;
} else {
cnt2++;
}
}
cout << std::min(cnt1, cnt2) << endl;
}
return 0;
}