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

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

int hanndann(int,int,int);

int main(){
    int N,I=0,J=1,K=2,sum=0;
    cin >> N;
    vector<int>v(N);
    for (int i = 0; i < N; i++){
        cin >> v.at(i);
    }
    for (int i = I; i < N-2; i++){
        for (int j = J; j < N-1; j++){
            for (int k = K; k < N; k++){
                sum += hanndann(v.at(i),v.at(j),v.at(k));
            }
            K++;
        }
        J++;
    }
    cout << sum << endl;
    return 0;
}

int hanndann(int i,int j,int k){
    if (i < j+k){
        if (j < i+k){
            if (k < i+j){
                return 1;
            }
        }
    }
    return;
}

Compiler output:
a.cc: In function 'int hanndann(int, int, int)':
a.cc:34:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   34 |     return;
      |     ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <stdio.h>

using namespace std;

#define LL long long
#define FOR(i,l,r) for(int i = l; i <= r; ++i)
#define REP(i,l,r) for(int i = l; i < r; ++i)

int N;
int A[2345];
string s;

int count(int x){
    int l = 1,r = N;
    while(l + 1 < r){
        int mid = (l + r)/2;
        if(A[mid] <= x) l = mid;
        else r = mid - 1;
    }
    for(int i = r; i >= l; --i) if(A[mid] <= x) return mid;
    return 0;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie();
    cout.tie();
    //
    cin >> N;
    FOR(i,1,N) cin >> A[i];
    sort(A + 1,A + 1 + N);
    //
    int res = 0;
    FOR(j,2,N) FOR(k,j + 1,N){
        res += max(0,count(A[j] - 1) - count(A[k] - A[i]));
    }

    cout << res;

    return 0;

}

Compiler output:
a.cc: In function 'int count(int)':
a.cc:22:38: error: 'mid' was not declared in this scope
   22 |     for(int i = r; i >= l; --i) if(A[mid] <= x) return mid;
      |                                      ^~~
a.cc: In function 'int main()':
a.cc:36:55: error: 'i' was not declared in this scope
   36 |         res += max(0,count(A[j] - 1) - count(A[k] - A[i]));
      |                                                       ^
Language: C++

#include <iostream>
#include <algorithm>
#include <stdio.h>

using namespace std;

#define LL long long
#define FOR(i,l,r) for(int i = l; i <= r; ++i)
#define REP(i,l,r) for(int i = l; i < r; ++i)

int N;
string s;

int count(int x){
    int l = 1,r = N;
    while(l + 1 < r){
        int mid = (l + r)/2;
        if(A[mid] <= x) l = mid;
        else r = mid - 1;
    }
    for(int i = r; i >= l; --i) if(A[mid] <= x) return mid;
    return 0;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie();
    cout.tie();
    //
    cin >> N;
    FOR(i,1,N) cin >> A[i];
    sort(A + 1,A + 1 + N);
    //
    int res = 0;
    FOR(i,2,N) FOR(j,i + 1,N){
        res += max(0,count(A[j] - 1) - count(A[k] - A[i]));
    }

    cout << res;

    return 0;

}

Compiler output:
a.cc: In function 'int count(int)':
a.cc:18:12: error: 'A' was not declared in this scope
   18 |         if(A[mid] <= x) l = mid;
      |            ^
a.cc:21:36: error: 'A' was not declared in this scope
   21 |     for(int i = r; i >= l; --i) if(A[mid] <= x) return mid;
      |                                    ^
a.cc:21:38: error: 'mid' was not declared in this scope
   21 |     for(int i = r; i >= l; --i) if(A[mid] <= x) return mid;
      |                                      ^~~
a.cc: In function 'int main()':
a.cc:30:23: error: 'A' was not declared in this scope
   30 |     FOR(i,1,N) cin >> A[i];
      |                       ^
a.cc:31:10: error: 'A' was not declared in this scope
   31 |     sort(A + 1,A + 1 + N);
      |          ^
a.cc:35:48: error: 'k' was not declared in this scope
   35 |         res += max(0,count(A[j] - 1) - count(A[k] - A[i]));
      |                                                ^
Language: C++

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

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>>n;
      |     ^~~
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<ll> l(n);
      |     ^~~~~~
a.cc:3:12: error: expected primary-expression before 'long'
    3 | #define ll long long
      |            ^~~~
a.cc:9:12: note: in expansion of macro 'll'
    9 |     vector<ll> l(n);
      |            ^~
a.cc:10:27: error: 'l' was not declared in this scope
   10 |     for(i=0;i<n;i++) cin>>l[i];
      |                           ^
a.cc:11:10: error: 'l' was not declared in this scope
   11 |     sort(l.begin(),l.end());
      |          ^
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |     sort(l.begin(),l.end());
      |     ^~~~
      |     short
a.cc:17:19: error: 'lower_bound' was not declared in this scope
   17 |             ans+=(lower_bound(l.begin(), l.end(), tmp)-l.begin()-i-1);
      |                   ^~~~~~~~~~~
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout<<ans;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
typedef long long ll;
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> L(n);
  rep(i,n) cin >> L[i];
  sort(L.begin(), L.end());
  rep(b,n)rep(a,b) {
    int ab = L[a]+L[b];
    int r = lower_bound(L.begin(), L.end(), ab) - L.begin();
    int l = b+1;
    ans += r-l;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |     ans += r-l;
      |     ^~~
      |     abs
a.cc:18:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |   cout << ans << endl;
      |           ^~~
      |           abs
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 = upper_bound(L.begin(),L.end(),ab);
			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++

#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 a = 0; a < n; a++){
    for (int b = 0; b < a; b++){
      int ab = l[a] + l[b];
      int i = lower_bound(l.begin() -l.end(), ab) - l.begin();
      int L = b + 1;
      ans += max(0, i - L);
    }
  }
  cout << ans << endl;
}
    
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:26: error: no matching function for call to 'lower_bound(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, int&)'
   17 |       int i = lower_bound(l.begin() -l.end(), ab) - l.begin();
      |               ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
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:1530:5: note: candidate: 'template<class _ForwardIterator, class _Tp> _ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&)'
 1530 |     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1530: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:1963:5: note: candidate: 'template<class _FIter, class _Tp, class _Compare> _FIter std::lower_bound(_FIter, _FIter, const _Tp&, _Compare)'
 1963 |     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1963:5: note:   candidate expects 4 arguments, 2 provided
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 a = 0; a < n; a++){
    for (int b = 0; b < a; b++){
      int ab = l[a] + l[b];
      int i = lower_bound(l.begin() -l.end(), ab) - l.bedin();
      int L = b + 1;
      ans += max(0, i - L);
    }
  }
  cout << ans << endl;
}
    
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:26: error: no matching function for call to 'lower_bound(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, int&)'
   17 |       int i = lower_bound(l.begin() -l.end(), ab) - l.bedin();
      |               ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
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:1530:5: note: candidate: 'template<class _ForwardIterator, class _Tp> _ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&)'
 1530 |     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1530: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:1963:5: note: candidate: 'template<class _FIter, class _Tp, class _Compare> _FIter std::lower_bound(_FIter, _FIter, const _Tp&, _Compare)'
 1963 |     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1963:5: note:   candidate expects 4 arguments, 2 provided
a.cc:17:55: error: 'class std::vector<int>' has no member named 'bedin'; did you mean 'begin'?
   17 |       int i = lower_bound(l.begin() -l.end(), ab) - l.bedin();
      |                                                       ^~~~~
      |                                                       begin
Language: C++

#include <iostream>
#include <vector>
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 a = 0; a < n; a++){
    for (int b = 0; b < a; b++){
      int ab = l[a] + l[b];
      int i = lower_bound(l.begin() -l.end(), ab) - l.bedin();
      int L = b + 1;
      ans += max(0, i - L);
    }
  }
  cout << ans << endl;
}
    
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |   sort(l.begin(), l.end());
      |   ^~~~
      |   short
a.cc:17:26: error: no matching function for call to 'lower_bound(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, int&)'
   17 |       int i = lower_bound(l.begin() -l.end(), ab) - l.bedin();
      |               ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 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/stl_algobase.h:1530:5: note: candidate: 'template<class _ForwardIterator, class _Tp> _ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&)'
 1530 |     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1530:5: note:   candidate expects 3 arguments, 2 provided
a.cc:17:55: error: 'class std::vector<int>' has no member named 'bedin'; did you mean 'begin'?
   17 |       int i = lower_bound(l.begin() -l.end(), ab) - l.bedin();
      |                                                       ^~~~~
      |                                                       begin
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <tuple>
#include <bits/stdc++.h>
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;

//素因数分解
vector<pair<ll,int>> factorize(ll n){
    vector<pair<ll,int>>res;
    for(ll i=2;i*i<=n;i++){
        if(n%i)continue;
        res.emplace_back(i,0);
        while (n%i == 0)
        {
        n /= i;
        res.back().second++;
        }
        
    }
    if(n != 1) res.emplace_back(n,1);
    return res;
}

int main(){
    int N;
    cin >> N;
    vector<long long> L(N);
    REP(i,N)cin >> L[i];
    sort(L.begin(),L.end());

    ll res = 0;

    REP(i,N){
        for(int j=i+1;j<N;j++){
            int k = lower_bound(L.begin(),L.end(),L[i] + L[j]) ;
            res += max(k - (j+1),0);
        }
    }
    cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:32: error: cannot convert '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' to 'int' in initialization
   39 |             int k = lower_bound(L.begin(),L.end(),L[i] + L[j]) ;
      |                     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                |
      |                                __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >
Language: C

#include <cstdio>
#include <iostream>
#include <iomanip>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <limits>
#include <numeric>
#include <queue>
#include <cmath>
#include <set>
#include <map>

using namespace std;

#define INFint (1<<30)
#define BOUND 27182818284
#define MAT 2

typedef long long ll;
typedef long long int lli;
typedef pair<ll, ll> P;

ll MOD = 1000000007;
const ll INF = (1ll<<60);
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for(int i=int(a);i<int(b);++i)

template<class T>
bool umax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool umin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

// gcd
template<typename T>
T gcd(T a, T b) {
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

int findGCD(int arr[], int n) {
    int result = arr[0];
    for (int i = 1; i < n; i++)
        result = gcd(arr[i], result);
    return result;
}

template<typename T>
T lcm(T m, T n) {
    // 引数に0がある場合は0を返す
    if ((0 == m) || (0 == n))
        return 0;
    return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    fill((T *) array, (T *) (array + N), val);
}


int dx[5] = {1, 0, -1, 0};
int dy[5] = {0, 1, 0, -1};

// v.front() = -BOUND;
// v.back() = BOUND;

//struct edge{
//    int cost, to;
//
//    edge(int in_cost, int in_to){
//        cost=in_cost;
//        to=in_to;
//    }
//    bool operator<(const edge &a) const
//    {
//        return cost > a.cost;
//    }
//};

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 i=N-1; i>=2; i--){
        for(int j=i-1; j>=1; j--){
            auto itr
            = upper_bound(L.begin(), L.begin()+j, L[i]-L[j]);
            ans+=((L.begin()+j)-itr);
        }
    }

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

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
import java.util.ArrayList;

public class Main {
    public static void main(String[] args) throws Exception {
        // 宣言
        Scanner sc  = new Scanner(System.in);
        int count = 0;
        ArrayList<Integer> lists = new ArrayList<>();
        // 入力値取得
        int rod = sc.nextInt();
        int lens[] = new int[rod];
        while(sc.hasNext()){
            lens[count] = sc.nextInt();
            count++;
        }
        
        Array.sort(lens);
        // 組み合わせ抽出処理
        for(int i=0;i<lens.length;i++){
            for(int j=i+1;j<lens.length;j++){
                for(int k=j+1;k<lens.length;k++){
                    if( (lens[i] < (lens[j] + lens[k])) && (lens[j] < (lens[k] + lens[i])) && (lens[k] < (lens[i] + lens[j])) ){
                        count++;                        
                    }
                    
                }
            }
        }
        System.out.println(count);
    }
}


Compiler output:
Main.java:18: error: cannot find symbol
        Array.sort(lens);
        ^
  symbol:   variable Array
  location: class Main
1 error
Language: C++

#pragma warning(disable: 4996)
#define _USE_MATH_DEFINES
#include <iostream>
#include <unordered_map>
#include <functional>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <bitset>
using namespace std;

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

	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 b = 0; b < N; b++)
	{
		for (int a = 0; a < b; a++)
		{
			int ab = L[a] + L[b];
			int r = lower_bound(L.begin(), L.end(), ab) - L.begin();
			int l = b + 1;
			ans += r - l;
		}
	}
	cout << ans << endl;
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:38:18: error: expected '}' at end of input
   38 |         return 0;
      |                  ^
a.cc:13:16: note: to match this '{'
   13 | int main(void) {
      |                ^
Language: C++

import bisect

n = int(input())
d = list(map(int, input().split()))
d.sort()

m = 0

for a in range(n-2):
	for b in range(a+1,n-1):
		m+=bisect.bisect_left(d,d[a]+d[b])-1-j

print(m)

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0;i < (int)(n);i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n);i++)
#define ALL(a)  (a).begin(),(a).end()

int upper_bound_place_2(vector<int> a, int key){
if(key >= a[a.size()-1])
  return -1;
  else{
  
int ret = upper_bound(ALL(a), key) - a.begin();
    return ret;
  
  }
  return 0;
}


int main(){
int N;
cin >> N;
vector<int> l(N);
rep(i,N)
cin >> l.at(i);
int a, b, c;
long long int ans =0;
  int sk=0;
  int kari=0;

sort(l.begin(), l.end());
  rep(i,N-2){
  rep2(j, i+1, N-1){
    su= l[i]+l[j];
  int pl = upper_bound_place_2(l,su);
    if(pl!=-1){
    ans+=l.size()-pl;
    }
  } 
  }
cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:5: error: 'su' was not declared in this scope; did you mean 'sk'?
   34 |     su= l[i]+l[j];
      |     ^~
      |     sk
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vetor' was not declared in this scope
    6 |   vetor<int>bo(N);
      |   ^~~~~
a.cc:6:9: error: expected primary-expression before 'int'
    6 |   vetor<int>bo(N);
      |         ^~~
a.cc:9:12: error: 'bo' was not declared in this scope
    9 |     cin >> bo[i];
      |            ^~
a.cc:13:8: error: 'bo' was not declared in this scope
   13 |   sort(bo.begin(), bo.end());
      |        ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define M 1000000007
#define all(a) (a).begin(),(a).end()
#define rep(i,n) reps(i,0,n)
#define reps(i,m,n) for(int i=(m);i<(n);i++)
int main(){
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected '}' at end of input
    9 | int main(){
      |           ~^
Language: C++

#include <cstdio>
#include <cstdint>
#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
using u16 = uint16_t;
using uint = uint32_t;

u16 n;
uint ans;
u16 a[2000];
int main(){
  scanf("%hu", &n);
  for(uint i = 0; i < n; i++) scanf("%hu", &a[i]);
  sort(a, a + n);
  for(uint i = 0; i < n; i++) for(uint j = i + 1; j < n; j++) for(uint k = j + 1; k < n; k++) if(a[i] + a[j] > a[k]) ans++;
  printf("%u", ans);
}


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

#include <cstdio>
#include <cstdint>
#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
using u16 = uint16_t;

u16 n;
uint ans;
u16 a[2000];
int main(){
  scanf("%hu", &n);
  for(uint i = 0; i < n; i++) scanf("%hu", &a[i]);
  sort(a, a + n);
  for(uint i = 0; i < n; i++) for(uint j = i + 1; j < n; j++) for(uint k = j + 1; k < n; k++) if(a[i] + a[j] > a[k]) ans++;
  printf("%u", ans);
}


Compiler output:
a.cc:10:1: error: 'uint' does not name a type; did you mean 'int'?
   10 | uint ans;
      | ^~~~
      | int
a.cc: In function 'int main()':
a.cc:14:7: error: 'uint' was not declared in this scope; did you mean 'int'?
   14 |   for(uint i = 0; i < n; i++) scanf("%hu", &a[i]);
      |       ^~~~
      |       int
a.cc:14:19: error: 'i' was not declared in this scope
   14 |   for(uint i = 0; i < n; i++) scanf("%hu", &a[i]);
      |                   ^
a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |   sort(a, a + n);
      |   ^~~~
      |   short
a.cc:16:7: error: 'uint' was not declared in this scope; did you mean 'int'?
   16 |   for(uint i = 0; i < n; i++) for(uint j = i + 1; j < n; j++) for(uint k = j + 1; k < n; k++) if(a[i] + a[j] > a[k]) ans++;
      |       ^~~~
      |       int
a.cc:16:19: error: 'i' was not declared in this scope
   16 |   for(uint i = 0; i < n; i++) for(uint j = i + 1; j < n; j++) for(uint k = j + 1; k < n; k++) if(a[i] + a[j] > a[k]) ans++;
      |                   ^
a.cc:16:39: error: expected ';' before 'j'
   16 |   for(uint i = 0; i < n; i++) for(uint j = i + 1; j < n; j++) for(uint k = j + 1; k < n; k++) if(a[i] + a[j] > a[k]) ans++;
      |                                       ^~
      |                                       ;
a.cc:16:51: error: 'j' was not declared in this scope
   16 |   for(uint i = 0; i < n; i++) for(uint j = i + 1; j < n; j++) for(uint k = j + 1; k < n; k++) if(a[i] + a[j] > a[k]) ans++;
      |                                                   ^
a.cc:16:71: error: expected ';' before 'k'
   16 |   for(uint i = 0; i < n; i++) for(uint j = i + 1; j < n; j++) for(uint k = j + 1; k < n; k++) if(a[i] + a[j] > a[k]) ans++;
      |                                                                       ^~
      |                                                                       ;
a.cc:16:83: error: 'k' was not declared in this scope
   16 |   for(uint i = 0; i < n; i++) for(uint j = i + 1; j < n; j++) for(uint k = j + 1; k < n; k++) if(a[i] + a[j] > a[k]) ans++;
      |                                                                                   ^
a.cc:16:118: error: 'ans' was not declared in this scope
   16 |   for(uint i = 0; i < n; i++) for(uint j = i + 1; j < n; j++) for(uint k = j + 1; k < n; k++) if(a[i] + a[j] > a[k]) ans++;
      |                                                                                                                      ^~~
a.cc:17:16: error: 'ans' was not declared in this scope
   17 |   printf("%u", ans);
      |                ^~~
Language: C++

// ABC143D.cpp

#include "pch.h"
#include <iostream>
#include <vector>
#include <algorithm> // sortを使う
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(), greater<int>()); // 降順にソート
	int ans = 0;
	for (int j = 0; j < (N-2); j++)
	{
		for (int k = j+1; k < (N-1); k++)
		{
			int c = L.at(j) - L.at(k);
			for (int m = k+1; m < N; m++)
			{
				if (L.at(m)>c)
				{
					ans++;
				}
			}
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc:3:10: fatal error: pch.h: No such file or directory
    3 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, s=0;
  cin >> n;
  vector<int>l(n);
  rep(i,n) cin >> l[i];
  sort(l.begin(),l.end());
  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[j]<l[i]+l[k] && l[k]<l[j]+l[i]) s++;
      }
    }
  }
  cout<<s;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   rep(i,n) cin >> l[i];
      |       ^
a.cc:7:3: error: 'rep' was not declared in this scope
    7 |   rep(i,n) cin >> l[i];
      |   ^~~
Language: C++

// https://atcoder.jp/contests/abc143/submissions?f.User=snuke
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main() {
    int n;
    cin >> n;
    vector<int> L(n);
    rep(i, n) cin >> L[i];
    sort(L.begin(), L.end()); // 入力を昇順にソート
    rep(b, n)rep(a, b) { // a と b を固定する
        int ab = L[a] + L[b];
        int r = lower_bound(L.begin(), L.end(), ab) - L.begin(); // L の中で ab 以上になる最初の要素
        int l = b + 1;
        // c = [l, r)
        ans += max(0, r-l);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |         ans += max(0, r-l);
      |         ^~~
      |         abs
a.cc:20:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: Java

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		int ans = 0;
		for(int i = 0; i < n; i++) {
			nums[i] = sc.nextInt();
		}
		Arrays.sort(nums);
		
		for(int i = 0; i < n - 2; i++) {
			for(int j = i + 1; j < n - 1; j++) {
				ans += lowerBound(nums, nums[i] + nums[j]) - j;
			}
		}
		
		
		System.out.println(ans);

	}
	public static int lowerBound(int[] A, int a) {
		int high = A.length - 1;
		int low = 0;
		while(high - low > 1) {
			int mid = (high + low) / 2;
			if(A[mid] >= a) {
				high = mid;
			} else {
				low = mid;
			}
		}
		return high;
	}


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

#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int,int> P;
using ll = long long;
using VI = vector<int>;

const int MAX = 2100;
int main(){
  long long res = 0;
  int n;cin >> n;
  vector<Int> l(n);
  rep(i,n) cin >> l[i];

  //c,s
  vector<Int> c(MAX,0),s(MAX+1,0);
  for(int i=0;i<n;i++) c[l[i]]++;
  for(int x=0;x<MAX;x++) s[x+1] = x[x] + c[x];//累積和

  //aとbを固定
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(i==j) continue;//同じものは選ばない

      //cの満たすべき値の区間を[left,right]で表す
      int left = abs(l[i]-l[j]) + 1;
      int right = l[i] + l[j];
      //累積和で個数を求める
      int count = s[right] - s[left];
      if(left<=l[i]&&l[i]<right) --count;
      if(left<=l[j] && l[j]<right) --count;
    }
  }
  cout << res/6 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:36: error: invalid types 'int[int]' for array subscript
   24 |   for(int x=0;x<MAX;x++) s[x+1] = x[x] + c[x];//累積和
      |                                    ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
  int N;
  std::vector<int> L;
  std::cin >> N;
  for (int i=0; i<N; ++i)
    std::cin >> L[i];
  std::sort(L);
  int sum = 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 (L[i]+L[j]<=L[k]) break;
        else sum +=1;
      }
  std::cout << sum << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: no matching function for call to 'sort(std::vector<int>&)'
   12 |   std::sort(L);
      |   ~~~~~~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/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:   candidate expects 2 arguments, 1 provided
/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, 1 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, 1 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, 1 provided
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector<int> v(N);
  for (int i = 0; i < N; i++) {
    cin >> v.at(i);
  }
  sort(v.begin(), v.end())
  int a=0;
  for(int i=0; i<N;i++){
    for(int j=i+1; j<N;j++){
      for(int k=j+1; k<N;k++){
        if(v.at(j)<v.at(i)+v.at(k)&&v.at(k)<v.at(j)+v.at(i)){
        a++;
        }
      }
    }
  }
  cout <<a<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: expected ';' before 'int'
   11 |   sort(v.begin(), v.end())
      |                           ^
      |                           ;
   12 |   int a=0;
      |   ~~~                      
a.cc:17:9: error: 'a' was not declared in this scope
   17 |         a++;
      |         ^
a.cc:22:10: error: 'a' was not declared in this scope
   22 |   cout <<a<<endl;
      |          ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main() {
    int n;
    cin >> n;
    vector<int> L(n);
    rep(i, n) cin >> L[i];
    sort(L.begin(), L.end()); // 入力を昇順にソート
    rep(b, n)rep(a, b) { // a と b を固定する
        int ab = a + b;
        int r = lower_bound(L.begin(), L.end(), ab) - L.begin(); // L の中で ab 以上になる最初の要素
        int l = b + 1;
        // c = [l, r)
        ans += max(0, r-l);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |         ans += max(0, r-l);
      |         ^~~
      |         abs
a.cc:19:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;


int main(){
  int n,num;
  cin >> n;
  num=0;
  vector<int> L;
  for(i=0;i<n;i++){
    cin >> L[i];
  }

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

  rep(b,n) rep(a,b){
    int ab = L[a]+L[b];
    int r = lower_bound(L.begin(),L.end(),ab)-L.begin();
    int l=b+1;
    num += max(0,r-l);
  }


  cout << num << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<n;i++){
      |       ^
Language: C++

#include<stdio.h>
int main(void) {
	int n;
	int l[1000];
	int num = 0;
	scanf("%d", &n);
	if (n < 3 || n>2 * 1000) {
		printf("0");
		return;
	}
	for (int i = 0; i < n; i++) {
		scanf("%d", &l[i]);
	}
	for (int j = 0; j < n; j++) {
		for (int k = j + 1; k < n; k++) {
			for (int m = k + 1; m < n; m++) {
				if (j == k || k == m || m == j) {
					continue;
				}
				else if (l[j] < l[k] + l[m] && l[k] < l[m] + l[j] && l[m] < l[j] + l[k]) {
					num++;
				}
			}
		}
	}
	printf("%d", num);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
    9 |                 return;
      |                 ^~~~~~
Language: C++

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

#define FOR(i, m, n) for(int (i) = (m); (i) < (n); (i)++)
#define REP(i, n) FOR(i, 0, n)
#define co(n) cout << (n) << endl
#define cosp(n) cout << (n) << ' '
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
typedef long long ll;
typedef pair<int, int> P;

const ll INF = 2e9;
const ll MOD = 1e9+7;
//const ll MOD 998244353;

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

	vector<int> l(n);
	REP(i, n) cin >> l[i];
	sort(all(l));

	ll ans = 0;
	REP(i, n-2){
		FOR(j, i+1, n-1){
			REP(k, j+1, n){
				if(l[i] + l[j] > l[k]) ans++;
				else break;
			}
		}
	}

	co(ans);

	return 0;
}


Compiler output:
a.cc:31:38: error: macro "REP" passed 3 arguments, but takes just 2
   31 |                         REP(k, j+1, n){
      |                                      ^
a.cc:5:9: note: macro "REP" defined here
    5 | #define REP(i, n) FOR(i, 0, n)
      |         ^~~
a.cc: In function 'int main()':
a.cc:31:25: error: 'REP' was not declared in this scope
   31 |                         REP(k, j+1, n){
      |                         ^~~
Language: C++

#include <iostream>
#include <vector>
#include <boost/foreach.hpp>

using namespace std;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))


void dump(vector<int>& v){
	BOOST_FOREACH(int x,v){
		cout << x << endl;
	}
}

bool is_triangle(int a,int b,int c){
	if(c<a+b){
		return true;
	}
	return false;
}

int main(){
	int n;
	cin >> n;
	
	vector<int> rods;
	int tmp,i=0;
	while(cin >> tmp){
		rods.push_back(tmp);
		i++;
		if(i>=n){
			break;
		}
	}
	sort(rods.begin(),rods.end());
	int count = 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(is_triangle(rods[i],rods[j],rods[k])){
					count++;
				}
			}
		}
	}
	cout << count << endl;
}

Compiler output:
a.cc:3:10: fatal error: boost/foreach.hpp: No such file or directory
    3 | #include <boost/foreach.hpp>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
using ll = long long;

int N;
int L[2001];
int ans;

void input(){
	cin >> N;
	rep(i, N){ cin >> L[i]; }
}
void solve(){
	sort(L, L + N);
	REP(a,0,N-2){
		REP(b,a+1,N-1){
			REP(c,b+1,N){
				if ((L[a] < L[b] + L[c]) && (L[c] < L[b] + L[a]) && (L[b] < L[c] + L[a])){
					ans++;
				}
			}
		}
	}
	cout << ans << endl;
}


int main(){
	input();
	solve();
	return 0;
}


Compiler output:
a.cc: In function 'void input()':
a.cc:24:9: error: 'cin' was not declared in this scope
   24 |         cin >> N;
      |         ^~~
a.cc:14:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   13 | #include<numeric>
  +++ |+#include <iostream>
   14 | using namespace std;
a.cc: In function 'void solve()':
a.cc:28:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   28 |         sort(L, L + N);
      |         ^~~~
      |         sqrt
a.cc:38:9: error: 'cout' was not declared in this scope
   38 |         cout << ans << endl;
      |         ^~~~
a.cc:38:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C

#include <iostream>

using namespace std;

int main(void){
  int n, l[1000];
  int i, j, k;
  int c = 0;
  
  cin >> n;
  for(i = 0; i < n; i++){
    cin >> l[i];
  }
  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] && l[j] < l[k] + l[i] && l[k] << l[i] + l[j]){
          c++;
        }
      }
    }
  }
  cout << c;
  
  return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class ABC143D {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		List<Integer> L = new ArrayList<Integer>();
		for(int i = 0;i < N;i++) {
			L.add(Integer.parseInt(sc.next()));
		}
		sc.close();

		long sum = 0;
		L.sort(Comparator.reverseOrder());

		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.get(i) <  L.get(j) + L.get(k)) {
						sum++;
					}else {
						break;
					}
				}
			}
		}
		System.out.println(sum);
	}
}

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

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
  int N; cin >> N;
  vector<long long> L(N);
  for (int i = 0; i < N; i++) cin >> L[i];
  
 sort(L.begin(), L.end());
 
 long long res = 0;
 
  for (int i = 0; i < n; i++) {
   for (int j = i + 1; j < n; j++) {
     int k = lower_bound(L.begin(), L.end(), L[i] + L[j]) - L.begin();
     res = k - (j + 1);
   }
  }
  cout << res << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: 'n' was not declared in this scope
   13 |   for (int i = 0; i < n; i++) {
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N; cin >> N;
  vector<long long> L(N);
  for (int i = 0; i < N; i++) cin >> L[i];
  
 sort(L.begin(), L.end());
 
 long long res = 0;
  
 for (int i = 0; i < N; i++) {
   int k = i;
   for (int j = i+1; j < N; j++) {
     while(k < N && L[k] < L[i] + L[j]) ++k;
     res += k - (j + 1);
   }
 }
  cout << res << endl;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:23: error: expected '}' at end of input
   19 |   cout << res << endl;
      |                       ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

#include "bits/stdc++.h"
 
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const ll INF = 1LL << 60;
 
int main(){
 
  ll n;cin>>n;
  ll l[n+10];rep(i,0,n)cin>>l[i];

  ll ans=0;

  rep(i,0,n-2){
     rep(j,i+1,n-1){
        rep(k,j+1,n){
           if(l[i]+l[j]>l[k]&&(l[i]+l[k]>l[j]&&(l[k]+l[j]>l[i])ans++;
         }
     }	
  }

  out(ans);
  
 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:64: error: expected ')' before 'ans'
   25 |            if(l[i]+l[j]>l[k]&&(l[i]+l[k]>l[j]&&(l[k]+l[j]>l[i])ans++;
      |                               ~                                ^~~
      |                                                                )
a.cc:25:69: error: expected ')' before ';' token
   25 |            if(l[i]+l[j]>l[k]&&(l[i]+l[k]>l[j]&&(l[k]+l[j]>l[i])ans++;
      |              ~                                                      ^
      |                                                                     )
Language: C++

import bisect
n = int(input())
l = list(map(int, input().split()))
l = sorted(l)
ans = 0
 
for i in range(n-2):
    for j in range(i+1, n-1):
        idx = bisect.bisect_right(l, l[i]+l[j]-1, j+1)
        ans+=idx-(j+1)
print(ans)

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

#include <iostream>
#include <vector>

using namespace std;
int N, res;
vector<int> L;

int main() {
    cin >> N;
    for (int i=0; i<N; i++) {
        int l;
        cin >> l;
        L.push_back(l);
    }
    sort(L.begin(), L.end());
    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[k]>=L[i]+L[j]) break;
                res++;
            }
        }
    }
    cout << res << "\n";
    return 0;
}

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

package main

import (
	"fmt"
	"sort"
)

func main() {
	var N int
	fmt.Scan(&N)

	inputs := scanNums(N)
	sort.Sort(sort.Reverse(sort.IntSlice(inputs)))
	res := 0
	for i := 0; i < N; i++ {
		for j := i + 1; j < N; j++ {
			if inputs[i] >= 2*inputs[j] {
				break
			}
			for k := j + 1; k < N; k++ {
				if inputs[i] >= inputs[j]+inputs[k] {
					break
				}
				res++
			}
		}
	}

	fmt.Println(res)

}

func scanNums(len int) (nums []int) {
	var num int
	for i := 0; i < len; i++ {
		fmt.Scan(&num)
		nums = append(nums, num)
	}
	return
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:33:1: error: 'func' does not name a type
   33 | func scanNums(len int) (nums []int) {
      | ^~~~
Language: C++

#![allow(non_snake_case)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!(
        n: usize,
        mut l: [isize; n],
    );
    l.sort();
    // println!("{:?}", l);
    let mut count = 0;
    for i in 0..(n-2) {
        let a = l[i];
        for j in (i+1)..(n-1) {
            // let b = l[j];
            let wa = a + l[j];
            let left = j + 1;
            if !(l[left] < wa) {
                // sort済みなので右を探しても条件に当てはまる棒はない
                continue;
            }
            // 適合する最後のINDEX+1を返す
            let right = {
                let mut low = left;
                let mut high = n;
                while low != high {
                    let mid = (low + high) / 2;
                    if l[mid] <= wa {
                        low = mid + 1;
                    } else {
                        high = mid;
                    }
                }
                high
            };
            count += right - left;
            // print!("[{},{}]", i,j);
            // println!("left:{} right:{}", left, right);
        }
    }
    println!("{}", count);
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #![allow(non_snake_case)]
      |  ^
a.cc:37:10: error: too many decimal points in number
   37 |         (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
      |          ^~~~~~~
a.cc:58:14: error: too many decimal points in number
   58 |     for i in 0..(n-2) {
      |              ^~~
a.cc:2:1: error: 'macro_rules' does not name a type
    2 | macro_rules! input {
      | ^~~~~~~~~~~
a.cc:19:1: error: 'macro_rules' does not name a type
   19 | macro_rules! input_inner {
      | ^~~~~~~~~~~
a.cc:32:1: error: 'macro_rules' does not name a type
   32 | macro_rules! read_value {
      | ^~~~~~~~~~~
a.cc:50:1: error: 'fn' does not name a type
   50 | fn main() {
      | ^~
Language: C++

// In the name of God

#include <bits/stdc++.h>

using namespace std;

#define int long long

const int N = 1e3+5;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i=0;i<n;i++) cin >> a[i];
	sort(a.begin(), a.end());
	int ans = 0;
	for(int i=0;i<n;i++) {
		for(int j=i+1;j<n;j++) {
			int sum = a[i] + a[j];
			int diff = a[j] - a[i];
			int idx = lower_bound(a.begin(), a.end(), sum) - a.begin();
			int idy = upper_bound(a.begin(), a.end(), diff) - a.begin();
			idx--;
			if(idx > n || a[idx] >= sum) continue;
			if(a[idy] <= diff) continue;
			ans += (idx-idy+1);
			if(i>=idy && i<=idx) ans--;
			if(j>=idy && j<=idx) ans--;
		}
	}	
	cout << ans/3;
	return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'