| Problem | 01knapsack |
|---|---|
| User | j0ashhh |
| Submission Time | 2026-02-20 16:16:36 |
| Score | 0 |
| Max Time | N/A |
| Max Memory | N/A |
Owl Get a Life
01knapsack.cpp: In function ‘int knapsack(int, std::vector<int>, std::vector<int>)’:
01knapsack.cpp:13:35: error: ‘wt’ was not declared in this scope
13 | pick = vals[i-1] + dp[i-1][j-wt[i-1]];
| ^~
01knapsack.cpp:20:13: error: ‘i’ was not declared in this scope
20 | cout << dp[i][j];
| ^
01knapsack.cpp:20:16: error: ‘j’ was not declared in this scope
20 | cout << dp[i][j];
| ^
01knapsack.cpp: In function ‘int main()’:
01knapsack.cpp:28:10: error: ‘weights’ was not declared in this scope; did you mean ‘weight’?
28 | cin >> weights[i] >> vals[i];
| ^~~~~~~
| weight