Problem knapsack
User Dan64091
Submission Time 2026-06-25 15:32:03
Score 0
Max Time N/A
Max Memory N/A

Compile Error

knapsack.cpp: In function ‘int32_t main()’:
knapsack.cpp:30:25: error: ‘k’ was not declared in this scope
30 | int use = min(take, k);
| ^
knapsack.cpp: At global scope:
knapsack.cpp:41:2: error: ‘cout’ does not name a type
41 | cout << dp[S];
| ^~~~
knapsack.cpp:42:2: error: expected unqualified-id before ‘return’
42 | return 0;
| ^~~~~~
knapsack.cpp:43:1: error: expected declaration before ‘}’ token
43 | }
| ^