/ Vijos /

记录详情

Compile Error

foo.cc:9:1: error: 'string' does not name a type
    9 | string maze[205]//地图
      | ^~~~~~
foo.cc:10:40: error: expected unqualified-id before ',' token
   10 | int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[8] = {0, 0, -1, 1, -1, 1, 1, -1};
      |                                        ^
foo.cc:10:48: error: expected constructor, destructor, or type conversion before '=' token
   10 | int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[8] = {0, 0, -1, 1, -1, 1, 1, -1};
      |                                                ^
foo.cc: In function 'void bfs()':
foo.cc:16:5: error: 'queue' was not declared in this scope
   16 |     queue<pair<int, int>> q;//bfs的队列
      |     ^~~~~
foo.cc:1:1: note: 'std::queue' is defined in header '<queue>'; did you forget to '#include <queue>'?
  +++ |+#include <queue>
    1 | using namespace std;
foo.cc:16:11: error: 'pair' was not declared in this scope
   16 |     queue<pair<int, int>> q;//bfs的队列
      |           ^~~~
foo.cc:1:1: note: 'std::pair' is defined in header '<utility>'; did you forget to '#include <utility>'?
  +++ |+#include <utility>
    1 | using namespace std;
foo.cc:16:16: error: expected primary-expression before 'int'
   16 |     queue<pair<int, int>> q;//bfs的队列
      |                ^~~
foo.cc:17:5: error: 'q' was not declared in this scope
   17 |     q.push({sx, sy});//将起点加入队列
      |     ^
foo.cc:21:14: error: expected primary-expression before 'int'
   21 |         pair<int, int> t = q.front(); q.pop();//从队列取点
      |              ^~~
foo.cc:26:22: error: 't' was not declared in this scope
   26 |             int nx = t.first + dx[i];
      |                      ^
foo.cc:26:32: error: 'dx' was not declared in this scope; did you mean 'nx'?
   26 |             int nx = t.first + dx[i];
      |                                ^~
      |                                nx
foo.cc:27:33: error: 'dy' was not declared in this scope; did you mean 'ny'?
   27 |             int ny = t.second + dy[i];
      |                                 ^~
      |                                 ny
foo.cc:31:21: error: 'cout' was not declared in this scope
   31 |                     cout << dis[t.first][t.second] << endl;
      |                     ^~~~
foo.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
  +++ |+#include <iostream>
    1 | using namespace std;
foo.cc:31:55: error: 'endl' was not declared in this scope
   31 |                     cout << dis[t.first][t.second] << endl;
      |                                                       ^~~~
foo.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; did you forget to '#include <ostream>'?
  +++ |+#include <ostream>
    1 | using namespace std;
foo.cc:34:62: error: 'maze' was not declared in this scope
   34 |                 if(nx < 0 || nx >= n || ny < 0 || ny >= m || maze[nx][ny] == 'X') break;//这里说明受阻了,飞镖停下来
      |                                                              ^~~~
foo.cc:44:22: error: 't' was not declared in this scope
   44 |             int nx = t.first + dx[i];
      |                      ^
foo.cc:44:32: error: 'dx' was not declared in this scope; did you mean 'nx'?
   44 |             int nx = t.first + dx[i];
      |                                ^~
      |                                nx
foo.cc:45:33: error: 'dy' was not declared in this scope; did you mean 'ny'?
   45 |             int ny = t.second + dy[i];
      |                                 ^~
      |                                 ny
foo.cc:46:58: error: 'maze' was not declared in this scope
   46 |             if(nx >= 0 && nx < n && ny >= 0 && ny < m && maze[nx][ny] != 'X' && !vis[nx][ny]){
      |                                                          ^~~~
foo.cc:55:5: error: 'cout' was not declared in this scope
   55 |     cout << "Impossible!" << endl;
      |     ^~~~
foo.cc:55:5: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
foo.cc:55:30: error: 'endl' was not declared in this scope
   55 |     cout << "Impossible!" << endl;
      |                              ^~~~
foo.cc:55:30: note: 'std::endl' is defined in header '<ostream>'; did you forget to '#include <ostream>'?
foo.cc: In function 'int main()':
foo.cc:59:5: error: 'ios' has not been declared
   59 |     ios::sync_with_stdio(false);
      |     ^~~
foo.cc:60:5: error: 'cin' was not declared in this scope
   60 |     cin >> n >> m;
      |     ^~~
foo.cc:60:5: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
foo.cc:62:16: error: 'maze' was not declared in this scope
   62 |         cin >> maze[i];
      |                ^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

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