T3000

Untitled

Mar 29th, 2022
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. using ll = long long;
  5.  
  6. int main()
  7. {
  8.     ll x, y;
  9.     cin >> x >> y;
  10.     ll ans = y + 1;
  11.     vector<vector<char>> z1(x);
  12.     for (int i = 0; i < x; i++)
  13.     {
  14.         for (int j = 0; j < y; j++)
  15.         {
  16.             char w;
  17.             cin >> w;
  18.             z1.at(i).push_back(w);
  19.         }
  20.     }
  21.     for (int i = 0; i < y; i++)
  22.     {
  23.         for (int j = 0; j < x; j++)
  24.         {
  25.             if (z1.at(j).at(i) != '_')
  26.             {
  27.                 ans -= 1;
  28.                 break;
  29.             }
  30.         }
  31.     }
  32.     cout << ans << endl;
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment