Advertisement
Guest User

1.cpp

a guest
Feb 17th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <queue>
  4. #include <tuple>
  5.  
  6. using namespace std;
  7.  
  8. const int INF = 1e9 + 7;
  9.  
  10. bool correct(int x, int y)
  11. {
  12.     return x >= 0 && x < 8 && y >= 0 && y < 8;
  13. }
  14.  
  15. int main()
  16. {
  17.     string coords1, coords2;
  18.     cin >> coords1 >> coords2;
  19.     int start_x = coords1[0] - 'a', start_y = coords1[1] - '1', finish_x = coords2[0] - 'a', finish_y = coords2[1] - '1';
  20.     vector<int> sides(6);
  21.     for (int i = 0; i < 6; ++i)
  22.         cin >> sides[i];
  23.     int min_count[8][8][6][4];
  24.     tuple<int, int, int, int> parents[8][8][6][4];
  25.     for (int i = 0; i < 8; ++i)
  26.         for (int j = 0; j < 8; ++j)
  27.             for (int k = 0; k < 6; ++k)
  28.                 for (int t = 0; t < 4; ++t)
  29.                 {
  30.                     min_count[i][j][k][t] = INF;
  31.                     parents[i][j][k][t] = {-1, -1, -1, -1};
  32.                 }
  33.     bool visited[8][8][6][4] = {};
  34.     queue<tuple<int, int, int, int>> q;
  35.     for (int d = 0; d < 4; ++d)
  36.     {
  37.         min_count[start_x][start_y][sides[4]][d] = sides[4];
  38.         visited[start_x][start_y][sides[4]][d] = true;
  39.         q.push({start_x, start_y, sides[4], d});
  40.     }
  41.     while (!q.empty())
  42.     {
  43.         int x, y, down, d;
  44.         tie(x, y, down, d) = q.front();
  45.         q.pop();
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement