F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_38641210_24405.cpp: In function 'int main()':
0_0_38641210_24405.cpp:45:10: error: 'function' is not a member of 'std'
     std::function<void(std::vector<int>&, int, int, int, int&)> dfs = [&] (std::vector<int> &ps, int c, int x, int f, int& ans) {
          ^~~~~~~~
0_0_38641210_24405.cpp:45:10: note: 'std::function' is defined in header '<functional>'; did you forget to '#include <functional>'?
0_0_38641210_24405.cpp:4:1:
+#include <functional>
 
0_0_38641210_24405.cpp:45:10:
     std::function<void(std::vector<int>&, int, int, int, int&)> dfs = [&] (std::vector<int> &ps, int c, int x, int f, int& ans) {
          ^~~~~~~~
0_0_38641210_24405.cpp:45:62: error: expression list treated as compound expression in functional cast [-fpermissive]
     std::function<void(std::vector<int>&, int, int, int, int&)> dfs = [&] (std::vector<int> &ps, int c, int x, int f, int& ans) {
                                                              ^
0_0_38641210_24405.cpp:45:19: error: expected primary-expression before 'void'
     std::function<void(std::vector<int>&, int, int, int, int&)> dfs = [&] (std::vector<int> &ps, int c, int x, int f, int& ans) {
                   ^~~~
0_0_38641210_24405.cpp: In lambda function:
0_0_38641210_24405.cpp:65:9: error: 'dfs' was not declared in this scope
         dfs(ps, 0, 1, -1, ans);
         ^~~


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2025-02-18 17:10:58, Gzip enabled