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

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
  int N;
  cin >> N;
  
  vector<int>house(N,0);
  
  for(int i=0;i<N;i++){
    cin >> house[i];
  }
  
  sort(house.begin(),house,end());
  
  int ans = 0;
  int now_house = house[0];
  
  for(int i=1;i<N;i++){
    ans += house[i] - now_house;
    now_house = house[i];
  }
  
  cout << ans << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:31: error: no matching function for call to 'end()'
   15 |   sort(house.begin(),house,end());
      |                            ~~~^~
In file included from /usr/include/c++/14/bits/range_access.h:36,
                 from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:115:31: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
  115 |   template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept;
      |                               ^~~
/usr/include/c++/14/bits/range_access.h:115:31: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:116:37: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
/usr/include/c++/14/bits/range_access.h:116:37: note:   candidate expects 1 argument, 0 provided
Language: C++

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

int main(){
  int N,A[110];
  cin >> N;
  for (i=0;i<N;i++){
    cin >> A[i];
  }
  sort(A,A+N);
  cout << A[N-1]-A[0] <<endl;
}

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

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

int main(){
	int n; cin >>n;
	vector<int> a(n);
	cinf(n,a);
	sort(a.begin(),a.end());
	cout << a[m-1]-a[0]<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: 'm' was not declared in this scope
   11 |         cout << a[m-1]-a[0]<< endl;
      |                   ^
Language: C++

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

int main(){
    int N;
    cin>>N;
    int a[N];
    for(int i=0;i<N;i++) cin>>a[i];
    sort(a.begin(),a.end());
    int ans = a[N-1] - a[0];
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: request for member 'begin' in 'a', which is of non-class type 'int [N]'
    9 |     sort(a.begin(),a.end());
      |            ^~~~~
a.cc:9:22: error: request for member 'end' in 'a', which is of non-class type 'int [N]'
    9 |     sort(a.begin(),a.end());
      |                      ^~~
Language: C++

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

int main(){
    int N;
    cin>>N;
    vector<int> a;
    for(int i=0;i<N;i++) a[i].push_back();
    sort(a.begin(),a.end());
    int ans = a[N-1] - a[0];
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: request for member 'push_back' in 'a.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
    8 |     for(int i=0;i<N;i++) a[i].push_back();
      |                               ^~~~~~~~~
Language: C++

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

int main(){
    int N;
    cin>>N;
    vector<int> a;
    for(i=0;i<N;i++) a[i].push_back();
    sort(a.begin(),a.end());
    int ans = a[N-1] - a[0];
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     for(i=0;i<N;i++) a[i].push_back();
      |         ^
Language: C++

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

	int main(){
      int N;
      for (int i=0;i<N;i++){
        cin >> a[i];
      }
      sort(a,a+N);
      cout << a[N-1]-a[0] << endl;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'a' was not declared in this scope
    7 |         cin >> a[i];
      |                ^
a.cc:9:12: error: 'a' was not declared in this scope
    9 |       sort(a,a+N);
      |            ^
Language: C++

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

int main() {
  int n,sum=0;
  cin >> n;
  vector<int> v(n);
  for(int i=0; i<n; i++) {
    cin >> v[i];
  }
  sort(v.begin(),v.end());
  reverse(v.begin(),end());
  for(int i=0; i<n; i++) {
    sum+=v[i+1]-v[i];
  }
  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: no matching function for call to 'end()'
   12 |   reverse(v.begin(),end());
      |                     ~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1265:5: note:   candidate expects 1 argument, 0 provided
Language: C++

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

int main(){
	int N,a;
  	cin>>N;
  	cin>>a;
  	maxv=a;minv=a;
  	for(int i=1;i<N;++i){
    	cin>>a;
      	maxv=max(a,maxv);
      	minv=min(a,minv);
    }
  	cout<<maxv-minv<<endl;
  	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'maxv' was not declared in this scope
    9 |         maxv=a;minv=a;
      |         ^~~~
a.cc:9:16: error: 'minv' was not declared in this scope
    9 |         maxv=a;minv=a;
      |                ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define Abs(x)((x) < 0 ? (x) * -1 : (x))

#define rep(x, y) for ((x) = 0; (x) < (y); (x)++)
#define repin(x, y) for ((x) = 0; (x) <= (y); (x)++)
#define nep(x, y) for ((x) = (y) - 1; 0 <= (x); (x)--)
#define nepi(x, y, z) for ((x) = (y) - 1; (z) <= (x); (x)--)
#define repi(x, y, z) for ((x) = (z); (x) < (y); (x)++)
#define repiin(x, y, z) for ((x) = (z); (x) <= (y); (x)++)
#define reps(x, y, z) for ((x) = 0; (x) < (y); (x) += (z))
#define repis(x, y, z, s) for ((x) = (z); (x) < (y); (x) += (s))
#define repiins(x, y, z, s) for ((x) = (z); (x) <= (y); (x) += (s))
#define repit(x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define nepit(x) for (__typeof((x).rbegin()) it = (x).rbegin(); it != (x).rend(); it++)

#define All(x) (x).begin(),(x).end()

#define Mem0(x) memset(x, 0, sizeof(x))
#define Mem1(x) memset(x, -1, sizeof(x))

#define Unique(v) v.resize(unique(All(v)) - v.begin())

#define peq(p0, p1)(p0.first == p1.first && p0.second == p1.second)

#define End '\n'
#define Out(x) cout<<(x)<<End
#define OutP(p, sep, end) cout<<p.first<<sep<<p.second<<end

template<typename T> inline bool Max(T &x, const T &y) { return x < y ? x = y, 1 : 0; }
template<typename T> inline bool Min(T &x, const T &y) { return x > y ? x = y, 1 : 0; }
template<typename T> using V = vector<T>;
template<typename T> using VV = V<V<T> >;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define lb std::lower_bound
#define ub std::upper_bound

#define lbi(v, x) lb(All(v), (x))-v.begin()
#define ubi(v, x) ub(All(v), (x))-v.begin()

static const ll MOD = 1e9 + 7;
static const double PI = 3.141592653589793;

#define LOCAL 0

int main()
{
#if LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#endif

    cin.tie(0);
    ios::sync_with_stdio(false);
	//std::cout.precision(18);

    int n;

	cin >> n;

	int ma = -1;
	int mi = INT_max;
	int x;

	int i;

	rep(i, n) {
		cin >> x;

		Max(ma, x);
		Min(mi, x);
	}

	Out(ma - mi);
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:18: error: 'INT_max' was not declared in this scope; did you mean 'INT_MAX'?
   72 |         int mi = INT_max;
      |                  ^~~~~~~
      |                  INT_MAX
Language: Java

import java.util.*;

public class B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> list_a = new ArrayList<Integer>();
        for(int i = 0; i < n; i++){
            int din = sc.nextInt();
            list_a.add(din);
        }
        
        Collections.sort(list_a);
        int ans = 0;
        for(int i = 1; i < n; i++){
            //char c = (i == n - 1)? '\n' : ' ';
            //System.out.print(list_a.get(i));
            //System.out.print(c);
            ans += list_a.get(i) - list_a.get(i - 1);
        }
        System.out.println(ans);
    }    
}

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

#include<stdio.h>

int main(){
  int N, a, max = 0, min = 1001;
  
  scanf("%d", &N);
  
  for (i = 0; i < N; i++){
    scanf("%d", &a);
    if(a > max){
      max = a;
    }
    if(a < min){
      min = a;
    }
  }
  
  printf("%d\n", max - min);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:8: error: 'i' undeclared (first use in this function)
    8 |   for (i = 0; i < N; i++){
      |        ^
main.c:8:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;

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

  sort(a,a+N);
  cout<<a[N-1]-a[0]<<endl;
}


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

#include<iostream>
using namespace std;
#define MAX 500000
#define SENTINEL 2000000000

int L[MAX/2 + 2], R[MAX/2+2];
int cnt;

void merge(int A[], int n, int left, int mid, int right){
  int n1 = mid - left;
  int n2 = right - mid;
  for( int i = 0; i < n1; i++ )L[i] = A[left + i];
  for( int i = 0; i < n2; i++ )R[i] = A[mid + i];
  L[n1] = R[n2] = SENTINEL;
  int i = 0, j = 0;
  for ( int k = left; k < right; k++ ){
    cnt++;
    if(L[i] <= R[j]){
      A[k] = L[i++];
    }else{
      A[k] = R[j++];
    }
  }
}

void mergeSort(int A[], int n, int left, int right){
  if( left+1 < right){
    int mid = (left + right) / 2;
    mergeSort(A, n, left, mid);
    mergeSort(A, n, mid, right);
    merge(A, n, left, mid, right);
  }
}
int main(){
  int n;cin>>n;
  int a,
  min=1001,max=01;
  for(int i=1;i<=n;i++){
    cin>>a;
    if(min>A)min=a;
    if(max<a)max=a;
  }
  cou<<max-min<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:12: error: 'A' was not declared in this scope
   40 |     if(min>A)min=a;
      |            ^
a.cc:43:3: error: 'cou' was not declared in this scope
   43 |   cou<<max-min<<endl;
      |   ^~~
Language: C

#include <stdio.h>
#include <climits>

int main(void){
  int n;
  scanf("%d", &n);
  int min = INT_MAX;
  int max = INT_MIN;
  
  for(int i = 0; i < n; i++){
    int a;
    scanf("%d", &a);
    if(a < min) min = a;
    if(max < a) max = a;
  }
  
  printf("%d\n", max - min);
  return 0;
}

Compiler output:
main.c:2:10: fatal error: climits: No such file or directory
    2 | #include <climits>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
using namespace std;
signed main(){
	int n;
	cin >> n;
	vec(a,n);
	REP(i,n){
		cin >> a[i];
	}
	sort(a.bebin(),a.end());
	cout << a[n-1]-a[0] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'class std::vector<long long int>' has no member named 'bebin'; did you mean 'begin'?
   15 |         sort(a.bebin(),a.end());
      |                ^~~~~
      |                begin
Language: C++

#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
using namespace std;
signed main(){
	int n;
	cin >> n;
	vec(a,n);
	REP(i,n){
		cin >> a[i];
	}
	sort(a.bebin(),a.end());
	cout << a[n-1]-a[0] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'a' was not declared in this scope
    9 |         vec(a,n);
      |             ^
a.cc:9:9: error: 'vec' was not declared in this scope
    9 |         vec(a,n);
      |         ^~~
Language: C++

#include<bits/stdc++.h>
#include<vector>
using namespace std;
int n, a;
int max = -1;
int min = 1001;
int main(){
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a;
    if(Min > a) Min = a;
    if(Max < a) Max = a;
  }
  cout << Max - Min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'Min' was not declared in this scope; did you mean 'min'?
   11 |     if(Min > a) Min = a;
      |        ^~~
      |        min
a.cc:12:8: error: 'Max' was not declared in this scope; did you mean 'max'?
   12 |     if(Max < a) Max = a;
      |        ^~~
      |        max
a.cc:14:11: error: 'Max' was not declared in this scope; did you mean 'max'?
   14 |   cout << Max - Min << endl;
      |           ^~~
      |           max
a.cc:14:17: error: 'Min' was not declared in this scope; did you mean 'min'?
   14 |   cout << Max - Min << endl;
      |                 ^~~
      |                 min
Language: C++

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

using namespace std;

int main()
{
  int N;
  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  cout << a.back() - a.front();
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: 'a' was not declared in this scope
   12 |     cin >> a.at(i);
      |            ^
a.cc:14:8: error: 'a' was not declared in this scope
   14 |   sort(a.begin(), a.end());
      |        ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: invalid types 'int[int]' for array subscript
   13 |         if(a[j]<a[j+1]){
      |             ^
a.cc:13:18: error: invalid types 'int[int]' for array subscript
   13 |         if(a[j]<a[j+1]){
      |                  ^
a.cc:14:18: error: invalid types 'int[int]' for array subscript
   14 |             min=a[j];
      |                  ^
a.cc:17:18: error: invalid types 'int[int]' for array subscript
   17 |             min=a[j+1];
      |                  ^
a.cc:21:13: error: invalid types 'int[int]' for array subscript
   21 |         if(a[j]<a[j+1]){
      |             ^
a.cc:21:18: error: invalid types 'int[int]' for array subscript
   21 |         if(a[j]<a[j+1]){
      |                  ^
a.cc:22:18: error: invalid types 'int[int]' for array subscript
   22 |             max=a[j+1];
      |                  ^
a.cc:25:18: error: invalid types 'int[int]' for array subscript
   25 |             max=a[j];
      |                  ^
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:12:28: note: to match this '{'
   12 |     for(int j=0;j<=n-2;j++){
      |                            ^
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
	int a[100],n;
	cin>>n;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i]
		sort(a,a+n);
	}
	printf("%d\n",a[n-1]-a[0] );
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:9:26: error: expected ';' before 'sort'
    9 |                 cin>>a[i]
      |                          ^
      |                          ;
   10 |                 sort(a,a+n);
      |                 ~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
	int a[100],n;
	cin>>n;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i]
		sort(a,a+n)
	}
	printf("%d\n",a[n-1]-a[0] );
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:9:26: error: expected ';' before 'sort'
    9 |                 cin>>a[i]
      |                          ^
      |                          ;
   10 |                 sort(a,a+n)
      |                 ~~~~
Language: C++

#incllude<cstdio>
#include<algorithm>
using namespace std;
int a[100001];
int main()
{
    int n,i;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    sort(a+1,a+n+1);
    printf("%d\n",a[n]-a[1]);
    return 0;
} 

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incllude; did you mean #include?
    1 | #incllude<cstdio>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:5: error: 'scanf' was not declared in this scope
    8 |     scanf("%d",&n);
      |     ^~~~~
a.cc:11:5: error: 'printf' was not declared in this scope
   11 |     printf("%d\n",a[n]-a[1]);
      |     ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include<algorithm>
  +++ |+#include <cstdio>
    3 | using namespace std;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a=0x7f7f7f7f,b=-0x3f3f3f3f,n;
int main(){
    cin>>n;
    for(i=1;i<=n;i++){
        int x;
        cin>>x;
        a=min(a,x);
        b=max(b,x);
    }
    cout<<b-a<<endl;
    return 0;
}

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

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

int main(){
  int a,array[101];
  cin>>a;
  for(int i=0;i<a;i++){
    cin>>array[i];
  }
  sort(arrray,array+a);
  cout<<array[a-1]-array[0]<<endl;
}

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

#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b){
if(a<b){return gcd(b,a);}
else if(a%b){return gcd(b,a%b);}
else{return b;}
}
int main(){
  int N,A,MIN=1001,MAX=-1;
  cin>>N;
  for(int i=1; i<=N; ++i)
    cin>>A;
    if(MIN>A) MIN=A;
    if(MAX<A) MAX=A;
}
  cout<<MAX-MIN<<endl;
}


Compiler output:
a.cc:33:3: error: 'cout' does not name a type
   33 |   cout<<MAX-MIN<<endl;
      |   ^~~~
a.cc:34:1: error: expected declaration before '}' token
   34 | }
      | ^
Language: C++

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

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

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

    cout << xs[N-1] - xs[0] << endl;

    return 0;
}

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

#include<stdio.h>

int main(){
  int n,min=1000,max=0,a,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    if(min>a)
      min=a;
    if(max<a)
      max=a;
  }
  printf("%d\n"max-min);
}

Compiler output:
main.c: In function 'main':
main.c:13:16: error: expected ')' before 'max'
   13 |   printf("%d\n"max-min);
      |         ~      ^~~
      |                )
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<vector<P>> Graph;


int main(){
  
  int n;
  cin >> n;
  
  int v[n];
  REP(i,n){
    cin >> v[i];
  }
  
  sort(v,v+n);
  
  cout << v[n-1] - v[0] << endl



 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:32: error: expected ';' before 'return'
   26 |   cout << v[n-1] - v[0] << endl
      |                                ^
      |                                ;
......
   30 |  return 0;
      |  ~~~~~~
Language: C++

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

int main()
{
  int n;
  cin >> n;
  vector<int> a;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int m = min(a.begin(), a.end());
  int M = max(a.begin(), a.end());
  cout << M-m << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: cannot convert 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   14 |   int m = min(a.begin(), a.end());
      |           ~~~^~~~~~~~~~~~~~~~~~~~
      |              |
      |              const __gnu_cxx::__normal_iterator<int*, std::vector<int> >
a.cc:15:14: error: cannot convert 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   15 |   int M = max(a.begin(), a.end());
      |           ~~~^~~~~~~~~~~~~~~~~~~~
      |              |
      |              const __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

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

int main(){
int n;
cin>>n;
vector<int>a(n);
for(int i=0;i<n;i++){
  cin>>a.at(i);
  }
sort(a.begin(),a.end());
cout<<a(n-1)-a(0)<<endl;
return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: no match for call to '(std::vector<int>) (int)'
   12 | cout<<a(n-1)-a(0)<<endl;
      |       ~^~~~~
a.cc:12:15: error: no match for call to '(std::vector<int>) (int)'
   12 | cout<<a(n-1)-a(0)<<endl;
      |              ~^~~
Language: C++

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

int main (void) {
  int N;
  cin >>N;
  ans_max=0;
  ans_min=0;
  for (int i; i<=N-1; i++){
    int j; cin >> k;
    asn_max=max(ans_max,k);
    asn_min=max(ans_min,k);
  }
  cout << ans_max-ans_min;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'ans_max' was not declared in this scope
   10 |   ans_max=0;
      |   ^~~~~~~
a.cc:11:3: error: 'ans_min' was not declared in this scope; did you mean 'asin'?
   11 |   ans_min=0;
      |   ^~~~~~~
      |   asin
a.cc:13:19: error: 'k' was not declared in this scope
   13 |     int j; cin >> k;
      |                   ^
a.cc:14:5: error: 'asn_max' was not declared in this scope
   14 |     asn_max=max(ans_max,k);
      |     ^~~~~~~
a.cc:15:5: error: 'asn_min' was not declared in this scope; did you mean 'asin'?
   15 |     asn_min=max(ans_min,k);
      |     ^~~~~~~
      |     asin
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
        int n;
        cin>>n;
        int E[100];
        for(int i=0;i<n;i++){
                cin>>E[i];
        }
        sort(E,E+n);
        cout<<s[0]+s[n-1];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 's' was not declared in this scope
   12 |         cout<<s[0]+s[n-1];
      |               ^
Language: C++

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

int main(){
  int N;
  int a[1100];
  cin >> N;
  for(int i = 0; i < N;i++){
    cin >> a[i];
  }
  
  sort(a,a+n);
  int ans = a[N-1]-a[0];
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'n' was not declared in this scope
   13 |   sort(a,a+n);
      |            ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> vc(N);
    for(int i=0;i<N;i++)    cin >> vc[i];
    sort(vc.begin(),vc.end());
    cout << vc[N-1]-vc[0] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> vc(N);
      |     ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include<algorithm>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> vc(N);
      |            ^~~
a.cc:9:36: error: 'vc' was not declared in this scope
    9 |     for(int i=0;i<N;i++)    cin >> vc[i];
      |                                    ^~
a.cc:10:10: error: 'vc' was not declared in this scope
   10 |     sort(vc.begin(),vc.end());
      |          ^~
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n;
  int a[1000];
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  sort(a,a+n);
  cout << a[n-1]-a[0] << endl;

  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int ma=0;int mi=1000000000;
    for(int i=0;i<n;i++){
        int a;
        cin>>a;
        ma=max(a,ma);
        mi=miny(a,mi);
    }
    cout<<ma-mi<<endl;
}
        

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: 'miny' was not declared in this scope; did you mean 'mi'?
   11 |         mi=miny(a,mi);
      |            ^~~~
      |            mi
Language: C++

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

int main(){
	int N, MAX=0, MIN=0;
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> int a;
		MAX = max(a, MAX);
		MIN = min(a, MIN);
	}
	cout << MAX - MIN << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: expected primary-expression before 'int'
    9 |                 cin >> int a;
      |                        ^~~
a.cc:10:27: error: 'a' was not declared in this scope
   10 |                 MAX = max(a, MAX);
      |                           ^
Language: C++

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

int main(){
	int N, MAX=0, MIN=0;
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> a;
		MAX = max(a, MAX);
		MIN = min(a, MIN);
	}
	cout << MAX - MIN << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: 'a' was not declared in this scope
    9 |                 cin >> a;
      |                        ^
Language: C++

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	cin>>n; vector<int> a(n); rep(i, n) cin>>a[i]; sort(all(a));
  cout<<a[n-1]-a[0]<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:14: error: 'n' was not declared in this scope; did you mean 'yn'?
   42 |         cin>>n; vector<int> a(n); rep(i, n) cin>>a[i]; sort(all(a));
      |              ^
      |              yn
Language: C++

#include <iostream>
#include <math.h>
#include <string>
#include <string.h> 
#include <stdio.h>
using namespace std;
#define MAX 200000
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)

int main(){
    int n,a;
    int min=1001,max=0;
    scanf("%d",&n);
    REP(i,n){
        scanf("%d",&a);
        if(a<min)min=a;
        if(a>max)max=a
    }
    printf("%d\n",max-min);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:23: error: expected ';' before '}' token
   20 |         if(a>max)max=a
      |                       ^
      |                       ;
   21 |     }
      |     ~
Language: C++

clude <stdio.h>

int main(){
        int N;
        scanf("%d",&N);
        int i,a[100]={};
        for(i=0;i<N;i++){
                scanf("%d",&a[i]);
                printf("%d\n",a[i]);
        }
        int Max=0,Min=1000;
        for(i=0;i<N-1;i++){
                if(Max<a[i]){
                        Max = a[i];
                }
                if(a[i]<Min){
                        Min = a[i];
                }
        }
        printf("%d %d\n",Max, Min );
        printf("%d",Max-Min);
        return 0;
}


Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude <stdio.h>
      | ^~~~~
Language: C++

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

const int MAX_N = 100;
int n, a[MAX_N];
int MAX = 0, MIN = 1000;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];

	for (int i = 0; i < n; i++) {
		if (a[i] > MAX) max = a[i];
		if (a[i] < MIN) min = a[i];
	}

	cout << MAX - MIN << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:42: error: overloaded function with no contextual type information
   14 |                 if (a[i] > MAX) max = a[i];
      |                                          ^
a.cc:15:42: error: overloaded function with no contextual type information
   15 |                 if (a[i] < MIN) min = a[i];
      |                                          ^
Language: C

#include <iostream>
using namespace std;

int n, a, min = 1001, max = -1;

int main() {
	cin >> n;
	for(int i = 1; i <= n; i++) {
		cin >> a;
		if(min > a) min = a;
		if(max < a) max = a;
	}
	cout << max - min << endl;
	return 0;
}


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

import java.util.Arrays;
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
 
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int a[]=new int[N];
		for(int i=0;i<N;i++) {
			a[i]=sc.nextInt();
		}
		Arrays.sort(a);
		
		System.out.println(a[N-1]-a[0]);
	}
}

Compiler output:
Main.java:3: error: illegal character: '\u00a0'
?
^
Main.java:5: error: illegal character: '\u00a0'
?
^
Main.java:7: error: illegal character: '\u00a0'
?
^
3 errors
Language: C++

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

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int a[]=new int[N];
		for(int i=0;i<N;i++) {
			a[i]=sc.nextInt();
		}
		Arrays.sort(a);
		
		System.out.println(a[N-1]-a[0]);
	}
}


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

#include <bits/stdc++.h>
using namespace std;
int main(void)
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    int MAX=INT_MIN;
    int MIN=INT_MAX;
    int temp;
    for(int i=0;i<n;++i)
    {
        cin>>temp;
        MAX=max(MAX,temp);
        MIN=min(MIN,temp);
    }
    cout <<MAX-MIN<<endl;
    return 0;
}


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:5: error: not a statement
    ios::sync_with_stdio(0);
    ^
Main.java:9: error: not a statement
    cin>>n;
       ^
Main.java:15: error: not a statement
        cin>>temp;
           ^
Main.java:19: error: not a statement
    cout <<MAX-MIN<<endl;
                  ^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
int main(void)
^
  (use --enable-preview to enable unnamed classes)
Main.java:3: error: <identifier> expected
int main(void)
             ^
Main.java:5: error: ';' expected
    ios::sync_with_stdio(0);
                        ^
9 errors
Language: C++

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

int main(void){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++) cin >> a[i];
  cout << *max_element(a.begin(),a.end()) - *min_element(a.begin(),a.end()) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'max_element' was not declared in this scope
   10 |   cout << *max_element(a.begin(),a.end()) - *min_element(a.begin(),a.end()) << endl;
      |            ^~~~~~~~~~~
a.cc:10:46: error: 'min_element' was not declared in this scope
   10 |   cout << *max_element(a.begin(),a.end()) - *min_element(a.begin(),a.end()) << endl;
      |                                              ^~~~~~~~~~~
Language: C++

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

int main(){
  int N;
  cin >> N;
  int a[N+1]
  for(int i=0;i<N+1;i++){
  cin >> a[i];
  }
  
  int max=a[0];
  int min=a[0];

  for(int i=0;i<N+1;i++){
  if(a[i]>a[i+1])max=a[i+1];
  if(a[i]<a[i+1])min=a[i+1];
  }

  cout << max-min << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'for'
    8 |   for(int i=0;i<N+1;i++){
      |   ^~~
a.cc:8:15: error: 'i' was not declared in this scope
    8 |   for(int i=0;i<N+1;i++){
      |               ^
a.cc:12:11: error: 'a' was not declared in this scope
   12 |   int max=a[0];
      |           ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  int a[N+1]
  for(int i=0;i<N+1;i++){
  cin >> a[i];
  }
  
  int max=a[0];
  int min=a[0];

  for(int i=0;i<N+1;l++){
  if(a[i]>a[i+1])max=a[i+1];
  if(a[i]<a[i+1])min=a[i+1];
  }

  cout << max-min << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'for'
    8 |   for(int i=0;i<N+1;i++){
      |   ^~~
a.cc:8:15: error: 'i' was not declared in this scope
    8 |   for(int i=0;i<N+1;i++){
      |               ^
a.cc:12:11: error: 'a' was not declared in this scope
   12 |   int max=a[0];
      |           ^
a.cc:15:21: error: 'l' was not declared in this scope
   15 |   for(int i=0;i<N+1;l++){
      |                     ^
Language: C++

        #include <bits/stdc++.h>
         
        using namespace std;
        map <int, bool> m;
         
        int main(){
         int n, x;
    cin >> n >> x;
    vector <int> a;
    for(int i = 0; i < n; i++){
    cin >> x;
    if(m[x]) continue;
    else{
    a.push_back(x);
    m[x] =1;
    }
    }
    if(a.size() == 1) cout << 0;
    else{
     int ans = 0;
sort(a.begin(), a.end());
for(int i = 0; i < a.size() - 1; i++) ans += a[i+1] - a[i];
cout << ans;
    }

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

    #include <bits/stdc++.h>
     
    using namespace std;
    map <int, bool> m;
     
    int main(){
     int n, x;
cin >> n >> x;
vector <int> a;
for(int i = 0; i < n; i++){
cin >> x;
if(m[x]) continue;
else{
a.push_back(x);
m[x] =1;
}
}
if(a.size() == 1) cout << 0;
else{

}

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

#include <stdio.h>

int main(void){
    int n;
    int i;
    int a[100];
    int max = 0,mim = 1000;
    scanf("%d\n",&n)
    for (i = 0; i <= n; i++) {
        scanf("%d ",&a[i]);
        if (max < a[i]) {
            max = a[i];
        }
        if (mim > a[i]) {
            mim = a[i];
        }
    }
    printf("%d\n",max - mim );
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:21: error: expected ';' before 'for'
    8 |     scanf("%d\n",&n)
      |                     ^
      |                     ;
    9 |     for (i = 0; i <= n; i++) {
      |     ~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;
int main(){

	int n;
	vector <int> a;

	cin >> n;


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

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

	cout << a[n-1] - a[0] << endl;

	return 0;
}

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

// 7/4 Tuesday
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

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

	sort(A.begin(), A.end());
	ans = A.begin - A.end;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator-'
   17 |         ans = A.begin - A.end;
      |               ~~~~~~~ ^ ~~~~~
      |                 |         |
      |                 |         <unresolved overloaded function type>
      |                 <unresolved overloaded function type>
Language: Java

public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> points = new ArrayList<>();
        for(int i=0; i<n; i++) {
            points.add(sc.nextInt());
        }

        int min = points.get(0);

        for(int p : points) {
            min = Math.min(p, min);
        }

        int max = points.get(0);

        for(int p : points) {
            max = Math.max(p, max);
        }

        System.out.println(max - min);
    }

}

Compiler output:
Main.java:5: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
        List<Integer> points = new ArrayList<>();
        ^
  symbol:   class List
  location: class Main
Main.java:7: error: cannot find symbol
        List<Integer> points = new ArrayList<>();
                                   ^
  symbol:   class ArrayList
  location: class Main
4 errors
Language: C++

#include <stdio.h>
#include <algorithm>
#include <vector>
#include <limits>
using namespace std;
int main() {
	int N;
	scanf("%d", &N);
	int ma = INT_MIN;
	int mi = INT_MAX;
	for (int i = 0; i < N; i++) {
		int t;
		scanf("%d", &t);
		mi = min(mi, t);
		ma = max(ma, t);
	}
	printf("%d", ma-mi);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'INT_MIN' was not declared in this scope
    9 |         int ma = INT_MIN;
      |                  ^~~~~~~
a.cc:5:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <limits>
  +++ |+#include <climits>
    5 | using namespace std;
a.cc:10:18: error: 'INT_MAX' was not declared in this scope
   10 |         int mi = INT_MAX;
      |                  ^~~~~~~
a.cc:10:18: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <sstream>
#include <string>
#include <iomanip>
#include <set>
#include <map>

using namespace std;

#define EPS 1e-14
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) FOR(i, 0, n)
#define PI 2*acos(0.0)
#define ALL(a) (a).begin(),(a).end()
#define DEBUG(x) cout<<#x <<": "<< x << "\n"
#define DEBUG_ARR(a) REP(i, size(a)){ cout << #a << "[" << i << "]: " << a[i] << "\n"; }
const int VX[] = { 0, 1, 0, -1 };
const int VY[] = { 1, 0, -1, 0 };
const long MOD = 1000000007;

int main()
{
	//	--- I/O 高速化 ---
	cin.tie(0);
	ios::sync_with_stdio(false);
	// --- ここまで ---

	int n, a, a_max = 0, a_min = INT_MAX;
	cin >> n;

	REP(i, n)
	{
		cin >> a;
		if (a > a_max) a_max = a;
		if (a < a_min) a_min = a;
	}

	cout << a_max - a_min << "\n";

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:38: error: 'INT_MAX' was not declared in this scope
   32 |         int n, a, a_max = 0, a_min = INT_MAX;
      |                                      ^~~~~~~
a.cc:11:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   10 | #include <map>
  +++ |+#include <climits>
   11 |
Language: C++

#Traveling AtCoDeer Problem
import numpy as np
n = int(input())
a = list(map(int, input().split()))
print(max(a)-min(a))

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #Traveling
    1 | #Traveling AtCoDeer Problem
      |  ^~~~~~~~~
a.cc:2:1: error: 'import' does not name a type
    2 | import numpy as np
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
using namespace std;
int main()
{
    
    int arlong;
    cin >> arlong;
    int ar[arlong];
    for (int i=0; i<arlong; i++) {
        cin >>ar[i];
    }
    int maxv = INT_MIN;
    int minv = INT_MAX;
    for(int i = 0; i < arlong; ++i) {
        if( ar[i] > maxv )
            maxv = ar[i];
        if( ar[i] < minv )
            minv = ar[i];
    }
    cout << (INT_MAX-INT_MIN) <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'INT_MIN' was not declared in this scope
   12 |     int maxv = INT_MIN;
      |                ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
a.cc:13:16: error: 'INT_MAX' was not declared in this scope
   13 |     int minv = INT_MAX;
      |                ^~~~~~~
a.cc:13:16: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'