1213A Chips Moving codeforces solution in cpp
by ujjal roy
#include<bits/stdc++.h>
using namespace std;
main()
{
int n,e=0,o=0,i,r;
cin>>n;
int a;
for(i=0;i<n;i++)
{
cin>>a;
if(a%2==0) e++;
else o++;
}
cout<<min(e,o)<<endl;
return 0;
}
1213A Chips Moving codeforces solution in cpp
by ujjal roy
#include<bits/stdc++.h>
using namespace std;
main()
{
int n,e=0,o=0,i,r;
cin>>n;
int a;
for(i=0;i<n;i++)
{
cin>>a;
if(a%2==0) e++;
else o++;
}
cout<<min(e,o)<<endl;
return 0;
}
0 Comments