| Problem | 01knapsack |
|---|---|
| User | PerihelionfromAphelion |
| Submission Time | 2026-06-09 22:36:37 |
| Score | 0 |
| Max Time | N/A |
| Max Memory | N/A |
Owl Get a Life
01knapsack.cpp: In function ‘int main()’:
01knapsack.cpp:9:21: error: conflicting declaration ‘std::vector<long long int> w’
9 | vector <long long> w(n + 1);
| ^
01knapsack.cpp:7:9: note: previous declaration as ‘int w’
7 | int n, w, i, j;
| ^
01knapsack.cpp:12:13: error: invalid types ‘int[int]’ for array subscript
12 | cin >> w[i] >> v[i];
| ^
01knapsack.cpp:16:23: error: invalid types ‘int[int]’ for array subscript
16 | for (j = w; j >= w[i]; j--) {
| ^
01knapsack.cpp:17:33: error: invalid types ‘int[int]’ for array subscript
17 | dp[j] = max(dp[j], dp[j - w[i]] + v[i]);
| ^