Problem catteams
User Rolo
Submission Time 2024-08-24 18:45:07
Score 0
Max Time N/A
Max Memory N/A

Compile Error

catteams.cpp: In function ‘int main()’:
catteams.cpp:10:22: error: expected initializer before ‘:’ token
10 | int dp[n+1][k+1][2]:
| ^
catteams.cpp:11:16: error: ‘i’ was not declared in this scope
11 | for(int i = 1;i <= n;i++)
| ^
catteams.cpp:20:4: error: ‘dp’ was not declared in this scope
20 | dp[i][j][1] = 0;
| ^~
catteams.cpp:33:4: error: ‘dp’ was not declared in this scope
33 | dp[i][j][0] = max( dp[i][j+1][0] ,dp[i-1][j][1] + a[i] - a[min(1,i-1)] );
| ^~
catteams.cpp:39:14: error: ‘dp’ was not declared in this scope
39 | cout << max(dp[n][k][0], dp[n][k][1]) << '\n' ;
| ^~