Problem knapsack
User snorky
Submission Time 2024-01-25 19:40:52
Score 0
Max Time N/A
Max Memory N/A

Compile Error

knapsack.cpp: In function ‘int helper(int&, int&, int&, int&, int, int, int)’:
knapsack.cpp:6:9: error: invalid types ‘int[int]’ for array subscript
6 | if(dp[S][index]!=-1) return dp[S][index];
| ^
knapsack.cpp:6:34: error: invalid types ‘int[int]’ for array subscript
6 | if(dp[S][index]!=-1) return dp[S][index];
| ^
knapsack.cpp:8:3: error: ‘maxV’ was not declared in this scope
8 | maxV = min(k[index],S/w[index]);
| ^~~~
knapsack.cpp:8:21: error: invalid types ‘int[int]’ for array subscript
8 | maxV = min(k[index],S/w[index]);
| ^
knapsack.cpp:8:32: error: invalid types ‘int[int]’ for array subscript
8 | maxV = min(k[index],S/w[index]);
| ^
knapsack.cpp:12:18: error: expected ‘]’ before ‘)’ token
12 | if(S>=n*w[index)){
| ^
|