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

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <map>



using namespace std;


bool isTri(int a, int b, int c) {
	
	if (a >= b + c) {
		return false;
	}
	if (b >= c + a) {
		return false;
	}
	if (c >= a + b) {
		return false;
	}
	return true;

}


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

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

	int cnt = 0;
	
	sort(L.begin(), L.end());
	for (int i = 0; i < n - 2;i++) {
		for (int j = i+1; j < n - 1; j++) {
			
			

			if (isTri(L[i], L[j], L[j + 1])) {
				if (isTri(L[i], L[j], L[n - 1])) {
					cnt += n - 1 - j;

				}
				else {

					int right = j + 1;
					int left = n - 1;
					int mid = (right + left) / 2;

					while (right < mid) {
						if (isTri(L[i], L[j], L[mid])) {
							right = mid;

						}
						else {
							left = mid;
						}

						mid = (right + left) / 2;
					}


					cnt += right - j;
				}
			}
		}
	}

	cout << cnt << endl;
}

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

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

void loop() {
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++) {
         a = edge.at(i);
         b = edge.at(j);
         c = edge.at(k);  
         if(a < b + c && b < c + a && c < a + b) {
           count = count + 1;
         }
      }   
    }
  }
}
int main() {
  int N,a,b,c,count;
  cin >> N;
  vector<int> edge(N);
  for(int i = 0;i < N;i++) {
    cin >> edge.at(i);
  }
  loop();
  cout << count << endl;
}


Compiler output:
a.cc: In function 'void loop()':
a.cc:5:19: error: 'N' was not declared in this scope
    5 | for(int i = 0;i < N-2;i++) {
      |                   ^
a.cc:8:10: error: 'a' was not declared in this scope
    8 |          a = edge.at(i);
      |          ^
a.cc:8:14: error: 'edge' was not declared in this scope
    8 |          a = edge.at(i);
      |              ^~~~
a.cc:9:10: error: 'b' was not declared in this scope
    9 |          b = edge.at(j);
      |          ^
a.cc:10:10: error: 'c' was not declared in this scope
   10 |          c = edge.at(k);
      |          ^
a.cc:12:26: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   12 |            count = count + 1;
      |                    ~~~~~~^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm> /*sort()を使用するのに必要*/

using namespace std;

int main(){
    int N;
    vector<int> L;

    cin >> N;
    for(int i=0; i<N; i++){
        int j;
        cin >> j;
        L.push_back(j);
    }

    //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++){
            for(int k=j+1; k<N; k++){
                if(L[i] >= L[j] + L[k]) continue;
                if(L[j] >= L[i] + L[k]) continue;
                if(L[k] >= L[i] + L[j]) continue;
                count ++;
                print()
            }
        }
    }

    cout << count;

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'print' was not declared in this scope; did you mean 'printf'?
   28 |                 print()
      |                 ^~~~~
      |                 printf
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
ll N;
ll L[4000];

void input(){
  cin >> N;
  for (int i=1; i<=N; i++){
    cin >> L[i];
  }
}

void solve() {
  input();
  vector<ll> v(N);
  for (int i=0; i<<N; i++) v[i] = L[i+1];
  sort(v.begin(), v.end());
  ll ans = 0; 
  for(ll mid=N-1; mid>=0; mid--) {
    for(ll low = mid-1; low>=0; low--) {
      auto itr = lower_bound(v.begin(), v.end(), v[mid]+v[low]);
      ll ng = distance(itr, v.end());
      ans += (N-1-mid) - ng;
    }
  }
  cout << ans << endl;
  return;
}

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


Compiler output:
a.cc: In function 'void input()':
a.cc:11:11: error: missing template arguments before ';' token
   11 |   cin >> N;
      |           ^
a.cc:12:21: error: missing template arguments before ';' token
   12 |   for (int i=1; i<=N; i++){
      |                     ^
a.cc: In function 'void solve()':
a.cc:19:17: error: missing template arguments before ')' token
   19 |   vector<ll> v(N);
      |                 ^
a.cc:20:21: error: missing template arguments before ';' token
   20 |   for (int i=0; i<<N; i++) v[i] = L[i+1];
      |                     ^
a.cc:23:15: error: missing template arguments before '-' token
   23 |   for(ll mid=N-1; mid>=0; mid--) {
      |               ^
a.cc:27:16: error: missing template arguments before '-' token
   27 |       ans += (N-1-mid) - ng;
      |                ^
Language: C++

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


int main(void){
    int N;
    cin >> N;
    vector<int> vec(N);
    for(int i = 0; i < N; i++){
    	cin >> vec.at(i);
    }
    int sum = 0, count = 0;
    for(int i_a = 0; i_a < N - 1; i_a++){
    	for(int i_b = i_a + 1; i_b < N; i_b++){
        	sum = vec.at(i_a) + vec.at(i_b);
          	diff_a = vec.at(i_b) - vec.at(i_a);
          	diff_b = vec.at(i_a) - vec.at(i_b);
              for(int i_c = i_b + 1; i_c < N; i_c++){
              	if(sum > vec.at(i_c)){
                  if((vec.at(i_c)) > diff_a){
                    if((vec.at(i_c)) > diff_b)){
                	count++;
                    //cout << vec.at(i_a) << "," << vec.at(i_b) << "," << vec.at(i_c) << "," << count << endl;
                
                    }
                  }
                }
              }
        }
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'diff_a' was not declared in this scope
   16 |                 diff_a = vec.at(i_b) - vec.at(i_a);
      |                 ^~~~~~
a.cc:17:17: error: 'diff_b' was not declared in this scope
   17 |                 diff_b = vec.at(i_a) - vec.at(i_b);
      |                 ^~~~~~
a.cc:21:47: error: expected primary-expression before ')' token
   21 |                     if((vec.at(i_c)) > diff_b)){
      |                                               ^
Language: C++

#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <stdio.h>
#include <string.h>
using ll = long long;

//LLONG_MAX
#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define LOWER_BOUND(v,a) (lower_bound((v).begin(), (v).end(), (a)))
#define UPPER_BOUND(v,a) (upper_bound((v).begin(), (v).end(), (a)))
#define REP(i, n) for (int (i) =n 0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()

using namespace std;

int N;
int L[3000];
int ary_cnt;
int ary[3000 * 3000];

int A = 0;

//にぶたん
bool isOK(int index)
{
	return (L[index] > A);
}

int binary_search()
{
	int left = -1;
	int right = N;
	while (right - left > 1)
	{
		int mid = left + (right - left) / 2;
		if (isOK(mid))
			right = mid;
		else
			left = mid;
	}
	return right;
}

signed main()
{
	cin >> N;
	for (int i = 0; i < N; i++) cin >> L[i];

	ARY_SORT(L, N);

	int ans = 0;
	for (int i = 0; i < N; i++)
	{
		for (int j = i + 1; j < N; j++)
		{
			int a = L[i];
			int b = L[j];a

			int n = b - a;

			A = a - 1;
			int x = binary_search();
			A = n;
			int y = binary_search();
			ans += MAX(0, x - y);
		}
	}
	cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:79:39: error: expected ';' before 'long'
   79 |                         int b = L[j];a
      |                                       ^
      |                                       ;
a.cc:85:29: error: 'n' was not declared in this scope
   85 |                         A = n;
      |                             ^
Language: C++

#include <iostream>
#include <vector>
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 i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            int l=j,r=n; int mid;
            while(l+1<r){
                mid = (l+r)/2;
                if(L[i]+L[j]>L[mid]&&L[mid]+L[j]>L[i]&&L[i]+L[mid]>L[j]){
                    l = mid;
                }else{
                    r = mid;
                }
            }
            ans += (l-j);
        }
    }
    cout << ans << endl;
}


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


int main()
{
	int n,l[2005],ans=0;
	cin >> n;
	for (int i = 1; i <=n; i++) {
		cin >> l[i];
	}
	sort(l+1, l + n+1);
	for (int a = n ; a >= 3; a--) {
		for (int b = a - 1; b >= 2; b--) {
			if (l[a] >= l[b] + l[b - 1]) break;
			for (int c = b - 1; c >= 1; c--) {
				if (l[a] >= l[b] + l[c]) {
					break;
				}
				ans++;
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> n;
      |         ^~~
a.cc:9:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    9 |         sort(l+1, l + n+1);
      |         ^~~~
      |         short
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout << ans << endl;
      |         ^~~~
a.cc:21:24: error: 'endl' was not declared in this scope
   21 |         cout << ans << endl;
      |                        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
signed main(){
  int N;
  cin>>N;
  vi A(N);
  rep(i,0,N) cin>>A[i];
  sort(ALL(A));
  int ans=0;
  rep(i,0,N-2){
    rep(j,i+1,N-1){
      if(A[i]+A[j]>A[N-1])
        ans+=N-1-j;
      else{
        ans+=max(dislow(A,A[i]+A[j])-j-1,0);
        }
      }
    }
  cout<<ans;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: no matching function for call to 'max(long long int, int)'
   26 |         ans+=max(dislow(A,A[i]+A[j])-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:26:17: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   26 |         ans+=max(dislow(A,A[i]+A[j])-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:26:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   26 |         ans+=max(dislow(A,A[i]+A[j])-j-1,0);
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

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




Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   int n; cin >> n;
      |          ^~~
      |          std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n; cin>>n;
	vector<int>a(n a(n);
	for (int &x: a) cin>>x;
    sort(a.begin(), a.end());
    long long res=0;
    for (int i=a.size()-1; i>=2; --i) {
        int l=0, r=i-1;
        while (l<r) {
            if (a[l]+a[r]>a[i]) {
                res+=(long long)(r-l);
                --r;
            } else {
                ++l;
            }
        }
    }
    cout<<res;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: expected ')' before 'a'
    6 |         vector<int>a(n a(n);
      |                     ~ ^~
      |                       )
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
int n;cin>>n;
  vector <int> v;
  while(n--){
  int a;cin>>a; v.push_back(a);
  }
  int count=0;
  for (int i=v.size()-1;i>0;i--){
  int l=0,r=i-1;
    while(l<r){
    if(v[l]+v[r]v[i]){count +=r-l;r--;}
      else l++;
      
    
    }
  
  }
cout<<count;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: expected ')' before 'v'
   16 |     if(v[l]+v[r]v[i]){count +=r-l;r--;}
      |       ~         ^
      |                 )
Language: C++

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

int main(){
int n;cin>>n;
  vector <int> v;
  while(n--){
  int a;cin>>a; v.push_back(a);
  }
  int count=0;
  for (int i=v.size()-1;i>0;i--){
  int l=0,r=i-1;
    while(l<r){
    if(v[l]+v[r]v[i]){count +=r-l;r--;}
      else l++;
      
    
    }
  
  }
cout<<count;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected ')' before 'v'
   14 |     if(v[l]+v[r]v[i]){count +=r-l;r--;}
      |       ~         ^
      |                 )
Language: C++

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

int main(){
int n;cin>>n;
  vector <int> v;
  while(n--){
  int a;cin>>a; v.push_back(a);
  }
  int count=0;
  for (int i=v.size()-1;i>0;i--){
  int l=0,r=i-1;
    while(l<r){
    if(v[l]+v[r]v[i]){count +=r-l;r--;}
      else l++;
      
    
    }
  
  }
cout<<count;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:7: error: 'cin' was not declared in this scope
    5 | int n;cin>>n;
      |       ^~~
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector <int> v;
      |   ^~~~~~
a.cc:6:11: error: expected primary-expression before 'int'
    6 |   vector <int> v;
      |           ^~~
a.cc:8:17: error: 'v' was not declared in this scope
    8 |   int a;cin>>a; v.push_back(a);
      |                 ^
a.cc:11:14: error: 'v' was not declared in this scope
   11 |   for (int i=v.size()-1;i>0;i--){
      |              ^
a.cc:14:17: error: expected ')' before 'v'
   14 |     if(v[l]+v[r]v[i]){count +=r-l;r--;}
      |       ~         ^
      |                 )
a.cc:21:1: error: 'cout' was not declared in this scope; did you mean 'count'?
   21 | cout<<count;
      | ^~~~
      | count
Language: C

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

int main(){
  int n;
  vector<int>::iterator position;
  
  cin >> n;
  vector<int> l(n);
  for(int i=0;i<n;i++){
    cin >> l.at(i);
  }
  int64_t cnt = 0;
  
  sort(l.begin(),l.end());
  
  
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      position = upper_bound(l.begin(),l.end(),l.at(j)-l.at(i));
      //cout << l.at(j)-l.at(i) << "(" << i << "," << j << ")"<< distance(l.begin(),position)<<endl;
      if(distance(l.begin(),position) < i);
        if(i-distance(l.begin(),position) >= 1){
      cnt += i-distance(l.begin(),position);
      }
    }
  }
  cout << cnt << endl;
}
  

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

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int[] sticks = new int[N];

        for(int i = 0; i < N; i++) {

            sticks[i] = Integer.parseInt(sc.next());
        }

        sc.close();
      
        Arrays.sort(sticks);

        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(sticks[k] < sticks[i] + sticks[j]) {

                        count++;
                    }

                }
            }
        }

        System.out.println(count);
    }

}


Compiler output:
Main.java:18: error: cannot find symbol
        Arrays.sort(sticks);
        ^
  symbol:   variable Arrays
  location: class Main
1 error
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(v.begin(),v.end());
  long t=0;
  for(int i=0;i<n;i++)
    for(int j=i+1;j<n;j++){
      auto up=upper_bound(v.begin(),v.end(),v[i]+v[j]);
      if(up!=v.end())t+=n-(up-v.begin());
    }
  cout<<t;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'v' was not declared in this scope
    8 |   sort(v.begin(),v.end());
      |        ^
Language: Java

import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n = sc.nextInt();
        sc.nextLine();
        int[] L  = toArray(sc.nextLine());
        int res = 0;
        for (int i = 0; i < n; i++) {
            int a = L[i];
            for (int j = i+1; j < n; j++) {
                int b = L[j];
                for (int k = j+1; k < n; k++) {
                    int c = L[k];
                    if(a+b > c && a+c > b && b+c > a) res++;
                }
            }
        }
        System.out.println(res);
    }
}


Compiler output:
Main.java:10: error: cannot find symbol
        int[] L  = toArray(sc.nextLine());
                   ^
  symbol:   method toArray(String)
  location: class Main
1 error
Language: C

#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
	int a[10000];
	int i,j,m,n,count=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
		sort(a,a+n+1); 
		for(i=1;i<=n-2;i++)
		{
			for(j=i+1;j<=n-1;j++)
			{
				for(m=j+1;m<=n;m++)
				{
					if(a[i]+a[j]>a[m])
						count++;
					else
						count=count+0;
				}
			}
		}
		printf("%d\n",count);
}


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

import java.io.*;
import java.util.*;

public class D {

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null; }
        String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try { tokenizer = new StringTokenizer(reader.readLine()); } 
                catch (IOException e) { throw new RuntimeException(e);} }
            return tokenizer.nextToken(); }
        public int nextInt() { return Integer.parseInt(next()); }
        public long nextLong() { return Long.parseLong(next()); }
        public double nextDouble() { return Double.parseDouble(next()); }
    }

    static InputReader r = new InputReader(System.in);
    static PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {
        
        int n = r.nextInt();
        int[] arr = new int[n+1];
        for(int i = 1; i <= n; i++){
            arr[i] = r.nextInt();
        }
        Arrays.sort(arr);
        int bad = 0;
        for(int i = 1; i <= n; i++){
            for(int j = i+1; j <= n; j++){
                int idx = Arrays.binarySearch(arr, arr[i] + arr[j]);
                if(idx < 0) idx = -idx-1;
                // System.out.println(idx);
                bad += (n - idx + 1);
            }
        } // 1 2 3 4 
        // System.out.println(bad);
        int total = (n * (n-1) * (n-2)) / 6;
        pw.println(total - bad);
        pw.close();
    }
}

/**
                _        _                 _                                                
               | |      | |               | |                                               
   ___ ___   __| | ___  | |__  _   _    __| | __ _ _ __ _ __ ___ _ __     _   _  __ _  ___  
  / __/ _ \ / _` |/ _ \ | '_ \| | | |  / _` |/ _` | '__| '__/ _ \ '_ \   | | | |/ _` |/ _ \ 
 | (_| (_) | (_| |  __/ | |_) | |_| | | (_| | (_| | |  | | |  __/ | | |  | |_| | (_| | (_) |
  \___\___/ \__,_|\___| |_.__/ \__, |  \__,_|\__,_|_|  |_|  \___|_| |_|   \__, |\__,_|\___/ 
                                __/ |                               ______ __/ |            
                               |___/                               |______|___/             
 */

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

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll MOD = 1e9 + 7;
const int INF = 100100100;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl

int N; int L[4000];

void input(){
  cin >> N;
  REP(i, N) cin >> L[i];
}

/* TLE
void solve(){
  int res = 0;
  REP(i, N) REP(j, i) REP(k, j){
    if(L[i] < L[j] + L[k] && L[j] < L[k] + L[i] && L[k] < L[i] + L[j]){
      res++;
    }
  }
  cout << res << endl;
}
*/

// Lをソート i > j > k で i と j をfor、 k を二分探索 O(N^2 logN)
void solve(){
  vector<int> v(N);
  REP(i, N) v[i] = L[i];
  int ans = 0;
  sort(v.begin(),v.end());
  REP(i, N) REP(j, i){
    auto itr = upper_bound(v.begin(), v.end(), v[i] - v[j]);
    ans += ((j > index) ? (j - index) : 0);
    /*
    debug(i);
    debug(j);
    debug(index);
    debug(ans);
    */
  }
  cout << ans << endl;
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:37:16: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>'
   37 |     ans += ((j > index) ? (j - index) : 0);
      |              ~~^~~~~~~
a.cc:37:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-'
   37 |     ans += ((j > index) ? (j - index) : 0);
      |                            ~~^~~~~~~
Language: C++

//omajinai
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
//omajinai

int main(){

    // omajinai
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    // omajinai

    int n;
    cin >> n;
    //長さaの辺が何本あるか調べる
    vector<int> l(1001);
    for(int i = 0;i < n;i ++){
        int a;
        cin >> a;
        l.at(a) ++;
    }

    //無駄な部分は消す
    while(l.at(l.size()-1) == 0){
        l.pop_back();
    }
    int m = l.size();

    //累積和。長さi以下の辺の本数を調べる。
    vector<int> r(m);
    for(int i = 1;i < m;i ++){
        r.at(i) = r.at(i-1) + l.at(i);
    }

    ll ans = 0;

    //すべての辺の長さが異なるとき。
    //iは一番短い辺。jは二番目に短い辺。
    //(iの本数)×(jの本数)×(j+1 ~ i+j-1の本数の合計)
    for(int i = 2;i < m-2;i ++){
        for(int j = i+1;j < m-1;j ++){ 
            ans += l.at(i) * l.at(j) * (r.at(min(m-1,j+i-1)) - r.at(j));
        }
    }

    //長さの同じ辺が２本あるとき。
    //同じ２辺の選び方× 1~2*i-1までの本数。(iは除く)
    for(int i = 2;i < m;i ++){
        if(l.at(i) > 1){
            ans += (l.at(i) * (l.at(i)-1) / 2) * (r.at(min(m-1,2*i-1)) - l.at(i));
        }
    }

    //すべて同じ長さの時。
    for(int i = 1;i < m;i ++){
        if(l.at(i) > 2){
            ans += (l.at(i) * (l.at(i)-1) * (l.at(i)-2)) / 6;
        }
    }

    cout << ans << endl;
}


Compiler output:
a.cc:5:13: error: '::main' must return 'int'
    5 | #define int ll
      |             ^~
a.cc:8:1: note: in expansion of macro 'int'
    8 | int main(){
      | ^~~
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		int count = 0;

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


		for(int j = 0;j < n;j++){
			for(int k = j + 1;k < n;k++){
				for(int l = k + 1;l < n;l++){
					if(a[j] + a[k] > a[l] && a[j] + a[l] > a[k] &&a[l] + a[k] > a[j] ){
						count++;
					}
				}
			}
		}

		System.out.println(count);
	}

}

Compiler output:
Main.java:16: error: cannot find symbol
      		Arrays.sort(a);
      		^
  symbol:   variable Arrays
  location: class Main
1 error
Language: C++

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

int main(){
    int N;
    int L[2010];
    ll ans = 0;
    cin >> N;
    rep(i,N) cin >> L[i];
    sort(L,L+N);
    for(int i = 0;i < N;i++){
        for(int j = i + 1;j<i;j++){
            auto lb = upper_bound(L.begin()+j+1,L.end(),L[j]-L[i]);
            auto r = lower_bound(L.begin()+j+1,L.end(),L[j]+L[i]);
            ans += r - lb;
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:37: error: request for member 'begin' in 'L', which is of non-class type 'int [2010]'
   17 |             auto lb = upper_bound(L.begin()+j+1,L.end(),L[j]-L[i]);
      |                                     ^~~~~
a.cc:17:51: error: request for member 'end' in 'L', which is of non-class type 'int [2010]'
   17 |             auto lb = upper_bound(L.begin()+j+1,L.end(),L[j]-L[i]);
      |                                                   ^~~
a.cc:18:36: error: request for member 'begin' in 'L', which is of non-class type 'int [2010]'
   18 |             auto r = lower_bound(L.begin()+j+1,L.end(),L[j]+L[i]);
      |                                    ^~~~~
a.cc:18:50: error: request for member 'end' in 'L', which is of non-class type 'int [2010]'
   18 |             auto r = lower_bound(L.begin()+j+1,L.end(),L[j]+L[i]);
      |                                                  ^~~
Language: C++

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

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

int main(){
  int N;
  int i,j,k;
  cin >> N;
  
  int L[N]
  for(i = 0;i < N;i++) cin >> L[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(triangle_judge(L[i],L[j],L[k])) ans++;
      }
    }
  }
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: expected initializer before 'for'
   18 |   for(i = 0;i < N;i++) cin >> L[i];
      |   ^~~
a.cc:18:22: error: expected ';' before ')' token
   18 |   for(i = 0;i < N;i++) cin >> L[i];
      |                      ^
      |                      ;
a.cc:25:27: error: 'L' was not declared in this scope
   25 |         if(triangle_judge(L[i],L[j],L[k])) ans++;
      |                           ^
Language: C++

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

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

int main(){
  int N;
  int i,j,k;
  cin >> N;
  
  int L[N]
  for(i = 0;i < N;i++) cin >> L[N];

  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(triangle_judge(L.at(i),L.at(j),L.at(k))) ans++;
      }
    }
  }
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: expected initializer before 'for'
   18 |   for(i = 0;i < N;i++) cin >> L[N];
      |   ^~~
a.cc:18:22: error: expected ';' before ')' token
   18 |   for(i = 0;i < N;i++) cin >> L[N];
      |                      ^
      |                      ;
a.cc:25:27: error: 'L' was not declared in this scope
   25 |         if(triangle_judge(L.at(i),L.at(j),L.at(k))) ans++;
      |                           ^
Language: C++

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

void triangle_judge(int a,int b,int c)
{
  if((a < b+c) && (b <c+a) && (c < a+b))
    return true;
  else
    return false;
}

int main(){
  int N;
  int i,j,k;
  cin >> N;
  
  vector<int> L(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(triangle_judge) ans++;
      }
    }
  }
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'void triangle_judge(int, int, int)':
a.cc:7:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
    7 |     return true;
      |            ^~~~
a.cc:9:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
    9 |     return false;
      |            ^~~~~
Language: C++

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

void triangle_judge(int a,int b,int c)
{
  if((a < b+c) && (b <c+a) && (c < a+b))
    return true;
  else
    return false;
}

int main(){
  int N;
  int i,j,k;
  cin >> N;
  
  vector<int> L(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(triangle_judge) ans++;
      }
    }
  }
  cout << ans;
  return 0;
}
  

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

import java.util.Scanner;
import java.util.Array;

class Main{
  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 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(L[k]<L[i]+L[j]){
            count++;
          }
        }
      }
    }
    
    System.out.println(count);
  }
}


Compiler output:
Main.java:2: error: cannot find symbol
import java.util.Array;
                ^
  symbol:   class Array
  location: package java.util
Main.java:14: error: cannot find symbol
    Arrays.sort(L);
    ^
  symbol:   variable Arrays
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N,count=0;
  vector<int> L(1024);
  cin>>N;
  rep(i,N){cin>>L.at(i);}
  sort(L.begin(),L.end(),greater<int>());
  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.at(i)<L.at(j)+L.at(k))count++;
      }
    }
  }
  cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   rep(i,N){cin>>L.at(i);}
      |       ^
a.cc:8:3: error: 'rep' was not declared in this scope
    8 |   rep(i,N){cin>>L.at(i);}
      |   ^~~
Language: C++

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

int main() {
  int N;
  int count=0;
  std::cin >> N;
  std::vector<int> data(N);
  for (int i=0; i<N; i++) {
    std::cin >> data.at(i);
  }
  std::sort(data.begin(),data.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 (data.at(i) < data.at(j)+data.at(k)) {
          count++;
        }
        else {
          break;
        }
        }
      }
    }
  }
  std::cout << count << std::endl;
}


Compiler output:
a.cc:28:8: error: 'cout' in namespace 'std' does not name a type
   28 |   std::cout << count << std::endl;
      |        ^~~~
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: Java

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

public class Test_B {
    

        public static void main (String[] args)
        {
            FastReader input = new FastReader();
            int n = input.nextInt();
            int[] arr = new int[n];
            for(int i = 0;i < n;i++){
                arr[i] = input.nextInt();
            }
            Arrays.sort(arr);
            int count = 0;
            for(int i = 0;i < n-2;i++){
                int k = i + 2;
                for(int j = i+1;j < n;j++){
                    while (k < n && arr[i] + arr[j] > arr[k]){
                        k++;
                    }
                    if(k > j){
                        count += k - j - 1;
                    }
                }
            }
            System.out.println(count);
        }
    static 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:7: error: class Test_B is public, should be declared in a file named Test_B.java
public class Test_B {
       ^
1 error
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;
  for(int i=0; i<n-2; i++){
    for(int j=i+2; j<n; j++){
      for(int k=i+1; k<j; k++){
        a = i;
        b = j;
        c = k;
        if((a<b+c)&&(c<a+b)&&(b<a+c))ans++;
      }
    }
  }
  cout << ans << endl;
}
        

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'a' was not declared in this scope
   15 |         a = i;
      |         ^
a.cc:16:9: error: 'b' was not declared in this scope
   16 |         b = j;
      |         ^
a.cc:17:9: error: 'c' was not declared in this scope
   17 |         c = k;
      |         ^
Language: C++

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


int main(void){
    // Your code here!
    long N,a,ans=0;
    cin>>N;
    vector <long> L;
    rep(0,i,N){
        cin>>a;
        L.push_back(a);
    }
    sort(L.begin(),L.end());
    rep(0,i,N){
        rep(i+1,j,N){
            vector<int>::iterator k=lower_bound(L.begin(),L.end(),L[j]-L[i]+1);
            while(*k<L[i]){
                ++ans;
                ++k;
            }
        }
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:48: error: conversion from '__normal_iterator<long int*,vector<long int>>' to non-scalar type '__normal_iterator<int*,vector<int>>' requested
   19 |             vector<int>::iterator k=lower_bound(L.begin(),L.end(),L[j]-L[i]+1);
      |                                     ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

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

int main() {
  int n, sum = 0, a, b, c;
  cin >> n;
  vector<int> vec(n);
  
  rep(i, n) {
    cin >> vec.at(i);
  }
  
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  
  rep(i, n) {
    
  	for(int j = i + 1, j < n, j++) {
      
      rep(k, n) {
        
        if(i == k || j == k) {
          break;
        }
        
        a = vec.at(i);
        b = vec.at(j);
        c = vec.at(k);
        
        if(a >= (b + c) ) {
          break;
        }
        
        if(a < b + c && b < a + c && c < a + b) {
          sum++;
        }
        
      }
      
      
    }
    
  }
  
  cout << sum << endl;
  
}

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

#include <bits/stdc++.h>
using namespace std;
 
const int MAX = 1e3 + 5;
 
int cnt[MAX];
 
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    ++cnt[a[i]];
  }
  for (int i = MAX - 2; i >= 0; i--) {
    cnt[i] += cnt[i + 1];
  }
  sort(a.begin(), a.end());
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (a[i] + a[j] + 1 < MAX) {
        ans += cnt[a[i] + a[j] + 1];
    }
  }
  printf("%lld\n", ans);
  return 0;
}

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

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

const int MAX = 1e3 + 5;

int cnt[MAX];

int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    ++cnt[a[i]];
  }
  for (int i = MAX - 2; i >= 0; i--) {
    cnt[i] += cnt[i + 1];
  }
  sort(a.begin(), a.end());
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (a[i] + a[j] + 1 < MAX) {
        ans += cnt[a[i] + a[j] + 1];
    }
  }
  pritnf("%lld\n", ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:3: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
   27 |   pritnf("%lld\n", ans);
      |   ^~~~~~
      |   printf
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:8:12: note: to match this '{'
    8 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>

int main() {
  int N, temp;
  std::cin >> N;
  
  std::vector<int> L;
  while (std::cin >> temp) {
    L.push_back(temp); 
  }
  std::sort(L.begin(), L.end(), std::greater<>());
  
  int ans = 0;
  
  for (int i=0; i<N-2; ++i) {
    if (L.at(i) >= L.at(i+1) + L.at(i+2)) 
      continue;
    
    for (int j=i+1; j<N-1; ++j) {
      auto l = j+1;
      auto r = N;
      
      while (l < r) {
        auto mid = l + (r - l) / 2;
        if (L.at(i) >= L.at(mid) + L.at(j)) {
          r = mid;
        } else {
          l = mid + 1;
        }
      }
      ans += l - j - 1;
    }
  }
  std::cout << ans << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   12 |   std::sort(L.begin(), L.end(), std::greater<>());
      |        ^~~~
      |        qsort
Language: C

#include<stdio.h>

int main()
{
	int n = 0, s=0;/*num of stick, sum of trinangles*/
  	int l[1000];/*array of stick length*/
  
  	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++)
            {
				int max;
              	
              	max = l[i] > l[j]?l[i]:l[j];
              	max = max > l[k]?max:l[k];
            	if(max<(l[i]+l[j]+l[k]-max)){
                	s++;
                }
            }
        }
    }
  
  	printf("%d", s);
	rerutn 0;
}

Compiler output:
main.c: In function 'main':
main.c:32:9: error: 'rerutn' undeclared (first use in this function)
   32 |         rerutn 0;
      |         ^~~~~~
main.c:32:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:15: error: expected ';' before numeric constant
   32 |         rerutn 0;
      |               ^~
      |               ;
Language: C

#include<stdio.h>

int main()
{
	int n = 0, s=0;/*num of stick, sum of trinangles*/
  	int l[1000];/*array of stick length*/
  
  	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++)
            {
				int max;
              	
              	max = l[i] > l[j]?l[i]:l[j];
              	max = max > l[k]?max:l[k];
            	if((max<(l[i]+l[j]+l[k]-max)){
                	s++;
                }
            }
        }
    }
  
  	printf("%d", s);
	rerutn 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:46: error: expected ')' before '{' token
   24 |                 if((max<(l[i]+l[j]+l[k]-max)){
      |                   ~                          ^
      |                                              )
main.c:27:13: error: expected expression before '}' token
   27 |             }
      |             ^
main.c:32:9: error: 'rerutn' undeclared (first use in this function)
   32 |         rerutn 0;
      |         ^~~~~~
main.c:32:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:15: error: expected ';' before numeric constant
   32 |         rerutn 0;
      |               ^~
      |               ;
Language: C

#include<stdio.h>
int main(){
 int n;
 scanf("%d", &n);
 int l[n];
 for(int i = 0; i < n; i++){
   scanf("%d",&l[i])
 } 
 int num = 0;
 for(int i = 0; i < n; i++){
    for(int j = 0; j < i; j++){
        for(int k = 0; k < j; k++){
            if(l[i] < l[j] + l[k] && l[k] < l[j] + l[i] && l[j] < l[k] + l[i])
                num ++;
        }
    }
}
printf("%d",num);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:21: error: expected ';' before '}' token
    7 |    scanf("%d",&l[i])
      |                     ^
      |                     ;
    8 |  }
      |  ~
Language: C

int n;
scanf("%d", &n);
int l[n];
for(int i = 0; i < n; i++){
  scanf("%d",&l[i])
}
int num = 0;
for(int i = 0; i < n; i++){
    for(int j = 0; j < i; j++){
        for(int k = 0; k < j; k++){
            if(l[i] < l[j] + l[k] && l[k] < l[j] + l[i] && l[j] < l[k] + l[i])
                num ++;
        }
    }
}
printf("%d",num);

Compiler output:
main.c:2:7: error: expected declaration specifiers or '...' before string constant
    2 | scanf("%d", &n);
      |       ^~~~
main.c:2:13: error: expected declaration specifiers or '...' before '&' token
    2 | scanf("%d", &n);
      |             ^
main.c:3:5: error: variably modified 'l' at file scope
    3 | int l[n];
      |     ^
main.c:4:1: error: expected identifier or '(' before 'for'
    4 | for(int i = 0; i < n; i++){
      | ^~~
main.c:4:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    4 | for(int i = 0; i < n; i++){
      |                  ^
main.c:4:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    4 | for(int i = 0; i < n; i++){
      |                        ^~
main.c:8:1: error: expected identifier or '(' before 'for'
    8 | for(int i = 0; i < n; i++){
      | ^~~
main.c:8:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    8 | for(int i = 0; i < n; i++){
      |                  ^
main.c:8:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    8 | for(int i = 0; i < n; i++){
      |                        ^~
main.c:16:8: error: expected declaration specifiers or '...' before string constant
   16 | printf("%d",num);
      |        ^~~~
main.c:16:13: error: expected declaration specifiers or '...' before 'num'
   16 | printf("%d",num);
      |             ^~~
Language: Java

#include <bits/stdc++.h>
using namespace std;
int n,k,ng=0,ok=1234,l[2020],a[2020020],A=0,b[2020020];
int main(){
	cin>>n;
	for(int i=0;i<n;i++)cin>>l[i];
	sort(l,l+1);
	for(int i=0;i<n;i++){
		for(int j=(i-1);j<n;j++){
			a[A]=(i+j);
			A++;
		}
	}
	for(int i=0;i<=A;i++){
		while((ok-ng)!=1){
			int m=(ng+ok)/2;
			if(m<a[i])ng=m;
			else ok=m;
		}
		b[i]=ok;
		cout<<b[i]<<" ";
	}
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:3: error: class, interface, enum, or record expected
int n,k,ng=0,ok=1234,l[2020],a[2020020],A=0,b[2020020];
^
Main.java:5: error: not a statement
	cin>>n;
	   ^
Main.java:6: error: not a statement
	for(int i=0;i<n;i++)cin>>l[i];
	                       ^
Main.java:21: error: not a statement
		cout<<b[i]<<" ";
		          ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
7 errors