swap.cpp: In function 'std::vector<int>& solve(int, int)':
swap.cpp:20:17: error: could not convert 'vis[now].std::unordered_map<int, std::vector<bool> >::operator[](qq)' from 'std::unordered_map<int, std::vector<bool> >::mapped_type {aka std::vector<bool>}' to 'bool'
if(vis[now][qq]) return dp[now][qq];
^
swap.cpp:21:15: error: no match for 'operator=' (operand types are 'std::unordered_map<int, std::vector<bool> >::mapped_type {aka std::vector<bool>}' and 'int')
vis[now][qq]=1;
^
In file included from /usr/include/c++/7/vector:65:0,
from /usr/include/c++/7/queue:61,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:86,
from swap.cpp:1:
/usr/include/c++/7/bits/stl_bvector.h:682:5: note: candidate: std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(const std::vector<bool, _Alloc>&) [with _Alloc = std::allocator<bool>]
operator=(const vector& __x)
^~~~~~~~
/usr/include/c++/7/bits/stl_bvector.h:682:5: note: no known conversion for argument 1 from 'int' to 'const std::vector<bool>&'
/usr/include/c++/7/bits/stl_bvector.h:713:5: note: candidate: std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::vector<bool, _Alloc>&&) [with _Alloc = std::allocator<bool>]
operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
^~~~~~~~
/usr/include/c++/7/bits/stl_bvector.h:713:5: note: no known conversion for argument 1 from 'int' to 'std::vector<bool>&&'
/usr/include/c++/7/bits/stl_bvector.h:743:5: note: candidate: std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::initializer_list<bool>) [with _Alloc = std::allocator<bool>]
operator=(initializer_list<bool> __l)
^~~~~~~~
/usr/include/c++/7/bits/stl_bvector.h:743:5: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<bool>'
swap.cpp:48:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int k=0, i=0, j=0; i<p.size() || j<q.size(); k++)
~^~~~~~~~~
swap.cpp:48:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int k=0, i=0, j=0; i<p.size() || j<q.size(); k++)
~^~~~~~~~~
swap.cpp:50:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int t=0; t<(1<<k) && i<p.size(); t++, i++) ret.push_back(p[i]);
~^~~~~~~~~
swap.cpp:51:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int t=0; t<(1<<k) && j<q.size(); t++, j++) ret.push_back(q[j]);
~^~~~~~~~~
swap.cpp:59:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int k=0, i=0, j=0; i<p.size() || j<q.size(); k++)
~^~~~~~~~~
swap.cpp:59:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int k=0, i=0, j=0; i<p.size() || j<q.size(); k++)
~^~~~~~~~~
swap.cpp:61:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int t=0; t<(1<<k) && i<p.size(); t++, i++) ret.push_back(p[i]);
~^~~~~~~~~
swap.cpp:62:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int t=0; t<(1<<k) && j<q.size(); t++, j++) ret.push_back(q[j]);
~^~~~~~~~~
swap.cpp:72:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int k=0, i=0, j=0; i<p1.size() || j<q1.size(); k++)
~^~~~~~~~~~
swap.cpp:72:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int k=0, i=0, j=0; i<p1.size() || j<q1.size(); k++)
~^~~~~~~~~~
swap.cpp:74:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int t=0; t<(1<<k) && i<p1.size(); t++, i++)
~^~~~~~~~~~
swap.cpp:85:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int t=0; t<(1<<k) && j<q1.size(); t++, j++)
~^~~~~~~~~~
swap.cpp:99:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
swap.cpp: In function 'int main()':
swap.cpp:103:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &N);
~~~~~^~~~~~~~~~
swap.cpp:104:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=1; i<=N; i++) scanf("%d", &A[i]);
~~~~~^~~~~~~~~~~~~