Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. using namespace std;
  5.  
  6. typedef long long int ll;
  7.  
  8.  
  9.  
  10. int main() {
  11. int n, count = 0;
  12. cin >> n;
  13. for (int i = 0; i < n; i++) {
  14. int c;
  15. cin >> c;
  16. if (c) count++;
  17. }
  18.  
  19. cout << min(count, n - count);
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement