Current work

This commit is contained in:
2026-08-03 19:03:58 +01:00
parent b48299efb7
commit a79ff12290
46 changed files with 1345 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> ids(n);
for (int i = 0; i < n; i++) {
int tmp;
cin >> tmp;
ids[i] = tmp;
}
int even = 0;
int odd = 0;
for (int id : ids) {
if (id % 2 == 0) {
even++;
} else {
odd++;
}
}
while (even < odd or even > odd + 1) {
if (even < odd) {
odd -= 2;
even++;
} else {
even--;
}
}
cout << even + odd;
}