/ Vijos /

记录详情

Compile Error

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

信息

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