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

#include <iostream>
using namespace std;

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:38: error: expected ';' before '}' token
   15 |         else if (min>A[i]) min = A[i]
      |                                      ^
      |                                      ;
   16 |     }
      |     ~
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[i];
  sort(a.begin(), a.end());
  cout << a.at(n-1) -vec.at(0) <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: 'vec' was not declared in this scope
   10 |   cout << a.at(n-1) -vec.at(0) <<endl;
      |                      ^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: 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 | #include <string>
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> a(n);
      |          ^~~
a.cc:9:34: error: 'a' was not declared in this scope
    9 |   for (int i=0; i< n; i++) cin <<a(n);
      |                                  ^
a.cc:10:8: error: 'a' was not declared in this scope
   10 |   sort(a.begin(), a.end());
      |        ^
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort(a.begin(), a.end());
      |   ^~~~
      |   short
a.cc:11:22: error: 'vec' was not declared in this scope
   11 |   cout << a.at(n-1) -vec.at(0) <<endl;
      |                      ^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   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 | #include <string>
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> a(n);
      |          ^~~
a.cc:8:34: error: 'a' was not declared in this scope
    8 |   for (int i=0; i< n; i++) cin <<a(n);
      |                                  ^
a.cc:9:8: error: 'a' was not declared in this scope
    9 |   sort(a.begin(), a.end());
      |        ^
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    9 |   sort(a.begin(), a.end());
      |   ^~~~
      |   short
a.cc:10:22: error: 'vec' was not declared in this scope
   10 |   cout << a.at(n-1) -vec.at(0) <<endl;
      |                      ^~~
Language: C++

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


int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  int mn, mx;
  mn = a[0];
  mx = a[0];
  reo(i,n){
    if (mn > a[i]) mn = a[i];
    if (mx < a[i]) mx = a[i];
  }
  cout << mx - mn << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'i' was not declared in this scope
   15 |   reo(i,n){
      |       ^
a.cc:15:3: error: 'reo' was not declared in this scope; did you mean 'rep'?
   15 |   reo(i,n){
      |   ^~~
      |   rep
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:11:10: error: request for member 'begin' in 'a', which is of non-class type 'int [N]'
   11 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:11:20: error: request for member 'end' in 'a', which is of non-class type 'int [N]'
   11 |   sort(a.begin(),a.end());
      |                    ^~~
Language: C++

#include <bits/stdc++>
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:1:10: fatal error: bits/stdc++: No such file or directory
    1 | #include <bits/stdc++>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define INF = numeric_limits<long long>::max();
#define intf int_fast64_t
int main(){
    intf n;
    cin >>b;
    vector<intf> a(n);
    rep(i,n) cin >>a[i];

    cout << *std::max_element(a.begin(),a.end()) - *std::min_element(a.begin(),a.end()) <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'b' was not declared in this scope
    8 |     cin >>b;
      |           ^
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[i];
    
    int mn=a[0],mx=[0];
    for(int i=0;i<N;i++){
      if(mn>a[i]){
        mn=a[i];
      }
      else if (mn<a[i]){
        mx=a[i];
      }
    }
    cout<<mx-mn<<endl;
  }
}
        

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: expected identifier before numeric constant
   12 |     int mn=a[0],mx=[0];
      |                     ^
a.cc: In lambda function:
a.cc:12:23: error: expected '{' before ';' token
   12 |     int mn=a[0],mx=[0];
      |                       ^
a.cc: In function 'int main()':
a.cc:12:20: error: invalid user-defined conversion from 'main()::<lambda()>' to 'int' [-fpermissive]
   12 |     int mn=a[0],mx=[0];
      |                    ^~~
a.cc:12:20: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
   12 |     int mn=a[0],mx=[0];
      |                    ^
a.cc:12:20: note:   no known conversion from 'void (*)()' to 'int'
Language: C

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


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> vec(n);
  for(i=0;i<n;i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end());
  cout << vec.at(n-1)-vec.at(0);
}


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

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

int main(){
    int n;
    cin >> n;
    vector<int>a(n);
    int ansmax=0,ansmin;
    for(int i=0;i<n;i++){
        cin >> a[i];
        if(i=0)ansmin=a[i];
        
        ansmax=max(ansmax,a[i]);
        else ansmin=min(ansmin,a[i]);
    }
    cout << ansmax-ansmin << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'else' without a previous 'if'
   14 |         else ansmin=min(ansmin,a[i]);
      |         ^~~~
Language: C++

    #include<iostream>
    using namespace std;
    int main(){
        int N;
        cin >> N;
        int A[N];
        int max = 0, min = 1e10;
        for(int i=0; i<N; i++){
            cin >> A[i];
            max = max(max, A[i]);
            min = min(min, A[i]);

        }
        cout << max -min <<endl;
        
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+10' to '2147483647' [-Woverflow]
    7 |         int max = 0, min = 1e10;
      |                            ^~~~
a.cc:10:22: error: 'max' cannot be used as a function
   10 |             max = max(max, A[i]);
      |                   ~~~^~~~~~~~~~~
a.cc:11:22: error: 'min' cannot be used as a function
   11 |             min = min(min, A[i]);
      |                   ~~~^~~~~~~~~~~
Language: C++

    #include<iostream>
    using namespace std;
    int main(){
        int N;
        cin >> N;
        int A[N];
        int max = 0, min = 10e10;
        for(int i=0; i<N; i++){
            cin >> A[i];
            max = max(max, A[i]);
            min = min(min, A[i]);

        }
        cout << max -min <<endl;
        
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+11' to '2147483647' [-Woverflow]
    7 |         int max = 0, min = 10e10;
      |                            ^~~~~
a.cc:10:22: error: 'max' cannot be used as a function
   10 |             max = max(max, A[i]);
      |                   ~~~^~~~~~~~~~~
a.cc:11:22: error: 'min' cannot be used as a function
   11 |             min = min(min, A[i]);
      |                   ~~~^~~~~~~~~~~
Language: Java

import util.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(Math.abs(A[N-1]-A[0]));
  }
}
    


Compiler output:
Main.java:1: error: package util.java does not exist
import util.java.*;
^
1 error
Language: Java

import util.java.*;

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: '{' expected
public class Main({
                 ^
1 error
Language: Java

import java.util.*;
 
class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    int N = sc.newInt();
    int [] A = new int[N];
    int ans = 0;
    for(int i=0;i<N;i++){
      A[i] = sc.nextInt();
    }
    int min = 100;
    int max = -1;
    for(int i=0;i<N;i++){
      if(A[i]>max){
        max = A[i];
      }
      if(A[i]<min){
        min = A[i];
      }
      System.out.println(max-min);
    }
	}
}


Compiler output:
Main.java:6: error: cannot find symbol
    int N = sc.newInt();
              ^
  symbol:   method newInt()
  location: variable sc of type Scanner
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int i;
  vector<int> vec(n);
  int mini,maxi;
  for(i=0;i<n;i++){
    cin >> vec.at(i);
  }
  mini=vec.at(0);
  maxi=vec.at(0);
  for(i=0;i<n;i++){
    mini=min(mini,vec.at(i));
    maxi=max(max,vec.at(i));
  }
  cout << maxi-mini;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: no matching function for call to 'max(<unresolved overloaded function type>, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   16 |     maxi=max(max,vec.at(i));
      |          ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:20: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const int&'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |         ~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:16:13: note:   couldn't deduce template parameter '_Tp'
   16 |     maxi=max(max,vec.at(i));
      |          ~~~^~~~~~~~~~~~~~~
Language: C++

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

int main() {
  vector<int> vec(N);
  for(int i=0;i<<N;i++){
    cin>>vec[i];
  }
  sort(vec.begin(),vec.end());
  cout<<vec[N-1]-vec[0]<<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 <iostream>
#include <bits/stdc++.h>
using namespace std;

int main(){
  int N;
  cin>>N;
  int i;
  int minimum;
  int maximum;
  vector<int> A(N);
  
  for(i=0;i<N-1;i++){
    cin>>A[i];
  }
  
  for(i=0;i<N;i++){
    minimum=A[0];
    maximum=A[0];
    
    if(minimum>A[i])minimum=A[i];
    if(maximum<A[i])maximum=A[i];
 
  }
  　cout<<maximum-minimum<<endl;
}


Compiler output:
a.cc:25:3: error: extended character 　 is not valid in an identifier
   25 |   　cout<<maximum-minimum<<endl;
      |   ^
a.cc: In function 'int main()':
a.cc:25:3: error: '\U00003000cout' was not declared in this scope
   25 |   　cout<<maximum-minimum<<endl;
      |   ^~~~~~
Language: C++

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

int main(){
  int N;
  cin>>N;
  int i;
  int minimum;
  int maximum;
  vector<int> A(N);
  
  for(i=0;i<N-1;i++){
    cin>>A[i];
  }
  
  for(i=0;i<N;i++){
    minimum=A[0];
    maximum=A[0];
    
    if(minimum>A[i])minimum=A[i];
    if(maximum<A[i])maximum=A[i];
 
}


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

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

int main(){
  int N;
  cin>>N;
  int i;
  int minimum;
  int maximum;
  vector<int> A(N);
  
  for(i=0;i<N-1;i++){
    cin>>A[i];
  }
  
  for(i=0;i<N;i++){
    minimum=A[0];
    maximum=A[0];
    
    minimum=min(minimum,A[i]);
    maximum=max(maximum,A[i]);
 
    cout<<maximum-minimum<<endl;
    
  }
  

    


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

#include <iostream>
using namespace std;

int main(){
  int N;
  cin>>N;
  int i;
  int minimum;
  int maximum;
  vector<int> A(N);
  
  for(i=0;i<N-1;i++){
    cin>>A[i];
  }
  
  for(i=0;i<N;i++){
    minimum=A[0];
    maximum=A[0];
    
    minimum=min(minimum,A[i]);
    maximum=max(maximum,A[i]);
 
    cout<<maximum-minimum<<endl;
    
  }
  

    


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'vector' was not declared in this scope
   10 |   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:10:10: error: expected primary-expression before 'int'
   10 |   vector<int> A(N);
      |          ^~~
a.cc:13:10: error: 'A' was not declared in this scope
   13 |     cin>>A[i];
      |          ^
a.cc:17:13: error: 'A' was not declared in this scope
   17 |     minimum=A[0];
      |             ^
a.cc:25:4: error: expected '}' at end of input
   25 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  vector<int> A(N);
  cin>>N;
  int i;
  int minimum;
  int maximum;
  
  for(i=0;i<N-1;i++){
    cin>>A[i];
  }
  
  for(i=0;i<N;i++){
    minimum=A[0];
    maximum=A[0];
    
    minimum=min(minimum,A[i]);
    maximum=max(maximum,A[i]);
 
    cout<<maximum-minimum<<endl;
    
  }
  

    


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   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:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> A(N);
      |          ^~~
a.cc:13:10: error: 'A' was not declared in this scope
   13 |     cin>>A[i];
      |          ^
a.cc:17:13: error: 'A' was not declared in this scope
   17 |     minimum=A[0];
      |             ^
a.cc:25:4: error: expected '}' at end of input
   25 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  string A;
  cin>>N;
  int i;
  int minimum;
  int maximum;
  for(i=0;i<N-1;i++){
    cin>>A[i];
  }
  
  for(i=0;i<N;i++){
    minimum=A[0];
    maximum=A[0];
    
    minimum=min(minimum,A[i]);
    maximum=max(maximum,A[i]);
 
    cout<<maximum-minimum<<endl;
    
  }
  

    


Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   19 |     minimum=min(minimum,A[i]);
      |             ~~~^~~~~~~~~~~~~~
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: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:   template argument deduction/substitution failed:
a.cc:19:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
   19 |     minimum=min(minimum,A[i]);
      |             ~~~^~~~~~~~~~~~~~
/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, 2 provided
a.cc:20:16: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   20 |     maximum=max(maximum,A[i]);
      |             ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:20:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
   20 |     maximum=max(maximum,A[i]);
      |             ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
a.cc:24:4: error: expected '}' at end of input
   24 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  string A;
  cin>>N>>A;
  int i;
  int minimum;
  int maximum;
  
  for(i=0;i<N;i++){
    minimum=A[0];
    maximum=A[0];
    
    minimum=min(minimum,A[i]);
    maximum=max(maximum,A[i]);
 
    cout<<maximum-minimum<<endl;
    
  }
  

    


Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   16 |     minimum=min(minimum,A[i]);
      |             ~~~^~~~~~~~~~~~~~
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: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:   template argument deduction/substitution failed:
a.cc:16:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
   16 |     minimum=min(minimum,A[i]);
      |             ~~~^~~~~~~~~~~~~~
/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, 2 provided
a.cc:17:16: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   17 |     maximum=max(maximum,A[i]);
      |             ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:17:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
   17 |     maximum=max(maximum,A[i]);
      |             ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
a.cc:21:4: error: expected '}' at end of input
   21 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  string A;
  cin>>N>>A;
  int i;
  int minimum;
  
  for(i=0;i<N;i++){
    minimum=A[0];
    maximum=A[0];
    
    minimum=min(minimum,A[i]);
    maximum=max(maximum,A[i]);
 
    cout<<maximum-minimum<<endl;
    
  }
  

    

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'maximum' was not declared in this scope; did you mean 'minimum'?
   13 |     maximum=A[0];
      |     ^~~~~~~
      |     minimum
a.cc:15:16: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   15 |     minimum=min(minimum,A[i]);
      |             ~~~^~~~~~~~~~~~~~
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: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:   template argument deduction/substitution failed:
a.cc:15:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
   15 |     minimum=min(minimum,A[i]);
      |             ~~~^~~~~~~~~~~~~~
/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, 2 provided
a.cc:20:4: error: expected '}' at end of input
   20 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<queue>
#include<vector>
#define LL long long
#define ULL unsigned long long
#define For(i,a,b) for(int i=(a);i<=(b);i++)
#define itn int
#define pritnf printf
#define mp make_pair
#define pb push_back
using namespace std;

const int maxn=100;
LL n;
LL a[maxn];

int main(){
	cin>>n;
	LL Max=-1,Min=1e9+1;
	For(i,1,n){
		LL temp;cin>>temp;
		Min=min(in,temp);
		Max=max(Max,temp);
	}
	cout<<Max-Min;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:25: error: 'in' was not declared in this scope; did you mean 'i'?
   28 |                 Min=min(in,temp);
      |                         ^~
      |                         i
Language: C++

#include<bits/stdc++.h>
using namespace std;
//#include<ext/rope>
//using namespace __gnu_cxx
//#include<ext/pb_ds/priority_queue.hpp>
//using namespace __gnu_pbds;
#define lowbit(x) (x&-x)
#define pb push_back
#define empb emplace_back
#define all(x) (x).begin(),(x).end()
#define clr(a,b) memset(a,b,sizeof(a))
#define caze(T) for(cin>>T;T;T--)
#define inf (1<<29)
#define Endl ('\n')
#define fi first
#define se second
#define db double
#define ldb long double
#define ll long long
#define pii pair<int,int>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define pll pair<ll,ll>
#define ull unsigned long long
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
inline char nc() {
	#define SZ 1000000
	static char buf[SZ], *p1, *p2;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,SZ,stdin),p1==p2)?EOF:*p1++;
}
template<typename T>
inline int scan(T &x) {
	char c, sign=1; 
	while(!isdigit(c=nc())&&c!=EOF)if(c=='-')sign*=-1;
	if(c==EOF) return EOF;
	for(x = 0; isdigit(c); c = nc())
		x = (x<<1) + (x<<3) + (c&15);
	return x *= sign, 1;
}
template<typename T, typename...Args>
inline int scan(T &x, Args&...args) {
	return scan(x), scan(args...);
}
int main()
{IOS;
	cin>>n;
	vector<int>v(n);
	for(int i=0;i<n;++i)
		cin>>v[i];
	sort(all(v));cout<<v[n-1]-v[0]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:14: error: 'n' was not declared in this scope; did you mean 'yn'?
   46 |         cin>>n;
      |              ^
      |              yn
Language: C++

#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
   // ll n,i;
    int n,i;
    cin>>n;
    for(i=0; i<n; i++){
       cin>>a[i];
    }
    sort(a,a+n);
    ll ans=a[n-1]-a[0];
    cout<<ans<<endl;
    return 0;
}


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

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


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

#include <iostream>
using namespace std;
 
int a[100];
 
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		cin >> a[i];
	}
	int najmanji = a[0];
	for (int i = 0; i < n; ++i)
	{
		if (a[i] < najmanji)
			najmanji = a[i];
	}
	int najveci = a[0];
	for (int i = 0; i < n; ++i)
	{
		if (a[i] > najveci)
			najveci = a[i]
	}
	cout << najveci - najmanji;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:39: error: expected ';' before '}' token
   24 |                         najveci = a[i]
      |                                       ^
      |                                       ;
   25 |         }
      |         ~
Language: C++

#include <iostream>
using namespace std;
 
int a[1000000000];
 
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		cin >> a[i];
	}
	cout << max(a[i]) - min (a[i]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: 'i' was not declared in this scope
   14 |         cout << max(a[i]) - min (a[i]);
      |                       ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int>A(N);
  for(int i = 0;  < N; i++){
    cin >> A.at(i);  
  }
  int maxdif = 0;
  for(int i = 0; i < N - 1; i++){
    for(int j = i + 1; j < N; j++){
      if(abs(A.at(i) - A.at(i + j)) > maxdif) maxdif = abs(A.at(i) - A.at(i + j));
    }
  }
  cout << maxdif << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected primary-expression before '<' token
    8 |   for(int i = 0;  < N; i++){
      |                   ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int>A(N);
  for(int i = 0;  < N; i++){
    cin >> A.at(i);  
  }
  int maxdif = 0;
  for(int i = 0; i < N - 1; i++){
    for(int j = i + 1; j < N - i - 1; j++){
      if(abs(A.at(i) - A.at(i + j)) > maxdif) maxdif = abs(A.at(i) - A.at(i + j));
    }
  }
  cout << maxdif << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected primary-expression before '<' token
    8 |   for(int i = 0;  < N; i++){
      |                   ^
Language: C++

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

int main()
{
  int N;
  cin >> N;
  int A;
  
  int max = INF;
  int min = 0;
  
  for (int i = 0; i < N; i++) {
    cin >> A;
    if (A > max) {
      max = A;
    }
    if (A < min) {
      min = A;
    }

  }
  cout << max - min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'INF' was not declared in this scope
   10 |   int max = INF;
      |             ^~~
Language: C++

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

int main(){
  
  int N;
  cin >> N;
  
  vec <int> A(N);
  
  cin >> A.at(0);
  int min = A.at(0);
  int max = A.at(0);
  
  for (int i=1,i<N,i++){
    cin >> A.at(i);
    if (A.at(i) < min ) min=A.at(i);
    else if (A.at(i) > max ) max = A.at(i);
    else continue;
  }
  
  cout << max - min <<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vec' was not declared in this scope
    9 |   vec <int> A(N);
      |   ^~~
a.cc:9:8: error: expected primary-expression before 'int'
    9 |   vec <int> A(N);
      |        ^~~
a.cc:11:10: error: 'A' was not declared in this scope
   11 |   cin >> A.at(0);
      |          ^
a.cc:15:17: error: expected ';' before '<' token
   15 |   for (int i=1,i<N,i++){
      |                 ^
      |                 ;
a.cc:15:17: error: expected primary-expression before '<' token
a.cc:15:23: error: expected ';' before ')' token
   15 |   for (int i=1,i<N,i++){
      |                       ^
      |                       ;
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(i);
  int mn = a(0), mx = a(0);
  for (int i = 0; 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:13: error: no match for call to '(std::vector<int>) (int&)'
    8 |     cin >> a(i);
      |            ~^~~
a.cc:9:13: error: no match for call to '(std::vector<int>) (int)'
    9 |   int mn = a(0), mx = a(0);
      |            ~^~~
a.cc:11:15: error: no match for call to '(std::vector<int>) (int&)'
   11 |     if (mn > a(i)) mn = a(i);
      |              ~^~~
a.cc:11:26: error: no match for call to '(std::vector<int>) (int&)'
   11 |     if (mn > a(i)) mn = a(i);
      |                         ~^~~
a.cc:12:9: error: 'mx' was not declared in this scope; did you mean 'mn'?
   12 |     if (mx < a(i)) mx = a(i);
      |         ^~
      |         mn
a.cc:12:15: error: no match for call to '(std::vector<int>) (int&)'
   12 |     if (mx < a(i)) mx = a(i);
      |              ~^~~
a.cc:12:26: error: no match for call to '(std::vector<int>) (int&)'
   12 |     if (mx < a(i)) mx = a(i);
      |                         ~^~~
a.cc:15:11: error: 'mx' was not declared in this scope; did you mean 'mn'?
   15 |   cout << mx - mn << endl;
      |           ^~
      |           mn
Language: C++


#include<vector>
#include<iostream>
#include<limits>

using namespace std;

int main(){
    int n;
    cin>>n;
    vector<int> ar;
    int max=0 , min = 9999999;
    for(int i =0; i< n; i ++)
    {
        int temp;
        cin>>temp;
        // if( temp > max ){

        //     max = temp;
        //     continue;
        // }
        // if ( temp < min ){

        //     min = temp;
        //     continue;
        // }
        ar.push_back(temp);

    }
    cout<<*max_element(ar.begin(), ar.end()) - *min_element( ar.begin() , ar.end() ) ;
    return 0;
}

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


#include<vector>
#include<iostream>
#include<limits>

using namespace std;

int main(){
    int n;
    cin>>n;
    // vector<int> ar(n , 0);
    int max=0 , min = INT_MAX;
    for(int i =0; i< n; i ++)
    {
        int temp;
        cin>>temp;
        if( temp > max ){

            max = temp;
            continue;
        }
        if ( temp < min ){

            min = temp;
            continue;
        }
    }
    cout<<max - min ;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: 'INT_MAX' was not declared in this scope
   12 |     int max=0 , min = INT_MAX;
      |                       ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include<limits>
  +++ |+#include <climits>
    5 |
Language: C++


#include<vector>
#include<iostream>

using namespace std;

int main(){
    int n;
    cin>>n;
    // vector<int> ar(n , 0);
    int max=0 , min = INT_MAX;
    for(int i =0; i< n; i ++)
    {
        int temp;
        cin>>temp;
        if( temp > max ){

            max = temp;
            continue;
        }
        if ( temp < min ){

            min = temp;
            continue;
        }
    }
    cout<<max - min ;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: 'INT_MAX' was not declared in this scope
   11 |     int max=0 , min = INT_MAX;
      |                       ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<iostream>
  +++ |+#include <climits>
    4 |
Language: C++


#include<vector>
#include<iostream>

using namespace std;

int main(){
    int n;
    cin>>n;
    // vector<int> ar(n , 0);
    int max=0 , min = INT_MAX;
    for(int i =0; i< n; i ++)
    {
        int temp;
        cin>>temp;
        if( temp > max )
            max = temp;
        if ( temp < min )
            min = temp;
    }
    cout<<max - min ;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: 'INT_MAX' was not declared in this scope
   11 |     int max=0 , min = INT_MAX;
      |                       ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<iostream>
  +++ |+#include <climits>
    4 |
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:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>N;
      |   ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> a(N);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> a(N);
      |          ^~~
a.cc:11:10: error: 'a' was not declared in this scope
   11 |     cin>>a[i];
      |          ^
a.cc:13:12: error: 'a' was not declared in this scope
   13 |   int mn = a[0], mx = a[0];
      |            ^
a.cc:16:8: error: 'mx' was not declared in this scope; did you mean 'mn'?
   16 |     if(mx < a[i]) mx = a[i];
      |        ^~
      |        mn
a.cc:19:3: error: 'cout' was not declared in this scope
   19 |   cout<<mx - mn<<endl;
      |   ^~~~
a.cc:19:9: error: 'mx' was not declared in this scope; did you mean 'mn'?
   19 |   cout<<mx - mn<<endl;
      |         ^~
      |         mn
a.cc:19:18: error: 'endl' was not declared in this scope
   19 |   cout<<mx - mn<<endl;
      |                  ^~~~
Language: C

#include<stdio.h>
int main()
{
int a,c,max,min;
  scanf("%d",&a);
   char b[a];
  
  for(int j=0;j=a-1;j++)
  {
  scanf("%d",&b[j]);
  }
 
  max=b[0];
  min=b[0];
  
   for(int j=1;j=a-1;j++)
   {
   if(b[j]>max) max=b[j];
   else if(b[j]<min) min=b[j];
   }
  
  c=max-min
  
 printf("%d",c);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:12: error: expected ';' before 'printf'
   22 |   c=max-min
      |            ^
      |            ;
   23 | 
   24 |  printf("%d",c);
      |  ~~~~~~
Language: C++

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

int main() {
    int n, max;
    cin >> n;
    vector<int> a(n);

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

    cout << max << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin >> n;
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <algorithm>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << max << endl;
      |     ^~~~
a.cc:17:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:20: error: 'endl' was not declared in this scope
   17 |     cout << max << endl;
      |                    ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <algorithm>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: C++

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

int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    rep(i,N){
        cin >> A.at(i);
    }

    sort(A.bigin(), A.end());
    cout << A.at(N-1) - A.at(0) << endl;
}

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

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

int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    rep(i,N){
        cin >> A.at(i);
    }

    sort(A.bigin(), A.end());
    cout << A.(N-1) - A.at(0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'A' was not declared in this scope
   11 |         cin >> A.at(i);
      |                ^
a.cc:14:10: error: 'A' was not declared in this scope
   14 |     sort(A.bigin(), A.end());
      |          ^
a.cc:15:15: error: expected unqualified-id before '(' token
   15 |     cout << A.(N-1) - A.at(0) << endl;
      |               ^
Language: C++

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

int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    rep(i,N){
        cin >> A.at(i);
    }

    sort(a.bigin(), a.end());
    cout << A.(N-1) - A.at(0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'A' was not declared in this scope
   11 |         cin >> A.at(i);
      |                ^
a.cc:14:12: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
   14 |     sort(a.bigin(), a.end());
      |            ^~~~~
      |            begin
a.cc:15:13: error: 'A' was not declared in this scope
   15 |     cout << A.(N-1) - A.at(0) << endl;
      |             ^
a.cc:15:15: error: expected unqualified-id before '(' token
   15 |     cout << A.(N-1) - A.at(0) << endl;
      |               ^
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 min = Integer.MAX_VALUE;
      int max = Integer.MIN_VALUE;
      while(n-- > 0) {
        int num = sc.nextInt();
        min = Matn.min(min, num);
        max = Math.max(max, num);
      }
      System.out.println(max - min);
  } 
}

Compiler output:
Main.java:11: error: cannot find symbol
        min = Matn.min(min, num);
              ^
  symbol:   variable Matn
  location: class Main
1 error
Language: C

#include<stdio.h>
int main(void){
  int a[100],n,i,min=1000000,max=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",a[i]);
    if(max<a[i]) max=a[i];
    if(min>a[i]) min=a[i];
  }
  printf("%d",max-min);
  return 0;

Compiler output:
main.c: In function 'main':
main.c:11:3: error: expected declaration or statement at end of input
   11 |   return 0;
      |   ^~~~~~
Language: C

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

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

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

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

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

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

#include<bits/stdc++.h>

using namespace std;

int main(){
    long long n, ans = 0;
    cin >> n;
    vector<long long>v;
    for(long long i = 0; i < n; ++i){
        long long tmp; cin >> tmp;
        v.push_back(tmp);
    }
    for(long long i = 0; i < n - 1; ++i){
        ans = max(ans, abs(v[i] - v[i + 1]))
    }
    cout << ans;
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:45: error: expected ';' before '}' token
   14 |         ans = max(ans, abs(v[i] - v[i + 1]))
      |                                             ^
      |                                             ;
   15 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
    long long n, ans = 0;
    cin >> n;
    vector<long long>v;
    for(long long i = 0; i < n; ++i){
        long long tmp; cin >> tmp;
        v.push_back(tmp);
    }
    for(long long i = 0; i < n - 1; ++i){
        ans = max(ans, abs(arr[i] - arr[i + 1]))
    }
    cout << ans;
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:28: error: 'arr' was not declared in this scope
   14 |         ans = max(ans, abs(arr[i] - arr[i + 1]))
      |                            ^~~
Language: C++

#includ <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.at(n-1)-a.at(0)<<endl;
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #includ; did you mean #include?
    1 | #includ <bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #includ <bits/stdc++.h>
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> a(n);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #includ <bits/stdc++.h>
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> a(n);
      |          ^~~
a.cc:8:10: error: 'a' was not declared in this scope
    8 |     cin>>a.at(i);
      |          ^
a.cc:10:8: error: 'a' was not declared in this scope
   10 |   sort(a.begin(),a.end());
      |        ^
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort(a.begin(),a.end());
      |   ^~~~
      |   short
a.cc:11:3: error: 'cout' was not declared in this scope
   11 |   cout<<a.at(n-1)-a.at(0)<<endl;
      |   ^~~~
a.cc:11:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:28: error: 'endl' was not declared in this scope
   11 |   cout<<a.at(n-1)-a.at(0)<<endl;
      |                            ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #includ <bits/stdc++.h>