0_0_33289156_476.cpp:6:7: error: 'len' does not name a type
const len = 1002;
^
0_0_33289156_476.cpp:8:11: error: 'len' was not declared in this scope
int value[len];
^
0_0_33289156_476.cpp:9:10: error: 'len' was not declared in this scope
int cost[len]
^
0_0_33289156_476.cpp:11:1: error: expected initializer before 'int'
int dp[len][len];
^
0_0_33289156_476.cpp: In function 'int main()':
0_0_33289156_476.cpp:21:20: error: 'value' was not declared in this scope
cin >> value[i + 1];
^
0_0_33289156_476.cpp:24:20: error: 'cost' was not declared in this scope
cin >> cost[i + 1];
^
0_0_33289156_476.cpp:27:16: error: 'dp' was not declared in this scope
memset(dp, 0, sizeof(int) * len * len);
^
0_0_33289156_476.cpp:27:37: error: 'len' was not declared in this scope
memset(dp, 0, sizeof(int) * len * len);
^
0_0_33289156_476.cpp:27:46: error: 'memset' was not declared in this scope
memset(dp, 0, sizeof(int) * len * len);
^
0_0_33289156_476.cpp:31:21: error: 'cost' was not declared in this scope
if (cost[i] > j) {
^
0_0_33289156_476.cpp:34:75: error: 'value' was not declared in this scope
dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - cost[i]] + value[i]);
^
|