| Problem | knapsack |
|---|---|
| User | lykieutrang |
| Submission Time | 2026-02-18 16:05:19 |
| Score | 0 |
| Max Time | N/A |
| Max Memory | N/A |
Owl Get a Life
knapsack.cpp: In function ‘int main()’:
knapsack.cpp:12:58: error: expected unqualified-id before ‘static’
12 | ll N, K; cin >> K >> N; static ll val[5000000 + 10], static weight[5000000 + 10];
| ^~~~~~
knapsack.cpp:23:13: error: ‘weight’ was not declared in this scope
23 | weight[idx] = (w * curtake);
| ^~~~~~
knapsack.cpp:34:15: error: ‘weight’ was not declared in this scope
34 | rl(K, weight[i], w) { // loop ngược nhé!!!
| ^~~~~~
knapsack.cpp:5:41: note: in definition of macro ‘rl’
5 | #define rl(a, b, i) for (ll i = a; i >= b; i--)
| ^