segments.cpp: In member function 'void tree::build(int)':
segments.cpp:27:48: error: no matching function for call to 'std::vector<tree::node>::assign(int, <brace-enclosed initializer list>)'
t.assign(n * 4, make_struct(-inf, -inf));
^
In file included from /usr/include/c++/7/vector:64:0,
from /usr/include/c++/7/functional:61,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71,
from segments.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:501:7: note: candidate: void std::vector<_Tp, _Alloc>::assign(std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = tree::node; _Alloc = std::allocator<tree::node>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = tree::node]
assign(size_type __n, const value_type& __val)
^~~~~~
/usr/include/c++/7/bits/stl_vector.h:501:7: note: no known conversion for argument 2 from '<brace-enclosed initializer list>' to 'const value_type& {aka const tree::node&}'
/usr/include/c++/7/bits/stl_vector.h:520:2: note: candidate: template<class _InputIterator, class> void std::vector<_Tp, _Alloc>::assign(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; <template-parameter-2-2> = <template-parameter-1-2>; _Tp = tree::node; _Alloc = std::allocator<tree::node>]
assign(_InputIterator __first, _InputIterator __last)
^~~~~~
/usr/include/c++/7/bits/stl_vector.h:520:2: note: template argument deduction/substitution failed:
/usr/include/c++/7/bits/stl_vector.h:546:7: note: candidate: void std::vector<_Tp, _Alloc>::assign(std::initializer_list<_Tp>) [with _Tp = tree::node; _Alloc = std::allocator<tree::node>]
assign(initializer_list<value_type> __l)
^~~~~~
/usr/include/c++/7/bits/stl_vector.h:546:7: note: candidate expects 1 argument, 2 provided
segments.cpp: In member function 'void tree::modify(int, int, int, int, int, int)':
segments.cpp:41:39: error: no matching function for call to 'max(short int&, int&)'
t[v].add = max(t[v].add, x);
^
In file included from /usr/include/c++/7/bits/specfun.h:45:0,
from /usr/include/c++/7/cmath:1914,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:41,
from segments.cpp:1:
/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:
segments.cpp:41:39: note: deduced conflicting types for parameter 'const _Tp' ('short int' and 'int')
t[v].add = max(t[v].add, x);
^
In file included from /usr/include/c++/7/bits/specfun.h:45:0,
from /usr/include/c++/7/cmath:1914,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:41,
from segments.cpp:1:
/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:
segments.cpp:41:39: note: deduced conflicting types for parameter 'const _Tp' ('short int' and 'int')
t[v].add = max(t[v].add, 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 segments.cpp:1:
/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:
segments.cpp:41:39: note: mismatched types 'std::initializer_list<_Tp>' and 'short int'
t[v].add = max(t[v].add, 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 segments.cpp:1:
/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:
segments.cpp:41:39: note: mismatched types 'std::initializer_list<_Tp>' and 'short int'
t[v].add = max(t[v].add, x);
^