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_39527614_26807.cpp: In function 'int main()':
0_0_39527614_26807.cpp:79:36: error: 'itn' was not declared in this scope; did you mean 'int'?
   79 |                 std::function<void(itn)>dfs = [&](int i)
      |                                    ^~~
      |                                    int
0_0_39527614_26807.cpp:79:40: error: template argument 1 is invalid
   79 |                 std::function<void(itn)>dfs = [&](int i)
      |                                        ^
0_0_39527614_26807.cpp: In lambda function:
0_0_39527614_26807.cpp:82:44: error: expression cannot be used as a function
   82 |                                         dfs(j), times[i] += times[j];
      |                                         ~~~^~~
0_0_39527614_26807.cpp: In function 'int main()':
0_0_39527614_26807.cpp:79:47: error: cannot convert 'main()::<lambda(int)>' to 'int' in initialization
   79 |                 std::function<void(itn)>dfs = [&](int i)
      |                                               ^~~~~~~~~~
      |                                               |
      |                                               main()::<lambda(int)>
   80 |                         {
      |                         ~                      
   81 |                                 for (int j : tree[i])
      |                                 ~~~~~~~~~~~~~~~~~~~~~
   82 |                                         dfs(j), times[i] += times[j];
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   83 |                         };
      |                         ~                      
0_0_39527614_26807.cpp:95:20: error: 'dfs' cannot be used as a function
   95 |                 dfs(0);
      |                 ~~~^~~


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-15 06:12:04, Gzip enabled