election.cpp: In function 'void init()':
election.cpp:19:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < psums.size(); i++){
~~^~~~~~~~~~~~~~
election.cpp:24:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i + (1<<b) <= psums.size(); i++){
~~~~~~~~~~~^~~~~~~~~~~~~~~
election.cpp: In function 'int get(int, int, int, int)':
election.cpp:51:20: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
if(memo.find(a<<15+b) == memo.end()){
~~^~
election.cpp:51:22: error: no matching function for call to 'std::map<std::pair<int, int>, int>::find(int)'
if(memo.find(a<<15+b) == memo.end()){
^
In file included from /usr/include/c++/7/map:61:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:81,
from election.cpp:1:
/usr/include/c++/7/bits/stl_map.h:1163:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::find(const key_type&) [with _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<std::pair<const std::pair<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::pair<int, int>]
find(const key_type& __x)
^~~~
/usr/include/c++/7/bits/stl_map.h:1163:7: note: no known conversion for argument 1 from 'int' to 'const key_type& {aka const std::pair<int, int>&}'
/usr/include/c++/7/bits/stl_map.h:1169:2: note: candidate: template<class _Kt> decltype (((std::map<_Key, _Tp, _Compare, _Alloc>*)this)->std::map<_Key, _Tp, _Compare, _Alloc>::_M_t._M_find_tr(__x)) std::map<_Key, _Tp, _Compare, _Alloc>::find(const _Kt&) [with _Kt = _Kt; _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >]
find(const _Kt& __x) -> decltype(_M_t._M_find_tr(__x))
^~~~
/usr/include/c++/7/bits/stl_map.h:1169:2: note: template argument deduction/substitution failed:
/usr/include/c++/7/bits/stl_map.h: In substitution of 'template<class _Kt> decltype (((std::map<std::pair<int, int>, int>*)this)->std::map<std::pair<int, int>, int>::_M_t.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<const std::pair<int, int>, int> > >::_M_find_tr(__x)) std::map<std::pair<int, int>, int>::find<_Kt>(const _Kt&) [with _Kt = int]':
election.cpp:51:22: required from here
/usr/include/c++/7/bits/stl_map.h:1169:2: error: no matching function for call to 'std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<const std::pair<int, int>, int> > >::_M_find_tr(const int&)'
In file included from /usr/include/c++/7/map:60:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:81,
from election.cpp:1:
/usr/include/c++/7/bits/stl_tree.h:1212:2: note: candidate: template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) [with _Kt = _Kt; _Req = _Req; _Key = std::pair<int, int>; _Val = std::pair<const std::pair<int, int>, int>; _KeyOfValue = std::_Select1st<std::pair<const std::pair<int, int>, int> >; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >]
_M_find_tr(const _Kt& __k)
^~~~~~~~~~
/usr/include/c++/7/bits/stl_tree.h:1212:2: note: template argument deduction/substitution failed:
/usr/include/c++/7/bits/stl_tree.h:1209:9: error: no type named 'type' in 'struct std::__has_is_transparent<std::less<std::pair<int, int> >, int, void>'
typename _Req =
^~~~~~~~
/usr/include/c++/7/bits/stl_tree.h:1222:2: note: candidate: template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) const [with _Kt = _Kt; _Req = _Req; _Key = std::pair<int, int>; _Val = std::pair<const std::pair<int, int>, int>; _KeyOfValue = std::_Select1st<std::pair<const std::pair<int, int>, int> >; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >]
_M_find_tr(const _Kt& __k) const
^~~~~~~~~~
/usr/include/c++/7/bits/stl_tree.h:1222:2: note: template argument deduction/substitution failed:
/usr/include/c++/7/bits/stl_tree.h:1219:9: error: no type named 'type' in 'struct std::__has_is_transparent<std::less<std::pair<int, int> >, int, void>'
typename _Req =
^~~~~~~~
In file included from /usr/include/c++/7/map:61:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:81,
from election.cpp:1:
/usr/include/c++/7/bits/stl_map.h:1188:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::const_iterator std::map<_Key, _Tp, _Compare, _Alloc>::find(const key_type&) const [with _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<std::pair<const std::pair<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::pair<int, int>]
find(const key_type& __x) const
^~~~
/usr/include/c++/7/bits/stl_map.h:1188:7: note: no known conversion for argument 1 from 'int' to 'const key_type& {aka const std::pair<int, int>&}'
/usr/include/c++/7/bits/stl_map.h:1194:2: note: candidate: template<class _Kt> decltype (((const std::map<_Key, _Tp, _Compare, _Alloc>*)this)->std::map<_Key, _Tp, _Compare, _Alloc>::_M_t._M_find_tr(__x)) std::map<_Key, _Tp, _Compare, _Alloc>::find(const _Kt&) const [with _Kt = _Kt; _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >]
find(const _Kt& __x) const -> decltype(_M_t._M_find_tr(__x))
^~~~
/usr/include/c++/7/bits/stl_map.h:1194:2: note: template argument deduction/substitution failed:
/usr/include/c++/7/bits/stl_map.h: In substitution of 'template<class _Kt> decltype (((const std::map<std::pair<int, int>, int>*)this)->std::map<std::pair<int, int>, int>::_M_t.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<const std::pair<int, int>, int> > >::_M_find_tr(__x)) std::map<std::pair<int, int>, int>::find<_Kt>(const _Kt&) const [with _Kt = int]':
election.cpp:51:22: required from here
/usr/include/c++/7/bits/stl_map.h:1194:2: error: no matching function for call to 'std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<const std::pair<int, int>, int> > >::_M_find_tr(const int&) const'
In file included from /usr/include/c++/7/map:60:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:81,
from election.cpp:1:
/usr/include/c++/7/bits/stl_tree.h:1212:2: note: candidate: template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) [with _Kt = _Kt; _Req = _Req; _Key = std::pair<int, int>; _Val = std::pair<const std::pair<int, int>, int>; _KeyOfValue = std::_Select1st<std::pair<const std::pair<int, int>, int> >; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >]
_M_find_tr(const _Kt& __k)
^~~~~~~~~~
/usr/include/c++/7/bits/stl_tree.h:1212:2: note: template argument deduction/substitution failed:
/usr/include/c++/7/bits/stl_tree.h:1209:9: error: no type named 'type' in 'struct std::__has_is_transparent<std::less<std::pair<int, int> >, int, void>'
typename _Req =
^~~~~~~~
/usr/include/c++/7/bits/stl_tree.h:1222:2: note: candidate: template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) const [with _Kt = _Kt; _Req = _Req; _Key = std::pair<int, int>; _Val = std::pair<const std::pair<int, int>, int>; _KeyOfValue = std::_Select1st<std::pair<const std::pair<int, int>, int> >; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >]
_M_find_tr(const _Kt& __k) const
^~~~~~~~~~
/usr/include/c++/7/bits/stl_tree.h:1222:2: note: template argument deduction/substitution failed:
/usr/include/c++/7/bits/stl_tree.h:1219:9: error: no type named 'type' in 'struct std::__has_is_transparent<std::less<std::pair<int, int> >, int, void>'
typename _Req =
^~~~~~~~
election.cpp:52:13: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
memo[a<<15+b] = max_psum(a, b, l, r);
~~^~
election.cpp:52:7: error: no match for 'operator[]' (operand types are 'std::map<std::pair<int, int>, int>' and 'int')
memo[a<<15+b] = max_psum(a, b, l, r);
^
In file included from /usr/include/c++/7/map:61:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:81,
from election.cpp:1:
/usr/include/c++/7/bits/stl_map.h:484:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::pair<int, int>]
operator[](const key_type& __k)
^~~~~~~~
/usr/include/c++/7/bits/stl_map.h:484:7: note: no known conversion for argument 1 from 'int' to 'const key_type& {aka const std::pair<int, int>&}'
/usr/include/c++/7/bits/stl_map.h:504:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::pair<int, int>]
operator[](key_type&& __k)
^~~~~~~~
/usr/include/c++/7/bits/stl_map.h:504:7: note: no known conversion for argument 1 from 'int' to 'std::map<std::pair<int, int>, int>::key_type&& {aka std::pair<int, int>&&}'
election.cpp:54:19: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
return memo[a<<15+b];
~~^~
election.cpp:54:13: error: no match for 'operator[]' (operand types are 'std::map<std::pair<int, int>, int>' and 'int')
return memo[a<<15+b];
^
In file included from /usr/include/c++/7/map:61:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:81,
from election.cpp:1:
/usr/include/c++/7/bits/stl_map.h:484:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::pair<int, int>]
operator[](const key_type& __k)
^~~~~~~~
/usr/include/c++/7/bits/stl_map.h:484:7: note: no known conversion for argument 1 from 'int' to 'const key_type& {aka const std::pair<int, int>&}'
/usr/include/c++/7/bits/stl_map.h:504:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::pair<int, int>]
operator[](key_type&& __k)
^~~~~~~~
/usr/include/c++/7/bits/stl_map.h:504:7: note: no known conversion for argument 1 from 'int' to 'std::map<std::pair<int, int>, int>::key_type&& {aka std::pair<int, int>&&}'
election.cpp: In function 'int main()':
election.cpp:83:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < s.size(); i++){
~~^~~~~~~~~~