Language: C++

#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_DISABLE_PERFCRIT_LOCKS
#define POPCNTI(a) __builtin_popcount(a)
 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <bits/stdc++.h>
 
using namespace std;
using namespace  __gnu_pbds;
 
#ifndef _LOCAL_DEFINE
inline int getchar_unlocked(){return _getchar_nolock();}
inline void putchar_unlocked(char c) {_putchar_nolock(c);}
#endif
 
typedef long long ll;  
typedef pair<int,int> pr; 
 
const ll MOD = 1e9 + 7,OOl=LLONG_MAX;
const int N = 1e6+1, M = 1e6+1, OO = INT_MAX,OOmem = 0x4f4f4f4f;
 
inline void WRITE_CHAR(char c)  {putchar_unlocked(c);}
 
template<typename T> 
inline bool READn (T &result) {
  int minus = 1;
  char ch;
  result=0;
  ch = (char) getchar_unlocked();
  if(ch!='-') while (!isdigit(ch) && ch!=EOF) ch= (char) getchar_unlocked(), minus = (ch == '-'? -1 : minus);
 
  if(ch==EOF) return false;
  while (isdigit(ch))  result = result*10 + (int) (ch - '0'),ch = (char) getchar_unlocked();
  
  result *= minus;
  return ch != '\n';
}
template<typename T>
inline void WRITEn(T x) {
  if (x < 0) {putchar_unlocked('-'); x = -x; }
  char writeBuffer[20], *writePtr = writeBuffer;
  do {
    *writePtr++ = (char)('0' + x % 10);
    x /= 10;
  }
  while (x);
  do  { putchar_unlocked(*--writePtr); }
  while (writePtr > writeBuffer);
}
inline bool Read_CHAR(char &c)
{
  char READ_CHARACTER = (char)getchar_unlocked();
  while ((READ_CHARACTER == '\n' || READ_CHARACTER == '\t' || READ_CHARACTER == ' ')) READ_CHARACTER = (char)getchar_unlocked();
  if(READ_CHARACTER == EOF) return false;
  c = READ_CHARACTER;
  return true;
} 
inline bool READ_CHAR_ARRAY(char (&x)[N]) {
  char READ_CHARACTER = (char)getchar_unlocked();
  while ((READ_CHARACTER == '\n' || READ_CHARACTER == '\t' || READ_CHARACTER == ' ')) READ_CHARACTER = (char)getchar_unlocked();
  if(READ_CHARACTER == EOF) return false;
  char *ptr = &x[0];
  while ((READ_CHARACTER != '\n' && READ_CHARACTER != '\t' && READ_CHARACTER != ' ' && READ_CHARACTER != EOF)) *ptr++ = READ_CHARACTER, READ_CHARACTER = (char)getchar_unlocked();
  *ptr = '\0';
  return true;
}
inline void WRITE_CHAR_ARRAY(const char *x) {
  while(*x != '\0')
    putchar_unlocked(*x++);
}
int cost[N],n;
ll dp[N];
int main()
{
  
  READn(n);
  for(int i=0;i<n;++i) READn(cost[i]);
  for(int i=n-1;~i;--i)
  dp[i] = min(dp[i+1]+abs(cost[i]-cost[i+1]),dp[i+2]+abs(cost[i]-cost[i+2]));
  WRITEn(dp[0]-cost[n-1]);
  return 0;
}


Compiler output:
a.cc: In function 'int getchar_unlocked()':
a.cc:15:38: error: '_getchar_nolock' was not declared in this scope; did you mean 'getchar_unlocked'?
   15 | inline int getchar_unlocked(){return _getchar_nolock();}
      |                                      ^~~~~~~~~~~~~~~
      |                                      getchar_unlocked
a.cc: In function 'void putchar_unlocked(char)':
a.cc:16:39: error: '_putchar_nolock' was not declared in this scope; did you mean 'putchar_unlocked'?
   16 | inline void putchar_unlocked(char c) {_putchar_nolock(c);}
      |                                       ^~~~~~~~~~~~~~~
      |                                       putchar_unlocked