Problem coke
User ARock
Submission Time 2023-12-06 15:58:31
Score 0
Max Time N/A
Max Memory N/A

Compile Error

coke.cpp:18:20: error: ‘long long int dp(long long int, long long int)’ redeclared as different kind of entity
18 | int dp(int i, int w) { // enjoyment
| ^
coke.cpp:11:5: note: previous declaration ‘long long int dp [3005][3005]’
11 | int dp[3005][3005];
| ^~
coke.cpp: In function ‘long long int dp(long long int, long long int)’:
coke.cpp:20:6: error: ‘memo’ was not declared in this scope
20 | if (memo[i][w] != -1) return memo[i][w];
| ^~~~
coke.cpp:23:2: error: ‘memo’ was not declared in this scope
23 | memo[i][w] = dp(i+1, w);
| ^~~~
coke.cpp:23:24: error: ‘dp’ cannot be used as a function
23 | memo[i][w] = dp(i+1, w);
| ^
coke.cpp:26:54: error: ‘dp’ cannot be used as a function
26 | memo[i][w] = max(memo[i][w], dp(i+1, w+coke[i].first) + w * coke[i].second);
| ^
coke