Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include <vector>
- #include <algorithm>
- #include <cmath>
- #include <set>
- using namespace std;
- const int WALL = -1;
- const int SPACE = -2;
- const int START = 0;
- const int END = -22;
- int main() {
- ios_base::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- int N, M;
- cin >> N >> M;
- vector <vector <int>> a (N);
- pair <int,int> start_in, end_in;
- char lel;
- for (int i = 0; i < N; ++i) {
- for (int g = 0; g < M; ++g) {
- cin >> lel;
- if (lel == '+') a[i].push_back(WALL);
- if (lel == '.') a[i].push_back(SPACE);
- if (lel == '@') {
- a[i].push_back(START);
- start_in = {i, g};
- }
- if (lel == '#') {
- a[i].push_back(END);
- end_in = {i, g};
- }
- }
- }
- int amount = 0;
- int d = START;
- while (a[end_in.first][end_in.second] == END && amount > 0) {
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement