answer.code: In function ‘void dfs(int, int)’:
answer.code:37:21: warning: range-based ‘for’ loops only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
37 | for(int v : g[u]) if(v != pre)
| ^
answer.code:37:24: error: forming reference to reference type ‘std::vector<int>&’
37 | for(int v : g[u]) if(v != pre)
| ^
answer.code: In function ‘void build_virtual_tree()’:
answer.code:54:82: warning: lambda expressions only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
54 | sort(imp.begin(), imp.end(), [](int _x, int _y){return dfn[_x] < dfn[_y];});
| ^
answer.code:54:13: error: no matching function for call to ‘sort(std::vector<int>::iterator, std::vector<int>::iterator, build_virtual_tree()::<lambda(int, int)>)’
54 | sort(imp.begin(), imp.end(), [](int _x, int _y){return dfn[_x] < dfn[_y];});
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from answer.code:2:
/usr/include/c++/14/bits/stl_algo.h:4761:5: note: candidate: ‘template<class _RAIter> void std::sort(_RAIter, _RAIter)’
4761 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4761:5: note: candidate expects 2 arguments, 3 provided
/usr/include/c++/14/bits/stl_algo.h:4792:5: note: candidate: ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’
4792 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4792:5: note: template argument deduction/substitution failed:
answer.code: In substitution of ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Compare = build_virtual_tree()::<lambda(int, int)>]’:
answer.code:54:6: required from here
54 | sort(imp.begin(), imp.end(), [](int _x, int _y){return dfn[_x] < dfn[_y];});
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code:54:13: error: template argument for ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’ uses local type ‘build_virtual_tree()::<lambda(int, int)>’
answer.code:54:13: error: trying to instantiate ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’
answer.code:59:82: warning: lambda expressions only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
59 | sort(vtp.begin(), vtp.end(), [](int _x, int _y){return dfn[_x] < dfn[_y];});
| ^
answer.code:59:13: error: no matching function for call to ‘sort(std::vector<int>::iterator, std::vector<int>::iterator, build_virtual_tree()::<lambda(int, int)>)’
59 | sort(vtp.begin(), vtp.end(), [](int _x, int _y){return dfn[_x] < dfn[_y];});
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4761:5: note: candidate: ‘template<class _RAIter> void std::sort(_RAIter, _RAIter)’
4761 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4761:5: note: candidate expects 2 arguments, 3 provided
/usr/include/c++/14/bits/stl_algo.h:4792:5: note: candidate: ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’
4792 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4792:5: note: template argument deduction/substitution failed:
answer.code: In substitution of ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Compare = build_virtual_tree()::<lambda(int, int)>]’:
answer.code:59:6: required from here
59 | sort(vtp.begin(), vtp.end(), [](int _x, int _y){return dfn[_x] < dfn[_y];});
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code:59:13: error: template argument for ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’ uses local type ‘build_virtual_tree()::<lambda(int, int)>’
answer.code:59:13: error: trying to instantiate ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’
answer.code:61:21: warning: range-based ‘for’ loops only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
61 | for(int i : vtp) vt[i].clear();
...