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

#define D(x) cout << #x " = " << x << endl
#define DD(x, y) cout << "(" #x ", " #y ") = (" << x << ", " << y << ")" << endl
#define DDD(x, y, z) cout << "(" #x ", " #y ", " #z ") = (" << x << ", " << y << ", " << z << ")" << endl
#define DV(v) for (auto __macro_vi : v){ cout << __macro_vi << " ";} cout << endl;
#define DA(a, n) for (int __macro_i = 0; __macro_i < n; ++__macro_i) { cout << a[__macro_i] << " "; } cout << endl;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define ALL(v) (v).begin(), (v).end()
#include<iostream>
#include<vector>
#include<cassert>
#include<cmath>
template<class T, class U> std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p){ os << "(" << p.first << ", " <<  p.second << ")"; return os; }

using namespace std;

void solve(long long N, std::vector<long long> L){
    sort(L.begin(), L.end());
    int ans = 0;
    for (int i = 0; i < N; ++i) {
        for (int j = i + 1; j < N; ++j) {
            int lmax = L[i] + L[j] - 1;
            int lmin = abs(L[i] - L[j]) + 1;

            int imin = distance(L.begin(), lower_bound(L.begin(), L.end(), lmin));
            // 1 2 3 4 4 4 4
            //       | * 
            // lb( , 4)

            // 1 2 3 4 4 4 4 5
            //               |
            int imax = distance(L.begin(), upper_bound(L.begin(), L.end(), lmax));
            imin = max(j + 1, imin);
            imax = max(j, imax);
            ans += imax - imin;
        }
    }
    cout << ans << endl;
}

// Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> L(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&L[i]);
    }
    solve(N, std::move(L));
    return 0;
}


Compiler output:
a.cc: In function 'void solve(long long int, std::vector<long long int>)':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   17 |     sort(L.begin(), L.end());
      |     ^~~~
      |     sqrt
a.cc:31:44: error: 'upper_bound' was not declared in this scope
   31 |             int imax = distance(L.begin(), upper_bound(L.begin(), L.end(), lmax));
      |                                            ^~~~~~~~~~~
Language: C++

#include <iostream>

int main(void) {
  	cin.tie(0); ios::sync_with_stdio(0);
	int N, L[2001];
	std::cin >> N;
	for (int i=0; i<N; i++) std::cin >> L[i];
	int count = 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[j] < L[k] + L[i] &&
			L[k] < L[i] + L[j]
		) count++;
	}
	std::cout << count << std::endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |         cin.tie(0); ios::sync_with_stdio(0);
      |         ^~~
      |         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
      |                  ^~~
a.cc:4:21: error: 'ios' has not been declared
    4 |         cin.tie(0); ios::sync_with_stdio(0);
      |                     ^~~
Language: Java

package abc143;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class MainD {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String nString = sc.nextLine();
		List<Integer> list = new ArrayList<>();
		for(String s : sc.nextLine().split(" ")) {
			list.add(Integer.valueOf(s));
		}
		Collections.sort(list);
		
		int size = list.size();
		int sizei = size - 2;
		int sizej = size - 1;
		long sum = 0;

		for (int i = 0; i < sizei; i++) {
			int li = list.get(i);
			for (int j = i + 1; j < sizej; j++) {
				int lj = list.get(j);
				int val = li + lj;
				for (int k = j + 1; k < size; k++) {
					int lk = list.get(k);
					if (val <= lk) {
						sum = sum + k - j - 1;
						break;
					} else if (k == sizej) {
						sum = sum + k - j;
					}
				}
			}
		}
		System.out.println(sum);
	}
}


Compiler output:
Main.java:10: error: class MainD is public, should be declared in a file named MainD.java
public class MainD {
       ^
1 error
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++)

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){
a = l[i];
  
  
  rep2(k, i+1, N-1){
    if(k > i+1 && b == l[k]){
      kari --;
      if(kari>=0)
      ans += kari;
    continue; 
    }
b = l[k];
    sk=0;
    
  kari=0;
    
rep2(j, k+1, N){
  if(sk ==1)
    continue;
  c = l[j];
    else {
      ans ++;
      kari++;
  }
  
  
  }
  }
}
    
cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:5: error: 'else' without a previous 'if'
   39 |     else {
      |     ^~~~
Language: C++

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

#define int long long
#define uint unsigned long long
#define double long double
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define uniq(x) (x).erase(unique(all(x)), (x).end());
#define bit(n) (1LL << (n))
#define dump(x) cerr << #x " = " << (x) << endl
using vint=vector<int>;
using vvint=vector<vint>;
using pint=pair<int, int>;
using vpint=vector<pint>;
template<typename T> using priority_queue_rev=priority_queue<T, vector<T>, greater<T>>;
constexpr double pi = 3.1415926535897932384626433832795028;
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<typename T1, typename T2> bool chmax(T1 &a, const T2 &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> bool chmin(T1 &a, const T2 &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct Setup {
    static constexpr int PREC = 20;
    Setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

int N;
int L[2200];
signed main() {
    cin >> N;
    rep(i, N) {
        cin >> L[i];
    }
    int ans=0;
    rep(i, N) {
        rep(j, i) {
            rep(k, j) {
                ans+=L[i]<L[j]+L[k]&&L[j]<L[k]+L[i]&&L[k]<L[i]+L[j]
            }
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:71:68: error: expected ';' before '}' token
   71 |                 ans+=L[i]<L[j]+L[k]&&L[j]<L[k]+L[i]&&L[k]<L[i]+L[j]
      |                                                                    ^
      |                                                                    ;
   72 |             }
      |             ~
Language: C++

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

#define int long long
#define uint unsigned long long
#define double long double
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define uniq(x) (x).erase(unique(all(x)), (x).end());
#define bit(n) (1LL << (n))
#define dump(x) cerr << #x " = " << (x) << endl
using vint=vector<int>;
using vvint=vector<vint>;
using pint=pair<int, int>;
using vpint=vector<pint>;
template<typename T> using priority_queue_rev=priority_queue<T, vector<T>, greater<T>>;
constexpr double pi = 3.1415926535897932384626433832795028;
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<typename T1, typename T2> bool chmax(T1 &a, const T2 &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> bool chmin(T1 &a, const T2 &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct Setup {
    static constexpr int PREC = 20;
    Setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

int N;
int L[2200];
signed main() {
    cin >> N;
    rep(i, N) {
        cin >> L[i];
    }
    rep(i, N) {
        rep(j, i) {
            rep(k, j) {
                ans+=L[i]<L[j]+L[k]&&L[j]<L[k]+L[i]&&L[k]<L[i]+L[j]
            }
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:70:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   70 |                 ans+=L[i]<L[j]+L[k]&&L[j]<L[k]+L[i]&&L[k]<L[i]+L[j]
      |                 ^~~
      |                 abs
a.cc:74:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   74 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: Java

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

public class triangle {
	
	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();
		}
		int ans = 0;
		
		Arrays.sort(l);
//		for(int i = 0; i < n; i++) {
//			System.out.print(l[i]);
//		}
		for(int i = 0; i < n ; i++) {
			for(int j = i + 1; j < n; j++) {
				for(int k = j + 1; k < n; k++) {
					if(l[i] + l[j] > l[k]) {
						ans++;
					} else break;
				}
			}
		}
		System.out.println(ans);
	}
}


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

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


int main() {
    int a,b,c=0,n;
    string s,p;
   
    cin >> n;
    int j=0;
    
    for(int i=0; i<n; i++)
        {
            cin >> a;
            v.push_back(a);
        
        
        }
    
  
    sort(v.begin(),v.end());
    
    for (int i = 0; i < n - 2; ++i)
        {
            int k = i + 2;

            for (int j = i + 1; j < n; ++j)
            {
               
                while (k < n && v[i] + v[j] > v[k])
                ++k;

              
                if(k > j)
                c += k - j - 1;
            }
        }

        
    cout << c << endl;

 
    
    
       
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'v' was not declared in this scope
   16 |             v.push_back(a);
      |             ^
a.cc:22:10: error: 'v' was not declared in this scope
   22 |     sort(v.begin(),v.end());
      |          ^
Language: C++

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

int main(){
  int N;
  
  cin >> N;
  int L[N];
  
  for(int i=0; i<N; i++){
    cin >> L[i];
  }
  
  int ans=0;
  sort(L,L+N);
  
  for(int i=0; i<N-2; i++){
    for(int j=i+1; j<N-1; j++){
      for(int k=j+1; k<N; k++){
      if(L[i]<L[j]+L[k]&&L[j]<L[k]+L[i]&&L[k]<L[i]+L[j])
        ans++;
      }
      else
        break;
    }
  }
  
  cout << ans << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: 'else' without a previous 'if'
   24 |       else
      |       ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
#include <cctype>
#include <cstdio>
#include <math.h>
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
const int AMAX = 100000; 
using namespace std;
#define rep(i, n) for (i64 i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (i64 i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define all(x) (x).begin(), (x).end()
#define fst first
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define sw swap
#define UP(x) transform(x.begin(), x.end(), x.begin(), ::toupper);
#define down(x) transform(x.begin(), x.end(), x.begin(), ::tolower);
using LL = long long;
using ULL = unsigned long long;
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;
}
 
int main()
{
   LL n,a;
  cin >> n;
  vector<LL> l;
   rep(i,n){
   cin >> a;
     l.pb(a);
   }
  a=0;
   SORT(l);
   reve(l);
   rep(i,n){
    for(int j = i+1;j<n;j++){
     for(int k = j+1;k<n;k++){
   if(l[i]<l[j]+l[k])
      {
                              a++;
    }
     }
    }
   }
                              cout << a;
}

Compiler output:
a.cc:13:12: error: 'uint8_t' does not name a type
   13 | using u8 = uint8_t;
      |            ^~~~~~~
a.cc:12:1: note: 'uint8_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   11 | #include <math.h>
  +++ |+#include <cstdint>
   12 | using i8 = int8_t;
a.cc:15:13: error: 'uint16_t' does not name a type
   15 | using u16 = uint16_t;
      |             ^~~~~~~~
a.cc:15:13: note: 'uint16_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:17:13: error: 'uint32_t' does not name a type
   17 | using u32 = uint32_t;
      |             ^~~~~~~~
a.cc:17:13: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:19:13: error: 'uint64_t' does not name a type
   19 | using u64 = uint64_t;
      |             ^~~~~~~~
a.cc:19:13: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc: In function 'int main()':
a.cc:75:4: error: 'reve' was not declared in this scope; did you mean 'remove'?
   75 |    reve(l);
      |    ^~~~
      |    remove
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,sum=0;
  cin >> N;
  vector<int> L(N);
    for(int n=0;n<N;n++){
      cin >> L.at(n);
    }
  
  for(int x=0;x<N;x++){
    for(int y=x+1;y<N;y++){
        for(int z=y+1;z<N;z++){
          if( L.at(x)<L.at(y)+L.at(z) && L.at(y)<L.at(x)+L.at(z) && L.at(z)<L.at(y)+L.at(x) )sum++;
        }
    }
  }
  
 cout << sum << endl;
  //x 

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

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

import bisect

def main():
    N = int(input())
    L = list(map(int, input().split()))

    L = sorted(L)

    ans = 0
    for i in range(N-2):
        for j in range(N-1):
            if j > i:
                ans += bisect.bisect_left(L[j+1:], L[i] + L[j])

    print(ans)

if __name__ == '__main__':
    main()



Compiler output:
a.cc:21:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   21 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>//priority_queue<型名> 変数：優先度付きキュー　最大値の探索が早い
#include<set>
#include<stack>
#include<string>
#include<vector>

#include<bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<tuple>
#include<utility>
#define rep0(i,n)  for(ll i=0; i<n; i++)
#define rrep0(i,n) for(ll i=n-1; 0<=i; i--)
#define rep1(i,n)  for(ll i=1; i<=n; i++)
#define rrep1(i,n) for(ll i=n; 1<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
using ll = long long;
using namespace std;

int main(){
  ll n;  cin >> n;
  vll l(n);
  rep0(i,n){
    cin >> l[i];
  }
  sort(all(l));

  ll ans = 0;
  rep0(i,n-2){
    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{
          ans++;
        }
      }
      if(out){
        break;
      }
    }
  }
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:10: error: 'out' was not declared in this scope
   49 |       if(out){
      |          ^~~
Language: C++

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

void recursive_comb(int *indexes, int s, int rest, std::function<void(int *)> f) {
  if (rest == 0) {
    f(indexes);
  } else {
    if (s < 0) return;
    recursive_comb(indexes, s - 1, rest, f);
    indexes[rest - 1] = s;
    recursive_comb(indexes, s - 1, rest - 1, f);
  }
}

// nCkの組み合わせに対して処理を実行する
void foreach_comb(int n, int k, std::function<void(int *)> f) {
  int indexes[k];
  recursive_comb(indexes, n - 1, k, f);
}

int main(){
	int nn;
	scanf("%d",&nn);

	int* l = new int[nn];
	for(int i=0;i<nn;i++){
		scanf("%d",&l[i]);
	}

	int count=0;

	foreach_comb(nn,3,[](int *indexes){
		if(l[indexes[0]]<l[indexes[1]]+l[indexes[2]]] &&l[indexes[1]]<l[indexes[0]]+l[indexes[2]]]&&l[indexes[2]]<l[indexes[1]]+l[indexes[0]]]){
			count += 1;
		}
	});

	printf("%d",count);
	return 0;
}


Compiler output:
a.cc: In lambda function:
a.cc:35:20: error: 'l' is not captured
   35 |                 if(l[indexes[0]]<l[indexes[1]]+l[indexes[2]]] &&l[indexes[1]]<l[indexes[0]]+l[indexes[2]]]&&l[indexes[2]]<l[indexes[1]]+l[indexes[0]]]){
      |                    ^
a.cc:34:28: note: the lambda has no capture-default
   34 |         foreach_comb(nn,3,[](int *indexes){
      |                            ^
a.cc:27:14: note: 'int* l' declared here
   27 |         int* l = new int[nn];
      |              ^
a.cc:35:34: error: 'l' is not captured
   35 |                 if(l[indexes[0]]<l[indexes[1]]+l[indexes[2]]] &&l[indexes[1]]<l[indexes[0]]+l[indexes[2]]]&&l[indexes[2]]<l[indexes[1]]+l[indexes[0]]]){
      |                                  ^
a.cc:34:28: note: the lambda has no capture-default
   34 |         foreach_comb(nn,3,[](int *indexes){
      |                            ^
a.cc:27:14: note: 'int* l' declared here
   27 |         int* l = new int[nn];
      |              ^
a.cc:35:48: error: 'l' is not captured
   35 |                 if(l[indexes[0]]<l[indexes[1]]+l[indexes[2]]] &&l[indexes[1]]<l[indexes[0]]+l[indexes[2]]]&&l[indexes[2]]<l[indexes[1]]+l[indexes[0]]]){
      |                                                ^
a.cc:34:28: note: the lambda has no capture-default
   34 |         foreach_comb(nn,3,[](int *indexes){
      |                            ^
a.cc:27:14: note: 'int* l' declared here
   27 |         int* l = new int[nn];
      |              ^
a.cc:35:61: error: expected ')' before ']' token
   35 |                 if(l[indexes[0]]<l[indexes[1]]+l[indexes[2]]] &&l[indexes[1]]<l[indexes[0]]+l[indexes[2]]]&&l[indexes[2]]<l[indexes[1]]+l[indexes[0]]]){
      |                   ~                                         ^
      |                                                             )
a.cc:35:61: error: expected primary-expression before ']' token
Language: C++

N = int(input())
L = tuple(map(int, input().split()))

L = sorted(L)

count = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        ab_num = [i, j]
        #print(ab_num)
        for k in range(j+1, N):
            if k not in ab_num:
                if L[ab_num[0]] + L[ab_num[1]] > L[k]:
                    count += 1
                else:
                    break


print(count)

Compiler output:
a.cc:10:10: error: invalid preprocessing directive #print
   10 |         #print(ab_num)
      |          ^~~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: Java



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
    public static void main(final String[] args) {
        final FastScanner scanner = new FastScanner(System.in);
        final int n = scanner.nextInt();
        final long[] bars = new long[1001];
        final long[] accumulation = new long[1001];
        for (int i = 0; i < n; i++) {
            bars[scanner.nextInt()]++;
        }

        for (int i = 1; i < 1001; i++) {
            accumulation[i] += accumulation[i - 1];
        }

        long answer = 0;
        for (int i = 1; i < 1001; i++) {
            if (bars[i] == 0) {
                continue;
            }

            if (bars[i] > 3) {
                answer += i * (i - 1)*(i-2) / 2
            }

            for (int j = i + 1; j < 1001; j++) {
                if (bars[j] == 0) {
                    continue;
                }

                if (bars[j]> 2){
                    answer+= i * j*(j-1)/2;
                }

                for (int k = j + 1; k < i + j && k < 1001; k++) {
                    if (bars[k] == 0 || k == i || k == j) {
                        continue;
                    }

                    answer += bars[i] * bars[j] * bars[k];
                }
            }
        }
        System.out.println(answer);
    }

    static class FastScanner {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(final InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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


Compiler output:
Main.java:32: error: ';' expected
                answer += i * (i - 1)*(i-2) / 2
                                               ^
1 error
Language: C++

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

int main(){

  int n;
  cin >> n;
  int a[n];
  rep(i, n)cin >> a[i];

  int count = 0;

  for(int i = 0; i < n - 2; i++){
    int s = n - 2;
    for(int j = 0; j < n - i - 2; j++){
      int w = n - 1;
      for(int k = 0; k < n - i - 2; k++){
         \\         cout << a[i] << ":" << a[s] << ":" << a[w] << endl;
        if(a[i] == a[s] || a[i] == a[w] || a[s] == a[w]);
        else if(a[i] < a[s] + a[w] && a[s] < a[w] + a[i] && a[w] < a[i] + a[w]){
          count++;
       \\   cout << a[i] << ":" << a[s] << ":" << a[w] << endl;

        }
        w--;
      }
      s--;
    }

  }

  cout << count << endl;
}


Compiler output:
a.cc:23:10: error: stray '\' in program
   23 |          \\         cout << a[i] << ":" << a[s] << ":" << a[w] << endl;
      |          ^
a.cc:23:11: error: stray '\' in program
   23 |          \\         cout << a[i] << ":" << a[s] << ":" << a[w] << endl;
      |           ^
a.cc:27:8: error: stray '\' in program
   27 |        \\   cout << a[i] << ":" << a[s] << ":" << a[w] << endl;
      |        ^
a.cc:27:9: error: stray '\' in program
   27 |        \\   cout << a[i] << ":" << a[s] << ":" << a[w] << endl;
      |         ^
Language: C++

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

int n ;
int a[MX] ;
vector<int> v;
int cp ;
int find_pos(int err)
{
    int l = 0, r = n ;
    int mid ;
    cp = err ;
    int hold ;
    while(l <= r)
    {
        mid = (l+r)>>1 ;
        if(a[mid] == err)
        {
            hold = mid ;
            for(int i=mid+1; i<n; i++)
            {
                if(a[i] == err)
                {
                    hold = i ;
                    continue ;
                }
                break ;
            }
            return hold ;
        }
        if(a[mid] > err)
        {
            //cout << "bigger\n" << '\n' ;
            r = mid-1 ;
        }
        else
        {
            l = mid+1 ;
        }
    }
    //cout << l << ' ' << a[l] << ' ' << r << ' ' << a[r] << '\n' ;
    int hold ;
    for(int i=-10; i<10; i++)
    {
        if(mid+i>=0 && mid+i<n)
        {
            if(a[mid+i]<err)
            {
                cp = a[mid+i] ;
                hold = mid+i ;
            }
        }
    }
    return hold ;
}
int main()
{
    int ans ;
    int app[MX] ;

    while(cin >> n)
    {
        memset(app, 0, sizeof(app)) ;
        ans = 0 ;
        int hand ;
        for(int i=0; i<n; i++)
        {
            cin >> hand ;
            a[i] = hand ;
            app[hand]++ ;
        }
        sort(a, a+n) ;
        //for(int i=0; i<n; i++) cout << a[i] << ' ' ;
        //cout << '\n' ;
        //sort(v.begin(), v.end()) ;
        for(int i=0; i<n-2; i++)
        {
            for(int j=i+1; j<n; j++)
            {
                int pos = find_pos(a[i]+a[j]-1) ;
                ans += max(pos-j,0) ;
            }
        }
        cout << ans << '\n' ;
    }
    return 0 ;
}


Compiler output:
a.cc: In function 'int find_pos(int)':
a.cc:43:9: error: redeclaration of 'int hold'
   43 |     int hold ;
      |         ^~~~
a.cc:14:9: note: 'int hold' previously declared here
   14 |     int hold ;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
long long d[1010][1010][1010];
long long b[5010];
long long a[5010];
long long c[5010];
int main()
{
	
	long long n;
	cin >> n;
	for(long long i = 0; i < n ;i++){
		cin >> a[i];
		c[a[i]]++;
	}
	sort(a,a+n);
	b[1001] = 0;
	long long ans = 0;
	long long flag = 0;
	for(long long i = 0; i < n; i++){
		for(long long j = i + 1; j < n; j++){
			for(int k = j + 1; k < n; k++){
				if(a[i] + a[j] > a[k] && !d[a[i]][a[j]]){
					ans++;
					d[a[i]][a[j]] = 1;
				}
			}
		}
	}
	cout << ans <<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:55: error: incompatible types in assignment of 'int' to 'long long int [1010]'
   25 |                                         d[a[i]][a[j]] = 1;
      |                                         ~~~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>

#define INF 2e9

#define REP(i,n) for(int i = 0; i < n;++i)
#define REPA(i,a,n) for(int i = a; i < n; ++i)
#define ALL(a) a.begin(), a.end()

using namespace std;

int main(void) {

	int N, a, b, c, sum = 0;
	vector<int> l(2001);

	cin >> N;

	vector<int> len(N);

	REP(i, N) {
		cin >> len[i];
		l[len[i]]++;
	}
	
	sort(ALL(len));

	REP(i, N){
		a = len[i];
		REPA(j, i + 1, N){
			b = len[j];
			for(int k = a + b - 1; k >= b ; k--){
				sum += l[k];
			}
			if(temp_sum != sum) sum -= l[a];
			j += b;
		}
	}

	cout << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:28: error: 'temp_sum' was not declared in this scope
   40 |                         if(temp_sum != sum) sum -= l[a];
      |                            ^~~~~~~~
Language: Java

package ABC147.D;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
    public static void main(final String[] args) {
        final FastScanner scanner = new FastScanner(System.in);
        final int n = scanner.nextInt();
        final long[] bars = new long[1001];
        final long[] accumulation = new long[1001];
        for (int i = 0; i < n; i++) {
            bars[scanner.nextInt()]++;
        }

        for (int i = 1; i < 1001; i++) {
            accumulation[i] += accumulation[i - 1];
        }

        long answer = 0;
        for (int i = 1; i < 1001; i++) {
            if (bars[i] == 0) {
                continue;
            }

            if (bars[i] > 3) {
                answer += i * (i - 1)*(i-2) / 2
            }

            for (int j = i + 1; j < 1001; j++) {
                if (bars[j] == 0) {
                    continue;
                }

                if (bars[j]> 2){
                    answer+= i * j*(j-1)/2;
                }

                for (int k = j + 1; k < i + j && k < 1001; k++) {
                    if (bars[k] == 0 || k == i || k == j) {
                        continue;
                    }

                    answer += bars[i] * bars[j] * bars[k];
                }
            }
        }
        System.out.println(answer);
    }

    static class FastScanner {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(final InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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


Compiler output:
Main.java:32: error: ';' expected
                answer += i * (i - 1)*(i-2) / 2
                                               ^
1 error
Language: C++

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

int main()
{
 int N,d;
 bool f,c,e;
 vector<int> L(10000);
 d=0;

 cin >> N;

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

for(int i=0;i<N;i++){
 for(int a=1;a<(N-1);a++){
for(int j=2;j<(N-2);j++){
         if(L.at(a+i)<(L.at(i)+L.at(i+j))){
         if(L.at(i)<(L.at(i+a)+L.at(i+j)) || L.at(a+i)<(L.at(i)+L.at(i+j)) || L.at(i+j)<(L.at(i)+L.at(a+i))){
         
          f = true;
         }

         if(f == true){ 
             d++;
         }

    }

        }
}

        cout << d <<endl;

}

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

    long int n,a,b,c;
    long int m[1100],co=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>m[i];
    }
    for(int i=0;i<n;i++){
        for(int j=i+2;j<n;j++){
            a=m[i];
            b=m[i+1];
            c=m[j];
            if(a<b+c && b<c+a && c<a+b)co++;
        }
    }
    cout<<co;


Compiler output:
a.cc:3:5: error: 'cin' does not name a type
    3 |     cin>>n;
      |     ^~~
a.cc:4:5: error: expected unqualified-id before 'for'
    4 |     for(int i=0;i<n;i++){
      |     ^~~
a.cc:4:17: error: 'i' does not name a type
    4 |     for(int i=0;i<n;i++){
      |                 ^
a.cc:4:21: error: 'i' does not name a type
    4 |     for(int i=0;i<n;i++){
      |                     ^
a.cc:7:5: error: expected unqualified-id before 'for'
    7 |     for(int i=0;i<n;i++){
      |     ^~~
a.cc:7:17: error: 'i' does not name a type
    7 |     for(int i=0;i<n;i++){
      |                 ^
a.cc:7:21: error: 'i' does not name a type
    7 |     for(int i=0;i<n;i++){
      |                     ^
a.cc:15:5: error: 'cout' does not name a type
   15 |     cout<<co;
      |     ^~~~
Language: C

#include<stdio.h>

int main(void){
    int n;
    scanf("%d",&n);
    int l[n];
    int i, j, k;
    int s;
    int ans = 0;
    int temp;
    for(i=0;i<n;i++){
        scanf("%d",&l[i]);
    }
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            if(d[i]>d[j]){
                temp = d[i];
                d[i] = d[j];
                d[j] = temp;
            }
        }
    }
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            for(k=j+1;k<n;k++){
                s = l[i] + l[j] + l[k];
                if((s-2*l[i])*(s-2*l[j])*(s-2*l[k]) > 0)
                    ans++;
                if((s-2*l[i])*(s-2*l[j])*(s-2*l[k]) <= 0)
                    break;
            }
        }
    }
    printf("%d",ans);
    return 0;
    
}


Compiler output:
main.c: In function 'main':
main.c:16:16: error: 'd' undeclared (first use in this function)
   16 |             if(d[i]>d[j]){
      |                ^
main.c:16:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<stdio.h>
int main(){
  int N;
  scanf("%d",&N);
  int L[N];
  int i,j,k;
  for(i=1;i<=N;++i){
scanf("%d",&L[i]);
  }
  int c2;
  for(i=1;i<=N-2;++i){
    for(j=i+1;j<=N-1;++j){
for(k=j+1;k<=N;++j){
  if(L[i]<L[j]+L[k]||L[j]<L[i]+L[k]||L[k]<L[i]+L[j]){
    c2+=+1;
}
}
    }
  }
  printf("%d\n",c1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'c1' was not declared in this scope; did you mean 'c2'?
   20 |   printf("%d\n",c1);
      |                 ^~
      |                 c2
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(){
    int n;
    cin >> n;
    int t;
    vector<int> l;
    while( n-- ){
        cin >> t;
        l.push_back(t);
    }
    sort( l.begin(), l.end() );
    n = l.size();
    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];
            auto it = lower_bound(l.begin()+j , l.end(), l[i]+l[j]);
            it--;
            while( it > l.begin()+j ){
                int c = *it;
                if( a < b+c && b < a+c && c < a+b ) {
                    //cout << a << " " << b << " " << c << endl;
                    ans++;
                }
                it--;
            }
        }
    }
    cout << ans;
    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++

#include <bits/stdc++.h>
usnig namespace std;
int main(){
  int N,ALL=0;
  cin>>N;
  vector<int> L(N);
  for(int i=0;i<N;i++)cin>>L.at(i);
  for(int i=0;i<N;i++){
    for(int i2=i+1;i2<N;i2++){
      for(int i3=i2+1;i3<N;i3++){
        if(L.at(i)<L.at(i2)+L.at(i3) && L.at(i2)<L.at(i)+L.at(i3) && L.at(i3)<L.at(i)+L.at(i2)){
          ALL++;
        }
      }
    }
  }
  cout<<ALL<<endl;

Compiler output:
a.cc:2:1: error: 'usnig' does not name a type
    2 | usnig namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>N;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> L(N);
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> L(N);
      |          ^~~
a.cc:7:28: error: 'L' was not declared in this scope
    7 |   for(int i=0;i<N;i++)cin>>L.at(i);
      |                            ^
a.cc:11:12: error: 'L' was not declared in this scope
   11 |         if(L.at(i)<L.at(i2)+L.at(i3) && L.at(i2)<L.at(i)+L.at(i3) && L.at(i3)<L.at(i)+L.at(i2)){
      |            ^
a.cc:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |   cout<<ALL<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:17:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |   cout<<ALL<<endl;
      |              ^~~~
      |              std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:17:19: error: expected '}' at end of input
   17 |   cout<<ALL<<endl;
      |                   ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(){
    int n;
    cin >> n;
    int t;
    vector<int> l;
    while( n-- ){
        cin >> t;
        l.push_back(t);
    }
    sort( l.begin(), l.end() );
    n = l.size();
    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];
            auto it = lower_bound(l.begin()+j , l.end(), l[i]+l[j]);
            it--;
            while( it > l.begin()+j ){
                int c = *it;
                if( a < b+c && b < a+c && c < a+b ) {
                    cout << a << " " << b << " " << c << endl;
                    ans++;
                }
                it--;
            }
        }
    }
    cout << ans;
    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++

#include <functional>
#include <queue>
#include <vector>
#include <iostream>
#include <cstdint>
#include <cstring>
using namespace std;

int main()
{
	int n;
	vector<int> l;
	int cnt = 0;

	cin >> n;

	for (int i = 0; i < n; i++)
	{
		int in;
		cin >> in;
		l.push_back(in);
	}

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

	for (int i = 0; i < n; i++)
	{
		cout << l[i] << endl;
	}
	
	for (int x = 0; x < n; x++)
	{
		int a = l[x];
		for (int y = x + 1; y < n; y++)
		{
			int b = l[y];
			for (int z = y + 1; z < n; z++)
			{
				int c = l[z];

				if (a + b < c)
				{
					if (a < b + c)
					{
						if (b < c + a)
						{
							cnt++;
						}
					}
				}
				else
				{
					break;
				}
			}
		}
	}

	cout << cnt;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   24 |         std::sort(l.begin(), l.end());
      |              ^~~~
      |              qsort
Language: Java

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

Compiler output:
Main.java:22: error: ')' expected
                	if((b[i]<b[j]+b[k])
                	                   ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <string>

int b143(void);
int c143(void);
int d143(void);

int main(void) {
	d143();
	return 0;
}

int d143(void) {
	int n;
	std::cin >> n;
	std::vector<int> l;
	int temp;
	for(int i = 0; i < n; i++){
		std::cin >> temp;
		l.push_back(temp);
	}
	std::sort(l.rbegin(), l.rend());

	for (int i = 0; i < n; i++) {
		std::cout << l[i];
	}
	
	int res_count = 0;
	int a, b, c;
	for (int i = 0; i < n; i++) {
		a = l[i];
		for (int j = i + 1; j < n; j++) {
			b = l[j];
			if (b * 2 < a) {
				break;
			}
			for (int k = j + 1; k < n; k++) {
				c = l[k];
				if (c < b - a) {
					break;
				}
				if (a < b + c && b < a + c && c < a + b) {
					res_count += 1;
				}
			}
		}
	}
	std::cout << res_count;
	return 0;
}

int b143(void) {
	int n;
	std::cin >> n;
	std::vector<int> k;
	int temp;
	for (int i = 0; i < n; i++) {
		std::cin >> temp;
		k.push_back(temp);
	}
	int sum = 0;
	for (int i = 0; i+1 < n;  i++) {
		for (int j = i+1; j < n; j++) {
			sum += k[i] * k[j];
		}
	}
	std::cout << sum;
	return 0;
}

int c143(void) {
	int l;
	std::cin >> l;
	std::string colors;
	std::cin >> colors;
	std::string result;
	char holder='0';

	for (int i = 0; i < l; i++) {
		if (holder != colors[i]) {
			result.push_back(colors[i]);
			holder = colors[i];
		}
	}
	std::cout << result.size();
	return 0;
}

Compiler output:
a.cc: In function 'int d143()':
a.cc:23:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   23 |         std::sort(l.rbegin(), l.rend());
      |              ^~~~
      |              qsort
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
  int ans = 0;
  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(), std::greater<int>());

  for(int i = 0; i < n; i++) {
    for(int j = i + 1; j < n; j++) {
      for(int k = j + 1; k < n; k++) {
	if( l[i] < l[j] + l[k] && l[j] < l[i] + l[k] && l[k] < l[i] + l[j]) {
	  ans += 1;
	} else {
	  break;
	}
      }
    }
  }
  cout << ans << endl;
  return 0;
}


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

#include<stdio.h>
int main(){
  int N;
  scanf("%d",&N);
  int L[i];
  for(i=1;i<=N;++i){
scanf("%d",&L[i]);
  }
int i,j,k;
  int c1,c2;
  c1=0;
  for(i=1;i<=N-2;++i){
    for(j=i+1;j<=N-1;++j){
for(k=j+1;k<=N;++j){
  if(L[i]<L[j]+L[k]){
    c2=c1+1;
    c1=c2;
}else if(L[j]<L[i]+L[k]){
     c2=c1+1;
    c1=c2;
  }
else if(L[k]<L[i]+L[j]){
   c2=c1+1;
    c1=c2;
}
}
    }
  }
  printf("%d\n",c1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'i' was not declared in this scope
    5 |   int L[i];
      |         ^
a.cc:7:13: error: 'L' was not declared in this scope
    7 | scanf("%d",&L[i]);
      |             ^
a.cc:15:6: error: 'L' was not declared in this scope
   15 |   if(L[i]<L[j]+L[k]){
      |      ^
Language: Java


import java.util.*;

class Main {



	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int L[] = new int[N];
        int count = 0;
        int a = 0;
        int b = 0;
        int c = 0;

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

        Arrays.sort(L, 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++){
                    a = L[i];
                    b = L[j];
                    c = L[k];

                    if(a < b+c && b < c+a && c < b+a){
                        count++;
                    }
                }
            }
        }


        System.out.println(count);

    }



}







Compiler output:
Main.java:21: error: no suitable method found for sort(int[],Comparator<T#1>)
        Arrays.sort(L, Comparator.reverseOrder());
              ^
    method Arrays.<T#2>sort(T#2[],Comparator<? super T#2>) is not applicable
      (inference variable T#2 has incompatible bounds
        equality constraints: int
        upper bounds: Object)
    method Arrays.<T#3>sort(T#3[],int,int,Comparator<? super T#3>) is not applicable
      (cannot infer type-variable(s) T#3
        (actual and formal argument lists differ in length))
  where T#1,T#2,T#3 are type-variables:
    T#1 extends Comparable<? super T#1>
    T#2 extends Object declared in method <T#2>sort(T#2[],Comparator<? super T#2>)
    T#3 extends Object declared in method <T#3>sort(T#3[],int,int,Comparator<? super T#3>)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

#include<stdio.h>
int main(){
  int N;
  scanf("%d",%N);
  int L[i];
  for(i=1;i<=N;++i){
scanf("%d",%L[i]);
  }
int i,j,k;
  int c1,c2;
  c1=0;
  for(i=1;i<=N-2;++i){
    for(j=i+1;j<=N-1;++j){
for(k=j+1;k<=N;++j){
  if(L[i]<L[j]+L[k]){
    c2=c1+1;
    c1=c2;
}else if(L[j]<L[i]+L[k]){
     c2=c1+1;
    c1=c2;
  }
else if(L[k]<L[i]+L[j]){
   c2=c1+1;
    c1=c2;
}
}
    }
  }
  printf("%d\n",c1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: expected primary-expression before '%' token
    4 |   scanf("%d",%N);
      |              ^
a.cc:5:9: error: 'i' was not declared in this scope
    5 |   int L[i];
      |         ^
a.cc:7:12: error: expected primary-expression before '%' token
    7 | scanf("%d",%L[i]);
      |            ^
a.cc:7:13: error: 'L' was not declared in this scope
    7 | scanf("%d",%L[i]);
      |             ^
a.cc:15:6: error: 'L' was not declared in this scope
   15 |   if(L[i]<L[j]+L[k]){
      |      ^
Language: C

#include<stdio.h>

int main(void){
    int n;
    scanf("%d",&n);
    int l[n];
    int i, j, k;
    int s;
    int ans = 0;
    for(i=0;i<n;i++){
        scanf("%d",&l[i]);
    }
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            for(k=j+1;k<n;k++){
                if(b+c>a){
                    if(c+a>b){
                        if(a+b>c){
                            ans++;
                        }
                    }
                }
            }
        }
    }
    printf("%d",ans);
    return 0;
    
}


Compiler output:
main.c: In function 'main':
main.c:16:20: error: 'b' undeclared (first use in this function)
   16 |                 if(b+c>a){
      |                    ^
main.c:16:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:22: error: 'c' undeclared (first use in this function)
   16 |                 if(b+c>a){
      |                      ^
main.c:16:24: error: 'a' undeclared (first use in this function)
   16 |                 if(b+c>a){
      |                        ^