| Problem | knapsack |
|---|---|
| User | aiden |
| Submission Time | 2025-12-27 19:31:33 |
| Score | 0 |
| Max Time | N/A |
| Max Memory | N/A |
Owl Get a Life
knapsack.cpp:3:1: error: ‘define’ does not name a type
3 | define int long long
| ^~~~~~
knapsack.cpp:6:8: error: ‘sheep’ was not declared in this scope
6 | int wt[sheep];
| ^~~~~
knapsack.cpp:7:9: error: ‘sheep’ was not declared in this scope
7 | int val[sheep];
| ^~~~~
knapsack.cpp: In function ‘int knapSack(int, int)’:
knapsack.cpp:26:15: error: ‘wt’ was not declared in this scope; did you mean ‘w’?
26 | else if (wt[i-1] <= w)
| ^~
| w
knapsack.cpp:27:21: error: ‘val’ was not declared in this scope
27 | K[i][w] = max(val[i-1] + K[i-1][w- wt[i-1]], K[i-1][w]);
| ^~~
knapsack.cpp: In function ‘int main()’:
knapsack.cpp:44:7: error: ‘wt’ was not declared in this scope
44 | wt[total] = tempw;
| ^~
knapsack.cpp:45:7: error: ‘val’ was not declared in this scope
45 |