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

#include <cstdio>
#include <algorithm>

int main()
{
  int N;
  scanf("%d", &N);
  
  int a[105];
  
  for(int i = 0; i < N; i++)
  {
    scanf("%d", &a[i])
  }
  sort(a,a+N)
    
    printf("%d", a[N - 1] - a[0]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: expected ';' before '}' token
   13 |     scanf("%d", &a[i])
      |                       ^
      |                       ;
   14 |   }
      |   ~                    
a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   15 |   sort(a,a+N)
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include <cstdio>
#include <algorithm>
int main(){
  int N, a[100];
  scanf("%d", &N);
  for(int i=0; i<N; i++){
    scanf("%d", &a[i]);
  }
  sort(a, a+n);
  printf("%d", a[N-1]-a[0]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'n' was not declared in this scope
    9 |   sort(a, a+n);
      |             ^
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    9 |   sort(a, a+n);
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include<cstdio>
#include<algorithm>

int main(){
  	int n;
  	scanf("%d",&n);
	int a[100];
  	for(int i=0;i<n;i++){
      scanf("%d",&a[i]);
    }
	sort(a,a+n);
  	print("%d",a[n-1]-a[0]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   11 |         sort(a,a+n);
      |         ^~~~
      |         std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:12:9: error: 'print' was not declared in this scope; did you mean 'printf'?
   12 |         print("%d",a[n-1]-a[0]);
      |         ^~~~~
      |         printf
Language: C++

#include <cstdio>
#include <algorithm>
int main(){
  int N, a[100];
  scanf("%d", &N);
  for(int i=0; i<N; i++){
    scanf("%d", a[i]);
  }
  sort(a, a+n);
  printf("%d", a[N-1]-a[0]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'n' was not declared in this scope
    9 |   sort(a, a+n);
      |             ^
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    9 |   sort(a, a+n);
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include <cstdio>
#include <algorithm>
int main(){
  int N, a[100];
  scnf("%d", &N);
  for(int i=0; i<N; i++){
    scanf("%d", a[i]);
  }
  sort(a, a+n);
  printf("%d", a[N-1]-a[0]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'scnf' was not declared in this scope; did you mean 'scanf'?
    5 |   scnf("%d", &N);
      |   ^~~~
      |   scanf
a.cc:9:13: error: 'n' was not declared in this scope
    9 |   sort(a, a+n);
      |             ^
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    9 |   sort(a, a+n);
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include<cstdio>
#include<algorithm>

int main(){
  	int n;
  	scanf("%d",&n);
	int a[100];
  	for(int i=0;i<n;i++){
      scanf("%d",a[i]);
    }
	sort(a,a+n);
  	print("%d",a[n-1]-a[0]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   11 |         sort(a,a+n);
      |         ^~~~
      |         std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:12:9: error: 'print' was not declared in this scope; did you mean 'printf'?
   12 |         print("%d",a[n-1]-a[0]);
      |         ^~~~~
      |         printf
Language: C++

#include<iostream>
#include<vector>


using namespace std;

int main(void)
{
  int N;
  
  cin>>N;
  
  Vector<int> pos(N);
  
  for(int i=0;i<N;i++)
  {
    cin>>pos[i];
  }
  
  int a,b;
  int max,min;
  
  for(int i=0;i<N;i++)
  {
    if(max<pos[i])
       max=pos[i];
  }
  
  min=max;
  
  for(int i=0;i<N;i++)
  {
    if(pos[i]<min)
      min=pos[i];
  }
  
  cout<<max-min<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'Vector' was not declared in this scope
   13 |   Vector<int> pos(N);
      |   ^~~~~~
a.cc:13:10: error: expected primary-expression before 'int'
   13 |   Vector<int> pos(N);
      |          ^~~
a.cc:17:10: error: 'pos' was not declared in this scope
   17 |     cin>>pos[i];
      |          ^~~
a.cc:25:12: error: 'pos' was not declared in this scope
   25 |     if(max<pos[i])
      |            ^~~
a.cc:33:8: error: 'pos' was not declared in this scope
   33 |     if(pos[i]<min)
      |        ^~~
Language: C++

#include<iostream>
#include<vector>


using namespace std;

int main(void)
{
  int N;
  
  cin>>N;
  
  Vector<int> pos(N);
  
  int a,b;
  int max,min;
  
  for(int i=0;i<N;i++)
  {
    if(max<pos[i])
       max=pos[i];
  }
  
  min=max;
  
  for(int i=0;i<N;i++)
  {
    if(pos[i]<min)
      min=pos[i];
  }
  
  cout<<max-min<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'Vector' was not declared in this scope
   13 |   Vector<int> pos(N);
      |   ^~~~~~
a.cc:13:10: error: expected primary-expression before 'int'
   13 |   Vector<int> pos(N);
      |          ^~~
a.cc:20:12: error: 'pos' was not declared in this scope
   20 |     if(max<pos[i])
      |            ^~~
a.cc:28:8: error: 'pos' was not declared in this scope
   28 |     if(pos[i]<min)
      |        ^~~
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(void)
{
  int N;
  
  Vector<int> pos(N);
  
  int a,b;
  int max,min;
  
  for(int i=0;i<N;i++)
  {
    if(max<pos[i])
       max=pos[i];
  }
  
  min=max;
  
  for(int i=0;i<N;i++)
  {
    if(pos[i]<min)
      min=pos[i];
  }
  
  cout<<max-min<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'Vector' was not declared in this scope
   10 |   Vector<int> pos(N);
      |   ^~~~~~
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   Vector<int> pos(N);
      |          ^~~
a.cc:17:12: error: 'pos' was not declared in this scope
   17 |     if(max<pos[i])
      |            ^~~
a.cc:25:8: error: 'pos' was not declared in this scope
   25 |     if(pos[i]<min)
      |        ^~~
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];
  }
  int ma=a[0],mi=a[0];
  for(i=1;i<n;i++){
  	ma=max(ma,a[i]);
    mi=min(mi,a[i]);
  }
  cout<<ma-mi;
}

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

#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}


signed main() {
    int N;
    cin >> N;
    vi a(N);
    rep(i, N) cin >> a[i];
    SORT(a);

    int sum = 0;
    FOR(i, 1, N) {
        sum += a[i]-a[i-1];
    }

    cout << sum << endl;
    
    return 0;

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

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

int main(){
  int N;
  cin >> N;
  int L=0,U=1000,x;
  for(int i=0;i<N;i++){
    cin >> x;
    L=max(L,x);
    U=min(U,x);
  }
  cout << L-U;
}

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


int N, max, min;
stack<int> A;
int main() {
    cin >> N;
    for ( int i=0; i<N;; i++ ) {
        cin >> max;
        A.push(max);
    }
    max = 0;
    min = 0;
    for ( int i=0; i<N;  i++ ) {
        if (A.top() > max ) {
            max = A.top();
        }
        if (A.top() < min ) {
          min = A.top();
        }
      	A.pop();
    }
  cout << max - min << "\n";
}

Compiler output:
a.cc:3:1: error: 'stack' does not name a type
    3 | stack<int> A;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'min'?
    5 |     cin >> N;
      |     ^~~
      |     min
a.cc:6:24: error: expected primary-expression before ';' token
    6 |     for ( int i=0; i<N;; i++ ) {
      |                        ^
a.cc:6:24: error: expected ')' before ';' token
    6 |     for ( int i=0; i<N;; i++ ) {
      |         ~              ^
      |                        )
a.cc:6:26: error: 'i' was not declared in this scope
    6 |     for ( int i=0; i<N;; i++ ) {
      |                          ^
a.cc:13:13: error: 'A' was not declared in this scope
   13 |         if (A.top() > max ) {
      |             ^
a.cc:16:13: error: 'A' was not declared in this scope
   16 |         if (A.top() < min ) {
      |             ^
a.cc:19:9: error: 'A' was not declared in this scope
   19 |         A.pop();
      |         ^
a.cc:21:3: error: 'cout' was not declared in this scope
   21 |   cout << max - min << "\n";
      |   ^~~~
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;
	int mn=1000,mn=0;
	rep(i,n){
		int a; cin>>a;
		mn=min(mn,a);
		mx=max(mx,a);
	}
	cout<<mx-mn<<endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: redeclaration of 'int mn'
    9 |         int mn=1000,mn=0;
      |                     ^~
a.cc:9:13: note: 'int mn' previously declared here
    9 |         int mn=1000,mn=0;
      |             ^~
a.cc:13:17: error: 'mx' was not declared in this scope; did you mean 'mn'?
   13 |                 mx=max(mx,a);
      |                 ^~
      |                 mn
a.cc:15:15: error: 'mx' was not declared in this scope; did you mean 'mn'?
   15 |         cout<<mx-mn<<endl;
      |               ^~
      |               mn
Language: C++

#include<bits/stdc++.h>
 
using namespace std;
 
 
#define IOS ios::sync_with_stdio(0); cin.tie(0), cout.tie(0)
 
 
#define ll long long int
#define ld long double
 
#define fr first
#define se second
 
 
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) (int)v.size()
#define sunq(v) sort(all(v));v.resize(distance(v.begin(),unique(all(v))))
 
 
#define pb push_back
#define mp make_pair
 
 
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define emla(a, val) memset(a, val, sizeof(a))
#define easm(a, b) (a + b - 1) /b 
 
#define PI 3.141592653589793238
 
 
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}

 

//bool valid(int i, int j){return i >= 0 && i < n && j >= 0 && j < m;}

int n;
int main() {
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
  //clock_t z = clock();
  cin >> n;
  vector<int>v(n);
  for(auto &i : v)
    cin >> i;
  cout << s[n-1] - s[0] << endl;
  //debug("Total Time: %.3f\n", (double)(clock() - z) / CLOCKS_PER_SEC);
  /*
  *try tricky test cases:
    -bounds
    -small input (0, 1)
    -big input
    -random tests
  */
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,k;cin>>n>>k;int ans=0;vector<int>v;
	for(int x=0;x<n;x++){
		int a;cin>>a;v.push_back(a);
	}
	sort(v.begin(),v.end());
	int ans=v[n-1]-v[0];
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: redeclaration of 'int ans'
    9 |         int ans=v[n-1]-v[0];
      |             ^~~
a.cc:4:31: note: 'int ans' previously declared here
    4 |         int n,k;cin>>n>>k;int ans=0;vector<int>v;
      |                               ^~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int x, arr[105];
cin >> x;
for(int i=1; I<=x;i++){
cin >> arr[i];
}
sort(arr+1, arr+1+x);
cout << arr[x]-arr[1] << endl;
return 0;
}

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

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int x, arr[105];
cin >> x;
for(int i=1; i<+n;i++){
cin >> arr[i];
}
sort(arr+1, arr+1+n);
cout << arr[n]-arr[1] << endl;
return 0;
}

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

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int x, arr[105];
cin >> x;
for(int i=1; I<+n;i++){
cin >> arr[i];
}
sort(arr+1, arr+1+n);
cout << arr[n]-arr[1] << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: 'I' was not declared in this scope
    7 | for(int i=1; I<+n;i++){
      |              ^
a.cc:7:17: error: 'n' was not declared in this scope
    7 | for(int i=1; I<+n;i++){
      |                 ^
a.cc:10:19: error: 'n' was not declared in this scope
   10 | sort(arr+1, arr+1+n);
      |                   ^
Language: C++

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <numeric>
typedef long long Int;
#define rep(i,a,b) for(Int i=a;i<b;++i)
#define rrep(i,a,b) for(Int i=a;i>=b;--i)
using namespace std;

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

    int N, vector<int> A(N);
    rep(i, 0, N) cin >> A[i];
    cout << *max_element(A.begin(), A.end()) - *min_element(A.begin(), A.end()) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: invalid declarator before 'A'
   13 |     int N, vector<int> A(N);
      |                        ^
a.cc:14:25: error: 'A' was not declared in this scope
   14 |     rep(i, 0, N) cin >> A[i];
      |                         ^
a.cc:15:26: error: 'A' was not declared in this scope
   15 |     cout << *max_element(A.begin(), A.end()) - *min_element(A.begin(), A.end()) << endl;
      |                          ^
Language: Java

import java.io.*;
import java.util.StringTokenizer;
import java.util.Arrays;
import static java.lang.Math.*;

public class Main {
  public static void main(String[] args) {
    new Main().solve();
  }

  private void solve() {
    try(InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out)) {

      int n = in.nextInt();
      int[] a = in.mapInt(n);

      Arrays.parallelSort(a);
      int ans = a[n-1] - a[0];
      out.println(ans);
    }
    catch(IOException e) {
      System.err.println(e);
    }
  }

  int atoi(String s) { return Integer.parseInt(s); }
  long atol(String s) { return Long.parseLong(s); }

  static class InputReader implements AutoCloseable {
    public BufferedReader br;
    public StringTokenizer st;

    public InputReader(InputStream stream) {
      br = new BufferedReader(new InputStreamReader(stream), 32768);
      st = null;
    }

    public String nextLine() throws IOException {
      return br.readLine();
    }
    public String next() {
      if (st == null || !st.hasMoreTokens()) {
        try { st = new StringTokenizer(br.readLine());
        } catch (IOException e) {
          throw new UncheckedIOException(e);
        }
      }
      return st.nextToken();
    }
    public int nextInt() { return Integer.parseInt(next()); }
    public long nextLong() { return Long.parseLong(next()); }
    int[] mapInt(int len) {
      int[] ret = new int[len];
      for (int i = 0; i < len; i++) ret[i] = Integer.parseInt(next());
      return ret;
    }
    long[] mapLong(int len) {
      long[] ret = new long[len];
      for (int i = 0; i < len; i++) ret[i] = Long.parseLong(next());
      return ret;
    }
    @Override public void close() throws IOException { br.close(); }
  }

Compiler output:
Main.java:64: error: reached end of file while parsing
  }
   ^
1 error
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
  int a;
  vector<int> b(a);
  rep(i,a)
    cin>>b.at(i);
  sort(all(b));
  cout<<b.at(a.size()-1)-b.at(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: request for member 'size' in 'a', which is of non-class type 'long long int'
   15 |   cout<<b.at(a.size()-1)-b.at(0);
      |                ^~~~
Language: C++

#include<bits/stdc++.h>
using namesapce std;
int main(){
int a,b[10000000];
cin>>a;
for(int i=0;i<a:i++){
cin>>b[i];
}
sort(b,b+a);
cout<b[a-1]-b[0]<<"\n";
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
    2 | using namesapce std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin>>a;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
    6 | for(int i=0;i<a:i++){
      |             ^
a.cc:6:16: error: found ':' in nested-name-specifier, expected '::'
    6 | for(int i=0;i<a:i++){
      |                ^
      |                ::
a.cc:6:15: error: 'a' is not a class, namespace, or enumeration
    6 | for(int i=0;i<a:i++){
      |               ^
a.cc:9:1: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    9 | sort(b,b+a);
      | ^~~~
      | std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:10:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 | cout<b[a-1]-b[0]<<"\n";
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:17: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
   10 | cout<b[a-1]-b[0]<<"\n";
      |      ~~~~~~~~~~~^~~~~~
      |            |      |
      |            int    const char [2]
a.cc:10:23: error: expected ')' before ';' token
   10 | cout<b[a-1]-b[0]<<"\n";
      |                       ^
      |                       )
a.cc:6:4: note: to match this '('
    6 | for(int i=0;i<a:i++){
      |    ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
  rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define all(x) x.begin(), x.end()
#define int long long
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int MX = 1e5 + 5, INF = 5 << 28, MOD = 1e9 + 7;

int N, M, K;
vi A, B;
string S, T;

void input() {
  int x, y, z;
  ;
  cin >> N;
  A.resize(N);
  rep(i, 0, N - 1) { cin >> A[i]; }
}
void solve() {
  sort(A);
  int ans = 0;
  rep(i, 1, N - 1) { ans += A[i] - A[i - 1]; }
  cout << ans << endl;
  ;
  ;
}
signed main() {
  input();
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:26:7: error: no matching function for call to 'sort(vi&)'
   26 |   sort(A);
      |   ~~~~^~~
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: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/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, 1 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, 1 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, 1 provided
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> vec(n);
  for(int i=0;i<n;i++){
    cin >>vec.at(i);
    }
    sort(vec.begin(),vec.end());
    cout << vec.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> vec(n);
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <math.h>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> vec(n);
      |          ^~~
a.cc:9:11: error: 'vec' was not declared in this scope
    9 |     cin >>vec.at(i);
      |           ^~~
a.cc:11:10: error: 'vec' was not declared in this scope
   11 |     sort(vec.begin(),vec.end());
      |          ^~~
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   11 |     sort(vec.begin(),vec.end());
      |     ^~~~
      |     sqrt
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
int main() {
  int n;
  cin >>n;
  vector<int> vec(n);
  for(int i=0;i<n;i++){
    cin >>vec.at(i);
    }
    sort(vec.begin(),vec.end());
    cout << vec.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> vec(n);
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <math.h>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> vec(n);
      |          ^~~
a.cc:9:11: error: 'vec' was not declared in this scope
    9 |     cin >>vec.at(i);
      |           ^~~
a.cc:11:10: error: 'vec' was not declared in this scope
   11 |     sort(vec.begin(),vec.end());
      |          ^~~
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   11 |     sort(vec.begin(),vec.end());
      |     ^~~~
      |     sqrt
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> vec(n);
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <math.h>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> vec(n);
      |          ^~~
a.cc:8:11: error: 'vec' was not declared in this scope
    8 |     cin >>vec.at(i);
      |           ^~~
a.cc:10:10: error: 'vec' was not declared in this scope
   10 |     sort(vec.begin(),vec.end());
      |          ^~~
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   10 |     sort(vec.begin(),vec.end());
      |     ^~~~
      |     sqrt
Language: C++


int N, A, min = 1001, max = 01;
int main(){
    std::cin >> N;
    for(int i = 1; i <= N; i++){
        std::cin >> A;
        if(min > A) min = A;
        if(max < A) max = A;
    }
    std::cout << max -min <<  std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: 'cin' is not a member of 'std'
    4 |     std::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 | 
a.cc:6:14: error: 'cin' is not a member of 'std'
    6 |         std::cin >> A;
      |              ^~~
a.cc:6:14: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:10: error: 'cout' is not a member of 'std'
   10 |     std::cout << max -min <<  std::endl;
      |          ^~~~
a.cc:10:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:36: error: 'endl' is not a member of 'std'
   10 |     std::cout << max -min <<  std::endl;
      |                                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 |
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'house' was not declared in this scope; did you mean 'hou'?
    9 |       cin>>house[i];
      |            ^~~~~
      |            hou
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'house' was not declared in this scope; did you mean 'hou'?
    9 |       cin>>house[i];
      |            ^~~~~
      |            hou
a.cc:11:12: error: request for member 'begin' in 'hou', which is of non-class type 'int [n]'
   11 |   sort(hou.begin(),hou.end());
      |            ^~~~~
a.cc:11:24: error: request for member 'end' in 'hou', which is of non-class type 'int [n]'
   11 |   sort(hou.begin(),hou.end());
      |                        ^~~
Language: C++

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

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

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define FT first
#define SC second

using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef pair<int, int> pint;
const int INF = 1e9;
const double EPS = 1e-9;



int main()
{
  int n ;
  cin >> n ;
  vector<int> poi(n) ;
  int count = 0 ;
  REP(i,n){
    cin >> poi.at(i) ;
  }
  sort(ALL(poi)) ;
  
  REP(i,n-1){
    count += s.at(i+1)-s.at(i) ;
  }
  
  cout << count <<endl ;
    

  return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:14: error: 's' was not declared in this scope
   33 |     count += s.at(i+1)-s.at(i) ;
      |              ^
Language: C++

#include <iostream>
#include <vector>

int N;

using namespace std;

int main(){
  cin >> N;
  int maxa = -1; mina = 10000;
  vector<int> a(N);
  for(int i = 0; i < N; i++){
    cin >> a[i];
    if(a[i] <= mina) mina = a[i];
    if(a[i] >= maxa) maxa = a[i];
  }
  cout << maxa - mina;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'mina' was not declared in this scope
   10 |   int maxa = -1; mina = 10000;
      |                  ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'class std::vector<int>' has no member named 'sort'
   11 |   v.sort(v.begin(),v.end());
      |     ^~~~
Language: C++

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cassert>
#include <functional>
#include <string>
#include <sstream>
#include <cctype>
using namespace std;


int main(){
  int N; cin >> N;
  int min = 1000; max = 0;
  for(int i = 0; i > N; i++){
    int tmp;
    cin >> tmp;
    if(tmp < min) tmp = min;
    if(tmp > max) tmp = max;
  }
  cout << max - min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: overloaded function with no contextual type information
   17 |   int min = 1000; max = 0;
      |                         ^
a.cc:22:12: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>'
   22 |     if(tmp > max) tmp = max;
      |        ~~~~^~~~~
a.cc:22:25: error: cannot resolve overloaded function 'max' based on conversion to type 'int'
   22 |     if(tmp > max) tmp = max;
      |                         ^~~
a.cc:24:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   24 |   cout << max - min << endl;
      |           ~~~~^~~~~
Language: C++

#include <iostream>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <float.h>
#include <limits>
#include <vector> 
#include <string.h>

#define rep(i,a,n) for(ll int (i) = (a);(i) < (n);(i)++)
#define urep(i,a,n) for(ll int (i) = (a);(i) > (n);(i)--)
#define MOD 1000000007
#define ll long long
#define asort(a) sort(a.begin(),a.end());

using namespace::std;

int jo(ll int jxo, ll int jyo){//累乗
	ll int jhogeo = 1;
	rep(jinto,0,jyo) jhogeo=jhogeo*jxo;
	return jhogeo;
}
char tobig(char toxbig){//char大文字化
  return (toxbig-0x20);
}
char tolow(char toxlow){//char小文字化
  return (toxlow+0x20);
}
int ctoi(char cctoi){//char->int
  if('0' <= cctoi && cctoi <= '9') return (cctoi-'0');
  return -1;
}
int gcd(int gcad, int gcbd) {//最大公約数
  if(gcad < gcbd) return gcd(gcbd, gcad);
  int gcrd;
  while ((gcrd=gcad%gcbd)) {
    gcad = gcbd;
    gcbd = gcrd;
  }
  return gcbd;
}
int lcm(int lcam, int lcbm){//最小公倍数
 return (lcam*lcbm)/gcd(lcam,lcbm);
}


int main(){
  int n;
  cin>>n;
  vecor<int> a(n);

  rep(i,0,n) cin>>a[i];
  asort(a);
  cout<<a[n-1]-a[0];
}

// int *p = new int[N];

//  vector<int> 変数名(要素数);
//  sort(変数名.begin(),変数名.end());//昇順ソート

// vector<vector<int>> 変数名(左の個数, vector<int>(右の個数));

//


Compiler output:
a.cc: In function 'int main()':
a.cc:50:3: error: 'vecor' was not declared in this scope
   50 |   vecor<int> a(n);
      |   ^~~~~
a.cc:50:9: error: expected primary-expression before 'int'
   50 |   vecor<int> a(n);
      |         ^~~
a.cc:52:19: error: 'a' was not declared in this scope
   52 |   rep(i,0,n) cin>>a[i];
      |                   ^
a.cc:53:9: error: 'a' was not declared in this scope
   53 |   asort(a);
      |         ^
a.cc:14:23: note: in definition of macro 'asort'
   14 | #define asort(a) sort(a.begin(),a.end());
      |                       ^
Language: C++

#include<iostream>
using namespace std;

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

    return 0;
}

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

#include <iostream>

int main() {
  int n = 0;
  cin >> n;
  int maxi = 0, mini = 100000;
  int buf = 0;
  for (int i=0; i<n; i++) {
    std::cin >> buf;
    if (buf > maxi) maxi = buf;
    if (buf < mini) mini = buf;
  }
  std::cout << maxi - mini << endl;
  retunr 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from 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:13:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   std::cout << maxi - mini << endl;
      |                               ^~~~
      |                               std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:14:3: error: 'retunr' was not declared in this scope
   14 |   retunr 0;
      |   ^~~~~~
Language: C++

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

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

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

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(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 debug(x)  cout << #x << " = " << (x) << endl;
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;

int main() {
  int N; cin >> N;
  vi a(N); cin >> a.at(i);
  
  cout << *max_element(all(a)) - *min_element(all(a)) << endl;
}

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

#include<iostream>
using namespace std;
int main(){
int a, b, Mma=-1, min=1001;
  cin >> a;
  for(i=0;i<a;i++) {
  cin >> b;
  if(min>b) min=b;
    if(Mma<b) Mma=b;
  }
cout << Mma-min <<endl;
}

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

#include<iostream>
using namespace std;
int main(){
int a, b, Mma=-1, min=1001;
  cin >> a;
  for(i=0;i<a;i++){
  cin >> b;
  if(min>b) min=b;
    if(Mma<b) Mma=b;
  }
cout << Mma-min <<endl;
}

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

#include<iostream>
using namespace std;
int main(){
int a, b, Mma=-1, min=1001;
  cin >> a;
  for(i=0;i<a;i++){
  cin >> b;
  if(min>b) min=b;
    if(Mma<b) Mma=b;
  }
cout << Mma+min <<endl;
}

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

#include<its/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;
}

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

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
  int n
  char a[100];
  scanf("%d",&n);
  for(int i=0;i<n;i++)scanf("%c",&a[i]);
  qsort(a,n,sizeof(int),strcmp);
  printf("%d",a[n-1]-a[0]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:8: error: expected ';' before 'char'
    5 |   int n
      |        ^
      |        ;
    6 |   char a[100];
      |   ~~~~  
main.c:7:15: error: 'n' undeclared (first use in this function)
    7 |   scanf("%d",&n);
      |               ^
main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:25: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
    9 |   qsort(a,n,sizeof(int),strcmp);
      |                         ^~~~~~
      |                         |
      |                         int (*)(const char *, const char *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'int (*)(const char *, const char *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'?
   13 |   ans = *std::max_element(a.begin(), a.end()) - *std::min_element(a.begin(), a.end());
      |               ^~~~~~~~~~~
      |               tuple_element
a.cc:13:55: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'?
   13 |   ans = *std::max_element(a.begin(), a.end()) - *std::min_element(a.begin(), a.end());
      |                                                       ^~~~~~~~~~~
      |                                                       tuple_element
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[n-1]-a[0] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: expected unqualified-id before '.' token
   10 |   sort(a..begin(),a.end());
      |          ^
Language: Java

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

class Main {
  	public static void main(string args[]) {
      
      Scanner std = new Scanner(System.in);
      List<Integer> list = new ArrayList<>();
      
      int N = std.nextInt();
      for(int i = 0; i < N; i++) {
      	int a = std.next();
        list.add(a);
      }
      
      Integer x = Collections.max(list);
      Integer y = Collections.min(list);
        
    }
}

Compiler output:
Main.java:7: error: cannot find symbol
  	public static void main(string args[]) {
  	                        ^
  symbol:   class string
  location: class Main
Main.java:14: error: incompatible types: String cannot be converted to int
      	int a = std.next();
      	                ^
2 errors
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.at(N-1)-a.at(0)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: request for member 'begin' in 'a', which is of non-class type 'int [N]'
   13 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:13:20: error: request for member 'end' in 'a', which is of non-class type 'int [N]'
   13 |   sort(a.begin(),a.end());
      |                    ^~~
a.cc:15:11: error: request for member 'at' in 'a', which is of non-class type 'int [N]'
   15 |   cout<<a.at(N-1)-a.at(0)<<endl;
      |           ^~
a.cc:15:21: error: request for member 'at' in 'a', which is of non-class type 'int [N]'
   15 |   cout<<a.at(N-1)-a.at(0)<<endl;
      |                     ^~
Language: C++

using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++i)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
 
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin>>N;
  VEC(A,N);
  rep(i,N)
    cin>>A[i];
  sortall(A);
  cout<<A[N-1]-A[0]<<endl;

}
  






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

using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++i)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
 
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin>>N;
  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:28:10: error: request for member 'begin' in 'A', which is of non-class type 'int [N]'
   28 |   sort(A.begin(),A.end());
      |          ^~~~~
a.cc:28:20: error: request for member 'end' in 'A', which is of non-class type 'int [N]'
   28 |   sort(A.begin(),A.end());
      |                    ^~~
Language: C++

using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++i)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
 
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin>>N;
  int A[N];
  rep(i,N)
    cin>>A[i];
  sort(all(A));
  cout<<A[N-1]-A[0]<<endl;

}
  






Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: request for member 'begin' in 'A', which is of non-class type 'int [N]'
    6 | #define all(v) (v.begin(), v.end())
      |                   ^~~~~
a.cc:28:8: note: in expansion of macro 'all'
   28 |   sort(all(A));
      |        ^~~
a.cc:6:30: error: request for member 'end' in 'A', which is of non-class type 'int [N]'
    6 | #define all(v) (v.begin(), v.end())
      |                              ^~~
a.cc:28:8: note: in expansion of macro 'all'
   28 |   sort(all(A));
      |        ^~~
Language: C++

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

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


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