Main.cpp: In function 'int main()':
Main.cpp:110:5: error: 'g' was not declared in this scope
110 | g[i] = x.first;
| ^
Main.cpp:168:46: error: 'v' was not declared in this scope
168 | maxPath = max(maxPath, diam[x.s] - 3 + sz(v));
| ^
Main.cpp:2:22: note: in definition of macro 'sz'
2 | #define sz(v) ((int)(v).size())
| ^
Main.cpp:171:46: error: 'v' was not declared in this scope
171 | maxPath = max(maxPath, diam[x.e] - 3 + sz(v));
| ^
Main.cpp:2:22: note: in definition of macro 'sz'
2 | #define sz(v) ((int)(v).size())
| ^
Main.cpp:188:45: error: 'v' was not declared in this scope
188 | maxPath = max(maxPath, new_diam - 3 + sz(v));
| ^
Main.cpp:2:22: note: in definition of macro 'sz'
2 | #define sz(v) ((int)(v).size())
| ^
Main.cpp:192:6: error: 'v' was not declared in this scope
192 | if(v.s != l) valup.push_back(far[v.s]);
| ^
Main.cpp:193:6: error: 'v' was not declared in this scope
193 | if(v.e != l) valdown.push_back(far[v.e]);
| ^
Main.cpp:194:73: error: 'g' was not declared in this scope
194 | for(int i = x.s; dep[i] >= dep[l] + 2; i = par[0][i]) valup.push_back(g[i]);
| ^
Main.cpp:195:75: error: 'g' was not declared in this scope
195 | for(int i = x.e; dep[i] >= dep[l] + 2; i = par[0][i]) valdown.push_back(g[i]);
| ^
Main.cpp:200:27: error: no matching function for call to 'max(int&, std::tuple_element<0, std::pair<long long int, long long int> >::type)'
200 | dist = max(dist, d + 1);
| ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
from /usr/include/c++/10/cmath:1927,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
254 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: template argument deduction/substitution failed:
Main.cpp:200:27: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::tuple_element<0, std::pair<long long int, long long int> >::type' {aka 'long long int'})
200 | dist = max(dist, d + 1);
| ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
from /usr/include/c++/10/cmath:1927,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
300 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: template argument deduction/substitution failed:
Main.cpp:200:27: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::tuple_element<0, std::pair<long long int, long long int> >::type' {aka 'long long int'})
200 | dist = max(dist, d + 1);
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
3480 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: template argument deduction/substitution failed:
Main.cpp:200:27: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
200 | dist = max(dist, d + 1);
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
3486 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: template argument deduction/substitution failed:
Main.cpp:200:27: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
200 | dist = max(dist, d + 1);
| ^
Main.cpp:207:25: error: 'val' was not declared in this scope; did you mean 'valup'?
207 | for(auto &i : valup) val.push_back(i);
| ^~~
| valup
Main.cpp:208:27: error: 'val' was not declared in this scope; did you mean 'valup'?
208 | for(auto &i : valdown) val.push_back(i);
| ^~~
| valup
Main.cpp:211:25: error: 'val' was not declared in this scope; did you mean 'valup'?
211 | for(int i = 0; i < sz(val); i++){
| ^~~
Main.cpp:2:22: note: in definition of macro 'sz'
2 | #define sz(v) ((int)(v).size())
| ^