Josif_tepe

Untitled

Mar 10th, 2026
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <set>
  4. #include <cstring>
  5. #include <queue>
  6. using namespace std;
  7. typedef long long ll;
  8. const int maxn = 1005;
  9. int n, m;
  10. char mat[maxn][maxn];
  11.  
  12. bool visited[maxn][maxn][3];
  13. // visited[i][j][0] = gazenje so cekor 1
  14. // visited[i][j][1] = gazenje so cekor 2
  15. // visited[i][j][2] = gazenje so cekor 3
  16.  
  17. int main()
  18. {
  19.     cin >> n >> m;
  20.    
  21.     int si, sj, ei, ej;
  22.     for(int i = 0; i < n; i++) {
  23.         for(int j = 0; j < m; j++) {
  24.             cin >> mat[i][j];
  25.            
  26.             if(mat[i][j] == 'S') {
  27.                 si = i;
  28.                 sj = j;
  29.             }
  30.            
  31.             if(mat[i][j] == 'E') {
  32.                 ei = i;
  33.                 ej = j;
  34.             }
  35.         }
  36.     }
  37.    
  38.  
  39.     queue<int> q;
  40.     q.push(si);
  41.     q.push(sj);
  42.     q.push(0);
  43.     q.push(1);
  44.    
  45.    
  46.    
  47.     int di[] = {-1, 1, 0, 0};
  48.     int dj[] = {0, 0, -1, 1};
  49.     int di2[] = {-2, 2, 0, 0};
  50.     int dj2[] = {0, 0, -2, 2};
  51.     int di3[] = {-3, 3, 0, 0};
  52.     int dj3[] = {0, 0, -3, 3};
  53.    
  54.    
  55.    
  56.    
  57.     return 0;
  58. }
  59.  
Advertisement
Add Comment
Please, Sign In to add comment