Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
using namespace std;
const int INF = 1e9;
typedef long long lint;
const lint LINF = 1e18;
const lint MOD = 1e9 + 7;
// const lint MOD = 998244353;
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
char upper(char c){
	return c-0x20;
}
char lower(char c){
	return c+0x20;
}

int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x%y);
}
 
int main() {
	int n;
	cin >> n;
	vector<ll>a(n,0);
	repp(i,0,n) {
		cin >> a[i];
		a[i] -= i+1;
	}
	sort(a.begin(), a.end());
	ll ans;
	if (n % 2 == 1)ans = a[(n - 1) / 2];
	else ans = (a[n / 2] + a[n / 2 - 1]) / 2;
	ll sum = 0;
	repp(i, 0, n ) {
		sum += abs(a[i] - ans);
	}
	cout << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:16: error: 'll' was not declared in this scope; did you mean 'all'?
   41 |         vector<ll>a(n,0);
      |                ^~
      |                all
a.cc:41:18: error: template argument 1 is invalid
   41 |         vector<ll>a(n,0);
      |                  ^
a.cc:41:18: error: template argument 2 is invalid
a.cc:41:24: error: expression list treated as compound expression in initializer [-fpermissive]
   41 |         vector<ll>a(n,0);
      |                        ^
a.cc:42:14: error: 'i' was not declared in this scope
   42 |         repp(i,0,n) {
      |              ^
a.cc:42:9: error: 'repp' was not declared in this scope; did you mean 'rep'?
   42 |         repp(i,0,n) {
      |         ^~~~
      |         rep
a.cc:46:16: error: request for member 'begin' in 'a', which is of non-class type 'int'
   46 |         sort(a.begin(), a.end());
      |                ^~~~~
a.cc:46:27: error: request for member 'end' in 'a', which is of non-class type 'int'
   46 |         sort(a.begin(), a.end());
      |                           ^~~
a.cc:47:11: error: expected ';' before 'ans'
   47 |         ll ans;
      |           ^~~~
      |           ;
a.cc:48:24: error: 'ans' was not declared in this scope; did you mean 'abs'?
   48 |         if (n % 2 == 1)ans = a[(n - 1) / 2];
      |                        ^~~
      |                        abs
a.cc:48:31: error: invalid types 'int[int]' for array subscript
   48 |         if (n % 2 == 1)ans = a[(n - 1) / 2];
      |                               ^
a.cc:49:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   49 |         else ans = (a[n / 2] + a[n / 2 - 1]) / 2;
      |              ^~~
      |              abs
a.cc:49:22: error: invalid types 'int[int]' for array subscript
   49 |         else ans = (a[n / 2] + a[n / 2 - 1]) / 2;
      |                      ^
a.cc:49:33: error: invalid types 'int[int]' for array subscript
   49 |         else ans = (a[n / 2] + a[n / 2 - 1]) / 2;
      |                                 ^
a.cc:50:11: error: expected ';' before 'sum'
   50 |         ll sum = 0;
      |           ^~~~
      |           ;
a.cc:54:17: error: 'sum' was not declared in this scope
   54 |         cout << sum << endl;
      |                 ^~~