Encoder.cpp: In function 'void dfs0(int, int)':
Encoder.cpp:10:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
10 | for(int i=0;i<e[x].size();i++) if(e[x][i]==fa) {e[x].erase(e[x].begin()+i);break;}
| ~^~~~~~~~~~~~
Encoder.cpp:12:50: error: ISO C++ forbids declaration of 'parameter' with no type [-fpermissive]
12 | sort(e[x].begin,e[x].end(),[&](const int&a,const&int b){return sz[a]<sz[b];});
| ^
Encoder.cpp:12:51: error: expected ',' or '...' before 'int'
12 | sort(e[x].begin,e[x].end(),[&](const int&a,const&int b){return sz[a]<sz[b];});
| ^~~
Encoder.cpp: In lambda function:
Encoder.cpp:12:74: error: 'b' was not declared in this scope
12 | sort(e[x].begin,e[x].end(),[&](const int&a,const&int b){return sz[a]<sz[b];});
| ^
Encoder.cpp: In function 'void dfs0(int, int)':
Encoder.cpp:12:78: error: no matching function for call to 'sort(<unresolved overloaded function type>, std::vector<int>::iterator, dfs0(int, int)::<lambda(const int&, const int&)>)'
12 | sort(e[x].begin,e[x].end(),[&](const int&a,const&int b){return sz[a]<sz[b];});
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from Encoder.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:4849:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
4849 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/10/bits/stl_algo.h:4849:5: note: template argument deduction/substitution failed:
Encoder.cpp:12:78: note: candidate expects 2 arguments, 3 provided
12 | sort(e[x].begin,e[x].end(),[&](const int&a,const&int b){return sz[a]<sz[b];});
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from Encoder.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:4880:5: note: candidate: 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Compare = dfs0(int, int)::<lambda(const int&, const int&)>]'
4880 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/10/bits/stl_algo.h:4880:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
4880 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Device.cpp: In function 'void calc(int&, int&, int&, int)':
Device.cpp:12:13: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
12 | int mid=l+r>>1;
| ~^~