Advertisement
rahat62

A. Chips Moving

Sep 25th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.  
  6.     int t, a, c=0;
  7.     cin>>t;
  8.     for(int i=0; i<t; i++)
  9.     {
  10.         cin>>a;
  11.         if(a%2)
  12.             c++;
  13.     }
  14.     cout<<min(c, t-c)<<endl;
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement