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