valley.cpp:82:32: error: redefinition of 'int l'
82 | ll query(int l, int r, int l = 1, int r = n, int id = 0){
| ~~~~^~~~~
valley.cpp:82:18: note: 'int l' previously declared here
82 | ll query(int l, int r, int l = 1, int r = n, int id = 0){
| ~~~~^
valley.cpp:82:43: error: redefinition of 'int r'
82 | ll query(int l, int r, int l = 1, int r = n, int id = 0){
| ~~~~^~~~~
valley.cpp:82:25: note: 'int r' previously declared here
82 | ll query(int l, int r, int l = 1, int r = n, int id = 0){
| ~~~~^
valley.cpp: In constructor 'segmenttree::segmenttree(int)':
valley.cpp:68:27: error: reference to 'max' is ambiguous
68 | st.resize(4 * sz, max);
| ^~~
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from valley.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidates are: '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:3480:5: note: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
3480 | max(initializer_list<_Tp> __l)
| ^~~
In file included from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from valley.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: '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:254:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
254 | max(const _Tp& __a, const _Tp& __b)
| ^~~
valley.cpp:44:10: note: 'const ll max'
44 | const ll max = 1ll << 60;
| ^~~
valley.cpp: In member function 'll segmenttree::query(int, int, int)':
valley.cpp:83:26: error: reference to 'max' is ambiguous
83 | if(l > r) return max;
| ^~~
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from valley.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidates are: '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:3480:5: note: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
3480 | max(initializer_list<_Tp> __l)
| ^~~
In file included from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from valley.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: '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:254:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
254 | max(const _Tp& __a, const _Tp& __b)
| ^~~
valley.cpp:44:10: note: 'const ll max'
44 | const ll max = 1ll << 60;
| ^~~
valley.cpp:84:14: warning: self-comparison always evaluates to true [-Wtautological-compare]
84 | if(l <= l && r <= r) return st[id];
| ~ ^~ ~
valley.cpp:84:24: warning: self-comparison always evaluates to true [-Wtautological-compare]
84 | if(l <= l && r <= r) return st[id];
| ~ ^~ ~
valley.cpp:86:55: error: no matching function for call to 'segmenttree::query(int&, int&, int&, int&, int)'
86 | if(r <= m) return query(l, r, l, m, 2 * id + 1);
| ^
valley.cpp:82:8: note: candidate: 'll segmenttree::query(int, int, int)'
82 | ll query(int l, int r, int l = 1, int r = n, int id = 0){
| ^~~~~
valley.cpp:82:8: note: candidate expects 3 arguments, 5 provided
valley.cpp:87:63: error: no matching function for call to 'segmenttree::query(int&, int&, int, int&, int)'
87 | else if(l > m) return query(l, r, m + 1, r, 2 * id + 2);
| ^
valley.cpp:82:8: note: candidate: 'll segmenttree::query(int, int, int)'
82 | ll query(int l, int r, int l = 1, int r = n, int id = 0){
| ^~~~~
valley.cpp:82:8: note: candidate expects 3 arguments, 5 provided
valley.cpp:88:53: error: no matching function for call to 'segmenttree::query(int&, int&, int&, int&, int)'
88 | else return min(query(l, r, l, m, 2 * id + 1), query(l, r, m + 1, r, 2 * id + 2));
| ^
valley.cpp:82:8: note: candidate: 'll segmenttree::query(int, int, int)'
82 | ll query(int l, int r, int l = 1, int r = n, int id = 0){
| ^~~~~
valley.cpp:82:8: note: candidate expects 3 arguments, 5 provided
valley.cpp:88:88: error: no matching function for call to 'segmenttree::query(int&, int&, int, int&, int)'
88 | else return min(query(l, r, l, m, 2 * id + 1), query(l, r, m + 1, r, 2 * id + 2));
| ^
valley.cpp:82:8: note: candidate: 'll segmenttree::query(int, int, int)'
82 | ll query(int l, int r, int l = 1, int r = n, int id = 0){
| ^~~~~
valley.cpp:82:8: note: candidate expects 3 arguments, 5 provided
valley.cpp: At global scope:
valley.cpp:101:11: error: conflicting declaration 'const int sz'
101 | const int sz = 20;
| ^~
valley.cpp:98:13: note: previous declaration as 'std::vector<int> sz'
98 | vector<int> sz, ts;
| ^~
valley.cpp: In function 'void init()':
valley.cpp:109:41: error: no matching function for call to 'std::vector<std::vector<int> >::resize(std::vector<int>&, std::vector<int>)'
109 | pr.resize(sz, vector<int>(n + 1, -1));
| ^
In file included from /usr/include/c++/10/vector:67,
from /usr/include/c++/10/queue:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
from valley.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:937:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
937 | resize(size_type __new_size)
| ^~~~~~
/usr/include/c++/10/bits/stl_vector.h:937:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/10/bits/stl_vector.h:957:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = std::vector<int>]'
957 | resize(size_type __new_size, const value_type& __x)
| ^~~~~~
/usr/include/c++/10/bits/stl_vector.h:957:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'}
957 | resize(size_type __new_size, const value_type& __x)
| ~~~~~~~~~~^~~~~~~~~~
valley.cpp:110:41: error: no matching function for call to 'std::vector<std::vector<int> >::resize(std::vector<int>&, std::vector<int>)'
110 | in.resize(sz, vector<int>(n + 1, -1));
| ^
In file included from /usr/include/c++/10/vector:67,
from /usr/include/c++/10/queue:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
from valley.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:937:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
937 | resize(size_type __new_size)
| ^~~~~~
/usr/include/c++/10/bits/stl_vector.h:937:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/10/bits/stl_vector.h:957:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = std::vector<int>]'
957 | resize(size_type __new_size, const value_type& __x)
| ^~~~~~
/usr/include/c++/10/bits/stl_vector.h:957:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'}
957 | resize(size_type __new_size, const value_type& __x)
| ~~~~~~~~~~^~~~~~~~~~
valley.cpp:111:42: error: no matching function for call to 'std::vector<std::vector<int> >::resize(std::vector<int>&, std::vector<int>)'
111 | out.resize(sz, vector<int>(n + 1, -1));
| ^
In file included from /usr/include/c++/10/vector:67,
from /usr/include/c++/10/queue:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
from valley.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:937:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
937 | resize(size_type __new_size)
| ^~~~~~
/usr/include/c++/10/bits/stl_vector.h:937:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/10/bits/stl_vector.h:957:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = std::vector<int>]'
957 | resize(size_type __new_size, const value_type& __x)
| ^~~~~~
/usr/include/c++/10/bits/stl_vector.h:957:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'}
957 | resize(size_type __new_size, const value_type& __x)
| ~~~~~~~~~~^~~~~~~~~~
valley.cpp:112:37: error: no matching function for call to 'std::vector<std::vector<long long int> >::resize(std::vector<int>&, std::vector<long long int>)'
112 | dpt.resize(sz, vector<ll>(n + 1));
| ^
In file included from /usr/include/c++/10/vector:67,
from /usr/include/c++/10/queue:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
from valley.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:937:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
937 | resize(size_type __new_size)
| ^~~~~~
/usr/include/c++/10/bits/stl_vector.h:937:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/10/bits/stl_vector.h:957:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = std::vector<long long int>; _Alloc = std::allocator<std::vector<long long int> >; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = std::vector<long long int>]'
957 | resize(size_type __new_size, const value_type& __x)
| ^~~~~~
/usr/include/c++/10/bits/stl_vector.h:957:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<std::vector<long long int> >::size_type' {aka 'long unsigned int'}
957 | resize(size_type __new_size, const value_type& __x)
| ~~~~~~~~~~^~~~~~~~~~
valley.cpp:113:33: error: no matching function for call to 'std::vector<segmenttree>::resize(std::vector<int>&, segmenttree)'
113 | st.resize(sz, segmenttree(n));
| ^
In file included from /usr/include/c++/10/vector:67,
from /usr/include/c++/10/queue:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
from valley.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:937:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = segmenttree; _Alloc = std::allocator<segmenttree>; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
937 | resize(size_type __new_size)
| ^~~~~~
/usr/include/c++/10/bits/stl_vector.h:937:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/10/bits/stl_vector.h:957:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = segmenttree; _Alloc = std::allocator<segmenttree>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = segmenttree]'
957 | resize(size_type __new_size, const value_type& __x)
| ^~~~~~
/usr/include/c++/10/bits/stl_vector.h:957:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<segmenttree>::size_type' {aka 'long unsigned int'}
957 | resize(size_type __new_size, const value_type& __x)
| ~~~~~~~~~~^~~~~~~~~~
valley.cpp:116:17: error: no matching function for call to 'std::vector<int>::resize(std::vector<int>&)'
116 | ts.resize(sz);
| ^
In file included from /usr/include/c++/10/vector:67,
from /usr/include/c++/10/queue:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
from valley.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:937:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
937 | resize(size_type __new_size)
| ^~~~~~
/usr/include/c++/10/bits/stl_vector.h:937:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
937 | resize(size_type __new_size)
| ~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:957:7: note: candidate: 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = int]'
957 | resize(size_type __new_size, const value_type& __x)
| ^~~~~~
/usr/include/c++/10/bits/stl_vector.h:957:7: note: candidate expects 2 arguments, 1 provided
valley.cpp: In function 'void dfsg2(int, int, int)':
valley.cpp:135:14: error: reference to 'max' is ambiguous
135 | mx = max(mx, sz[i.f]);
| ^~~
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from valley.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidates are: '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:3480:5: note: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
3480 | max(initializer_list<_Tp> __l)
| ^~~
In file included from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from valley.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: '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:254:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
254 | max(const _Tp& __a, const _Tp& __b)
| ^~~
valley.cpp:44:10: note: 'const ll max'
44 | const ll max = 1ll << 60;
| ^~~
valley.cpp: At global scope:
valley.cpp:168:10: error: reference to 'max' is ambiguous
168 | ll oao = max;
| ^~~
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-g