/ Vijos /

记录详情

Compile Error

/in/foo.cc:12:1: error: expected initializer before 'int'
 int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[8] = {0, 0, -1, 1, -1, 1, 1, -1};//八个方向,从左往右分别是上 下 左 右 左上 右上 右下 左下,拿相同下标的dx dy搭配可以让当前坐标往特
 ^~~
/in/foo.cc:12:40: error: expected unqualified-id before ',' token
 int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[8] = {0, 0, -1, 1, -1, 1, 1, -1};//八个方向,从左往右分别是上 下 左 右 左上 右上 右下 左下,拿相同下标的dx dy搭配可以让当前坐标往特
                                        ^
/in/foo.cc:12:48: error: expected constructor, destructor, or type conversion before '=' token
 int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[8] = {0, 0, -1, 1, -1, 1, 1, -1};//八个方向,从左往右分别是上 下 左 右 左上 右上 右下 左下,拿相同下标的dx dy搭配可以让当前坐标往特
                                                ^
/in/foo.cc: In function 'void bfs()':
/in/foo.cc:28:32: error: 'dx' was not declared in this scope
             int nx = t.first + dx[i];
                                ^~
/in/foo.cc:29:33: error: 'dy' was not declared in this scope
             int ny = t.second + dy[i];
                                 ^~
/in/foo.cc:36:62: error: 'maze' was not declared in this scope
                 if(nx < 0 || nx >= n || ny < 0 || ny >= m || maze[nx][ny] == 'X') break;//这里说明受阻了,飞镖停下来
                                                              ^~~~
/in/foo.cc:46:32: error: 'dx' was not declared in this scope
             int nx = t.first + dx[i];
                                ^~
/in/foo.cc:47:33: error: 'dy' was not declared in this scope
             int ny = t.second + dy[i];
                                 ^~
/in/foo.cc:48:58: error: 'maze' was not declared in this scope
             if(nx >= 0 && nx < n && ny >= 0 && ny < m && maze[nx][ny] != 'X' && !vis[nx][ny]){
                                                          ^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:64:16: error: 'maze' was not declared in this scope
         cin >> maze[i];
                ^~~~

信息

递交者
类型
递交
题目
P1263 单挑女飞贼
语言
C++
递交时间
2023-12-24 14:54:08
评测时间
2023-12-24 14:54:08
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes