Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long;
ll dp[11009];
ll val[11009];
ll n;
ll frog(ll i)
{
    if(i==n-1)return 0;
    if(i>n-1)return 9898981;
   // cout<<"I = "<<i<<endl;

//    if(i==n-1)return (abs(val[i]-val[n-1]));
//    if(i==n-2)return (abs(val[i]-val[n-2]));
        if(dp[n]!=-1)return dp[n];
        ll f1,f2;
        f1=frog(i+1)+abs(val[i]-val[i+1]);
       // cout<<"f1 = "<<f1<<endl;
        f2=frog(i+2)+abs(val[i]-val[i+2]);
       // cout<<" f2 = "<<f2<<endl;

        dp[n]=min(f1,f2);
        return dp[n];
}
int main()
{
    cin>>n;
    for(ll i=0;i<n;i++)
    {
        ll d;cin>>d;
        val[i]=d;
    }
    memset(dp,-1,sizeof(dp));
    ll ans=frog(0);
    cout<<ans<<endl;
}


Compiler output:
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:4:1: note: in expansion of macro 'll'
    4 | ll dp[11009];
      | ^~
a.cc:4:4: error: 'dp' does not name a type
    4 | ll dp[11009];
      |    ^~
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:5:1: note: in expansion of macro 'll'
    5 | ll val[11009];
      | ^~
a.cc:5:4: error: 'val' does not name a type
    5 | ll val[11009];
      |    ^~~
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:6:1: note: in expansion of macro 'll'
    6 | ll n;
      | ^~
a.cc:6:4: error: 'n' does not name a type
    6 | ll n;
      |    ^
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:7:1: note: in expansion of macro 'll'
    7 | ll frog(ll i)
      | ^~
a.cc:3:21: error: expected ')' before ';' token
    3 | #define ll long long;
      |                     ^
a.cc:7:9: note: in expansion of macro 'll'
    7 | ll frog(ll i)
      |         ^~
a.cc:7:8: note: to match this '('
    7 | ll frog(ll i)
      |        ^
a.cc:3:21: error: expected constructor, destructor, or type conversion before ';' token
    3 | #define ll long long;
      |                     ^
a.cc:7:9: note: in expansion of macro 'll'
    7 | ll frog(ll i)
      |         ^~
a.cc:7:12: error: 'i' does not name a type
    7 | ll frog(ll i)
      |            ^
a.cc: In function 'int main()':
a.cc:27:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   27 |     cin>>n;
      |          ^
      |          yn
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:28:9: note: in expansion of macro 'll'
   28 |     for(ll i=0;i<n;i++)
      |         ^~
a.cc:28:12: error: 'i' was not declared in this scope
   28 |     for(ll i=0;i<n;i++)
      |            ^
a.cc:28:19: error: expected ')' before ';' token
   28 |     for(ll i=0;i<n;i++)
      |        ~          ^
      |                   )
a.cc:28:20: error: 'i' was not declared in this scope
   28 |     for(ll i=0;i<n;i++)
      |                    ^
a.cc:33:12: error: 'dp' was not declared in this scope; did you mean 'dup'?
   33 |     memset(dp,-1,sizeof(dp));
      |            ^~
      |            dup
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:34:5: note: in expansion of macro 'll'
   34 |     ll ans=frog(0);
      |     ^~
a.cc:34:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |     ll ans=frog(0);
      |        ^~~
      |        abs
a.cc:34:12: error: 'frog' was not declared in this scope
   34 |     ll ans=frog(0);
      |            ^~~~