-
Notifications
You must be signed in to change notification settings - Fork 0
/
solver.h
51 lines (33 loc) · 850 Bytes
/
solver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef SOLVER_H
#define SOLVER_H
#include <vector>
#include <map>
#include <iostream>
#include <algorithm>
#include "grid.h"
#include "object.h"
#include "util.h"
using std::vector;
using std::cout;
using std::endl;
using std::reverse;
class Solver {
public:
int callstopath;
const int dx[4] = {01, 00, -1, 00};
const int dy[4] = {00, 01, 00, -1};
vector<pair<int, int>> solution;
std::map<pair<int, int>, pair<int, int>> vis;
pair<int, int> origin;
Grid grid;
Solver();
Solver(Grid& g);
void set(Grid& g);
void path(pair<int, int> src, pair<int, int> prev);
vector<pair<int, int>> solve();
string to_string();
void disp();
void activate();
void deactivate();
};
#endif