/ Vijos /

记录详情

Compile Error

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

信息

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