Language: C++

#include<bits/stdc++.h>
#include<iostream>
#include<bitset>
using namespace std;
 
 
#define all(x) (x).begin(),(x).end()
 
#define FOR(i,x) for(int i=0;i<(int)(x);i++)
#define FOR_S(i,x) for(int i=1;i<=(int)(x);i++)
#define FOR_R(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define FOR_SR(i,x) for(int i=((int)(x));i>0;i--)
 
using ll = long long;
typedef long long ll;
typedef long long int64;
typedef long long lint;
typedef long long lli;
 
 
 
//bit
 
const unsigned int BIT_FLAG_0 = (1 << 0); // 0000 0000 0000 0001
const unsigned int BIT_FLAG_1 = (1 << 1); // 0000 0000 0000 0010
const unsigned int BIT_FLAG_2 = (1 << 2); // 0000 0000 0000 0100
const unsigned int BIT_FLAG_3 = (1 << 3); // 0000 0000 0000 1000
const unsigned int BIT_FLAG_4 = (1 << 4); // 0000 0000 0001 0000
const unsigned int BIT_FLAG_5 = (1 << 5); // 0000 0000 0010 0000
const unsigned int BIT_FLAG_6 = (1 << 6); // 0000 0000 0100 0000
const unsigned int BIT_FLAG_7 = (1 << 7); // 0000 0000 1000 0000
 
 
//variables
 
int N=0;
int M=0;
 
const int INF = 100000000;
int ans=0;
 
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
 
#include<bits/stdc++.h>
define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
using void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
////////////////////////////////////////////////////////////////
	 
void _main(){
 
  	cin >> N;
	vector<int> data(INF);
    rep(i,0, N) cin >> data[i];
    
  	vector<int> dp(INF);
    rep(i,0, N) dp[i] = INF;
    dp[0] = 0;
 
    rep(i,0, N) {
        chmin(dp[i + 1], dp[i] + abs(data[i] - data[i + 1]));
        chmin(dp[i + 2], dp[i] + abs(data[i] - data[i + 2]));
    }
 
    cout << dp[N - 1] << endl;
}

Compiler output:
a.cc:46:1: error: 'define' does not name a type
   46 | define rep(i,a,b) for(int i=a;i<b;i++)
      | ^~~~~~
a.cc:46:31: error: 'i' does not name a type
   46 | define rep(i,a,b) for(int i=a;i<b;i++)
      |                               ^
a.cc:46:35: error: 'i' does not name a type
   46 | define rep(i,a,b) for(int i=a;i<b;i++)
      |                                   ^
a.cc:52:7: error: expected nested-name-specifier before 'void'
   52 | using void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
      |       ^~~~
a.cc: In function 'int main()':
a.cc:52:75: error: '_main' was not declared in this scope; did you mean 'main'?
   52 | using void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
      |                                                                           ^~~~~
      |                                                                           main
a.cc: In function 'void _main()':
a.cc:61:9: error: 'i' was not declared in this scope
   61 |     rep(i,0, N) cin >> data[i];
      |         ^
a.cc:61:5: error: 'rep' was not declared in this scope; did you mean 'rrep'?
   61 |     rep(i,0, N) cin >> data[i];
      |     ^~~
      |     rrep