Advertisement
Guest User

ASD 6.5

a guest
Nov 17th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. #include <vector>
  4. #include <algorithm>
  5. #include <cmath>
  6. #include <set>
  7.  
  8. using namespace std;
  9.  
  10. const int WALL = -1;
  11. const int SPACE = -2;
  12. const int START = 0;
  13. const int END = -22;
  14.  
  15. int main() {
  16.     ios_base::sync_with_stdio(false);
  17.     cin.tie(nullptr);
  18.     cout.tie(nullptr);
  19.     int N, M;
  20.     cin >> N >> M;
  21.     vector <vector <int>> a (N);
  22.     pair <int,int> start_in, end_in;
  23.  
  24.     char lel;
  25.     for (int i = 0; i < N; ++i) {
  26.         for (int g = 0; g < M; ++g) {
  27.             cin >> lel;
  28.             if (lel == '+') a[i].push_back(WALL);
  29.             if (lel == '.') a[i].push_back(SPACE);
  30.             if (lel == '@') {
  31.                 a[i].push_back(START);
  32.                 start_in = {i, g};
  33.             }
  34.             if (lel == '#') {
  35.                 a[i].push_back(END);
  36.                 end_in = {i, g};
  37.             }
  38.         }
  39.     }
  40.     int amount = 0;
  41.     int d = START;
  42.     while (a[end_in.first][end_in.second] == END && amount > 0) {
  43.        
  44.     }
  45.  
  46.     return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement