[Init] Solved solutions

This commit is contained in:
2023-03-02 20:58:03 +07:00
parent 51f667ac81
commit 20542601dd
131 changed files with 4148 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int n;
cin >> n;
int i1, i2, c1 = 0, c2 = 0;
while (n--)
{
int t;
cin >> t;
if (t%2)
{
c1++;
i1 = c1 + c2;
}
else
{
c2++;
i2 = c1 + c2;
}
}
if (c1 < c2)
{
cout << i1;
}
else
{
cout << i2;
}
return 0;
}