race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:17:24: error: expected identifier before 'this'
17 | auto getsz = [&](this auto &&getsz, int u, int p)->void{
| ^~~~
race.cpp:17:24: error: expected ',' or '...' before 'this'
race.cpp: In lambda function:
race.cpp:18:16: error: 'u' was not declared in this scope
18 | sz[u] = 1;
| ^
race.cpp:20:28: error: 'p' was not declared in this scope
20 | if( v != p and !visited[v]){
| ^
race.cpp:21:25: error: use of 'getsz' before deduction of 'auto'
21 | getsz(v,u);
| ^~~~~
race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:27:27: error: expected identifier before 'this'
27 | auto centroid = [&](this auto &¢roid, int u, int p, int S)->int{
| ^~~~
race.cpp:27:27: error: expected ',' or '...' before 'this'
race.cpp: In lambda function:
race.cpp:28:31: error: 'u' was not declared in this scope
28 | for(auto [v,w]: G[u]){
| ^
race.cpp:29:28: error: 'p' was not declared in this scope
29 | if( v != p and !visited[v]){
| ^
race.cpp:30:37: error: 'S' was not declared in this scope
30 | if( sz[v] > S/2)
| ^
race.cpp:31:38: error: use of 'centroid' before deduction of 'auto'
31 | return centroid(v,u,S);
| ^~~~~~~~
race.cpp:34:20: error: 'u' was not declared in this scope
34 | return u;
| ^
race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:61:23: error: expected identifier before 'this'
61 | auto find = [&](this auto &&find, int u,int p, int d, i64 l)->void{
| ^~~~
race.cpp:61:23: error: expected ',' or '...' before 'this'
race.cpp: In lambda function:
race.cpp:62:17: error: 'l' was not declared in this scope
62 | if( l > k) return; // already pass the limit
| ^
race.cpp:64:26: error: 'l' was not declared in this scope
64 | if( K.find(k-l) != K.end()){
| ^
race.cpp:65:44: error: 'd' was not declared in this scope
65 | ans = min( ans, K[k-l] + d);
| ^
race.cpp:68:32: error: 'u' was not declared in this scope
68 | for( auto [v,w]: G[u]){
| ^
race.cpp:69:28: error: 'p' was not declared in this scope
69 | if( v != p and !visited[v]){
| ^
race.cpp:70:25: error: use of 'find' before deduction of 'auto'
70 | find(v,u,d+1,l+w);
| ^~~~
race.cpp:70:34: error: 'd' was not declared in this scope
70 | find(v,u,d+1,l+w);
| ^
race.cpp:70:38: error: 'l' was not declared in this scope
70 | find(v,u,d+1,l+w);
| ^
race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:74:27: error: expected identifier before 'this'
74 | auto optimize = [&](this auto &&optimize, int u,int p, int d, i64 l)->void{
| ^~~~
race.cpp:74:27: error: expected ',' or '...' before 'this'
race.cpp: In lambda function:
race.cpp:75:17: error: 'l' was not declared in this scope
75 | if( l > k) return; // already pass the limit
| ^
race.cpp:76:24: error: 'l' was not declared in this scope
76 | if( K.find(l) == K.end()) K[l] = d;
| ^
race.cpp:76:46: error: 'd' was not declared in this scope
76 | if( K.find(l) == K.end()) K[l] = d;
| ^
race.cpp:77:34: error: 'd' was not declared in this scope
77 | else K[l] = min(K[l],d);
| ^
race.cpp:78:32: error: 'u' was not declared in this scope
78 | for( auto [v,w]: G[u]){
| ^
race.cpp:79:28: error: 'p' was not declared in this scope
79 | if( v != p and !visited[v]){
| ^
race.cpp:80:25: error: use of 'optimize' before deduction of 'auto'
80 | optimize(v,u,d+1,l+w);
| ^~~~~~~~
race.cpp:80:38: error: 'd' was not declared in this scope
80 | optimize(v,u,d+1,l+w);
| ^
race.cpp:80:42: error: 'l' was not declared in this scope
80 | optimize(v,u,d+1,l+w);
| ^
race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:85:28: error: expected identifier before 'this'
85 | auto decompose = [&](this auto &&decompose, int u)->void{
| ^~~~
race.cpp:85:28: error: expected ',' or '...' before 'this'
race.cpp: In lambda function:
race.cpp:86:19: error: 'u' was not declared in this scope
86 | getsz(u,-1);
| ^
race.cpp:97:29: error: no match for call to '(best_path(int, int, int (*)[2], int*)::<lambda(int)>) (std::tuple_element<0, std::pair<int, int> >::type&, int&, int, std::tuple_element<1, std::pair<int, int> >::type&)'
97 | find(v,c,1,w);
| ~~~~^~~~~~~~~
race.cpp:61:19: note: candidate: 'best_path(int, int, int (*)[2], int*)::<lambda(int)>'
61 | auto find = [&](this auto &&find, int u,int p, int d, i64 l)->void{
| ^
race.cpp:61:19: note: candidate expects 1 argument, 4 provided
race.cpp:98:33: error: no match for call to '(best_path(int, int, int (*)[2], int*)::<lambda(int)>) (std::tuple_element<0, std::pair<int, int> >::type&, int&, int, std::tuple_element<1, std::pair<int, int> >::type&)'
98 | optimize(v,c,1,w);
| ~~~~~~~~^~~~~~~~~
race.cpp:74:23: note: candidate: 'best_path(int, int, int (*)[2], int*)::<lambda(int)>'
74 | auto optimize = [&](this auto &&optimize, int u,int p, int d, i64 l)->void{
| ^
race.cpp:74:23: note: candidate expects 1 argument, 4 provided
race.cpp:104:25: error: use of 'decompose' before deduction of 'auto'
104 | decompose(v);
| ^~~~~~~~~