race.cpp: In function 'int gethv(int, int)':
race.cpp:22:11: error: 'p' was not declared in this scope
par[u] = p, in[u] = ++idx, pos[idx] = u;
^
race.cpp:6:11: warning: left operand of comma operator has no effect [-Wunused-value]
#define x first
^
race.cpp:27:33: note: in expansion of macro 'x'
sz += z, ret = max(ret, (z, v.x));
^
race.cpp:27:35: error: no matching function for call to 'max(std::pair<int, int>&, int&)'
sz += z, ret = max(ret, (z, v.x));
^
In file included from /usr/include/c++/7/bits/char_traits.h:39:0,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from race.cpp:2:
/usr/include/c++/7/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)
max(const _Tp& __a, const _Tp& __b)
^~~
/usr/include/c++/7/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
race.cpp:27:35: note: deduced conflicting types for parameter 'const _Tp' ('std::pair<int, int>' and 'int')
sz += z, ret = max(ret, (z, v.x));
^
In file included from /usr/include/c++/7/bits/char_traits.h:39:0,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/istream:38,
from /usr/include/c++/7/sstream:38,
from /usr/include/c++/7/complex:45,
from /usr/include/c++/7/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
from race.cpp:2:
/usr/include/c++/7/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/7/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
race.cpp:27:35: note: deduced conflicting types for parameter 'const _Tp' ('std::pair<int, int>' and 'int')
sz += z, ret = max(ret, (z, v.x));
^
In file included from /usr/include/c++/7/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
from race.cpp:2:
/usr/include/c++/7/bits/stl_algo.h:3462:5: note: candidate: template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)
max(initializer_list<_Tp> __l)
^~~
/usr/include/c++/7/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed:
race.cpp:27:35: note: 'std::pair<int, int>' is not derived from 'std::initializer_list<_Tp>'
sz += z, ret = max(ret, (z, v.x));
^
In file included from /usr/include/c++/7/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
from race.cpp:2:
/usr/include/c++/7/bits/stl_algo.h:3468:5: note: candidate: template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)
max(initializer_list<_Tp> __l, _Compare __comp)
^~~
/usr/include/c++/7/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed:
race.cpp:27:35: note: 'std::pair<int, int>' is not derived from 'std::initializer_list<_Tp>'
sz += z, ret = max(ret, (z, v.x));
^
race.cpp: In function 'void dfs(int, int, bool)':
race.cpp:52:57: error: too many arguments to function 'void add(int)'
for(int i = in[v.x]; i <= out[v.x]; i++) add(pos[i], u);
^
race.cpp:33:6: note: declared here
void add(int u) {
^~~