Language: C++

#define long long ll
#define for(int i=0;i<n;i++) rep(n)
#define for(int i=a;i<b;i++) rep(a,b)
#define vector<long long> vec
#definr pair<long,long> pll
#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	int n;vector <int> r;
	cin>>n;
	int J=0;
	for (int& x:r)
	{
		scanf("%d",&x);
	}
	while(i<n)
	{
		if (abs(r.at(i)-r.at(i+1))>abs(r.at(i+2)-r.at(i)))
		{
			i+=2;
			J+=abs(r.at(i+2)-r.at(i));
		}
		else
	{i++;
		J+=abs(r.at(i+1)-r.at(i));
	}
	}
	cout<<J<<endl;
	return 0;
}

Compiler output:
a.cc:2:17: error: expected ',' or ')', found "i"
    2 | #define for(int i=0;i<n;i++) rep(n)
      |                 ^
a.cc:3:17: error: expected ',' or ')', found "i"
    3 | #define for(int i=a;i<b;i++) rep(a,b)
      |                 ^
a.cc:4:9: warning: ISO C++11 requires whitespace after the macro name
    4 | #define vector<long long> vec
      |         ^~~~~~
a.cc:5:2: error: invalid preprocessing directive #definr; did you mean #define?
    5 | #definr pair<long,long> pll
      |  ^~~~~~
      |  define
/usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:310:11: error: expected initializer before 'unsigned'
  310 |   typedef __SIZE_TYPE__         size_t;
      |           ^~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:311:11: error: expected initializer before 'int'
  311 |   typedef __PTRDIFF_TYPE__      ptrdiff_t;
      |           ^~~~~~~~~~~~~~~~
In file included from /usr/include/ctype.h:26,
                 from /usr/include/c++/14/cctype:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:35,
                 from a.cc:6:
/usr/include/x86_64-linux-gnu/bits/types.h:34:23: error: expected initializer before 'int'
   34 | typedef unsigned long int __u_long;
      |                       ^~~
/usr/include/x86_64-linux-gnu/bits/types.h:44:21: error: expected initializer before 'int'
   44 | typedef signed long int __int64_t;
      |                     ^~~
/usr/include/x86_64-linux-gnu/bits/types.h:45:23: error: expected initializer before 'int'
   45 | typedef unsigned long int __uint64_t;
      |                       ^~~
/usr/include/x86_64-linux-gnu/bits/types.h:58:9: error: '__int64_t' does not name a type; did you mean '__int8_t'?
   58 | typedef __int64_t __int_least64_t;
      |         ^~~~~~~~~
      |         __int8_t
/usr/include/x86_64-linux-gnu/bits/types.h:59:9: error: '__uint64_t' does not name a type; did you mean '__uint8_t'?
   59 | typedef __uint64_t __uint_least64_t;
      |         ^~~~~~~~~~
      |         __uint8_t
/usr/include/x86_64-linux-gnu/bits/types.h:63:14: error: expected initializer before 'int'
   63 | typedef long int __quad_t;
      |              ^~~
/usr/include/x86_64-linux-gnu/bits/types.h:64:23: error: expected initializer before 'int'
   64 | typedef unsigned long int __u_quad_t;
      |                       ^~~
/usr/include/x86_64-linux-gnu/bits/types.h:72:14: error: expected initializer before 'int'
   72 | typedef long int __intmax_t;
      |              ^~~
/usr/include/x86_64-linux-gnu/bits/types.h:73:23: error: expected initializer before 'int'
   73 | typedef unsigned long int __uintmax_t;
      |                       ^~~
/usr/include/x86_64-linux-gnu/bits/types.h:145:12: error: expected initializer before 'int'
  145 | __STD_TYPE __DEV_T_TYPE __dev_t;        /* Type of device numbers.  */
      |            ^~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:148:12: error: expected initializer before 'int'
  148 | __STD_TYPE __INO_T_TYPE __ino_t;        /* Type of file serial numbers.  */
      |            ^~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:149:12: error: expected initializer before 'int'
  149 | __STD_TYPE __INO64_T_TYPE __ino64_t;    /* Type of file serial numbers (LFS).*/
      |            ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:151:12: error: expected initializer before 'int'
  151 | __STD_TYPE __NLINK_T_TYPE __nlink_t;    /* Type of file link counts.  */
      |            ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:152:12: error: expected initializer before 'int'
  152 | __STD_TYPE __OFF_T_TYPE __off_t;        /* Type of file sizes and offsets.  */
      |            ^~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:153:12: error: expected initializer before 'int'
  153 | __STD_TYPE __OFF64_T_TYPE __off64_t;    /* Type of file sizes and offsets (LFS).  */
      |            ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:156:12: error: expected initializer before 'int'
  156 | __STD_TYPE __CLOCK_T_TYPE __clock_t;    /* Type of CPU usage counts.  */
      |            ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:157:12: error: expected initializer before 'int'
  157 | __STD_TYPE __RLIM_T_TYPE __rlim_t;      /* Type for resource measurement.  */
      |            ^~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:158:12: error: expected initializer before 'int'
  158 | __STD_TYPE __RLIM64_T_TYPE __rlim64_t;  /* Type for resource measurement (LFS).  */
      |            ^~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:160:12: error: expected initializer before 'int'
  160 | __STD_TYPE __TIME_T_TYPE __time_t;      /* Seconds since the Epoch.  */
      |            ^~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:162:12: error: expected initializer before 'int'
  162 | __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds.  */
      |            ^~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:163:12: error: expected initializer before 'int'
  163 | __STD_TYPE __SUSECONDS64_T_TYPE __suseconds64_t;
      |            ^~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:175:12: error: expected initializer before 'int'
  175 | __STD_TYPE __BLKSIZE_T_TYPE __blksize_t;
      |            ^~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:180:12: error: expected initializer before 'int'
  180 | __STD_TYPE __BLKCNT_T_TYPE __blkcnt_t;
      |            ^~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:181:12: error: expected initializer before 'int'
  181 | __STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t;
      |            ^~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:184:12: error: expected initializer before 'int'
  184 | __STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t;
      |            ^~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:185:12: error: expected initializer before 'int'
  185 | __STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t;
      |            ^~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:188:12: error: expected initializer before 'int'
  188 | __STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t;
      |            ^~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:189:12: error: expected initializer before 'int'
  189 | __STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t;
      |            ^~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:192:12: error: expected initializer before 'int'
  192 | __STD_TYPE __FSWORD_T_TYPE __fsword_t;
      |            ^~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:194:12: error: expected initializer before 'int'
  194 | __STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error.  */
      |            ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:197:12: error: expected initializer before 'int'
  197 | __STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t;
      |            ^~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:199:12: error: expected initializer before 'int'
  199 | __STD_TYPE __SYSCALL_ULONG_TYPE __syscall_ulong_t;
      |            ^~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:203:9: error: '__off64_t' does not name a type
  203 | typedef __off64_t __loff_t;     /* Type of file sizes and offsets (LFS).  */
      |         ^~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types.h:207:12: error: expected initializer before 'int'
  207 | __STD_TYPE __SWORD_TYPE __intptr_t;
      |            ^~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/local_lim.h:81,
                 from /usr/include/x86_64-linux-gnu/bits/posix1_lim.h:161,
                 from /usr/include/limits.h:195,
                 from /usr/lib/gcc/x86_64-linux-gnu/14/include/limits.h:210,
                 from /usr/lib/gcc/x86_64-linux-gnu/14/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-linux-gnu/14/include/limits.h:34,
                 from /usr/include/c++/14/climits:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:38:
/usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h:24:13: error: expected initializer before 'int'
   24 | extern long int __sysconf (int __name) __THROW;
      |             ^~~
In file included from /usr/include/setjmp.h:29,
                 from /usr/include/c++/14/csetjmp:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:39:
/usr/include/x86_64-linux-gnu/bits/setjmp.h:31:14: error: expected initializer before 'int'
   31 | typedef long int __jmp_buf[8];
      |              ^~~
a.cc:1:19: error: expected ';' at end of member declaration
    1 | #define long long ll
      |                   ^~
In file included from /usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h:23,
                 from /usr/include/setjmp.h:30:
/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h:7:27: error: expected primary-expression before 'unsigned'
    7 |   unsigned long int __val[_SIGSET_NWORDS];
      |                           ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h:7:27: error: expected ')' before 'unsigned'
    7 |   unsigned long int __val[_SIGSET_NWORDS];
      |                           ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h:7:42: error: expected ')' before ';' token
    7 |   unsigned long int __val[_SIGSET_NWORDS];
      |                                          ^
      |                                          )
/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h:7:27: note: to match this '('
    7 |   unsigned long int __val[_SIGSET_NWORDS];
      |                           ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h:7:42: error: expected ')' before ';' token
    7 |   unsigned long int __val[_SIGSET_NWORDS];
      |                                          ^
      |                                          )
/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h:7:27: note: to match this '('
    7 |   unsigned long int __val[_SIGSET_NWORDS];
      |                           ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/