ohwhatalovelyday

Untitled

Mar 2nd, 2024
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.80 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define FASTER() ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  4. #define ff first
  5. #define ss second
  6. #define pb push_back
  7. #define all(a) a.begin(), a.end()
  8. #define dbg(x) cerr<<__LINE__<<" "<<#x<<" "<<x<<endl
  9.  
  10. typedef long long ll;
  11.  
  12. using namespace std;
  13.  
  14. struct position {
  15.     int x, y, free;
  16. };
  17.  
  18. int main() {
  19.     FASTER();
  20.     int n = 9;
  21.     vector <vector <int>> mt(n, vector <int>(n));
  22.     for(int i = 0; i < n; i++) {
  23.         for(int j = 0; j < n; j++) {
  24.             char c;
  25.             cin >> c;
  26.             c == '.' ? mt[i][j] = -1 : mt[i][j] = c - '1'; //starts from 0
  27.         }
  28.     }
  29.     vector <vector <int>> comps(n, vector <int>(n));
  30.     for(int i = 0; i < n; i++) {
  31.         for(int j = 0; j < n; j++) {
  32.             char c;
  33.             cin >> c;
  34.             comps[i][j] = c - '1';
  35.         }
  36.     }
  37.  
  38.     vector <vector <vector <int>>> cnt(n, vector <vector <int>>(n, vector <int>(n))); //для каждой точки - сколько чисел заняты
  39.     vector <vector <int>> rows(n, vector <int>(n)); //для строки
  40.     vector <vector <int>> cols(n, vector <int>(n)); //для столбца
  41.  
  42.     for(int i = 0; i < n; i++) { //идем по строкам и пишем для каждой строки все сущ-е цифры
  43.         for(int j = 0; j < n; j++) {
  44.             if(mt[i][j] != -1) {
  45.                 rows[i][mt[i][j]] = 1;
  46.             }
  47.         }
  48.     }
  49.     for(int j = 0; j < n; j++) {
  50.         for(int i = 0; i < n; i++) {
  51.             if(mt[i][j] != -1) {
  52.                 cols[j][mt[i][j]] = 1;
  53.             }
  54.         }
  55.     }
  56.  
  57.     vector <position> pos; //заплоняем позиции
  58.     for(int i = 0; i < n; i++) {
  59.         for(int j = 0; j < n; j++) {
  60.            
  61.         }
  62.     }
  63.  
  64.  
  65.  
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment