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

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
  int n;
  cin >>n;
  vector<int> a;
  for(int i = 0;i<n;i++){
    int temp;
    cin >>temp;
    a.pushback(abs(temp));
  }
  a.sort();
  cout << a[a.size()-1]-a[0];
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> a;
      |   ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include<cmath>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> a;
      |          ^~~
a.cc:12:5: error: 'a' was not declared in this scope
   12 |     a.pushback(abs(temp));
      |     ^
a.cc:14:3: error: 'a' was not declared in this scope
   14 |   a.sort();
      |   ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
#define INF 1e9

int main(void){

  //変数の準備
  int max = 0, min = INF, N;
  
  //入力
  cin >> N;
  
  //配列の受け取り
  int A[N];
  for(int i = 0; i < N; i++){
    cin >> A[i];
    max = max(max, A[i]);
    min = min(min, A[i]);
  }
  
  cout << max - min << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: 'max' cannot be used as a function
   19 |     max = max(max, A[i]);
      |           ~~~^~~~~~~~~~~
a.cc:20:14: error: 'min' cannot be used as a function
   20 |     min = min(min, A[i]);
      |           ~~~^~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<cstdlib>

using namespace std;

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

  int min_a = *min_element(a.begin(), a.end());
  int max_a = *max_element(a.begin(), a.end());

  cout << max_a - min_a << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'min_element' was not declared in this scope
   15 |   int min_a = *min_element(a.begin(), a.end());
      |                ^~~~~~~~~~~
a.cc:16:16: error: 'max_element' was not declared in this scope
   16 |   int max_a = *max_element(a.begin(), a.end());
      |                ^~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<cstdlib>

using namespace std;

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

  int min = *std::min_element(a.begin(), a.end());
  int max = *std::max_element(a.begin(), a.end());

  cout << abs(max - min) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'?
   15 |   int min = *std::min_element(a.begin(), a.end());
      |                   ^~~~~~~~~~~
      |                   tuple_element
a.cc:16:19: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'?
   16 |   int max = *std::max_element(a.begin(), a.end());
      |                   ^~~~~~~~~~~
      |                   tuple_element
Language: C++

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

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

  int min = *min_element(a.begin(), a.end());
  int max = *max_element(a.begin(), a.end());

  cout << abs(max - min) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: 'min_element' was not declared in this scope
   14 |   int min = *min_element(a.begin(), a.end());
      |              ^~~~~~~~~~~
a.cc:15:14: error: 'max_element' was not declared in this scope
   15 |   int max = *max_element(a.begin(), a.end());
      |              ^~~~~~~~~~~
Language: Java

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class MaximumDifference {

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

		ArrayList<Integer> array_number = new ArrayList<>();
		for (int i =0; i < N; i++) {
			int input_number = sc.nextInt();
			array_number.add(input_number);
		}

		Collections.sort(array_number);

		System.out.println(array_number.get(N-1)-array_number.get(0));
	}

}


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

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

int manin(){
  int n, a, mx = 0, mn = 1e9;
  cin >> n;
  while (cin >> a) {
    mx = max(mx, a), mn = min(mn, a);
  }
  cout << mx - mn << endl;
  return 0;
}


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
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++)
typedef long long ll;

int main() {
    int N;
    cin >> N;
    int minA = 10**9;
    int maxA = 0;
    for (int i = 0; i < N; i++){
        int A;
        cin >> A;
        minA = min(A, minA);
        maxA = max(A, maxA);
    }
    cout << maxA - minA << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: invalid type argument of unary '*' (have 'int')
   10 |     int minA = 10**9;
      |                   ^~
Language: Java

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Excution2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//String s = sc.nextLine();
		int n = Integer.parseInt(sc.nextLine());
		ArrayList<Integer> nList = new ArrayList<>();

		for (int index = 1; index <= n; index++) {
			int m = sc.nextInt();
			nList.add(m);
		}
		Collections.sort(nList);
		int x = nList.get(0);
		int y = nList.get(nList.size() - 1);
		int z = y - x;
		System.out.println(z);
	}
}

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

#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::unordered_set;
using std::map;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }

void solve(void)
{
  ui N; cin >> N;
  vector<ui> A(N);
  for(auto& a : A) cin >> a;
  auto res = boost::minmax_element(A.begin(), A.end());

  cout
    << *res.second - *res.first
    << CRLF;
  return;
}

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

  solve();

  return 0;
}


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

#include<iostream>
using namespace std;
int N;
int main(){
  cin>>N;int max=0,min=1e9, tmpfor(int i=0;i<N;i++){cin>>tmp;if(tmp>max)max=tmp;if(tmp<min)min=tmp;}
  cout<<max-min<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:43: error: expected ')' before ';' token
    5 |   cin>>N;int max=0,min=1e9, tmpfor(int i=0;i<N;i++){cin>>tmp;if(tmp>max)max=tmp;if(tmp<min)min=tmp;}
      |                                   ~       ^
      |                                           )
a.cc:5:44: error: 'i' was not declared in this scope
    5 |   cin>>N;int max=0,min=1e9, tmpfor(int i=0;i<N;i++){cin>>tmp;if(tmp>max)max=tmp;if(tmp<min)min=tmp;}
      |                                            ^
Language: C++

#include<iostream>
using namespace std;
int N;
int main(){
  cin>>N;long max=0,min=1e9;for(int i=0;i<N;i++){cin>>tmp;if(tmp>max)max=tmp;if(tmp<min)min=tmp;}
  cout<<max-min<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:55: error: 'tmp' was not declared in this scope; did you mean 'tm'?
    5 |   cin>>N;long max=0,min=1e9;for(int i=0;i<N;i++){cin>>tmp;if(tmp>max)max=tmp;if(tmp<min)min=tmp;}
      |                                                       ^~~
      |                                                       tm
Language: C++

#include<iostream>
using namespace std;
int N;
int main(){
  cin>>N;long max=0,min=10e9;for(int i=0;i<N;i++){cin>>tmp;if(tmp>max)max=tmp;if(tmp<min)min=tmp;}
  cout<<max-min<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:56: error: 'tmp' was not declared in this scope; did you mean 'tm'?
    5 |   cin>>N;long max=0,min=10e9;for(int i=0;i<N;i++){cin>>tmp;if(tmp>max)max=tmp;if(tmp<min)min=tmp;}
      |                                                        ^~~
      |                                                        tm
Language: C++

#include<iostream>
using namespace std;
int N;
int main(){
  cin>>N;int max=0,min=10e9;for(int i=0;i<N;i++){cin>>tmp;if(tmp>max)max=tmp;if(tmp<min)min=tmp;}
  cout<<max-min<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:24: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+10' to '2147483647' [-Woverflow]
    5 |   cin>>N;int max=0,min=10e9;for(int i=0;i<N;i++){cin>>tmp;if(tmp>max)max=tmp;if(tmp<min)min=tmp;}
      |                        ^~~~
a.cc:5:55: error: 'tmp' was not declared in this scope; did you mean 'tm'?
    5 |   cin>>N;int max=0,min=10e9;for(int i=0;i<N;i++){cin>>tmp;if(tmp>max)max=tmp;if(tmp<min)min=tmp;}
      |                                                       ^~~
      |                                                       tm
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);
    }

    int max = 0;
    int tmp = 0;

    int i = 0;
    while (i < N) {
        int j = 0;
        while (j < N) {
            tmp = A.at(i) - A.at(j);
            if (max < tmp) {
                max = tmp;
            }
            j++;
        }
        i++;
    }

    cout << max << endl;

    return 0;

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

#include <iostream>
using namespace std;

int main(){
  int N;cin>>N;
  int A[N];
  for (int i=0;i<N;++i){
    cin>>A[i];
  }
  int MA=max(A);
  int MI=min(A);
  int sa=MA-MI;
  
  cout<<sa<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: no matching function for call to 'max(int [N])'
   10 |   int MA=max(A);
      |          ~~~^~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
a.cc:11:13: error: no matching function for call to 'min(int [N])'
   11 |   int MI=min(A);
      |          ~~~^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

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


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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: no matching function for call to 'sort(<unresolved overloaded function type>, std::vector<int>::iterator)'
   12 |     sort(a.begin, a.end());
      |     ~~~~^~~~~~~~~~~~~~~~~~
In file included 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/bits/stl_algo.h:4762:5: note: candidate: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:32: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |          ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 5;
int main(){
    int n;
    cin >> n;
    vi a(n);
    for(int i =0 ; i < n; i++) cin >> a[i];
    sort(all(a));
    couot << a[n-1] - a[0];
}

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

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

int main() {
  int N;
  cin>>N;
  vector<int> v(N);
  rep(i,N) cin>>v[i];
  sort(v.begin(),v.end());
  ans = v[N-1]-v[0];
  
  cout << ans << endl;
  return 0;  
    

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   ans = v[N-1]-v[0];
      |   ^~~
      |   abs
Language: C++

#include<iostream>  ;
using namespace std ;

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

}

Compiler output:
a.cc:1:21: warning: extra tokens at end of #include directive
    1 | #include<iostream>  ;
      |                     ^
a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before ')' token
   10 |   for(i=0;i<N,i++){
      |                  ^
      |                  ;
Language: C++

#include<iostream>  ;
using namespace std ;

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

}

Compiler output:
a.cc:1:21: warning: extra tokens at end of #include directive
    1 | #include<iostream>  ;
      |                     ^
a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before ')' token
   10 |   for(i=0;i<N,i++){
      |                  ^
      |                  ;
a.cc:14:20: error: expected ';' before ')' token
   14 |   for(i=0;i<N-1,i++){
      |                    ^
      |                    ;
a.cc:15:22: error: expected ';' before ')' token
   15 |     for(j=0;j<N-1,j++){
      |                      ^
      |                      ;
Language: C++

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

int main() {
  int n,ans,way;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a.at(i);
  }
  
  ans = 0;
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      way = a.at(i) - a.at(j);
      way = max(way,-way);
      ans = max(way,ans);
    }
  }
  
  cout << ans << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   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:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> a(n);
      |   ^~~~~~
a.cc:7: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:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> a(n);
      |          ^~~
a.cc:9:12: error: 'a' was not declared in this scope
    9 |     cin >> a.at(i);
      |            ^
a.cc:15:13: error: 'a' was not declared in this scope
   15 |       way = a.at(i) - a.at(j);
      |             ^
a.cc:16:13: error: 'max' was not declared in this scope; did you mean 'std::max'?
   16 |       way = max(way,-way);
      |             ^~~
      |             std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:21:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |   cout << ans << 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:21:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 |   cout << ans << 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)
      |     ^~~~
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int max = 0;
      int min = 1000000001;
      int[] array = new int[n];
      for(int i = 0;i < n;i++){
      	int[i] = sc.nextInt();
        max = Math.max(max,array[i]);
        min = Math.min(min,array[i]);
      }
      System.out.println(max-min);
    }
}

Compiler output:
Main.java:10: error: ']' expected
      	int[i] = sc.nextInt();
      	    ^
Main.java:10: error: ';' expected
      	int[i] = sc.nextInt();
      	     ^
2 errors
Language: C++

#include<iostream>
using namespace std;

#include<vector>
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
typedef long long ll;
#include<cmath>
int main(){
    ll N;
    cin >> N;
    vector<ll> A;
    rep(i,0,N) {
        ll temp;
        cin >> temp;
        A.pb(temp);
    }
    ll min = *min_element(A.begin(), A.end());
    ll max = *max_element(A.begin(), A.end());

    cout << abs(max - min) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: 'min_element' was not declared in this scope
   18 |     ll min = *min_element(A.begin(), A.end());
      |               ^~~~~~~~~~~
a.cc:19:15: error: 'max_element' was not declared in this scope
   19 |     ll max = *max_element(A.begin(), A.end());
      |               ^~~~~~~~~~~
Language: C++

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

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

  int min = 1000000000;
  int max = 1;
  int d;
  for(int i = 0; i < n; i++){
    cin >> d;
    min = min(d, min);
    max = max(d, max);
  }
  cout << max - min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: 'min' cannot be used as a function
   17 |     min = min(d, min);
      |           ~~~^~~~~~~~
a.cc:18:14: error: 'max' cannot be used as a function
   18 |     max = max(d, max);
      |           ~~~^~~~~~~~
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main(){
  int N;
  cin >> N;
  int A[110];
  int difmax, t1, t2;
  t1 = 10000000;
  t2 = -1;
  for(int i = 0; i < N; i++)cin >> A[i];
  for(int i = 0; i<A.size(); i++)if(A[i]<t1)t1=A[i];
  for(int i = 0; i<A.size(); i++)if(A[i]>t1)t2=A[i];
  cout<< t2 - t1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: request for member 'size' in 'A', which is of non-class type 'int [110]'
   14 |   for(int i = 0; i<A.size(); i++)if(A[i]<t1)t1=A[i];
      |                      ^~~~
a.cc:15:22: error: request for member 'size' in 'A', which is of non-class type 'int [110]'
   15 |   for(int i = 0; i<A.size(); i++)if(A[i]>t1)t2=A[i];
      |                      ^~~~
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main(){
  int N;
  cin >> N;
  int A[N + 10];
  int difmax, t1, t2;
  t1 = 10000000;
  t2 = -1;
  for(int i = 0; i < N; i++)cin >> A[i];
  for(int i = 0; i<A.size(); i++)if(A[i]<t1)t1=A[i];
  for(int i = 0; i<A.size(); i++)if(A[i]>t1)t2=A[i];
  cout<< t2 - t1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: request for member 'size' in 'A', which is of non-class type 'int [(N + 10)]'
   14 |   for(int i = 0; i<A.size(); i++)if(A[i]<t1)t1=A[i];
      |                      ^~~~
a.cc:15:22: error: request for member 'size' in 'A', which is of non-class type 'int [(N + 10)]'
   15 |   for(int i = 0; i<A.size(); i++)if(A[i]>t1)t2=A[i];
      |                      ^~~~
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main(){
  int N;
  cin >> N;
  int A[N + 10];
  int difmax, t1, t2;
  t1 = 10000000;
  t2 = -1
  for(int i = 0; i < N; i++)cin >> A[i];
  for(int i = 0; i<A.size(); i++)if(A[i]<t1)t1=A[i];
  for(int i = 0; i<A.size(); i++)if(A[i]>t1)t2=A[i];
  cout<< t2 - t1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: expected ';' before 'for'
   12 |   t2 = -1
      |          ^
      |          ;
   13 |   for(int i = 0; i < N; i++)cin >> A[i];
      |   ~~~     
a.cc:13:18: error: 'i' was not declared in this scope
   13 |   for(int i = 0; i < N; i++)cin >> A[i];
      |                  ^
a.cc:14:22: error: request for member 'size' in 'A', which is of non-class type 'int [(N + 10)]'
   14 |   for(int i = 0; i<A.size(); i++)if(A[i]<t1)t1=A[i];
      |                      ^~~~
a.cc:15:22: error: request for member 'size' in 'A', which is of non-class type 'int [(N + 10)]'
   15 |   for(int i = 0; i<A.size(); i++)if(A[i]>t1)t2=A[i];
      |                      ^~~~
Language: C++

#include <bits/stdc++.h>
#define int int64_t
using namespace std;
using pair = pair<int, int>;
using vec  = vector<int>;
using vvec = vector<vec>;
const int INF = 100000000;
// " ", ' '

// プロトタイプ宣言
// int myfunc(int, vvec);

// グローバル変数
// int N, M;
// vvec data(N, vec(M));

// 関数：

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int N; cin >> N;
	vec A(N);
	for (int i=0; i<N; i++) cin >> A.at(i);

	max_sbt = 0;
	for (int i=0; i<N-1; i++) {
		for (int j=i+1; j<N; j++) {
			int sbt = abs(A.at(i)-A.at(j));
			if (max_sbt < sbt) max_sbt = sbt;
		}
	}

	cout << max_sbt << endl;
}


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

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

int main(void) {
  int N, a;
  cin >> N;
  vector<int> v;
  while (cin >> a) {
    v.push_back(a);
  }
  std::sort(v.begin(), v.end());
  cout << v.back() - v.front() << "\n";
}


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

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

int main(void) {
  int N, a;
  cin >> N;
  vector<int> v;
  while (cin >> a) {
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  cout << v.back() - v.front() << "\n";
}


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(v.begin(), v.end());
      |   ^~~~
      |   short
Language: C++

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

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: 'N' was not declared in this scope
    5 |   vector<int> vec(N);
      |                   ^
Language: C++

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

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: 'N' was not declared in this scope
    5 |   vector<int> vec(N);
      |                   ^
a.cc:10:24: error: 'n' was not declared in this scope; did you mean 'yn'?
   10 |   cout << vec[0] - vec[n-1] << endl;
      |                        ^
      |                        yn
Language: C++

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

int main() {

	int N;
    std::cin >> N;
    std::vector<int> A(N);

	for (int i = 0; i < N; i++) std::cin >> A[i];

	int A_max;
	int A_min;

	A_max = std::max(A.begin(), A.end());
	A_min = std::min(A.begin(), A.end());

	std::cout << A_max - A_min << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: cannot convert 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   16 |         A_max = std::max(A.begin(), A.end());
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                         |
      |                         const __gnu_cxx::__normal_iterator<int*, std::vector<int> >
a.cc:17:25: error: cannot convert 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   17 |         A_min = std::min(A.begin(), A.end());
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                         |
      |                         const __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3121000;
long long fact[C_SIZE];
long long finv[C_SIZE];
long long inv[C_SIZE];
long long Comb(int a,int b){
 	if(a<b||b<0)return 0;
 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
}
void init_C(int n){
	fact[0]=finv[0]=inv[1]=1;
	for(int i=2;i<n;i++){
		inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
	}
	for(int i=1;i<n;i++){
		fact[i]=fact[i-1]*i%mod;
		finv[i]=finv[i-1]*inv[i]%mod;
	}
}
long long pw(long long a,long long b){
	long long ret=1;
	while(b){
		if(b%2)ret=ret*a%mod;
		a=a*a%mod;
		b/=2;
	}
	return ret;
}
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
double ABS(double a){return max(a,-a);}
// ここから編集しろ
char in[4];
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a;i++)scanf("%d",b+i);
	std::sort(b,b+a);
	printf("%d\n",b[a-1]-b[0]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:40: error: 'b' was not declared in this scope
   58 |         for(int i=0;i<a;i++)scanf("%d",b+i);
      |                                        ^
a.cc:59:19: error: 'b' was not declared in this scope
   59 |         std::sort(b,b+a);
      |                   ^
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());
  cout << A[N-1] - A[0] << endl;
}

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

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> TUP;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define mp(a,b) make_pair(a,b)
const ll MOD=1000000007;

int main(){
	ll N; cin>>N;
    vector<ll> a(N);
    rep(i,N) cin>>a[i];
  sort(a.begin(),a.end);
  printf("%lld",a[N-1]-a[0]);
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: no matching function for call to 'sort(std::vector<long long int>::iterator, <unresolved overloaded function type>)'
   16 |   sort(a.begin(),a.end);
      |   ~~~~^~~~~~~~~~~~~~~~~
In file included 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/bits/stl_algo.h:4762:5: note: candidate: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<long long int*, vector<long long int> >]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:63: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <iostream>

using namespace std;

int main() {
    int N;
    cin >> N;
    int A[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:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |     sort(A, A+N);
      |     ^~~~
      |     short
Language: C++

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

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'M' was not declared in this scope
    7 |   vector<int> a(M);
      |                 ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  std::vector<int> A(N);
  rep(i,N) cin >> A[i];
  
  int max = max_element(A.begin(), A.end());
  int min = min_element(A.begin(), A.end());
  
  cout << max - min << endl;

 return 0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   11 |   int max = max_element(A.begin(), A.end());
      |             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                        |
      |                        __gnu_cxx::__normal_iterator<int*, std::vector<int> >
a.cc:12:24: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   12 |   int min = min_element(A.begin(), A.end());
      |             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                        |
      |                        __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

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

int main(){
  int N;
  cin >> N;
  std::vector<int> A(N);
  rep(i,N) cin >> A[i];
  
  max = max_element(A.begin(), A.end());
  min = min_element(A.begin(), A.end());
  
  cout << max - min << endl;

 return 0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:39: error: overloaded function with no contextual type information
   11 |   max = max_element(A.begin(), A.end());
      |                                       ^
a.cc:12:39: error: overloaded function with no contextual type information
   12 |   min = min_element(A.begin(), A.end());
      |                                       ^
a.cc:14:15: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator-'
   14 |   cout << max - min << endl;
      |           ~~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
main(){
  int n;
  cin >>n;
  int arr[n+10];
  for(int  i = 0 ;  i<n ; i++) cin >>arr[i];
  sort(arr , arr + n);
  int ans = abs(s[n-1] - s[0]);
  cout<<ans;
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:17: error: 's' was not declared in this scope
    9 |   int ans = abs(s[n-1] - s[0]);
      |                 ^
Language: C

#include <stdio.h>
#include <math.h>

int main(void) 
{
    int i,sum;
    scanf("%d",&i);
    int = A[i],S[i];
    for(int a = 0;a < i;a++)
    {
        scanf("%d",A[i]);
    }
    for(int j = 0;j < i;++)
    {
        for(int l = 0;l < i;l++)
        {
            if(j != l)
            {
                if(A[j] <= A[l])
                {
                    S[j] = A[l] - A[j];
                } 
                else if(A[j] <= A[l])
                {
                     S[j] = A[j] - A[l];
                }
            }
        }
    }
    sum = S[0];
    for(int k = 0;k < i;i++)
    {
        if (S[k] > sum )
        {
            sum = S[k];
        }
    }
    printf("%d",sum);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: expected identifier or '(' before '=' token
    8 |     int = A[i],S[i];
      |         ^
main.c:11:20: error: 'A' undeclared (first use in this function)
   11 |         scanf("%d",A[i]);
      |                    ^
main.c:11:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:27: error: expected expression before ')' token
   13 |     for(int j = 0;j < i;++)
      |                           ^
main.c:15:23: error: 'l' undeclared (first use in this function)
   15 |         for(int l = 0;l < i;l++)
      |                       ^
main.c:21:21: error: 'S' undeclared (first use in this function)
   21 |                     S[j] = A[l] - A[j];
      |                     ^
Language: C

#include <stdio.h>
#include <math.h>

int main(void) 
{
    int i,sum;
    scanf("%d",&i);
    int = A[i],S[i];
    for(int j = 0;j < i;++)
    {
        for(int l = 0;l < i;l++)
        {
            if(j != l)
            {
                if(A[j] <= A[l])
                {
                    S[j] = A[l] - A[j];
                } 
                else if(A[j] <= A[l])
                {
                     S[j] = A[j] - A[l];
                }
            }
        }
    }
    sum = S[0];
    for(int k = 0;k < i;i++)
    {
        if (S[k] > sum )
        {
            sum = S[k];
        }
    }
    printf("%d",sum);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: expected identifier or '(' before '=' token
    8 |     int = A[i],S[i];
      |         ^
main.c:9:27: error: expected expression before ')' token
    9 |     for(int j = 0;j < i;++)
      |                           ^
main.c:11:23: error: 'l' undeclared (first use in this function)
   11 |         for(int l = 0;l < i;l++)
      |                       ^
main.c:11:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:20: error: 'A' undeclared (first use in this function)
   15 |                 if(A[j] <= A[l])
      |                    ^
main.c:17:21: error: 'S' undeclared (first use in this function)
   17 |                     S[j] = A[l] - A[j];
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,b,c;
  b=0;
  c=0;
  cin>>n;
  int a[n],;
  cin>>b;
  c=b;
  for(int i=1;i<n;i++){
    cin>>a[i];
  if(a[i]>b)
    b=a[i];
  else if(c>a[i])
    c=a[i];
    }
  cout<<c-b<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected unqualified-id before ';' token
    9 |   int a[n],;
      |            ^
Language: C++

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

int main() {
    int a,n,mx=INT_MIN, mn=INT_MAX;
    cin>>n;
    for(int i=0;i<n;++i) {
        cin>>a;
        if(a>mx) mx = a;
        if(a<mn) mn = a;
    }
    cout<<mx-mn;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'INT_MIN' was not declared in this scope
    6 |     int a,n,mx=INT_MIN, mn=INT_MAX;
      |                ^~~~~~~
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 | #include<string>
a.cc:11:14: error: 'mn' was not declared in this scope; did you mean 'mx'?
   11 |         if(a<mn) mn = a;
      |              ^~
      |              mx
a.cc:13:14: error: 'mn' was not declared in this scope; did you mean 'mx'?
   13 |     cout<<mx-mn;
      |              ^~
      |              mx
Language: C++

#include <iostream>
using namespace std;

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

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

      int mn=a[0],mx=a[0];

      for(int i=1; i<n i++){
            if(mn>a[i]) mn=a[i];
            if(mx<a[i]) mx=a[i];
      }

      cout<<mx-mn<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'vector' was not declared in this scope
    8 |       vector<int> a(n);
      |       ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:14: error: expected primary-expression before 'int'
    8 |       vector<int> a(n);
      |              ^~~
a.cc:9:35: error: 'a' was not declared in this scope
    9 |       for(int i=0; i<n; i++) cin>>a[i];
      |                                   ^
a.cc:11:14: error: 'a' was not declared in this scope
   11 |       int mn=a[0],mx=a[0];
      |              ^
a.cc:13:23: error: expected ';' before 'i'
   13 |       for(int i=1; i<n i++){
      |                       ^~
      |                       ;
a.cc:15:16: error: 'mx' was not declared in this scope; did you mean 'mn'?
   15 |             if(mx<a[i]) mx=a[i];
      |                ^~
      |                mn
a.cc:18:13: error: 'mx' was not declared in this scope; did you mean 'mn'?
   18 |       cout<<mx-mn<<endl;
      |             ^~
      |             mn
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'anko' was not declared in this scope
   14 |   cout << anko << endl;
      |           ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main()
{
  int n;
  cin>> n;
  for(int i=0,int a[n];i<=n;i++)
  {
    cin<< a[i];
  }
  for(int i=0;i<n;i++)
  {
    for(int l=1,int saidai=0,int k;l<=n;l++)
    {
      k=a[l]-a[i]
      if(saidai<k)
        saidai=k;
    }
  }
  cout<< saidai <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: expected unqualified-id before 'int'
    8 |   for(int i=0,int a[n];i<=n;i++)
      |               ^~~
a.cc:8:15: error: expected ';' before 'int'
    8 |   for(int i=0,int a[n];i<=n;i++)
      |               ^~~
      |               ;
a.cc:8:19: error: condition declares an array
    8 |   for(int i=0,int a[n];i<=n;i++)
      |                   ^
a.cc:8:28: error: expected ')' before ';' token
    8 |   for(int i=0,int a[n];i<=n;i++)
      |      ~                     ^
      |                            )
a.cc:8:29: error: 'i' was not declared in this scope
    8 |   for(int i=0,int a[n];i<=n;i++)
      |                             ^
a.cc:14:17: error: expected unqualified-id before 'int'
   14 |     for(int l=1,int saidai=0,int k;l<=n;l++)
      |                 ^~~
a.cc:14:17: error: expected ';' before 'int'
   14 |     for(int l=1,int saidai=0,int k;l<=n;l++)
      |                 ^~~
      |                 ;
a.cc:14:29: error: expected ';' before ',' token
   14 |     for(int l=1,int saidai=0,int k;l<=n;l++)
      |                             ^
      |                             ;
a.cc:14:29: error: expected primary-expression before ',' token
a.cc:14:30: error: expected primary-expression before 'int'
   14 |     for(int l=1,int saidai=0,int k;l<=n;l++)
      |                              ^~~
a.cc:14:30: error: expected ')' before 'int'
   14 |     for(int l=1,int saidai=0,int k;l<=n;l++)
      |        ~                     ^~~
      |                              )
a.cc:14:36: error: 'l' was not declared in this scope
   14 |     for(int l=1,int saidai=0,int k;l<=n;l++)
      |                                    ^
a.cc:21:10: error: 'saidai' was not declared in this scope
   21 |   cout<< saidai <<endl;
      |          ^~~~~~
Language: C++

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

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