Promi_38

cf 847G

Oct 22nd, 2021
668
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits\stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     cin >> n;
  9.    
  10.     int cnt[7], i;
  11.     for(i = 0; i < 7; i++) cnt[i] = 0;
  12.    
  13.     while(n--)
  14.     {
  15.         string s;
  16.         cin >> s;
  17.         for(i = 0; i < 7; i++) if(s[i] == '1') cnt[i]++;
  18.     }
  19.     sort(cnt, cnt + 7);
  20.     cout << cnt[6] << endl;
  21. }
  22.  
RAW Paste Data