horses.cpp: In lambda function:
horses.cpp:9:11: error: 'second' was not declared in this scope
9 | #define Y second
| ^~~~~~
horses.cpp:120:24: note: in expansion of macro 'Y'
120 | else t[id]=Y[l-1];
| ^
horses.cpp:8:11: error: 'first' was not declared in this scope
8 | #define X first
| ^~~~~
horses.cpp:122:32: note: in expansion of macro 'X'
122 | if (l) cur=mul(cur,X[l-1]);
| ^
horses.cpp:128:14: error: no match for call to '(std::function<void(int, int, int, const std::vector<int>&)>) (int, int&, int&)'
128 | build(id*2,l,m);
| ~~~~~^~~~~~~~~~
In file included from /usr/include/c++/13/functional:59,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53,
from horses.cpp:3:
/usr/include/c++/13/bits/std_function.h:587:7: note: candidate: '_Res std::function<_Res(_ArgTypes ...)>::operator()(_ArgTypes ...) const [with _Res = void; _ArgTypes = {int, int, int, const std::vector<int, std::allocator<int> >&}]'
587 | operator()(_ArgTypes... __args) const
| ^~~~~~~~
/usr/include/c++/13/bits/std_function.h:587:7: note: candidate expects 4 arguments, 3 provided
horses.cpp:129:14: error: no match for call to '(std::function<void(int, int, int, const std::vector<int>&)>) (int, int, int&)'
129 | build(id*2+1,m+1,r);
| ~~~~~^~~~~~~~~~~~~~
/usr/include/c++/13/bits/std_function.h:587:7: note: candidate: '_Res std::function<_Res(_ArgTypes ...)>::operator()(_ArgTypes ...) const [with _Res = void; _ArgTypes = {int, int, int, const std::vector<int, std::allocator<int> >&}]'
587 | operator()(_ArgTypes... __args) const
| ^~~~~~~~
/usr/include/c++/13/bits/std_function.h:587:7: note: candidate expects 4 arguments, 3 provided
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:131:5: error: no match for 'operator=' (operand types are 'std::function<void(int, int, int, const std::vector<int>&)>' and 'init(int, int*, int*)::<lambda(int, int, int)>')
131 | };
| ^
/usr/include/c++/13/bits/std_function.h:531:9: note: candidate: 'template<class _Functor> std::function<_Res(_ArgTypes ...)>::_Requires<std::function<_Res(_ArgTypes ...)>::_Callable<_Functor>, std::function<_Res(_ArgTypes ...)>&> std::function<_Res(_ArgTypes ...)>::operator=(_Functor&&) [with _Res = void; _ArgTypes = {int, int, int, const std::vector<int, std::allocator<int> >&}]'
531 | operator=(_Functor&& __f)
| ^~~~~~~~
/usr/include/c++/13/bits/std_function.h:531:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/13/bits/stl_pair.h:60,
from /usr/include/c++/13/bits/stl_algobase.h:64,
from /usr/include/c++/13/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51:
/usr/include/c++/13/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::__enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = std::function<void(int, int, int, const std::vector<int>&)>&]':
/usr/include/c++/13/bits/std_function.h:353:8: required by substitution of 'template<class _Res, class ... _ArgTypes> template<class _Cond, class _Tp> using std::function<_Res(_ArgTypes ...)>::_Requires = std::__enable_if_t<_Cond::value, _Tp> [with _Cond = std::function<void(int, int, int, const std::vector<int>&)>::_Callable<init(int, int*, int*)::<lambda(int, int, int)>, init(int, int*, int*)::<lambda(int, int, int)>, std::__invoke_result<init(int, int*, int*)::<lambda(int, int, int)>&, int, int, int, const std::vector<int, std::allocator<int> >&> >; _Tp = std::function<void(int, int, int, const std::vector<int>&)>&; _Res = void; _ArgTypes = {int, int, int, const std::vector<int, std::allocator<int> >&}]'
/usr/include/c++/13/bits/std_function.h:531:2: required by substitution of 'template<class _Functor> std::function<void(int, int, int, const std::vector<int>&)>::_Requires<std::function<void(int, int, int, const std::vector<int>&)>::_Callable<_Functor, typename std::enable_if<(! std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, std::function<void(int, int, int, const std::vector<int>&)> >::value), std::decay<_Ex> >::type::type, std::__invoke_result<typename std::enable_if<(! std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, std::function<void(int, int, int, const std::vector<int>&)> >::value), std::decay<_Ex> >::type::type&, int, int, int, const std::vector<int, std::allocator<int> >&> >, std::function<void(int, int, int, const std::vector<int>&)>&> std::function<void(int, int, int, const std::vector<int>&)>::operator=(_Functor&&) [with _Functor = init(int, int*, int*)::<lambda(int, int, int)>]'
horses.cpp:131:5: required from here
/usr/include/c++/13/type_traits:116:11: error: no type named 'type' in 'struct std::enable_if<false, std::function<void(int, int, int, const std::vector<int>&)>&>'
116 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~~~
/usr/include/c++/13/bits/std_function.h:541:9: note: candidate: 'template<class _Functor> std::function<_Res(_ArgTypes ...)>& std::function<_Res(_ArgTypes ...)>::operator=(std::reference_wrapper<_Functor>) [with _Res = void; _ArgTypes = {int, int, int, const std::vector<int, std::allocator<int> >&}]'
541 | operator=(reference_wrapper<_Functor> __f) noexcept
| ^~~~~~~~
/usr/include/c++/13/bits/std_function.h:541:9: note: template argument deduction/substitution failed:
horses.cpp:131:5: note: 'init(int, int*, int*)::<lambda(int, int, int)>' is not derived from 'std::reference_wrapper<_Tp>'
131 | };
| ^
/usr/include/c++/13/bits/std_function.h:469:7: note: candidate: 'std::function<_Res(_ArgTypes ...)>& std::function<_Res(_ArgTypes ...)>::operator=(const std::function<_Res(_ArgTypes ...)>&) [with _Res = void; _ArgTypes = {int, int, int, const std::vector<int, std::allocator<int> >&}]'
469 | operator=(const function& __x)
| ^~~~~~~~
/usr/include/c++/13/bits/std_function.h:469:33: note: no known conversion for argument 1 from 'init(int, int*, int*)::<lambda(int, int, int)>' to 'const std::function<void(int, int, int, const std::vector<int>&)>&'
469 | operator=(const function& __x)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/std_function.h:487:7: note: candidate: 'std::function<_Res(_ArgTypes ...)>& std::function<_Res(_ArgTypes ...)>::operator=(std::function<_Res(_ArgTypes ...)>&&) [with _Res = void; _ArgTypes = {int, int, int, const std::vector<int, std::allocator<int> >&}]'
487 | operator=(function&& __x) noexcept
| ^~~~~~~~
/usr/include/c++/13/bits/std_function.h:487:28: note: no known conversion for argument 1 from 'init(int, int*, int*)::<lambda(int, int, int)>' to 'std::function<void(int, int, int, const std::vector<int>&)>&&'
487 | operator=(function&& __x) noexcept
| ~~~~~~~~~~~^~~
/usr/include/c++/13/bits/std_function.h:501:7: note: candidate: 'std::function<_Res(_ArgTypes ...)>& std::function<_Res(_ArgTypes ...)>::operator=(std::nullptr_t) [with _Res = void; _ArgTypes = {int, int, int, const std::vector<int, std::allocator<int> >&}; std::nullptr_t = std::nullptr_t]'
501 | operator=(nullptr_t) noexcept
| ^~~~~~~~
/usr/include/c++/13/bits/std_function.h:501:17: note: no known conversion for argument 1 from 'init(int, int*, int*)::<lambda(int, int, int)>' to 'std::nullptr_t'
501 | operator=(nullptr_t) noexcept
| ^~~~~~~~~
horses.cpp:134:10: error: no match for call to '(std::function<void(int, int, int, const std::vector<int>&)>) (int, int, int&)'
134 | build(1, 0, n);
| ~~~~~^~~~~~~~~
/usr/include/c++/13/bits/std_function.h:587:7: note: candidate: '_Res std::function<_Res(_ArgTypes ...)>::operator()(_ArgTypes ...) const [with _Res = void; _ArgTypes = {int, int, int, const std::vector<int, std::allocator<int> >&}]'
587 | operator()(_ArgTypes... __args) const
| ^~~~~~~~
/usr/include/c++/13/bits/std_function.h:587:7: note: candidate expects 4 arguments, 3 provided