Problem knapsack
User snorky
Submission Time 2024-01-25 13:07:11
Score 0
Max Time N/A
Max Memory N/A

Compile Error

knapsack.cpp: In function ‘int helper(int&, int&, int&, int, int, int)’:
knapsack.cpp:6:5: error: ‘dp’ was not declared in this scope
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)){
| ^
| ]
knapsack.cpp:12:18: error: invalid types ‘int[int]’ for array subscript
knapsack.cpp:12:19: error: expected primary-expression before ‘)’ token
12 | if(S>=n*w[index)){