@@ -4,41 +4,9 @@ namespace Algorithm
4
4
{
5
5
namespace Graph
6
6
{
7
- /* typedef int(*_FirstEdgeAdapter)(int idx_v);
8
- typedef int(*_NextEdgeAdapter)(int idx_v, int idx_e);
9
- typedef int(*_EdgeToAdapter)(int idx_v, int idx_e);
10
- PathType bfsResult;
11
- std::vector<int> pointVector, edgeVector;
12
- C_PUBLIC void RunBfs(int idx_start_v, int idx_dest_v,
13
- _FirstEdgeAdapter firstOf,
14
- _NextEdgeAdapter nextOf,
15
- _EdgeToAdapter destOf)
16
- {
17
- bfsResult = bfs(idx_start_v, idx_dest_v, FirstEdgeAdapter(firstOf), NextEdgeAdapter(nextOf), EdgeToAdapter(destOf));
18
- pointVector = std::vector<int>(bfsResult.first.begin(), bfsResult.first.end());
19
- edgeVector = std::vector<int>(bfsResult.second.begin(), bfsResult.second.end());
20
-
21
- };
22
- C_PUBLIC int* GetPointListPointer()
23
- {
24
- return &pointVector[0];
25
- }
26
- C_PUBLIC int GetPointListLength()
27
- {
28
- return pointVector.size();
29
- }
30
- C_PUBLIC int* GetEdgeListPointer()
31
- {
32
- return &edgeVector[0];
33
- }
34
- C_PUBLIC int GetEdgeListLength()
35
- {
36
- return edgeVector.size();
37
- }*/
38
-
39
7
const int maxn = 30 ;
40
8
int a, b, t;
41
- char *** s ;
9
+ char s[maxn][maxn][maxn] ;
42
10
43
11
struct Node
44
12
{
@@ -88,20 +56,19 @@ namespace Algorithm
88
56
walk
89
57
};
90
58
91
- C_PUBLIC int EscapeMaze (int floors, int height, int width, char *** mazeData)
59
+ C_PUBLIC int EscapeMaze (int floors, int height, int width, char mazeData[maxn][maxn][maxn] )
92
60
{
93
61
t = floors;
94
62
a = height;
95
63
b = width;
96
- s = mazeData;
97
64
int start, dest;
98
65
for (int i = 0 ; i < t; i++)
99
66
{
100
67
for (int j = 0 ; j < a; j++)
101
68
{
102
- scanf_s (" %s" , s[i][j], 1024 );
103
69
for (int k = 0 ; k < b; k++)
104
70
{
71
+ s[i][j][k] = mazeData[i][j][k];
105
72
if (s[i][j][k] == ' S' )
106
73
{
107
74
start = encoder (i, j, k);
0 commit comments