Problem catlunch
User Rolo
Submission Time 2024-03-29 20:56:24
Score 0
Max Time N/A
Max Memory N/A

Compile Error

catlunch.cpp: In function ‘int main()’:
catlunch.cpp:23:27: error: ‘k’ was not declared in this scope
23 | for(int j = 0; j <= k;j++)
| ^
catlunch.cpp:28:33: error: invalid types ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]’ for array subscript
28 | if(j >0 && j < k)dp[i][j] = max(dp[i-1][j-1], dp[i-1][j] + t[i],0);
| ^
catlunch.cpp:28:52: error: invalid types ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]’ for array subscript
28 | if(j >0 && j < k)dp[i][j] = max(dp[i-1][j-1], dp[i-1][j] + t[i],0);
| ^
catlunch.cpp:28:64: error: invalid types ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]’ for array subscript
28 | if(j >0 && j < k)d