Problem | 01knapsack |
---|---|
User | carson |
Submission Time | 2025-08-12 14:35:37 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
01knapsack.cpp: In function ‘int main()’:
01knapsack.cpp:9:26: error: no match for call to ‘(std::vector<int>) (int&)’
9 | cin >> weight[i]>>val(n);
| ^
01knapsack.cpp:16:18: error: ‘dp’ was not declared in this scope
16 | int notpick = dp[i-1][j];
| ^~
01knapsack.cpp:17:7: error: ‘w’ was not declared in this scope
17 | if(w[i] <= j){
| ^
01knapsack.cpp:18:29: error: ‘wt’ was not declared in this scope
18 | pick = val[i]+dp[i-1][j-wt[i]];
| ^~
01knapsack.cpp:25:10: error: ‘dp’ was not declared in this scope
25 | cout << dp[n][m] << "\n";
| ^~