Problem knapsack2
User user123
Submission Time 2023-06-29 19:41:47
Score 0
Max Time N/A
Max Memory N/A

Compile Error

knapsack2.cpp: In function ‘int main()’:
knapsack2.cpp:32:13: error: invalid use of non-static member function ‘std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::size_type = long unsigned int]’
32 | cout<<mem[m].size<<endl;
| ~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/9/vector:67,
from /usr/include/c++/9/functional:62,
from /usr/include/c++/9/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/9/algorithm:71,
from knapsack2.cpp:2:
/usr/include/c++/9/bits/stl_vector.h:915:7: note: declared here
915 | size() const _GLIBCXX_NOEXCEPT
| ^~~~