mirror of
https://github.com/tiennm99/codeforces.git
synced 2026-06-09 22:11:55 +00:00
[Init] Solved solutions
This commit is contained in:
+35
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user