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

Compile Error

hamster1.cpp: In function ‘int main()’:
hamster1.cpp:3:13: error: expected primary-expression before ‘long’
3 | #define int long long
| ^~~~
hamster1.cpp:13:15: note: in expansion of macro ‘int’
13 | for (int j= int i-k; j <=i-1; j++){
| ^~~
hamster1.cpp:13:28: error: ‘i’ was not declared in this scope
13 | for (int j= int i-k; j <=i-1; j++){
| ^
hamster1.cpp:15:5: error: ‘temp’ was not declared in this scope
15 | temp = min (temp, dp [j] + abs(arr [i]- arr [j]));
| ^~~~
hamster1.cpp:18:7: error: ‘i’ was not declared in this scope
18 | dp [i]= temp;
| ^
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]
| ^~~~
hamste