Problem hamster1
User Minjia
Submission Time 2023-11-15 13:12:56
Score 0
Max Time N/A
Max Memory N/A

Compile Error

hamster1.cpp: In function ‘int32_t main()’:
hamster1.cpp:9:41: error: expected ‘;’ before ‘dp’
9 | for (int i = 0; i < n; i++) cin>>arr[i]
| ^
| ;
10 | dp[0] = 0;
| ~~
hamster1.cpp:13:3: error: expected ‘,’ or ‘;’ before ‘for’
13 | for (int j=i-k; j <=i-1; j++){
| ^~~
hamster1.cpp:13:19: error: ‘j’ was not declared in this scope
13 | for (int j=i-k; j <=i-1; j++){
| ^
hamster1.cpp:13:23: error: ‘i’ was not declared in this scope
13 | for (int j=i-k; j <=i-1; j++){
| ^
hamster1.cpp:18:11: error: ‘temp’ was not declared in this scope
18 | dp [i]= temp;
| ^~~~
hamster1.cpp: At global scope:
hamster1.cpp:20:2: error: ‘cout’ does not name a type
20 | cout<<dp[n-1