Josif_tepe

Untitled

Sep 10th, 2025
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <queue>
  4. using namespace std;
  5. const int maxn = 1005;
  6. int n, m;
  7. char mat[maxn][maxn];
  8.  
  9.  
  10. int main() {
  11.     ios_base::sync_with_stdio(false);
  12.    
  13.     cin >> n >> m;
  14.    
  15.     int f = 0;
  16.     int width = 0;
  17.     for(int i = 0; i < n; i++) {
  18.         int w = 0;
  19.         for(int j = 0; j < m; j++) {
  20.             cin >> mat[i][j];
  21.            
  22.             if(mat[i][j] == 'F') {
  23.                 f++;
  24.                 w++;
  25.             }
  26.            
  27.         }
  28.         width = max(width, w);
  29.     }
  30.    
  31.     int height = f / width;
  32.     vector<pair<int, int>> piano;
  33.    
  34.     int pi = 0;
  35.     int pj = 0;
  36.     for(int i = 0; i < n; i++) {
  37.        
  38.         for(int j =0 ; j < m; j++) {
  39.             if(mat[i][j] == '1') {
  40.                 piano.push_back({i, j});
  41.             }
  42.         }
  43.     }
  44.  
  45.    
  46.    
  47.      return 0;
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment