Problem knapsack
User AJigglypuffCoder
Submission Time 2025-02-03 21:02:32
Score 0
Max Time N/A
Max Memory N/A

Compile Error

knapsack.cpp: In function ‘int main()’:
knapsack.cpp:70:38: error: no matching function for call to ‘std::vector<item_type>::emplace_back(<brace-enclosed initializer list>)’
70 | tmp.emplace_back({V: tV, W: tW});
| ^
In file included from /usr/include/c++/9/vector:72,
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 /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from knapsack.cpp:21:
/usr/include/c++/9/bits/vector.tcc:109:7: note: candidate: ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {}; _Tp = item_type; _Alloc = std::allocator<item_type>; std::vector<_Tp, _Alloc>::reference = item_type&]’
109 | vector<_Tp, _Alloc>::<