Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:24:9: error: 'function' was not declared in this scope
   24 |         function<void(int, int, int)> dfs = [&](int i, int j, int step) {
      |         ^~~~~~~~
/in/foo.cc:4:1: note: 'std::function' is defined in header '<functional>'; did you forget to '#include <functional>'?
    3 | #include <vector>
  +++ |+#include <functional>
    4 | using namespace std;
/in/foo.cc:24:36: error: expression list treated as compound expression in functional cast [-fpermissive]
   24 |         function<void(int, int, int)> dfs = [&](int i, int j, int step) {
      |                                    ^
/in/foo.cc:24:18: error: expected primary-expression before 'void'
   24 |         function<void(int, int, int)> dfs = [&](int i, int j, int step) {
      |                  ^~~~
/in/foo.cc:46:9: error: 'dfs' was not declared in this scope
   46 |         dfs(x, y, 0);
      |         ^~~

信息

递交者
类型
递交
题目
P1513 马走日
语言
C++
递交时间
2025-07-14 16:34:31
评测时间
2025-07-14 16:34:31
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes