sortbooks.cpp: In member function 'void seg_tree::build(int, int, int, std::vector<int>&)':
sortbooks.cpp:45:25: error: no matching function for call to 'max(int&, long long int)'
45 | t[v].res=max(t[v].res, (ind-1>=0?t[v*2+1].vals[ind-1]+t[v*2].vals.back():0ll));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/algorithm:61,
from sortbooks.cpp:1:
/usr/include/c++/11/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++/11/bits/stl_algobase.h:254:5: note: template argument deduction/substitution failed:
sortbooks.cpp:45:25: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
45 | t[v].res=max(t[v].res, (ind-1>=0?t[v*2+1].vals[ind-1]+t[v*2].vals.back():0ll));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/algorithm:61,
from sortbooks.cpp:1:
/usr/include/c++/11/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++/11/bits/stl_algobase.h:300:5: note: template argument deduction/substitution failed:
sortbooks.cpp:45:25: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
45 | t[v].res=max(t[v].res, (ind-1>=0?t[v*2+1].vals[ind-1]+t[v*2].vals.back():0ll));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/algorithm:62,
from sortbooks.cpp:1:
/usr/include/c++/11/bits/stl_algo.h:3461:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
3461 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/11/bits/stl_algo.h:3461:5: note: template argument deduction/substitution failed:
sortbooks.cpp:45:25: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
45 | t[v].res=max(t[v].res, (ind-1>=0?t[v*2+1].vals[ind-1]+t[v*2].vals.back():0ll));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/algorithm:62,
from sortbooks.cpp:1:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
3467 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: template argument deduction/substitution failed:
sortbooks.cpp:45:25: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
45 | t[v].res=max(t[v].res, (ind-1>=0?t[v*2+1].vals[ind-1]+t[v*2].vals.back():0ll));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sortbooks.cpp: In member function 'std::pair<int, int> seg_tree::query(int, int, int, int, int, int)':
sortbooks.cpp:51:27: error: 'INF' was not declared in this scope
51 | if (l>r) return {-INF, pass_mx};
| ^~~
sortbooks.cpp:51:39: error: could not convert '{<expression error>, pass_mx}' from '<brace-enclosed initializer list>' to 'std::pair<int, int>'
51 | if (l>r) return {-INF, pass_mx};
| ^
| |
| <brace-enclosed initializer list>
sortbooks.cpp:54:27: error: 'INF' was not declared in this scope
54 | if (pass_mx==-INF) return {t[v].res, t[v].vals.back()};
| ^~~
sortbooks.cpp: In member function 'int seg_tree::query(int, int)':
sortbooks.cpp:76:43: error: 'INF' was not declared in this scope
76 | ll res= query(0, rsz-1, 1, l, r, -INF).ff;
| ^~~