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

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

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

int main(){
  int n; cin >> n;
  vi L(n);

  // 何の値が何個あるかを記録
  vi count(2001,0);
  rep(i, n){
    cin >> L[i];
    count[L[i]]++;
  }
  //累積和
  vi sum(2001,0);
  sum[0] = 0;
  rep(i, 2000) sum[i+1] = sum[i] + count[i];

  ll ans = 0;
  rep(a, n) rep(b, n){
    if(a == b) continue;
    int right = L[a]+L[b];
    int left = abs(L[a]-L[b])+1;

    int cnt = sum[right] - sum[left];
    if(left <= L[a] && L[a] < right) cnt--;
    if(left <= L[b] && L[b] < right) cnt--;

    ans += max(cnt,0);

  }
  std::cout << ans/6 << '\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:3: error: 'll' was not declared in this scope
   22 |   ll ans = 0;
      |   ^~
a.cc:32:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |     ans += max(cnt,0);
      |     ^~~
      |     abs
a.cc:35:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |   std::cout << ans/6 << '\n';
      |                ^~~
      |                abs
Language: C

#include<stdio.h>

int main(){
  int n=0;
  int ans=0;
  int L[2000];
  
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&L[i]);
  }
  for(int i=0;i<n-2;i++){
    for(int j=i+1;j<n-1;j++){
      for(int k=j+1;k<n;k++){
        if(L[i]<L[j]+L[k] && L[j]<L[k]+L[i] && L[k]<L[i]+L[j])
          ans++;
      }
    } 
  }
  printf("%d",ans);
  return 0;


Compiler output:
main.c: In function 'main':
main.c:21:3: error: expected declaration or statement at end of input
   21 |   return 0;
      |   ^~~~~~
Language: C++

#include<iostream>
using namespace std;

int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main()
{
  int N;
  cin >> N;

  int l[N];
  int i;
  for(i = 0; i < N; i++)
    cin >> l[i];
  
  std::qsort(l,N,4,compare_int);

  int j, k, m;
  int sum;
  int count = 0;
  for(j = N-1; j > 1 ; j--)
    {
      
      for(k = j-1; k > 0 ; k--)
	{
	  if(l[j]>2*l[k])
	    break;
	  
	  for(m = k-1; m > -1; m--)
	    {
	      sum = l[k] + l[m];

	      if(l[j] < sum && sum <= 2*l[j])
		{
		  count++;
		}

	    }
	}
    }
  cout << count << endl;

  return 0;
}
      
#include<iostream>
using namespace std;

int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main()
{
  int N;
  cin >> N;

  int l[N];
  int i;
  for(i = 0; i < N; i++)
    cin >> l[i];
  
  std::qsort(l,N,4,compare_int);

  int j, k, m;
  int sum;
  int count = 0;
  for(j = N-1; j > 1 ; j--)
    {
      
      for(k = j-1; k > 0 ; k--)
	{
	  if(l[j]>2*l[k])
	    break;
	  
	  for(m = k-1; m > -1; m--)
	    {
	      sum = l[k] + l[m];

	      if(l[j] < sum && sum/2 <= l[j])
		{
		  count++;
		}

	    }
	}
    }
  cout << count << endl;

  return 0;
}
      


Compiler output:
a.cc:52:5: error: redefinition of 'int compare_int(const void*, const void*)'
   52 | int compare_int(const void *a, const void *b)
      |     ^~~~~~~~~~~
a.cc:4:5: note: 'int compare_int(const void*, const void*)' previously defined here
    4 | int compare_int(const void *a, const void *b)
      |     ^~~~~~~~~~~
a.cc:57:5: error: redefinition of 'int main()'
   57 | int main()
      |     ^~~~
a.cc:9:5: note: 'int main()' previously defined here
    9 | int main()
      |     ^~~~
Language: C++

#include "bits/stdc++.h"

using namespace std;

int main() {
  int n; cin >> n;
  vector<int> l(n); for (int& x : l) cin >> x;
  
  int pre[1010];
  for (int i = 0; i <= 1000; i++) pre[i] = 0;
  for (int x : l) pre[x]++;
  for (int i = 1; i <= 1000; i++) pre[i] += pre[i - 1];
  
  int ans = 0;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i; j++) {
      int low = abs(l[i] - l[j]) + 1;
      int high = l[i] + l[j] - 1;
      ans += 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:1: error: expected primary-expression before '}' token
   20 | }
      | ^
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:15:31: note: to match this '{'
   15 |   for (int i = 1; i < n; i++) {
      |                               ^
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){

	int n, tmp1, tmp2, ans=0;
	vector<int> v;

	cin>> n;
	v.resize(n);
	for(int i=0;i<n;i++) cin>> v[i];

	sort(v.begin(), v.end());

	for (int i = 0;i < v.size();i++) {
		for (int j = i + 1;j < v.size();j++) {
			tmp1 = (int)lower_bound(v.begin() + j, v.end(), j - i + 1);
			tmp2 = (int)lower_bound(v.begin() + j, v.end(), j + i);
			ans += tmp2 - tmp1;
		}
	}

	cout<< ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:32: error: invalid cast from type '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to type 'int'
   21 |                         tmp1 = (int)lower_bound(v.begin() + j, v.end(), j - i + 1);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:22:32: error: invalid cast from type '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to type 'int'
   22 |                         tmp2 = (int)lower_bound(v.begin() + j, v.end(), j + i);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){

	int n, tmp1, tmp2, ans=0;
	vector<int> v;

	cin>> n;
	v.resize(n);
	for(int i=0;i<n;i++) cin>> v[i];

	sort(v.begin(), v.end());

	for (int i = 0;i < v.size();i++) {
		for (int j = i + 1;j < v.size();j++) {
			tmp1 = lower_bound(v.begin() + j, v.end(), j - i + 1);
			tmp2 = lower_bound(v.begin() + j, v.end(), j + i);
			ans += tmp2 - tmp1;
		}
	}

	cout<< ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:43: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   21 |                         tmp1 = lower_bound(v.begin() + j, v.end(), j - i + 1);
      |                                ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                           |
      |                                           __gnu_cxx::__normal_iterator<int*, std::vector<int> >
a.cc:22:43: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   22 |                         tmp2 = lower_bound(v.begin() + j, v.end(), j + i);
      |                                ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                           |
      |                                           __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: Java

import java.util.Scanner;
import java.util.Arrays;

public class Solution {

   public static void main(String[] args) {
   
      Scanner sc = new Scanner(System.in);
      
      int N = sc.nextInt();
      int[] L = new int[N];
      for(int i=0;i<N;i++) {
         L[i] = sc.nextInt();
      }
      Arrays.sort(L);
      int ans = 0;
      for(int i=0;i<N-2;i++) {
         for(int j=i+1;j<N-1;j++) {
            int ij = L[i]+L[j];
            int w = j+1;
            while(w < N && L[w] < ij) {
               ans++;
               w++;
            }
         }
      }
      
      System.out.println(ans);
   }
}

Compiler output:
Main.java:4: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
       ^
1 error
Language: Java

import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] nums = new int[n];

    for(int i=0; i<n; i++){
      nums[i] = sc.nextInt();
    }

    int cnt = 0;

    for(int i=0; i<n-2; i++){
      for(int j=0; j<n-1; j++){
        for(int k=0; j<n; k++){
          if((nums[i]<nums[j]+nums[k]) && (nums[j]<nums[i]+nums[k]) && (nums[k]<nums[i]+nums[j])){
            cnt++;
          }else{
            break;
        }
      }
    }
    System.out.println(cnt);
  }
}


Compiler output:
Main.java:27: error: reached end of file while parsing
}
 ^
1 error
Language: C++

import java.util.*;

public class Main{
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      int n = Integer.parseInt(sc.next());

      int[] L = new int[n];
      for(int i=0;i<n;i++){
        L[i] = Integer.parseInt(sc.next());
      }
      //System.out.println("");

      Arrays.sort(L);
      for(int i=0;i<n;i++){
        //System.out.print(L[i]+" ");
      }
      //System.out.println("");

      int ans = 0;

      for(int i=n-1;i>=0;i--){
        for(int j=i-1;j>=0;j--){
//////////////////////////////////////////////////////

int start = 0;
int end = j;
int sa = L[i]-L[j];
int cnt = -1;
while(true){
  int a = start+end;
  int mid = a/2;
  if(L[mid]>sa){ //L[mid以降]は使える。
    end = mid;
  }
  else if(L[mid]<=sa){ //L[mid以前]は使えない
    start = mid;
  }

  if(a==(start+end) && L[mid]>sa){
    cnt = mid;  //L[mid以降]は使えることの記録。
    //System.out.println(L[i]+","+L[j]+"のとき"+L[cnt]+"が最小の棒。"+"saは"+sa);
    break;
  }
  if(a==(start+end) && L[mid+1]>sa){
    cnt = mid+1;  //L[mid+1以降]は使えることの記録。
    //System.out.println(L[i]+","+L[j]+"のとき"+L[cnt]+"が最小の棒。"+"saは"+sa);
    break;
  }
  if(a==(start+end) && L[mid]<=sa){
    break;
  }
}
//使えるのはL[j]の次に小さいやつまでなので、
if(cnt!=-1){
  for(int k=j;k>0;k--){
    if(L[k]!=L[k-1]){ //L[k-1]から使える。
      ans += (k-1)-(cnt)+1;
      //System.out.println(((k-1)-(cnt)+1)+"個加算。");
      break;
    }
  }
}
//////////////////////////////////////////////////////
        }
      }


      System.out.println(ans);

    }
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main{
      | ^~~~~~
Language: C++

 #include<bists/stdc++.h>
using namespace std;
 
int n,len,a[100005],num[100005];
 
int sum(int a[])
{
    int ans=0;
    int x;
   
     for(int i=0;i<len;i++)
    {
        if(num[a[i]] >= 3)
            ans+=1;
        
        if(num[a[i]]>=2)
        {
            x = lower_bound(a,a+len,2*a[i])-a;
            ans += (x-1);
        }
        for(int j=i+1;j<len;j++)
        {
            x = lower_bound(a+j,a+len,a[i]+a[j])-a;
            ans += (x-j-1);
        }
    }
    return ans;
}
 
int main()
{
    cin>>n;
    
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        num[a[i]]++;
    }
    sort(a,a+n);
    
    len=unique(a,a+n)-a;
    
    cout<<sum(a)<<endl;
    return 0;
}

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

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;++i) cin >> a[i];
  sort(a.begin(), a.end(), greater<int>);
  int ans = 0;
  for(int i=0;i<(n-2);++i){
    for(int j=(i+1);j<(n-1);++j){
      for(int k=(j+1);k<n;++k){
        if(a[i]<(a[j]+a[k])) ans+=1;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:40: error: expected primary-expression before ')' token
    9 |   sort(a.begin(), a.end(), greater<int>);
      |                                        ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n)
  for(int i=0;i<n;++i) cin >> a[i];
  sort(a.begin(), a.end(), greater<int>);
  int ans = 0;
  for(int i=0;i<(n-2);++i){
    for(int j=(i+1);j<(n-1);++j){
      for(int k=(j+1);k<n;++k){
        if(a[i]<(a[j]+a[k])) ans+=1;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'for'
    8 |   for(int i=0;i<n;++i) cin >> a[i];
      |   ^~~
a.cc:8:15: error: 'i' was not declared in this scope
    8 |   for(int i=0;i<n;++i) cin >> a[i];
      |               ^
a.cc:9:40: error: expected primary-expression before ')' token
    9 |   sort(a.begin(), a.end(), greater<int>);
      |                                        ^
Language: C


#include<stdio.h>
int main()
{
    int N,x,y,z,sum=0;
    int L[10000];
    scanf("%d",&N);
    for (x=0;x<N;x++)
    {
    	scanf("%d",&L[x]);
	}
	for (x=0;x<N-2;x++)
	{
		for (y=x;y<N-1;y++)
		{
			for (z=y;z<N;z++1)
			{
				if (a<b+c&&b<a+c&&c<a+b)
				{
					sum++;
				}
			}
		}
	}
	printf("%d",sum);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:41: error: expected ')' before numeric constant
   16 |                         for (z=y;z<N;z++1)
      |                             ~           ^
      |                                         )
main.c:18:37: error: 'a' undeclared (first use in this function)
   18 |                                 if (a<b+c&&b<a+c&&c<a+b)
      |                                     ^
main.c:18:37: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:39: error: 'b' undeclared (first use in this function)
   18 |                                 if (a<b+c&&b<a+c&&c<a+b)
      |                                       ^
main.c:18:41: error: 'c' undeclared (first use in this function)
   18 |                                 if (a<b+c&&b<a+c&&c<a+b)
      |                                         ^
Language: C++

#include <iostream>
#include <string>
#include <stdio.h>
#include <list>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; ++i)
typedef long long ll;

bool isOK(int index, int key,vector<int> A)
{
	if(A[index] >= key)return true;
	else return false;
}

int binsrch(vector<int> A, int key)
{
	int left=-1;
	int right=A.size();
	while(right - left > 1)
	{
		int mid=left + (right -　left)/2;
		if(isOK(mid,key,A))right=mid;
		else left=mid;
	}
	return right;
}

int main()
{
	int n;cin >> n;
	vector<int> l(n);
	rep(i,n)cin >> l[i];
	sort(l.begin(),l.end());
	int count=0;
	for(int i=0;i<(n-2);i++)
		for(int j=i+1;j<(n-1);j++)
		{
			int find = binsrch(l,l[j]+l[i]);
			//if(find==n)find--;
			count+=find-j-1;
			//cout<<i<<":"<<j<<":"<<find<<endl;
		}
	cout<<count<<endl;
	return 0;
}

Compiler output:
a.cc:23:40: error: extended character 　 is not valid in an identifier
   23 |                 int mid=left + (right -　left)/2;
      |                                        ^
a.cc: In function 'int binsrch(std::vector<int>, int)':
a.cc:23:40: error: '\U00003000left' was not declared in this scope; did you mean 'left'?
   23 |                 int mid=left + (right -　left)/2;
      |                                        ^~~~~~
      |                                        left
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
	int n;
	cin>>n;
	vector<int>l(n);
	for(int i=0;i<n;i++)cin>>l[i];
	sort(l.begin(),l.end());
	int ans = 0;
	for (int i=0;i<n;i++) {
		for(int j=i+1;j<n;j++) {
			ans+=max(lower_bound(l.begin(),l.end(),l[i]+l[j])-l.begin()-(j+1),0);
		}
	}
	cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:33: error: no matching function for call to 'max(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, int)'
   12 |                         ans+=max(lower_bound(l.begin(),l.end(),l[i]+l[j])-l.begin()-(j+1),0);
      |                              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:12:33: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   12 |                         ans+=max(lower_bound(l.begin(),l.end(),l[i]+l[j])-l.begin()-(j+1),0);
      |                              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:12:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   12 |                         ans+=max(lower_bound(l.begin(),l.end(),l[i]+l[j])-l.begin()-(j+1),0);
      |                              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

    for(i=1;i<=s;i++)
    {
        for(j=1;j<=s;j++)
        {
                for(t=0;t<=2;t++)
            {
                if(judge[0][t]!=judge[0][j]&&judge[0][t]!=judge[1][j]&&judge[0][t]!=judge[2][j]);
                else
                sum=sum-1;
            }

        }
    }

Compiler output:
a.cc:1:5: error: expected unqualified-id before 'for'
    1 |     for(i=1;i<=s;i++)
      |     ^~~
a.cc:1:13: error: 'i' does not name a type
    1 |     for(i=1;i<=s;i++)
      |             ^
a.cc:1:18: error: 'i' does not name a type
    1 |     for(i=1;i<=s;i++)
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
map<long long,long long> cnt;
long long n;
long long res = 0;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n;
for (long long i=1;i<=n;i++)
{
int x;
cin >> x;
if (x > 0)
cnt[x]++;
}
for (map<long long,long long>::iterator it = cnt.begin();it != cnt.end();it++)
{
long long val = it->second;//second giá trị, first vị trí
res = res + ((val-2)*(val-1)*val)/6;
}
cout << res;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
#include<algorithm>
#define int long long
using namespace std;

int n;
int data[2000];

int main(void){
	cin>>>n;
	for(int i=0;i<n;i++){
		cin>>data[i];
	}
	sort(l,l+n);
	
	int ans=0;
	for(int i=0;i<n;i++){
		for(j=i+1;j<n;j++){
			int a=l[i]+l[j];
			int id1=lower_bound(l,1+n,a)-1;
			int cnt=id1-(j+1);
			ans+=cnt;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:10:14: error: expected primary-expression before '>' token
   10 |         cin>>>n;
      |              ^
a.cc:12:22: error: reference to 'data' is ambiguous
   12 |                 cin>>data[i];
      |                      ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:7:5: note:                 'long long int data [2000]'
    7 | int data[2000];
      |     ^~~~
a.cc:14:14: error: 'l' was not declared in this scope
   14 |         sort(l,l+n);
      |              ^
a.cc:18:21: error: 'j' was not declared in this scope
   18 |                 for(j=i+1;j<n;j++){
      |                     ^
Language: C++

#include <iostream>
#include <vector>
#include <bits/stdc++.h>
// #include <typeinfo>

using namespace std;

int main()
{
    int N;
    cin >> N;

    vector<int> vec(N);
    for (int i = 0; i < N; i++)
    {
        cin >> vec[i];
    }

    int cnt;

    sort(vec.begin(), vec.end());

    for (int i = 0; i < N - 2; i++)
    {
        for (int j = i + 1; j < N - 1; j++)
        {
            auto itr = lower_bound(vec.begin(), vec.end(), vec[i] + vec[j]) - vec.begin();
            cnt += itr - (j + 1);
        }
    }

    cout << cnt << endl;

    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:34:14: error: expected '}' at end of input
   34 |     return 0;
      |              ^
a.cc:9:1: note: to match this '{'
    9 | {
      | ^
Language: C++

#include<iostream>
#include<algorithm>
int main(){
  int n;
  std::cin >> n;
  int l[n];
  int i,j,k;
  int cnt = 0;
  for(i=0;i<n;i++){
    std::cin >> l[i];
  }
  
  std::sort(l.l+n,std::greater<>());
  for(i=0;i<n-2;i++){
    for(j=i+1;j<n-1;j++){
      for(k=j+1;k<n;k++){
        if(l[i]<l[j]+l[k]) cnt++;
        else break;
      }
    }
  }
  
  std::cout << cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: request for member 'l' in 'l', which is of non-class type 'int [n]'
   13 |   std::sort(l.l+n,std::greater<>());
      |               ^
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
  public static void main(String [] args) {
    FastReader fr = new FastReader();
    int N = fr.nextInt();
    int[] sticks = new int[N];
    for (int i = 0; i < N; i++) {
      sticks[i] = fr.nextInt();
    }
    
    Arrays.sort(sticks); // sort sticks in ascending order
    
    int result = 0;
    for (int i = N - 1; i >= 2; i--) {
      for (int j = i - 1; j >= 1; j--) {
        int minL = sticks[i] - sticks[j];
        int index = binarySearch(sticks, minL, 0, j - 1);
        if (sticks[index] > minL) {
          result += (N - index); // sticks[index] is also counted
        } else {
          result += (N - 1 - index); // sticks[index] isn't counted
        }
      }
    }
    
    System.out.println(result);
  }
  
  static int binarySearch(int[] sticks, int minL, int lo, int hi) {
    int mid = (lo + hi)/2;
    if (sticks[mid] == minL) return mid;
    if (sticks[mid] > minL) return binarySearch(sticks, minL, lo, mid - 1);
    return binarySearch(sticks, minL, mid + 1, hi);
  }
}

class FastReader {
  BufferedReader br;
  StringTokenizer st;

  public FastReader() {
    br = new BufferedReader(new
        InputStreamReader(System.in));
  }

  String next() {
    while (st == null || !st.hasMoreElements())
    {
      try
      {
        st = new StringTokenizer(br.readLine());
      }
      catch (IOException e)
      {
        e.printStackTrace();
      }
    }
    return st.nextToken();
  }

  int nextInt() {
    return Integer.parseInt(next());
  }

  long nextLong() {
    return Long.parseLong(next());
  }

  double nextDouble() {
    return Double.parseDouble(next());
  }

  String nextLine() {
    String str = "";
    try {
      str = br.readLine();
    }
    catch (IOException e) {
      e.printStackTrace();
    }
    return str;
  }
}

Compiler output:
Main.java:15: error: cannot find symbol
    Arrays.sort(sticks); // sort sticks in ascending order
    ^
  symbol:   variable Arrays
  location: class Main
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
  public static void main(String [] args) {
    FastReader fr = new FastReader();
    int N = fr.nextInt();
    int sticks = new int[N];
    for (int i = 0; i < N; i++) {
      sticks[i] = fr.nextInt();
    }
    
    Arrays.sort(sticks); // sort sticks in ascending order
    
    int result = 0;
    for (int i = N - 1; i >= 2; i--) {
      for (int j = i - 1; j >= 1; j--) {
        int minL = sticks[i] - sticks[j];
        int index = binarySearch(sticks, minL, 0, j - 1);
        if (sticks[index] > minL) {
          result += (N - index); // sticks[index] is also counted
        } else {
          result += (N - 1 - index); // sticks[index] isn't counted
        }
      }
    }
    
    System.out.println(result);
  }
  
  static int binarySearch(int[] sticks, int minL, int lo, int hi) {
    int mid = (lo + hi)/2;
    if (sticks[mid] == minL) return mid;
    if (sticks[mid] > minL) return binarySearch(sticks, minL, lo, mid - 1);
    return binarySearch(sticks, minL, mid + 1, hi);
  }
}

class FastReader {
  BufferedReader br;
  StringTokenizer st;

  public FastReader() {
    br = new BufferedReader(new
        InputStreamReader(System.in));
  }

  String next() {
    while (st == null || !st.hasMoreElements())
    {
      try
      {
        st = new StringTokenizer(br.readLine());
      }
      catch (IOException e)
      {
        e.printStackTrace();
      }
    }
    return st.nextToken();
  }

  int nextInt() {
    return Integer.parseInt(next());
  }

  long nextLong() {
    return Long.parseLong(next());
  }

  double nextDouble() {
    return Double.parseDouble(next());
  }

  String nextLine() {
    String str = "";
    try {
      str = br.readLine();
    }
    catch (IOException e) {
      e.printStackTrace();
    }
    return str;
  }
}

Compiler output:
Main.java:10: error: incompatible types: int[] cannot be converted to int
    int sticks = new int[N];
                 ^
Main.java:12: error: array required, but int found
      sticks[i] = fr.nextInt();
            ^
Main.java:15: error: cannot find symbol
    Arrays.sort(sticks); // sort sticks in ascending order
    ^
  symbol:   variable Arrays
  location: class Main
Main.java:20: error: array required, but int found
        int minL = sticks[i] - sticks[j];
                         ^
Main.java:20: error: array required, but int found
        int minL = sticks[i] - sticks[j];
                                     ^
Main.java:21: error: incompatible types: int cannot be converted to int[]
        int index = binarySearch(sticks, minL, 0, j - 1);
                                 ^
Main.java:22: error: array required, but int found
        if (sticks[index] > minL) {
                  ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
7 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
  public static void main(String [] args) {
    FastReader fr = new FastReader();
    int N = fr.nextInt();
    int sticks = new int[N];
    for (int i = 0; i < N; i++) {
      sticks[i] = fr.nextInt();
    }
    
    Arrays.sort(sticks); // sort sticks in ascending order
    
    int result = 0;
    for (int i = N - 1; i >= 2; i--) {
      for (int j = i - 1; j >= 1; j--) {
        int minL = sticks[i] - sticks[j];
        int index = binarySearch(sticks, minL, 0, j - 1);
        if (sticks[index] > minL) {
          result += (N - index); // sticks[index] is also counted
        } else {
          result += (N - 1 - index); // sticks[index] isn't counted
        }
      }
    }
    
    System.out.println(result);
  }
  
  static int binarySearch(int[] sticks, int minL, int lo, int hi) {
    int mid = (lo + hi)/2;
    if (sticks[mid] == minL) return mid;
    if (sticks[mid] > minL) return binarySearch(sticks, minL, lo, mid - 1);
    return binarySearch(sticks, minL, mid + 1, hi);
  }
}

class FastReader {
  BufferedReader br;
  StringTokenizer st;

  public FastReader() {
    br = new BufferedReader(new
        InputStreamReader(System.in));
  }

  String next() {
    while (st == null || !st.hasMoreElements())
    {
      try
      {
        st = new StringTokenizer(br.readLine());
      }
      catch (IOException e)
      {
        e.printStackTrace();
      }
    }
    return st.nextToken();
  }

  int nextInt() {
    return Integer.parseInt(next());
  }

  long nextLong() {
    return Long.parseLong(next());
  }

  double nextDouble() {
    return Double.parseDouble(next());
  }

  char nextChar() {
    return Character.
  }

  String nextLine() {
    String str = "";
    try {
      str = br.readLine();
    }
    catch (IOException e) {
      e.printStackTrace();
    }
    return str;
  }
}

Compiler output:
Main.java:78: error: <identifier> expected
    return Character.
                     ^
1 error
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class D_Triangles {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		//標準入力取得
		int num = sc.nextInt();
		int edge[] = new int[num];
		for (int i = 0; i < num; i++) {
			edge[i] = sc.nextInt();
		}

		Arrays.sort(edge);

		int triangle = 0;
		for (int i = 0; i < num - 2; i++) {
			for (int j = i + 1; j < num - 1; j++) {
				for (int k = j + 1; k < num; k++) {
					if (condition(edge[i], edge[j], edge[k])) {
						triangle++;
					} else {
						break;
					}
				}
			}
		}
		System.out.println(triangle);

		sc.close();

	}

	private static boolean condition(int i, int j, int k) {
		boolean result = false;

		if (i < j + k && j < k + i && k < i + j) {
			result = true;
		}
		return result;
	}

}


Compiler output:
Main.java:4: error: class D_Triangles is public, should be declared in a file named D_Triangles.java
public class D_Triangles {
       ^
1 error
Language: Java

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		//標準入力取得
		int num = sc.nextInt();
		int edge[] = new int[num];
		for (int i = 0; i < num; i++) {
			edge[i] = sc.nextInt();
		}

		Arrays.sort(edge);

		int triangle = 0;
		for (int i = 0; i < num - 2; i++) {
			for (int j = i + 1; j < num - 1; j++) {
				for (int k = j + 1; k < num; k++) {
					if (condition(edge[i], edge[j], edge[k])) {
						triangle++;
					} else {
						break;
					}
				}
			}
		}
		System.out.println(triangle);

		sc.close();

	}

	private static boolean condition(int i, int j, int k) {
		boolean result = false;

		if (i < j + k && j < k + i && k < i + j) {
			result = true;
		}
		return result;
	}

}


Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:13: error: cannot find symbol
		Arrays.sort(edge);
		^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: C++

#include <iostream>
#include <vector>
#include <tuple>

int main(){
  int N;
  std::cin >> N;
  std::vector<int> L_arr(N);
  for(int i = 0; i < N; i++) std::cin >> L_arr[i];

  std::sort(L_arr.begin(), L_arr.end());

  long long int n_count = 0;
  for(int i = 2; i < N; i++){
    for(int j = 1; j < i; j++){
      int low_limit = L_arr[i]-L_arr[j];
      int nc = std::distance(std::upper_bound(L_arr.begin(), L_arr.end(), low_limit), L_arr.begin()+j);
      if(nc > 0) n_count += nc;
    }
  }

  std::cout << n_count << std::endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   11 |   std::sort(L_arr.begin(), L_arr.end());
      |        ^~~~
      |        qsort
a.cc:17:35: error: 'upper_bound' is not a member of 'std'; did you mean 'lower_bound'?
   17 |       int nc = std::distance(std::upper_bound(L_arr.begin(), L_arr.end(), low_limit), L_arr.begin()+j);
      |                                   ^~~~~~~~~~~
      |                                   lower_bound
Language: C++

#include<vector>
#include<iostream>
#include<algorithm>
#include<functional>
#include<string>
#include<limits.h>
#include<cmath>
#include<queue>
#include<map>
#define rep(i,n) for (int i=0; i<n; i++)
using namespace std;
typedef long long ll;

ll gcd(ll a,ll b){
  ll r;
  while ((r=a%b)){a=b;b=r;}
  return b;
}

int main(){

  int n; cin >> n;
  vector<int> l(n); rep(i,n){cin>>l[i];}

  sort(l.begin(),l.end());

  int ans=0;

  for (int low = 0; low < n-2; low++){
    for (int mid = low+1; mid < n-1; mid++){
      auto itr = lower_bound(l.begin(), l.end(), l[low]+l[mid]);
      int ng = distance(itr, l.end());
        ans += N-1-mid-ng;
    }
  }

  cout << ans;


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:16: error: 'N' was not declared in this scope
   33 |         ans += N-1-mid-ng;
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> L(N);
  for(int i=0;i<N;i++)
    cin >> L.at(i);
  sort(L.begin(),L.end());
  
  int ans=0;
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++){
      auto itr = lower_bound(L.begin(),L.end(),L.at(i)+L.at(j))
      int a =distance(L.begin(),itr)-1;
      ans+=a;
    }
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: expected ',' or ';' before 'int'
   16 |       int a =distance(L.begin(),itr)-1;
      |       ^~~
a.cc:17:12: error: 'a' was not declared in this scope
   17 |       ans+=a;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> L(N);
  for(int i=0;i<N;i++)
    cin >> L.at(i);
  sort(L.begin(),L.end());
  
  int ans=0;
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++){
      auto itr = lower_bound(L.begin(),L.end(),L(i)+L(j))
      int a =distance(L.begin(),itr)-1;
      ans+=a;
    }
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:49: error: no match for call to '(std::vector<int>) (int&)'
   15 |       auto itr = lower_bound(L.begin(),L.end(),L(i)+L(j))
      |                                                ~^~~
a.cc:15:54: error: no match for call to '(std::vector<int>) (int&)'
   15 |       auto itr = lower_bound(L.begin(),L.end(),L(i)+L(j))
      |                                                     ~^~~
a.cc:17:12: error: 'a' was not declared in this scope
   17 |       ans+=a;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int l;
  cin >> l;
  int arr[l];
  for (int i = 0; i < l; i++){
    cin >> arr[i];
  }
  int t = 0;
  for (int a = 0; a < l; a++){
    for (int b = a + 1; b < l; b++){
      for (int c = b + 1; c < l; c++){
        aa = arr[a];
        ab = arr[b];
        ac = arr[c];
        
        if (aa < ab + ac && ab < aa + ac && ac < ab + ac){
          t++;
        }
  }
  cout << t;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'aa' was not declared in this scope; did you mean 'a'?
   14 |         aa = arr[a];
      |         ^~
      |         a
a.cc:15:9: error: 'ab' was not declared in this scope; did you mean 'b'?
   15 |         ab = arr[b];
      |         ^~
      |         b
a.cc:16:9: error: 'ac' was not declared in this scope; did you mean 'c'?
   16 |         ac = arr[c];
      |         ^~
      |         c
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:11:30: note: to match this '{'
   11 |   for (int a = 0; a < l; a++){
      |                              ^
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

from bisect import bisect_left

N = int(input())
L = list(map(int, input().split()))
L = sorted(L)

res = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        idx = bisect_left(L[j+1:], L[i]+L[j])
        res += idx

print(res)

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from bisect import bisect_left
      | ^~~~
Language: Java

import java.util.*;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int N = sc.nextInt();
        int[] L = new int[N + 1];
        for (int i = 0; i < N; i++) {
            L[i] = sc.nextInt();
        }
        L[N] = 10000;
        Arrays.sort(L);

        int cnt = 0;
        for (int i=0; i<N-2; i++){
          for (int j=0; j<N-1; j++){
            int sum = L[i] + L[j];

           for (int k=0; k<N; k++){
             if (sum>L[k]){
               cnt++;
             }
           }
         }
       }
       System.out.println(cnt)
    }
}

Compiler output:
Main.java:28: error: ';' expected
       System.out.println(cnt)
                              ^
1 error
Language: C++

import numpy as np

L_MAX = 3000 + 7

N = int(input())
L = list(map(lambda x: int(x), input().split(" ")))
L = sorted(L)

cnt = np.array([0 for i in range(L_MAX)])
for i in range(N):
  cnt[L[i]] += 1

s = np.cumsum(cnt)

ans = 0
for i in range(N):
  for j in range(N):
    if i == j: continue

    a = L[i]
    b = L[j]

    c_min = abs(a-b)
    c_max = abs(a+b)

    add = s[c_max-1] - s[c_min]

    if c_min < a < c_max: add -= 1
    if c_min < b < c_max: add -= 1

    ans += add

print(ans // 6)


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import numpy as np
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<int> vec(n);
  for(int i=0;i<n;i++){
    cin >> vec.at(i);
  }
  int ans=0;
  reverse.sort(vec.begin(),vec.end());
  for(int i=2;i<n;i++){
    if(vec.at(1)+vec.at(i)>vec.at(0)){
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: overloaded function with no contextual type information
   12 |   reverse.sort(vec.begin(),vec.end());
      |           ^~~~
Language: C++

#include<iostream>
using namespace std;
int p(int a,int b,int c){
        if(a+b>c&&a+c>b&&b+c>a){
            return 1;
        }
    return 0;
}
    
int main(){
    int n,a[100001];
    cin>>n;
    for(int i=1;i<n+1;i++){
        cin>>a[i];
    }
    int ans=0;
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            int it=lower_bound(a+1, a+n+1, a[i]+a[j])-a-2;
            if(it-j+1>0){
                ans+=it-j+1;
            }
        }
    }
    cout<<ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |     sort(a+1,a+n+1);
      |     ^~~~
      |     short
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a[10005],n,ans;
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i];
    for(int i=0;i<n-2;i++){
        if(a[i]+a[i+1]>a[i+2]&&a[i]+a[i+2]>a[i+1]&&a[i+1]a[i+2]>a[i]){
            ans++;
        }
    }
    cout<<ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:58: error: expected ')' before 'a'
    8 |         if(a[i]+a[i+1]>a[i+2]&&a[i]+a[i+2]>a[i+1]&&a[i+1]a[i+2]>a[i]){
      |           ~                                              ^
      |                                                          )
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> L.at(N);
  for(i=0;i<N;i++)
    cin >> L.at(i);
  int ans=0;
  for(i=0;i<N-2;i++){
    for(j=i+1;j<N-1;j++){
      for(k=j+1;k<N;k++){
        if(L.at(i)<L.at(j)+L.at(k) && L.at(j)<L.at(i)+L.at(k) && L.at(k)<L.at(i)+L.at(j))
          ans++;
      }
    }
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected initializer before '.' token
    7 |   vector<int> L.at(N);
      |                ^
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<N;i++)
      |       ^
a.cc:9:12: error: 'L' was not declared in this scope
    9 |     cin >> L.at(i);
      |            ^
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<N-2;i++){
      |       ^
a.cc:12:9: error: 'j' was not declared in this scope
   12 |     for(j=i+1;j<N-1;j++){
      |         ^
a.cc:13:11: error: 'k' was not declared in this scope
   13 |       for(k=j+1;k<N;k++){
      |           ^
a.cc:14:12: error: 'L' was not declared in this scope
   14 |         if(L.at(i)<L.at(j)+L.at(k) && L.at(j)<L.at(i)+L.at(k) && L.at(k)<L.at(i)+L.at(j))
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
constexpr int64_t mod=1e9+7;

int main()
{
  int n;
  cin>>n;
  vector<int> l(n);
  for(auto&& e:l)
  {
    cin>>e;
  }
  sort(l.begin(), l.end());
  ll ans = 0;
  for (int i = n-1; i >= 0; --i)
  {
    for (int j = i-1; j >= 0; --j)
    {
      auto itr = lower_bound(l.begin(), l.end(),l[i]+l[j]);
      ans += n-1-i - distance(itr,l.end());
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'll' was not declared in this scope; did you mean 'l'?
   15 |   ll ans = 0;
      |   ^~
      |   l
a.cc:21:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |       ans += n-1-i - distance(itr,l.end());
      |       ^~~
      |       abs
a.cc:24:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <map>
#define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
using namespace std;

int n, L[2010], sa, c;

int main(){
	cin >> n;
	rep(i, n) cin >> L[i];
	sort(L, L + n);
	rep(i, n){
		REP(j, i + 1, n){
			sa = i + j - 1;
			c += lower_bound(L.begin(), L.end(), sa);



		}
	}




}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:44: error: request for member 'begin' in 'L', which is of non-class type 'int [2010]'
   20 |                         c += lower_bound(L.begin(), L.end(), sa);
      |                                            ^~~~~
a.cc:20:55: error: request for member 'end' in 'L', which is of non-class type 'int [2010]'
   20 |                         c += lower_bound(L.begin(), L.end(), sa);
      |                                                       ^~~
Language: C++

#include<iostream>
#include<vector>
//imit
using namespace std;
int main(void){
    int n;
    cin >> n;
    vector<int> L(n);
    for(int i = 0;i < n;i++){
        cin >> L[i];
    }
    sort(L.begin(),L.end());
    long ans = 0;
    for(int a = 0;a < n - 1;a++){
        for(int b = a + 1;b < n;b++){
            int ab = L[a] + L[b];//AとBの和
            int r = lower_bound(L.begin(),L.end(),ab) - L.begin();//C < A + B となりうるCの最大値の位置
            int l = b + 1;//最小値
            ans += max(0,r - l);
        }
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |     sort(L.begin(),L.end());
      |     ^~~~
      |     short
Language: C++

#include<iostream>
#include<vector>
//imit
using namespace std;
int main(void){
    int n;
    cin >> n;
    vector<int> L(n);
    for(int i = 0;i < n;i++){
        cin >> L[i];
    }
    sort(L.begin(),L.end());//昇順ににソート
    int ans = 0;
    for(int a = 0;a < n - 1;a++){
        for(int b = a + 1;b < n;b++){
            int ab = L[a] + L[b];//AとBの和
            int r = lower_bound(L.begin(),L.end(),ab) - L.begin();//
            int l = b + 1;//
            ans += max(0,r - l);
        }
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |     sort(L.begin(),L.end());//昇順ににソート
      |     ^~~~
      |     short
Language: C++

#include<bits/stdc++.h>
 
#define REP(i,s,N) for (int i=s;i<(N); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;


ll ans=0;

int main(){
	ll N;
	cin >> N;
	vector<ll> L(N);
	REP(i,0,N) cin >> L[i];
	sort(L.begin(),L.end());
	REP(low,0,N){
		REP(mid,low+1,N){
			ab = L[low] + L[mid];
			auto itr = lower_bound(L.begin(),L.end(),ab)-L.begin();
			ans += itr - mid +1;
		}
	}
	
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: 'ab' was not declared in this scope; did you mean 'abs'?
   19 |                         ab = L[low] + L[mid];
      |                         ^~
      |                         abs
Language: C++

///*******
//
///HR_Bappy
//
///*******

#include<bits/stdc++.h>
#define pb push_back
#define mkp make_pair
#define maxx 1000000005
#define MOD 1000003
#define sf(n) scanf("%lld", &n);
#define sff(n,m) scanf("%lld %lld", &n, &m)
#define pf(n) printf("%lld\n", n)
#define pff(n,m) printf("%lld %lld\n", n, m)
#define mem(a) memset(a, 0, sizeof(a))
#define fr(i,n) for(ll i=0; i<n; i++)
#define my_sizeof(type) ((char *)(&type+1)-(char*)(&type))
#define pi 2*acos(0.0)
#define F first
#define S second
#define EPS 1e-9

using namespace std;
typedef long long ll;
typedef unsigned long long ull;

void Cnttri(vector <int> v){

    int n=A.size();

    sort(v.begin(), v.end());

    int c = 0;

    for( int i = n-1; i >= 1; i--){
        int l = 0, r = i-1;
        while( l < r){
            if( v[l] + v[r] > v[i]){


                c += r - l ;
                r--;
            }
            else

                l++;
        }
    }
    cout<<c << endl;;
}
int main(){

    int n;
    cin >>n;
    vector<int>v;
    for(int i = 0 ; i < n; i++){
        int a;
        cin >> a;
        v.pb(a);
    }

    Cnttri(v);

}


Compiler output:
a.cc: In function 'void Cnttri(std::vector<int>)':
a.cc:30:11: error: 'A' was not declared in this scope
   30 |     int n=A.size();
      |           ^
Language: C++

#include<bits/stdc++.h>
 
#define REPI(i, n) for(int i = 0; i < n; i++)
#define REPJ(j, n) for(int j = 0; j < n; j++)
 
using ll = long long;
using namespace std;
 
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
 
    ll n, ans = 0; cin >> n;
    int a[n]; REPI(i, n) cin >> a[i];
 
    sort(a, a + n, greater);
 
    for(ll i = 0; i < n - 2; i++)
        for(ll j = i + 1; j < n - 1; j++)
            for(ll k = j + 1; k < n; k++)
                if(a[j] < a[k] + a[i] && a[k] < a[i] + a[j])
                    ans++;
 
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:27: error: missing template arguments before ')' token
   16 |     sort(a, a + n, greater);
      |                           ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <map>
#include <functional>
#include <cmath>
#include <windows.h>

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);

	int n, l[3000];
	int cnt = 0;
	int i, j, k;

	cin >> n;
	for (i = 0; i < n; i++)
		cin >> l[i];

	

	for (i = 0; i < n; i++)
	{
		for (j = i+1; j < n; j++)
		{
			for (k = j+1; k < n; k++)
			{
				if (l[i] < l[j] + l[k])
					if (l[j] < l[i] + l[k])
						if (l[k] < l[j] + l[i])
							cnt++;
			}
		}
	}
	cout << cnt << endl;
	return 0;
}


Compiler output:
a.cc:9:10: fatal error: windows.h: No such file or directory
    9 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.