Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), ‘\0‘, sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define gg(x) getInt(&x)
using namespace std;
typedef long long ll;
inline void getInt(int* p);
const int maxn=1000010;
const int inf=0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
ll n;
ll dp[maxn];
ll a[maxn];
int main()
{
    gbtb;
    cin>>n;
    repd(i,1,n)
    {
        cin>>a[i];
    }
    dp[1]=0;
    dp[0]=0;
    dp[2]=abs(a[2]-a[1]);
    repd(i,3,n)
    {
        dp[i]=min(dp[i-2]+abs(a[i]-a[i-2]),dp[i-1]+abs(a[i]-a[i-1]));

    }
    cout<<dp[n];
    return 0;
}

inline void getInt(int* p) {
    char ch;
    do {
        ch = getchar();
    } while (ch == ‘ ‘ || ch == ‘\n‘);
    if (ch == ‘-‘) {
        *p = -(getchar() - ‘0‘);
        while ((ch = getchar()) >= ‘0‘ && ch <= ‘9‘) {
            *p = *p * 10 - ch + ‘0‘;
        }
    }
    else {
        *p = ch - ‘0‘;
        while ((ch = getchar()) >= ‘0‘ && ch <= ‘9‘) {
            *p = *p * 10 + ch - ‘0‘;
        }
    }
}

Compiler output:
a.cc:17:29: error: extended character ‘ is not valid in an identifier
   17 | #define MSC0(X) memset((X), ‘\0‘, sizeof((X)))
      |                             ^
a.cc:17:31: error: extended character ‘ is not valid in an identifier
   17 | #define MSC0(X) memset((X), ‘\0‘, sizeof((X)))
      |                               ^
a.cc:56:20: error: extended character ‘ is not valid in an identifier
   56 |     } while (ch == ‘ ‘ || ch == ‘\n‘);
      |                    ^
a.cc:56:22: error: extended character ‘ is not valid in an identifier
   56 |     } while (ch == ‘ ‘ || ch == ‘\n‘);
      |                      ^
a.cc:56:33: error: extended character ‘ is not valid in an identifier
   56 |     } while (ch == ‘ ‘ || ch == ‘\n‘);
      |                                 ^
a.cc:56:34: error: stray '\' in program
   56 |     } while (ch == ‘ ‘ || ch == ‘\n‘);
      |                                  ^
a.cc:56:35: error: extended character ‘ is not valid in an identifier
   56 |     } while (ch == ‘ ‘ || ch == ‘\n‘);
      |                                   ^
a.cc:57:15: error: extended character ‘ is not valid in an identifier
   57 |     if (ch == ‘-‘) {
      |               ^
a.cc:57:17: error: extended character ‘ is not valid in an identifier
   57 |     if (ch == ‘-‘) {
      |                 ^
a.cc:58:28: error: extended character ‘ is not valid in an identifier
   58 |         *p = -(getchar() - ‘0‘);
      |                            ^
a.cc:58:28: error: extended character ‘ is not valid in an identifier
a.cc:59:36: error: extended character ‘ is not valid in an identifier
   59 |         while ((ch = getchar()) >= ‘0‘ && ch <= ‘9‘) {
      |                                    ^
a.cc:59:36: error: extended character ‘ is not valid in an identifier
a.cc:59:49: error: extended character ‘ is not valid in an identifier
   59 |         while ((ch = getchar()) >= ‘0‘ && ch <= ‘9‘) {
      |                                                 ^
a.cc:59:49: error: extended character ‘ is not valid in an identifier
a.cc:60:33: error: extended character ‘ is not valid in an identifier
   60 |             *p = *p * 10 - ch + ‘0‘;
      |                                 ^
a.cc:60:33: error: extended character ‘ is not valid in an identifier
a.cc:64:19: error: extended character ‘ is not valid in an identifier
   64 |         *p = ch - ‘0‘;
      |                   ^
a.cc:64:19: error: extended character ‘ is not valid in an identifier
a.cc:65:36: error: extended character ‘ is not valid in an identifier
   65 |         while ((ch = getchar()) >= ‘0‘ && ch <= ‘9‘) {
      |                                    ^
a.cc:65:36: error: extended character ‘ is not valid in an identifier
a.cc:65:49: error: extended character ‘ is not valid in an identifier
   65 |         while ((ch = getchar()) >= ‘0‘ && ch <= ‘9‘) {
      |                                                 ^
a.cc:65:49: error: extended character ‘ is not valid in an identifier
a.cc:66:33: error: extended character ‘ is not valid in an identifier
   66 |             *p = *p * 10 + ch - ‘0‘;
      |                                 ^
a.cc:66:33: error: extended character ‘ is not valid in an identifier
a.cc: In function 'void getInt(int*)':
a.cc:56:20: error: '\U00002018' was not declared in this scope
   56 |     } while (ch == ‘ ‘ || ch == ‘\n‘);
      |                    ^
a.cc:56:21: error: expected ')' before '\U00002018'
   56 |     } while (ch == ‘ ‘ || ch == ‘\n‘);
      |             ~       ^~
      |                     )
a.cc:56:21: error: expected ';' before '\U00002018'
   56 |     } while (ch == ‘ ‘ || ch == ‘\n‘);
      |                     ^~
      |                     ;
a.cc:58:28: error: '\U000020180\U00002018' was not declared in this scope
   58 |         *p = -(getchar() - ‘0‘);
      |                            ^~~
a.cc:59:49: error: '\U000020189\U00002018' was not declared in this scope
   59 |         while ((ch = getchar()) >= ‘0‘ && ch <= ‘9‘) {
      |                                                 ^~~
a.cc:64:19: error: '\U000020180\U00002018' was not declared in this scope
   64 |         *p = ch - ‘0‘;
      |                   ^~~
a.cc:65:49: error: '\U000020189\U00002018' was not declared in this scope
   65 |         while ((ch = getchar()) >= ‘0‘ && ch <= ‘9‘) {
      |                                                 ^~~