criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
	int N;
	cin >> N;
	
	vector<int> H(N);
	
	for(int i=0;i<N;i++){
		cin >> H.at(i);
	}
	
	int c = 0;
	
	for(int j=0;j<N;j++){
		int e = 0
	
		for(int k=j+1;k<N;k++){
			e++
			int d = H.at(j) + H.at(k);
			
			if(e-d==0)
				c++;
		}
	}
	
	cout << c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: expected ',' or ';' before 'for'
   19 |                 for(int k=j+1;k<N;k++){
      |                 ^~~
a.cc:19:31: error: 'k' was not declared in this scope
   19 |                 for(int k=j+1;k<N;k++){
      |                               ^
Language: C++

// g++ -std=gnu++1y -O2 -I/opt/boost/gcc/include -L/opt/boost/gcc/lib -o ./a.out ./X.cpp & a.out //
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ull unsigned long long


using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);	
    cin.tie(NULL); cout.tie(NULL);
    
    int n; cin >> n;
    
    vector<ll> pref, suf;
    
    set<int> sufs;
    
    
    for(int i = 0; i < n; i++)
    {
		int x; cin >> x;
		
		pref.pb(i-x);
		suf.pb(i+x);
		sufs.insert(x+i);
	}
	
	int ans = 0;
	
	vector<vector<int>> cnt;
	
	for(auto y: sufs)
	{
		vector<int> c;
		c.pb(0);
		for(int i = 1; i < n; i++)
		{
			c.pb(c[i-1] + (c[i] == y ? 1 : 0));
		}
	}
	
	for(int a = n; a > 0; a--)
	{
		ans += cnt[pref[i]]
	}
	cout << ans << '\n';
	
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:47:33: error: 'i' was not declared in this scope
   47 |                 ans += cnt[pref[i]]
      |                                 ^
Language: C++

//------------------------------------------
// C++ templete
//------------------------------------------
#include <bits/stdc++.h>
// #define int long long
using namespace std;

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<VS> VVS;

//REPEAT
//------------------------------------------
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

//container util
//------------------------------------------
#define pb push_back
#define ALL(a) (a).begin(), (a).end()
#define PRINT(V)     \
  for (auto v : (V)) \
  cout << v << " "
#define PRINTL(V)    \
  for (auto v : (V)) \
  cout << v << endl
#define SORT(V) sort((V).begin(), (V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())

//最大公約数
//------------------------------------------
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }

//grobal variable
//------------------------------------------
int N, M;
VI Vec;

//main
//------------------------------------------
signed main()
{
  int n,m;
  cin >> n ;
  VI a(n);
  int c = 0;

  for (int i = 0; i < n; i++)
  {
    cin >> a[i];
  }
  // SORT(a);
  for (int i = 0; i < n; i++){    
    for (int j = max([0,i,a[i] - abs(i - j)]); j < n; j++)
    {
      if ((a[i]+a[j]) == abs(i - j)){
        c++;
      }
    }
  }
  cout << c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:23: error: expected identifier before numeric constant
   57 |     for (int j = max([0,i,a[i] - abs(i - j)]); j < n; j++)
      |                       ^
a.cc:57:24: error: expected ']' before ',' token
   57 |     for (int j = max([0,i,a[i] - abs(i - j)]); j < n; j++)
      |                        ^
      |                        ]
a.cc: In lambda function:
a.cc:57:24: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:57:44: error: expected ')' before ']' token
   57 |     for (int j = max([0,i,a[i] - abs(i - j)]); j < n; j++)
      |                     ~                      ^
      |                                            )
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  using lint = long long;

  lint N;
  cin >> N;
  

  vector<lint> A(N);
  vector<bool> done(N, false);
  
  for (lint i=0; i<N; i++){
    cin >> A[i];
  }

  
  vector<pair<lint, lint>> pp(N);
  
  for(lint i=0; i<N; i++){
    cin >> pp[i].first;
    pp[i].second = i;
  }
 // cout << pp[0].first << ' ' << pp[0].second << endl;
 
  sort(pp.begin(), pp.end());
  
  lint cnt = 0;
  
  for(lint i=N-1; i>=0; i--){
    lint height = pp[i].first;
    lint num = pp[i].second;
    
    lint upper = num + height;
    lint lower = num - height;
    
    if(upper<=N-1){
      for(lint j=upper+1; j<=N-1; j++){
        cnt += ( A[j] + A[num] == j - num );
      }
    }
    if(lower>=0){
      for(lint j=0; j<=lower-1; j++){
        cnt += ( A[j] + A[num] ==  num - j );
      }
    }
    cout << cnt << endl;

    
  
}


    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:52:2: error: expected '}' at end of input
   52 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main(){
  int N, A[200005], ans = 0, num, num2;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) scanf("%d", A + i);
  for (int i = 0; i < N; i++) {
    num = i - A[i];
    num2 = num / 2
    for (int j = 0; j <= num2; j++) {
      if (num - j == A[j]) ans++;
    }
  }
  printf("%d", ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:19: error: expected ';' before 'for'
   10 |     num2 = num / 2
      |                   ^
      |                   ;
   11 |     for (int j = 0; j <= num2; j++) {
      |     ~~~
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <unordered_map>
#include <math.h>
using namespace std;


int main() {
	int N;
	cin >> N;
	int* arr = new int[N];
	int* look = new int[N];

	for (int i = 0; i < N; ++i)
	{
		cin >> arr[i];
		look[i] = 0;
	}
	long long ans = 0;
	for (int i = 0; i < N ; ++i)
	{
		look[i + arr[i]]++;
	}
	for (int i = N - 1; i >= 0; --i)
	{
		if (look[i - arr[i] > 0)
		{
			ans++;
			look[i - arr[i]--;
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:40: error: expected ']' before ')' token
   30 |                 if (look[i - arr[i] > 0)
      |                                        ^
      |                                        ]
a.cc:33:42: error: expected ']' before ';' token
   33 |                         look[i - arr[i]--;
      |                                          ^
      |                                          ]
Language: C++

#include <bits/stdc++.h>
#define rep(i, z, n) for(int i = z; i <= n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;

using namespace std;

int main(){
  vector<int> A;
  cin >> N;
  int res= 0;
  rep(i, 0, N-1){
    int temp;
    cin >> temp;
    A.push_back(i);
  }
  rep(i, 0, N-1){
    rep(i,0,N-1){
      if(A[i]+A[j]=abs(i-j)) res++;
    }
  }
  cout << res;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'N' was not declared in this scope
   10 |   cin >> N;
      |          ^
a.cc:19:17: error: 'j' was not declared in this scope
   19 |       if(A[i]+A[j]=abs(i-j)) res++;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std; 

signed main() {
    int N;
    cin >> N;
    vector<int>A(N);
    int ans = 0;
    for(int i = 0; i < N; i++) {
        cin >> A(N);
    }
    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            if(abs(i-j) == A[i]+A[j] && i > j ) {
                ans++;
            }
            if(abs(j-i) == A[i]+A[j] && j > i ) {
                ans++;
            }
        }
    }
   cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: no match for call to '(std::vector<int>) (int&)'
   10 |         cin >> A(N);
      |                ~^~~
Language: C

#include<stdio.h>

#pragma GCC optimize ("O3")
#pragma GCC target ("AVX2")

int main(void){
    register int i,j;
    int n;
    scanf("%d",&n);
    long a[n];
    long long cnt = 0;
    for(i = 0;i < n;i++)scanf("%ld",&a[i]);
    for(i = 2;i < n;i++){
        j = 0;
        while(j+i<n){
            cnt += (i==a[j]+a[i+j] ? 1:0);
            j++;
        }
    }
    printf("%lld",cnt);
}

Compiler output:
cc1: error: attribute 'target' argument 'AVX2' is unknown
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
using Graph = vector<vector<ll>>;
#define all(x) (x).begin(), (x).end() //string の sort とかはこれ
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)

const ll MOD = 1000000007;
const ll INF = 1e18; //1*10^18
const double PI = 3.14159265;

int ctoi(char c)
{
  if (c >= '0' && c <= '9')
  {
    return c - '0';
  }
  return 0;
}

ll gcd(ll x, ll y) { return (x % y) ? gcd(y, x % y) : y; }
//最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
//最小公倍数

ll powll(ll a, ll n)
{ //O(log n)
  ll res = 1;
  while (n > 0)
  {
    if (n & 1) //(n & 1)=(n % 2 !=0)
    {
      res = res * a;
    }
    a = a * a;
    n >>= 1; //(n & 1)=(n % 2 !=0)
  }
  return res;
}

ll modpow(ll a, ll n, ll mod) //O(log n)
{
  ll res = 1;
  while (n > 0)
  {
    if (n & 1) //(n & 1)=(n % 2 !=0)
    {
      res = res * a % mod;
    }
    a = a * a % mod;
    n >>= 1; //(n>>=1)=(n/2)
  }
  return res;
}

int ReturnDigit(ll num)
{
  string number = to_string(num);
  return number.length();
}

const ll MAX = 1e6;
long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() //MODは素数じゃないとだよ！！
{
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++)
  {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

// 二項係数計算
long long COM(int n, int k)
{
  if (n < k)
    return 0;
  if (n < 0 || k < 0)
    return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

struct UnionFind
{
  vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

  UnionFind(int N) : par(N)
  { //最初は全てが根であるとして初期化
    for (int i = 0; i < N; i++)
      par[i] = i;
  }

  int root(int x)
  { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
    if (par[x] == x)
      return x;
    return par[x] = root(par[x]);
  }

  void unite(int x, int y)
  {                   // xとyの木を併合
    int rx = root(x); //xの根をrx
    int ry = root(y); //yの根をry
    if (rx == ry)
      return;     //xとyの根が同じ(=同じ木にある)時はそのまま
    par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
  }

  bool same(int x, int y)
  { // 2つのデータx, yが属する木が同じならtrueを返す
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
};

ll a[500000];
pair<ll, ll> p[500000];
int main()
{
  // COMinit();
  // srand((unsigned int)time(NULL));//--> rand()
  ll i, j, k, l, ans = 0;
  ll n;
  cin >> n;
  for (i = 0; i < n; i++)
  {
    cin >> p[i].firtst;
    p[i].second = i;
  }

  sort(p + 0, p + n);

  for (i = 0; i < n - 1; i++)
  {
    for (j = i + 1; p[i].first + p[j].first < n; j++)
    {
      if (p[i].first + p[j].first == abs(p[i].second - p[j].second))
      {
        ans++;
      }
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:137:17: error: 'struct std::pair<long long int, long long int>' has no member named 'firtst'; did you mean 'first'?
  137 |     cin >> p[i].firtst;
      |                 ^~~~~~
      |                 first
Language: C++

#include <bits/stdc++.h>

int e()
{
    int n;
    std::cin >> n;
    std::vector<long long> ha_a(n, 0);
    std::vector<long long> hb_b(n, 0);
    for(int i = 0; i < n; i++)
    {
        long long temp;
        std::cin >> temp;
        ha_a[i] = i + 1 - temp;
        hb_b[i] = i + 1 + temp;
    }
    
    std::sort(hb_b.begin(), hb_b.end());
    
    long long ans = 0;
    for(int i = 1; i <= n; i++)
    {
        std::vector<long long>::iterator it = std::lower_bound(hb_b.begin(), hb_b.end(), ha_a[i]);
        while(true)
        {
            if(*it != temp)
            {
                break;
            }
            ans++;
            ++it;
        }
    }
    
    std::cout << ans << std::endl;
    
    return 0;
}

int main(int argc, const char * argv[])
{
    e();
    return 0;
}

Compiler output:
a.cc: In function 'int e()':
a.cc:25:23: error: 'temp' was not declared in this scope; did you mean 'tm'?
   25 |             if(*it != temp)
      |                       ^~~~
      |                       tm
Language: C

#include <bits/stdc++.h>
using namespace std;

using ll = long long;

int main()
{
  ll N;
  cin >> N;
  vector<ll> A(N+1);
  map<ll, vector< ll > > kei;
  for(ll i = 1; i<=N; i++){
    cin >> A.at(i);
    if(i - A.at(i) >= 0){
      ll buf = i - A.at(i);
      if(kei.find(buf) ==kei.end() ){
        vector<ll> bb(1, i);
        kei.insert(buf, bb);
      }else{
        kei.at(buf).push_back(i);
      }
    }
  }

  ll count =0;

  for(int i = 0; i<=N; i++){
    ll keisan = i + A.at(i);
    if(kei.find(keisan) != kei.end()){
      vector<ll> koho - kei.at(keisan);
      for(ll k : koho){
        if(i > k){
          count++;
        }
      }
    }
  }

  cout << count <, endl;

  


}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

//------------------------------------------
// C++ templete
//------------------------------------------
#include <bits/stdc++.h>
// #define int long long
using namespace std;

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<VS> VVS;

//REPEAT
//------------------------------------------
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

//container util
//------------------------------------------
#define pb push_back
#define ALL(a) (a).begin(), (a).end()
#define PRINT(V)     \
  for (auto v : (V)) \
  cout << v << " "
#define PRINTL(V)    \
  for (auto v : (V)) \
  cout << v << endl
#define SORT(V) sort((V).begin(), (V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())

//最大公約数
//------------------------------------------
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }

//grobal variable
//------------------------------------------
int N, M;
VI Vec;

//main
//------------------------------------------
signed main()
{
  int n,m;
  cin >> n ;
  VI a(n);
  int c = 0;

  for (int i = 0; i < n; i++)
  {
    cin >> a[i];
  }
  // SORT(a);
  for (int i = 0; i < n; i++){    
    for (int j = max(0,i,a[i] - abs(i - j)); j < n; j++)
    {
      if ((a[i]+a[j]) == abs(i - j)){
        c++;
      }
    }
  }
  cout << c;
}

Compiler output:
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:57:21:   required from here
   57 |     for (int j = max(0,i,a[i] - abs(i - j)); j < n; j++)
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

long long n, cnt, jumlah, selisih;
map<long long, long long>sum, index;
long long a[200003], b[200003];

int main(){
	cin>>n;
	for(int i=1; i<=n; i++){
		cin>>a[i];
		b[i]=i;
	}
	for(int i=1; i<=n; i++){
		jumlah=a[i]+b[i];
		selisih=b[i]-a[i];
		sum[jumlah]++;
		index[selisih]++;
	}
	for(int i=1; i<=n; i++){
		jumlah=a[i]+b[i];
		selisih=b[i]-a[i];
		sum[jumlah]--;
		index[selisih]--;
		cnt=cnt+sum[selisih]+index[jumlah];
	}
	cout<<cnt<<endl;
}


Compiler output:
a.cc:5:31: error: 'std::map<long long int, long long int> index' redeclared as different kind of entity
    5 | map<long long, long long>sum, index;
      |                               ^~~~~
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:18:22: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   18 |                 index[selisih]++;
      |                      ^
a.cc:24:22: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   24 |                 index[selisih]--;
      |                      ^
a.cc:25:43: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   25 |                 cnt=cnt+sum[selisih]+index[jumlah];
      |                                           ^
Language: C++

#include<iostream>
#include<utility>
#include<vector>
#include<algorithm>
#include<c.math>
using namespace std;

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

int main(){
  int N; cin >> N;
  vector<pair<int,long long> >A(N);
  for(int i=0;i<N;i++){
    A.at(i).first = i+1;
    cin >> A.at(i).second;
  }
  sort(A.begin(),A.end(),compare_by_b);
  long long count =0;
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++){
      if(abs(A.at(i).first-A.at(i).first) == A.at(i).second + A.at(i).second){
        count ++;
      }
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc:5:9: fatal error: c.math: No such file or directory
    5 | #include<c.math>
      |         ^~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long [] in = new long [n];       
		long ans = 0;
        for(int i=0;i<n;i++){in[i] = sc.nextLong();
                            }
        for(int i=0;i<n-1;;i++){for(int j=i+1;j<a;j++){if(in[i]+in[j]==j-i){ans++;}
                                                     }
                              }
		System.out.println(ans);
	}
}


Compiler output:
Main.java:10: error: illegal start of expression
        for(int i=0;i<n-1;;i++){for(int j=i+1;j<a;j++){if(in[i]+in[j]==j-i){ans++;}
                          ^
Main.java:10: error: ';' expected
        for(int i=0;i<n-1;;i++){for(int j=i+1;j<a;j++){if(in[i]+in[j]==j-i){ans++;}
                              ^
2 errors
Language: C++

#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")
// using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
// typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
// 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; }

using namespace std;

int main()
{
  long int n;
  cin>>n;
  
  vector<long int> A;
  A.resize(n);
  for(long int i=0;i<n,i++){
    cin>>A[i];
  }
  
  int count=0;
  for(long int i=0;i<n;i++){
    for(long int j=i+1;j<n;j++){
      if(j-i==A[j]+A[i]){
        count++;
      }
    }
  }
  
  cout<<count<<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: expected ';' before ')' token
   21 |   for(long int i=0;i<n,i++){
      |                           ^
      |                           ;
Language: C++

#include<bits/stdc++.h>
using namespace std;

long long n, cnt, jumlah, selisih;
map<long long, long long>sum, index;
long long a[200003], b[200003];

int main(){
	cin>>n;
	for(int i=1; i<=n; i++){
		cin>>a[i];
		b[i]=i;
	}
	for(int i=1; i<=n; i++){
		jumlah=a[i]+b[i];
		selisih=b[i]-a[i];
		sum[jumlah]++;
		index[selisih]++;
	}
	for(int i=1; i<=n; i++){
		jumlah=a[i]+b[i];
		selisih=b[i]-a[i];
		sum[jumlah]--;
		index[selisih]--;
		cnt=cnt+sum[selisih]+index[jumlah];
	}
	cout<<cnt<<endl;
}

Compiler output:
a.cc:5:31: error: 'std::map<long long int, long long int> index' redeclared as different kind of entity
    5 | map<long long, long long>sum, index;
      |                               ^~~~~
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:18:22: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   18 |                 index[selisih]++;
      |                      ^
a.cc:24:22: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   24 |                 index[selisih]--;
      |                      ^
a.cc:25:43: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   25 |                 cnt=cnt+sum[selisih]+index[jumlah];
      |                                           ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long [] in = new long [n];       
		long ans = 0;
        for(int i=0;i<a;i++){in[i] = sc.nextLong();
                            }
        for(int i=0;i<a-1;i++){for(int j=i+1;j<a;j++){if(in[i]+in[j]==j-i){ans++;}
                                                     }
                              }
		System.out.println(ans);
	}
}


Compiler output:
Main.java:8: error: cannot find symbol
        for(int i=0;i<a;i++){in[i] = sc.nextLong();
                      ^
  symbol:   variable a
  location: class Main
Main.java:10: error: cannot find symbol
        for(int i=0;i<a-1;i++){for(int j=i+1;j<a;j++){if(in[i]+in[j]==j-i){ans++;}
                      ^
  symbol:   variable a
  location: class Main
Main.java:10: error: cannot find symbol
        for(int i=0;i<a-1;i++){for(int j=i+1;j<a;j++){if(in[i]+in[j]==j-i){ans++;}
                                               ^
  symbol:   variable a
  location: class Main
3 errors
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vl ;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;

#define rep(i,N) for(int i=0; i < (int)N; i++)
#define all(v) (v).begin(),(v).end()

const int INF = 1001001001;

int main(){
	int n; cin >> n;
	vl a(n);
	map<ll, ll> s;
	rep(i,n){
		cin >> a[i];
	}
	
	ll ans = 0;
	rep(i,n){
		ll t = abs(a[i] - (i + 1));
		ans += s[t];
		s[a[i] + i + 1] ++;
	}
	map<ll, ll> s;
	ll tmp = 0;
	for(int i = n-1; i>=0; i--){
		ll t = abs(a[i] - (i + 1));
		tmp += s[t];
		s[a[i] + i + 1] ++;
	}
	cout << min(ans,tmp) <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:21: error: redeclaration of 'std::map<long long int, long long int> s'
   29 |         map<ll, ll> s;
      |                     ^
a.cc:18:21: note: 'std::map<long long int, long long int> s' previously declared here
   18 |         map<ll, ll> s;
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long 
#define (A-B) if(A>B) A-B else B-A
signed main() {
    int N;
    cin >> N;
    vector<int>A(N);
    int ans = 0;
    for(int i = 0; i < N; i++) {
        cin >> A(N);
    }
    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            if(abs((i+1-j+1)) == A[i]+A[j] ) {
                ans++;
            }
        }
    }
   cout << ans << endl;
}


Compiler output:
a.cc:4:9: error: macro names must be identifiers
    4 | #define (A-B) if(A>B) A-B else B-A
      |         ^
a.cc: In function 'int main()':
a.cc:11:17: error: no match for call to '(std::vector<long long int>) (long long int&)'
   11 |         cin >> A(N);
      |                ~^~~
Language: C++

#include<iostream>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include <iomanip>
#include<vector>
#include<map>
typedef long long ll;
const int mod = 1e9+7;
using namespace std;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int mod=7+1e9;
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
ll qpow(ll a,ll b,ll p){a%=p; ll ret=1;for(;b;b>>=1,a=a*a%p) if(b&1) ret=ret*a%p; return ret;}
ll getInv(ll x,ll p){return qpow(x,p-2,p);}

int main(){
    ll n; 
    cin>>n;
    vector<ll> kkk(n+1);
    for(int i=1;i<=n;i++){
        cin>>kkk[i];
        }

    map<ll,int> hhh;

    for(int i=1;i<=n;i++){

        if(hhh[kkk[i]-i]) {
            hhh[kkk[i]-i]++;
        }

        else hhh[kkk[i]-i]=1;
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        if(hhh[-kkk[i]-i]) {
            ans+=hhh[-kkk[i]-i];
            }
    }
    cout<<ans<<'\n';
}

Compiler output:
a.cc:15:11: error: redefinition of 'const int mod'
   15 | const int mod=7+1e9;
      |           ^~~
a.cc:10:11: note: 'const int mod' previously defined here
   10 | const int mod = 1e9+7;
      |           ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){long long N,x=0;cin>>N;vector<long>a(N);for(int i=0;i<N;i++)cin>>a.at(i);
sort(a.begin(),a.end());
  for(int i=0;a.at(i)<200000;i++)for(int j=0;j<i;j++)if(i-j==a.at(i)+a.at(j))x++;}
cout<<x<<endl;}


Compiler output:
a.cc:6:1: error: 'cout' does not name a type
    6 | cout<<x<<endl;}
      | ^~~~
a.cc:6:15: error: expected declaration before '}' token
    6 | cout<<x<<endl;}
      |               ^
Language: C

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int mod=7+1e9;
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
ll qpow(ll a,ll b,ll p){a%=p; ll ret=1;for(;b;b>>=1,a=a*a%p) if(b&1) ret=ret*a%p; return ret;}
ll getInv(ll x,ll p){return qpow(x,p-2,p);}

int main(){
    ll n; scanf("%d",&n);
    vector<ll> kkk(n+1);
    for(int i=1;i<=n;i++){
        scanf("%lld",&kkk[i]);
        }

    map<ll,int> hhh;

    for(int i=1;i<=n;i++){

        if(hhh[kkk[i]-i]) {
            hhh[kkk[i]-i]++;
        }

        else hhh[kkk[i]-i]=1;
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        if(hhh[-kkk[i]-i]) {
            ans+=hhh[-kkk[i]-i];
            }
    }
    printf("%lld\n",ans);
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){long long N,x=0;cin>>N;vector<long>a(N);for(int i=0;i<N;i++)cin>>a.at(i);
sort(a.begin,a.end)
  for(int i=0;a.at(i)<200000;i++){if(a.at(i)<200000)for(int j=0;j<i;j++)if(i-j==a.at(i)+a.at(j))x++;}
cout<<x<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)'
    4 | sort(a.begin,a.end)
      | ~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   template argument deduction/substitution failed:
a.cc:4:5: note:   couldn't deduce template parameter '_RAIter'
    4 | sort(a.begin,a.end)
      | ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
a.cc:5:20: error: 'i' was not declared in this scope
    5 |   for(int i=0;a.at(i)<200000;i++){if(a.at(i)<200000)for(int j=0;j<i;j++)if(i-j==a.at(i)+a.at(j))x++;}
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
   	int N;
   	int count = 0;
   	cin >> N;
   	vector<int> num(N);
   	for(int i=0;i<N;i++){
   		cin >> num(i);
   	}
   	
   	for(int i=0;i<N-1;i++){
   		for(int j=i;j<N;J++){
   			if(j-i==num.at(i)+num.at(j))
   				count++;
   		}
   	}
   	cout << count; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:27: error: no match for call to '(std::vector<int>) (int&)'
    9 |                 cin >> num(i);
      |                        ~~~^~~
a.cc:13:33: error: 'J' was not declared in this scope
   13 |                 for(int j=i;j<N;J++){
      |                                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
   	int N;
   	int count = 0;
   	cin >> N;
   	vector<int> num(N);
   	for(int i=0;i<N:i++){
   		cin >> num(i);
   	}
   	
   	for(int i=0;i<N-1;i++){
   		for(int j=i;j<N;J++){
   			if(j-i==num.at(i)+num.at(j))
   				count++;
   		}
   	}
   	cout > >count; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
    8 |         for(int i=0;i<N:i++){
      |                     ^
a.cc:8:24: error: found ':' in nested-name-specifier, expected '::'
    8 |         for(int i=0;i<N:i++){
      |                        ^
      |                        ::
a.cc:8:23: error: 'N' is not a class, namespace, or enumeration
    8 |         for(int i=0;i<N:i++){
      |                       ^
a.cc:12:9: error: expected primary-expression before 'for'
   12 |         for(int i=0;i<N-1;i++){
      |         ^~~
a.cc:10:10: error: expected ';' before 'for'
   10 |         }
      |          ^
      |          ;
   11 | 
   12 |         for(int i=0;i<N-1;i++){
      |         ~~~
a.cc:12:9: error: expected primary-expression before 'for'
   12 |         for(int i=0;i<N-1;i++){
      |         ^~~
a.cc:10:10: error: expected ')' before 'for'
   10 |         }
      |          ^
      |          )
   11 | 
   12 |         for(int i=0;i<N-1;i++){
      |         ~~~
a.cc:8:12: note: to match this '('
    8 |         for(int i=0;i<N:i++){
      |            ^
a.cc:13:33: error: 'J' was not declared in this scope
   13 |                 for(int j=i;j<N;J++){
      |                                 ^
a.cc:18:16: error: expected primary-expression before '>' token
   18 |         cout > >count;
      |                ^
Language: C++

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>

#define N_MAX 200000
#define MODVAL 1000000007

int main(void){
	int n;
	int a[200000];
	int i,j;
	long long int ret = 0;
	int b[1000000] = {};
	int bias = 500000;
	int diff;

	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		if(a[i]<=200000){
			diff = i - a[i] + bias;
			b[diff]++;
		}
	}

	ret+=b[a[0]+bias];

	for(i=1;i<n;i++){
		if(a[i]<=200000){
			ret+=long long int (b[a[i]+bias+i]);
		}
	}



	printf("%lld\n",ret);

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:30: error: expected primary-expression before 'long'
   31 |                         ret+=long long int (b[a[i]+bias+i]);
      |                              ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
  
  ll n;
  cin >> n;
  vector<ll>a(n);
  for(int i=0; i<n; i++) cin >>a[i];
  
  ll count=0;
  for(int i=0; i<n-1; i++){
   int x=i+a[i]+1;
   if(a[i]>=n-1)contine;
   for(int j=x; j<n; j++){
     if(a[j]==j-x+1)count++;
   }
  }
  
  cout << count << endl;
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'contine' was not declared in this scope
   15 |    if(a[i]>=n-1)contine;
      |                 ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define INF 100000000000
#define MOD 1000000007
#define ll long long int
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()




using namespace std;

int main(){
  int N; cin>>N;
  vector <int> A(N);
  REP(i,N) cin>>A[i];
  vector <int> B(N),C(N);
  int yobun = 0;
  map <int,int> Mb,Mc;
  REP(i,N){
    B[i] = i - A[i];
    C[i] = i + A[i];
    if(B[i] == C[i]) yobun++;
    Mb[B[i]]++;
    Mc[C[i]]++;
  }
  //sort(all(B));
  //sort(all(C));

  ll ans=0;

  /*

  REP(i,N){
    cout<<B[i]<<" ";
  }
  cout<<endl;
  REP(i,N){
    cout<<C[i]<<" ";
  }
  cout<<endl;
  */
 

  
  auto itr1 = Mb.begin();
  auto itr2 = Mc.begin();
  //set <int> com;
  for(;;){
    auto BB = (*itr1);
    auto CC = (*itr2);

    if(itr1==Mb.end() or itr2 == Mc.end()) break;

    if(BB.first > CC.first){
      itr2++;
      continue;
    }
    if(BB.first < CC.first){
      itr1++;
      continue;
    }

    
     ans += BB.second * CC.second;
     // com.insert(B[bi]);
      
      itr1++;
      itr2++;
    
    


    //if(bi==N-1 and ci == N-1) break;
  }

  /*

  for(auto itr = com.begin();itr != com.end();itr++){
    int now = (*itr) ;
    int cnt1 = 0,cnt2 = 0;
    REP(i,N){
      if(B[i] == now) cnt1++;
      if(C[i] == now) cnt2++;
    }
    ans += cnt1 * cnt2;
  }
  */

 assert(ans - yobun >= 0)

  cout<<ans-yobun<<endl;
  //cout<<yobun<<endl;
  return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:92:3: error: expected ';' before 'cout'
   92 |   cout<<ans-yobun<<endl;
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main()
{
	ll n;
  	cin >> n;
  	ll tall[n];
  	for(int i = 0; i < n; i++)
    {
    	cin >> tall[i];
    }
  	ll hikaku[n-1];
  	int left = -1;
  	int right = n;
  	ll ans = 0;
  	for(int i = 0; i < n; i++)
    {
    	left = tall[i] + i + 1;
      	if(left < n)
        {
        	for(left; left < n; left++)
            {
            	if(left - i == a[left] + a[i])
                {
                	ans++;
                }
            }
        }
    }
  	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:32: error: 'a' was not declared in this scope
   26 |                 if(left - i == a[left] + a[i])
      |                                ^
Language: Java

import java.util.Scanner;

/**
 * @author Orange Summer
 * @date 2020/5/3-20:01
 */
public class EC {
    public static void main(String[] args){
        Scanner in=new Scanner(System.in);
        int number=Integer.parseInt(in.nextLine());
        String height=in.nextLine();
        String[] heights=height.split(" ");
        int[] heightss=new int[heights.length];
        for (int i=0;i<heights.length;i++){
            heightss[i]=Integer.parseInt(heights[i]);
        }
        int sum=0;
        int[] numbers=new int[heightss.length];
        for (int i=0;i<heightss.length;i++){
            for (int j=i+1;j<heightss.length;j++){
                if (heightss[i]+heightss[j]==Math.abs(i-j)){
                    sum++;
                }
            }
        }
        System.out.println(sum);
    }
}


Compiler output:
Main.java:7: error: class EC is public, should be declared in a file named EC.java
public class EC {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
#define INF 100000000000
#define MOD 1000000007
#define ll long long int
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()




using namespace std;

int main(){
  int N; cin>>N;
  vector <int> A(N);
  REP(i,N) cin>>A[i];
  vector <int> B(N),C(N);
  int yobun = 0;
  map <int,int> Mb,Mc;
  REP(i,N){
    B[i] = i - A[i];
    C[i] = i + A[i];
    if(B[i] == C[i]) yobun++;
    Mb[B[i]]++;
    Mc[C[i]]++;
  }
  //sort(all(B));
  //sort(all(C));

  ll ans=0;

  /*

  REP(i,N){
    cout<<B[i]<<" ";
  }
  cout<<endl;
  REP(i,N){
    cout<<C[i]<<" ";
  }
  cout<<endl;
  */
 

  int bi=0,ci=0;
  auto itr1 = Mb.begin();
  auto itr2 = Mc.begin();
  //set <int> com;
  for(;;){
    auto BB = (*itr1);
    auto CC = (*itr2);

    if(itr1==Mb.end() or itr2 == Mc.end()) break;

    if(BB.first > CC.first){
      itr2++;
      continue;
    }
    if(BB.first < CC.first){
      itr1++;
      continue;
    }

    
     ans += BB.second * CC.second;
     // com.insert(B[bi]);
      
      itr1++;
      
    
    


    //if(bi==N-1 and ci == N-1) break;
  }

  /*

  for(auto itr = com.begin();itr != com.end();itr++){
    int now = (*itr) ;
    int cnt1 = 0,cnt2 = 0;
    REP(i,N){
      if(B[i] == now) cnt1++;
      if(C[i] == now) cnt2++;
    }
    ans += cnt1 * cnt2;
  }
  */

 assert(ans - yobun >= 0)

  cout<<ans-yobun<<endl;
  //cout<<yobun<<endl;
  return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:92:3: error: expected ';' before 'cout'
   92 |   cout<<ans-yobun<<endl;
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){long long N,x=0;cin>>N;vector<long>a(N);for(int i=0;i<N;i++){cin>>a.at(i);if(a.at(i)<200000)for(int j=0;j<i;j++)if(i-j=a.at(i)+a.at(j))x++;}
cout<<x<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:128: error: lvalue required as left operand of assignment
    3 | int main(){long long N,x=0;cin>>N;vector<long>a(N);for(int i=0;i<N;i++){cin>>a.at(i);if(a.at(i)<200000)for(int j=0;j<i;j++)if(i-j=a.at(i)+a.at(j))x++;}
      |                                                                                                                               ~^~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>  // std::unique
#include <cmath>
using namespace std;

using ll = long long;
constexpr auto PrimeBigNum10_9_7 = 1000000007;

// 素数判定
template <typename T>
bool IsPrimeNumber(T value) {

	for (int i = 2; i * i <= value; ++i) {
		if ((value % i) == 0) {
			return true;
		}
	}
	return false;
}

// 桁数判定
template <typename T>
T GetFigureLength(T value) {
	T figure = 1;
	while (value >= 10) {
		value /= 10;
		++figure;
	}
	return figure;
}

// 素因数分解結果
template <typename T>
map<T, T> GetPrimeFactorize(T value) {

	map<T, T> res;

	for (T i = 2; i * i <= value; ++i) {
		if ((value%i) != 0)	continue;

		T count = 0;
		while ((value % i) == 0) {
			value /= i;
			++count;
		}

		res[i] = count;
	}

	if (value != 1) {
		res[value] = 1;
	}
	return res;
}


vector<ll> scores;
ll resultCount;

bool IsApplicable(ll index1, ll index2) {

	ll score1 = scores[index1] + scores[index2];
	ll score2 = index2 - index1;

#if 0 {
		for (auto itr = buf.begin(); itr != buf.end(); ++itr) {
			cout << *itr << " ";
		}
		cout << ":" << scores[buf[0]]  << " " << scores[buf[1]];
		cout << ":" << score1 << " " << score2;
		cout << "=" << ((score1 == score2) ? "@" : "");
		cout << endl;
	}
#endif
	return score1 == score2;
}

int main(void) {
	ll n;
	cin >> n;

	scores.clear();
	resultCount = 0;

	for (int i = 0; i < n; ++i) {
		ll a;
		cin >> a;
		scores.push_back(a);
	}
	vector<ll> bb(2);

	for (ll i = 0; i < n; ++i) {
		for (ll j = i + 1; j < n; ++j) {
			if (IsApplicable(i, j)) {
				resultCount++;
			}
		}
	}

	auto output = resultCount;
	cout << output;

	return 0;
}


Compiler output:
a.cc:68:7: error: token "{" is not valid in preprocessor expressions
   68 | #if 0 {
      |       ^
Language: C++

N=int(input())
A=[int(i) for i in input().split(" ")]


retval=0
for i in range(N):
    for j in range(i,N):
        if j-i==A[i]+A[j]:
            retval+=1

print(retval)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N=int(input())
      | ^
Language: C++

#include <iostream>
using namespace std;

long long pow(int x){
  return x*x*x*x*x;
}
int main(){
  long long x;
  cin >> x;
  for(int i=-100;i<100;i++){
    for(int j=i+1;j<100;j++){
      if(pow(j)-pow(i)==x){
        cout << j << " " << i << endl;
        return 0;
      }
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:17:4: error: expected '}' at end of input
   17 |   }
      |    ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include<iostream>
using std::cout;
using std::cin;
using std::endl;

#include<vector>
using std::vector;

#include

int main()
{
  int n;
  cin >> n;
  
  vector<int> a(n);
  for (int i = 0; i < n; i ++)
    cin >> a.at(i);
  
  int64_t count = 0;
  for (int i = 0; i < n; i ++)
  {
    for (int j = i + 1; j < n; j ++)
    {
      if (j - i == a.at(j) + a.at(i)) count ++;
    }
  }
  
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc:9:9: error: #include expects "FILENAME" or <FILENAME>
    9 | #include
      |         ^
Language: C++

#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
#include <map>
typedef long long ll;
#include <cmath>
#include <iomanip>
 
const int MOD = 1000000007;
 
 
ll POWER(ll x,ll y)
{
	ll ret=1;
	ll p=x;
	for (ll i=y;i>0;i/=2)
	{
		if (i%2) ret=(ret*p)%MOD;
		p=(p*p)%MOD;
	}
	return ret;
}
ll gcm(ll a, ll b)
{
	if (b>a) {ll c=a; a=b; b=c;}
	while (b>0)
	{
		ll r=a%b;
		a=b;
		b=r;
	}
	return a;
}
 
 
int main(int argc, char *argv[])
{
	int n;
	cin>>n;
	vector<int> a(n);
	for (int i=0;i<n;i++) cin>>a[i];
	
	ll ret=0;
	for (int i=0;i<n;i++)
	{
		for (int j=i+1;j<n;++)
		{
			if (a[i]+a[j]==j-i) ret++;
		}
	}
	cout<<ret<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:48:38: error: expected primary-expression before ')' token
   48 |                 for (int j=i+1;j<n;++)
      |                                      ^
Language: C

#include<stdio.h>
#define ll long long


int main(void)
{
  ll n;
  scanf("%lld", &n);
  ll ans = 0;
  ll a[n];
     for(ll i = 0; i < n; i++) {
        scanf("&lld", &a[i]);
    }

       for(ll i = n - 1; i > 2; i--) {
        for(ll j = i - a.at(i) - 1; j >= 0; j--) {
            if(i - j == a[i] + a[j])
                ans++;
        }
    }

    printf("%lld", ans);
 
}

Compiler output:
main.c: In function 'main':
main.c:16:25: error: request for member 'at' in something not a structure or union
   16 |         for(ll j = i - a.at(i) - 1; j >= 0; j--) {
      |                         ^
Language: C++

#include<iostream>
#include<vector>

#define rep(i,n) for (int i = 0; i < (n); i++)

using namespace std;
using ll = long long;
using P = pair<int,int>;

int main()
{
    long int n;
    cin >> n;
    long int a[200005], sum[200005]={0};
    rep(i,n) cin >> a[i+1];
    long int ans=0;

    for (long int i = 1; i <= n; i++)
    {
        sum[a[i] + i] ++;
    }
    
    long int ans=0;
    for (long int i = 1; i <= n; i++)
    {
        ans += sum[i-a[i]];
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:14: error: redeclaration of 'long int ans'
   23 |     long int ans=0;
      |              ^~~
a.cc:16:14: note: 'long int ans' previously declared here
   16 |     long int ans=0;
      |              ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){long long N,x=0;cin>>N;long A[N];for(int i=0;i<N;i++){cin>>A[i];if(A[i]<200000)for(int j=0;j<i;j++)if(i-j=A[i]+A[j])x++;}
cout<<x<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:115: error: lvalue required as left operand of assignment
    3 | int main(){long long N,x=0;cin>>N;long A[N];for(int i=0;i<N;i++){cin>>A[i];if(A[i]<200000)for(int j=0;j<i;j++)if(i-j=A[i]+A[j])x++;}
      |                                                                                                                  ~^~
Language: C++

#include <iostream>
using namespace std;
 
int main(){
  int x;
  cin>>x;
  int i,j;
  int flag=0;
  for(i=-120;i<=120;i++){
    for(j=-120;j<=120;j++){
      if(i*i*i*i*i-j*j*j*j*j=x){
        flag=1;
        break;
      }
    }
    if (flag==1) break;
  }
  cout <<i<<" "<<j<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: lvalue required as left operand of assignment
   11 |       if(i*i*i*i*i-j*j*j*j*j=x){
      |          ~~~~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> height(N);
  vector<int> height_minus(N);
  vector<int> height_plus(N);
  for (int i = 0; i < N; i++){
    cin >> height.at(i);
    height_minus.at(i) = i - height.at(i);
    height_plus.at(i) = i + height.at(i);
  }
  
  sort(height_minus.begin(), height_minus.end());
  sort(height_plus.begin(), height_plus.end());
  int count = 0;
  int jstart = 0;
  for(int i = 0; i < N; i++) {
  for (int j = k; jstart < N; j++) {
      jstart = j;
      if (height_minus.at(i) < height_plus.at(j))
        break;
      else if (height_minus.at(i) == height_plus.at(j))
        count++;
    }
  }
  cout << count << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: 'k' was not declared in this scope
   21 |   for (int j = k; jstart < N; j++) {
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){long long N,x=0;cin>>N;long A[N];for(int i=0;i<N;i++){cin>>A[i];if(A[i]<200000)for(j=0;j<i;j++)if(i-j=A[i]+A[j])x++;}
cout<<x<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:95: error: 'j' was not declared in this scope
    3 | int main(){long long N,x=0;cin>>N;long A[N];for(int i=0;i<N;i++){cin>>A[i];if(A[i]<200000)for(j=0;j<i;j++)if(i-j=A[i]+A[j])x++;}
      |                                                                                               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){long long N,x=0;cin>>N;long A[N];for(int i=0;i<N;i++]{cin>>A[i];if(A[i]<200000)for(j=0;j<i;j++)if(i-j=A[i]+A[j])x++;}
cout<<x<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:3:64: error: expected ')' before ']' token
    3 | int main(){long long N,x=0;cin>>N;long A[N];for(int i=0;i<N;i++]{cin>>A[i];if(A[i]<200000)for(j=0;j<i;j++)if(i-j=A[i]+A[j])x++;}
      |                                                ~               ^
      |                                                                )
a.cc:3:64: error: expected primary-expression before ']' token
a.cc:4:15: error: expected '}' at end of input
    4 | cout<<x<<endl;
      |               ^
a.cc:3:11: note: to match this '{'
    3 | int main(){long long N,x=0;cin>>N;long A[N];for(int i=0;i<N;i++]{cin>>A[i];if(A[i]<200000)for(j=0;j<i;j++)if(i-j=A[i]+A[j])x++;}
      |           ^
Language: C

#include<stdio.h>
#define ll long long


int main(void)
{
  ll n;
  scanf("%lld", &n);
  ll ans = 0;
  ll a[n];
     for(ll i = 0; i < n; i++) {
        scanf("&lld", &a[i]);
    }

       for(ll i = n - 1; i > 2; i--) {
        for(ll j = 1 + a[i]; j <= i; j++) {
            if(j == a[i] + a[i - j])
                ans++;
        }
    }

    printf("%lld", ans)
 
}

Compiler output:
main.c: In function 'main':
main.c:22:24: error: expected ';' before '}' token
   22 |     printf("%lld", ans)
      |                        ^
      |                        ;
   23 | 
   24 | }
      | ~