Problem knapsack
User simonfalke
Submission Time 2023-02-17 22:14:31
Score 0
Max Time N/A
Max Memory N/A

Compile Error

knapsack.cpp: In function ‘int main()’:
knapsack.cpp:9:31: error: no match for ‘operator+’ (operand types are ‘std::vector<std::pair<double, int> >’ and ‘std::vector<std::pair<double, int> >::size_type’ {aka ‘long unsigned int’})
9 | #define ALLA(arr, sz) arr, arr+sz
| ^
knapsack.cpp:10:35: note: in expansion of macro ‘ALLA’
10 | #define REVERSEA(arr, sz) reverse(ALLA(arr, sz))
| ^~~~
knapsack.cpp:44:9: note: in expansion of macro ‘REVERSEA’
44 | REVERSEA(value, value.size());
| ^~~~~~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/bits/specfun.h:45,
from /usr/include/c++/9/cmath:1927,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:41,
from knapsack.cpp:1:
/usr/include/c++/9/bits/stl_iterator.h