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

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProCon
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int min = 10000;
            int max = 0;
            for ( int i = 0; i < input.Length; ++i)
            {
                int t = int.Parse(input[i]);
                if (min > t)
                {
                    min = t;
                }
                if(max < t)
                {
                    max = t;
                }
            }
            Console.WriteLine(max - min);
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.IO;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Linq;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Text;
      |       ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'System'
    6 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:11:26: error: 'string' has not been declared
   11 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:11:35: error: expected ',' or '...' before 'args'
   11 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:30:6: error: expected ';' after class definition
   30 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void ProCon::Program::Main(int*)':
a.cc:13:13: error: 'string' was not declared in this scope
   13 |             string[] input = Console.ReadLine().Split(' ');
      |             ^~~~~~
a.cc:13:20: error: expected primary-expression before ']' token
   13 |             string[] input = Console.ReadLine().Split(' ');
      |                    ^
a.cc:16:34: error: 'input' was not declared in this scope; did you mean 'int'?
   16 |             for ( int i = 0; i < input.Length; ++i)
      |                                  ^~~~~
      |                                  int
a.cc:18:25: error: expected primary-expression before 'int'
   18 |                 int t = int.Parse(input[i]);
      |                         ^~~
a.cc:28:13: error: 'Console' was not declared in this scope
   28 |             Console.WriteLine(max - min);
      |             ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
int N, m, M, i;
cin >> N;
m = 0;
M = 0;
for(int j =0; j++; j<N){
cin >> i;
if (i < m){
m = i
} else if(i > M){
M = i
}
}
cout << M - m << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:6: error: expected ';' before '}' token
   12 | m = i
      |      ^
      |      ;
   13 | } else if(i > M){
      | ~     
a.cc:14:6: error: expected ';' before '}' token
   14 | M = i
      |      ^
      |      ;
   15 | }
      | ~
Language: C++

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

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

#include<iosteram>
#include<stdio.h>
using namespace std;

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

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

#include<stdio.h>

int main()
{
    int a, N, i, max, min;

    max = 0;
    min = 1000;
    scanf("%d", &N);

    if(i = 0; i < N; i++){
      scanf("%d", &a);
      if(max < a)max = a;
      if(min > a)min = a;
    }

    printf("%d\n", max - min);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:13: error: expected ')' before ';' token
   11 |     if(i = 0; i < N; i++){
      |       ~     ^
      |             )
Language: Java

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br =	new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		int number = Integer.parseInt(line);
		String[] in = br.readLine().split(" ");
		ArrayList<Integer> coordinate = new ArrayList<Integer>();
		int min = 1000;
		int max =0;

		for(int i = 0; i < in.length ;i++){
			coordinate.add(Integer.parseInt(in[i]));
		}

		for(int j =0; j < coordinate.size();j++){
			if(min > coordinate.get(j)){
				min = coordinate.get(j);	//1000からmax値を下げていく
			}
			if(max < coordinate.get(j)){
				max = coordinate.get(j);	//0からmin値を上げていく
			}
		}

		System.out.println(max - min);



	}
}

Compiler output:
Main.java:2: error: cannot find symbol
	public static void main(String[] args) throws IOException {
	                                              ^
  symbol:   class IOException
  location: class Main
Main.java:3: error: cannot find symbol
		BufferedReader br =	new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:3: error: cannot find symbol
		BufferedReader br =	new BufferedReader(new InputStreamReader(System.in));
		                   	    ^
  symbol:   class BufferedReader
  location: class Main
Main.java:3: error: cannot find symbol
		BufferedReader br =	new BufferedReader(new InputStreamReader(System.in));
		                   	                       ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:7: error: cannot find symbol
		ArrayList<Integer> coordinate = new ArrayList<Integer>();
		^
  symbol:   class ArrayList
  location: class Main
Main.java:7: error: cannot find symbol
		ArrayList<Integer> coordinate = new ArrayList<Integer>();
		                                    ^
  symbol:   class ArrayList
  location: class Main
6 errors
Language: C

#include<stdio.h>
 
int main()
{
     int N, a, MAX, MIN, i;
 
    MAX = 0;
    MIN = 1000;
 
    scanf("%d", &N);
 
    for(i = 0; i < N, i++){
        scanf("%d", &a);

        if( a > MAX){
          MAX = a;
        }

        if( a < MIN){
          MIN = a;
        }
    }
 
    printf("%d", MAX - MIN);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:26: error: expected ';' before ')' token
   12 |     for(i = 0; i < N, i++){
      |                          ^
      |                          ;
Language: C++

#include<stdio.h>
 
int main()
{
int N, a, MAX, MIN, i;
 
MAX = 0;
MIN = 1000;
 
scanf("%d", &N);
 
for(i = 0; i <= N, i++){
scanf("%d", &a);
if( a > MAX){
MAX = a}
if( a < MIN){
MIN = a}
}
 
printf("%d", MAX - MIN);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: expected ';' before ')' token
   12 | for(i = 0; i <= N, i++){
      |                       ^
      |                       ;
a.cc:15:8: error: expected ';' before '}' token
   15 | MAX = a}
      |        ^
      |        ;
a.cc:17:8: error: expected ';' before '}' token
   17 | MIN = a}
      |        ^
      |        ;
Language: C++

#include<studio.h>

int main()
{
int N, a, MAX, MIN, i;

MAX = 0;
MIN = 1000;

scanf("%d", &N);

for(i = 0; i <= N, i++){
scanf("%d", &a);
if( a > MAX){
MAX = a}
if( a < MIN){
MIN = a}
}

printf("%d", MAX - MIN);
return 0;
}



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

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

}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope; did you mean 'min'?
    8 |         cin>>N;
      |         ^~~
      |         min
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout<<max-min<<endl;
      |         ^~~~
a.cc:16:24: error: 'endl' was not declared in this scope
   16 |         cout<<max-min<<endl;
      |                        ^~~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	int N;
	cin >> N;
	int a[N];
	cout << a.max() - a.min();
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: request for member 'max' in 'a', which is of non-class type 'int [N]'
   10 |         cout << a.max() - a.min();
      |                   ^~~
a.cc:10:29: error: request for member 'min' in 'a', which is of non-class type 'int [N]'
   10 |         cout << a.max() - a.min();
      |                             ^~~
Language: C++

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

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

    vector<int> a(N);
    for (auto& ai : a) cin >> ai;

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

    cout << max - min << endl;

    return 0;
}


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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Comparator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 *
 * @author 97797
 */
public class Main {
     public static void main(String[] args) {
        System.out.println(new Main().run(args, System.in));
    }
    public String run(String[] args, InputStream in) {
        String result = null;
        try {
            
            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
            int N = Integer.parseInt(reader.readLine());
            
            List<Integer> list = reader.lines()
                    .flatMap(s -> Stream.of(
                            s.replaceAll("\\s+", " ").split(" ")))
                    .limit(N).map(Integer::parseInt)
                    //.sorted(Comparator.reverseOrder())
                    .sorted()
                    .collect(Collectors.toList());
            int min = list.get(0);
            int max = list.get(N-1);
            result = String.valueOf(max-min);
        } catch (IOException ex) {
            Logger.getLogger(abc064a.Main.class.getName()).log(Level.SEVERE, null, ex);
        }
        return result;
    }   
}


Compiler output:
Main.java:38: error: package abc064a does not exist
            Logger.getLogger(abc064a.Main.class.getName()).log(Level.SEVERE, null, ex);
                                    ^
1 error
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  int max = -1;
  int min = 1001;
  for(i = 0; i < n; i++){
    int a;
    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:8:7: error: 'i' was not declared in this scope
    8 |   for(i = 0; i < n; i++){
      |       ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:4:19: error: conflicting declaration 'int a'
    4 | int n, a[100]={}, a,min=100;
      |                   ^
a.cc:4:8: note: previous declaration as 'int a [100]'
    4 | int n, a[100]={}, a,min=100;
      |        ^
a.cc:9:2: error: incompatible types in assignment of 'int' to 'int [100]'
    9 | a=a[i]-a[j];
      | ~^~~~~~~~~~
a.cc:10:5: error: ordered comparison of pointer with integer zero ('int*' and 'int')
   10 | if(a<0)a*=-1
      |    ~^~
a.cc:10:9: error: invalid operands of types 'int [100]' and 'int' to binary 'operator*'
   10 | if(a<0)a*=-1
      |        ~^~~~
a.cc:10:9: note:   in evaluation of 'operator*=(int [100], int)'
Language: Java

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

Compiler output:
Main.java:10: error: '.class' expected
      Arrays.sort(a[]);
                     ^
1 error
Language: Java

import java.util.Scanner;

public class TravelingAtCoDeerProblem {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		scan.nextLine();
		String[] ary = scan.nextLine().split(" ");
		scan.close();
		int max = Integer.parseInt(ary[0]);
		int min = max;
		int value;
		for(int i=1; i<ary.length; i++) {
			value = Integer.parseInt(ary[i]);
			if(max < value) {
				max = value;
			}
			if(value < min) {
				min = value;
			}
		}
		System.out.println(max-min);
	}

}

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

#include <iostream>
#include <algorithm>

int main(int argc, char const *argv[]) {
	int count,min,max,temp;
	min = 1000;
	max = 0;
	std::cin >> count;
	for (size_t i = 0; i < count; i++) {
		std::cin >> temp;
		min = min(min,temp);
		max = max(max,temp);
	}
	std::cout << max-min << '\n';
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:11:26: error: 'min' cannot be used as a function
   11 |                 min = min(min,temp);
      |                       ~~~^~~~~~~~~~
a.cc:12:26: error: 'max' cannot be used as a function
   12 |                 max = max(max,temp);
      |                       ~~~^~~~~~~~~~
Language: C++

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

Compiler output:
a.cc:2:9: fatal error: algorithms: No such file or directory
    2 | #include<algorithms>
      |         ^~~~~~~~~~~~
compilation terminated.
Language: C++

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

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

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		int[] a = new int[n];
		for(int i=0;i<n;i++){
			a[i] = Integer.parseInt(scan.next());
		}
		Arrays.sort(a);
		System.out.println(a[n-1]-a[0]);
	}

}


Compiler output:
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
Main.java:9: error: cannot find symbol
		Arrays.sort(a);
		^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   10 |     t=max_main(a,n);
      |                ^
      |                |
      |                int*
a.cc:2:14: note:   initializing argument 1 of 'int max_main(int, int)'
    2 | int max_main(int,int);
      |              ^~~
a.cc: In function 'int max_main(int*, int)':
a.cc:18:9: error: 'i' was not declared in this scope
   18 |     for(i=0;i<n;i++)
      |         ^
Language: C++

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

using namespace std;

int main() {
  int N;
  vector<int> a;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int in;
    cin >> in;
    a.push_back(in);
  }
  
  sort(a.begin(), a.end());

  int answer = a[N-1] - a[0];

  cout << answer << endl;

  return 0;
}

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

#include<stdio.h>
#include<conio.h>
int a[100];
int main()
{
int i, n, mx,mn;

scanf("%d", &n);
for (i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
mx= a[0]; mn = a[0];
for (i = 1; i < n; i++)
{
if (mn > a[i])mn = a[i];
if (mx < a[i])mx = a[i];
}
int res=0;
res=mx-mn;
printf("%d",res);
return 0;
}


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

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

using namespace std;

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

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

    cout << *std::max_element(a.begin(), a.end()) - *std::min_element(a.begin(), a.end()) << endl;
    int sum = accumulate(v.begin(), v.end(), 0);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: 'v' was not declared in this scope
   18 |     int sum = accumulate(v.begin(), v.end(), 0);
      |                          ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sys/time.h>

using namespace std;

void solve(vector<int> coo) {
    int maxcoo = max_element(coo.begin(), coo.end());
    int mincoo = min_element(coo.begin(), coo.end());
    std::cout << maxcoo - mincoo << std::endl;
}

int main() {
    struct timeval start,end;
    long long span;
    int t;

    gettimeofday(&start,NULL);

    std::cin >> t;
    vector<int> coo(t);
    for (int i = 0; i < t; i++) {
        std::cin >> coo[i];
    }
    solve(coo);

    gettimeofday(&end,NULL);
    span = (end.tv_sec -start.tv_sec)*1000000LL + (end.tv_usec - start.tv_usec);
    std::cerr << "--Total Time: " << span/1000 << "ms" << endl;
    return 0;
}


Compiler output:
a.cc: In function 'void solve(std::vector<int>)':
a.cc:12:29: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   12 |     int maxcoo = max_element(coo.begin(), coo.end());
      |                  ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
      |                             |
      |                             __gnu_cxx::__normal_iterator<int*, std::vector<int> >
a.cc:13:29: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   13 |     int mincoo = min_element(coo.begin(), coo.end());
      |                  ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
      |                             |
      |                             __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

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

using namespace std;

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

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

    cout << *std::max_element(a.begin(), a.end()) - *std::min_element(a.begin(), a.end()) << endl;
    int sum = accumulate(v.begin(), v.end(), 0);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:40: error: 'v' was not declared in this scope
   15 |     for (int i = 0; i < N; ++i) cin >> v[i];
      |                                        ^
a.cc:18:26: error: 'v' was not declared in this scope
   18 |     int sum = accumulate(v.begin(), v.end(), 0);
      |                          ^
Language: C++

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

int main()
{
  int N;

  cin >> N;
  int t = N -1;
  int a[t];

  for(int c = 0; c < N;c++){
    cin >> a[c];
  }

  sort(a);

  cout << a[t] - a[0] << "\n";
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: no matching function for call to 'sort(int [t])'
   17 |   sort(a);
      |   ~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/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 <vector>

using namespace std;

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

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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sys/time.h>

using namespace std;

void solve(vector<int> coo) {
    maxcoo = max_element(coo.begin(), coo.end());
    mincoo = min_element(coo.begin(), coo.end());
    std::cout << maxcoo - mincoo << std::endl;
}

int main() {
    struct timeval start,end;
    long long span;
    int t;

    gettimeofday(&start,NULL);

    std::cin >> t;
    vector<int> coo(t);
    for (int i = 0; i < t; i++) {
        std::cin >> coo[i];
    }
    solve(coo);

    gettimeofday(&end,NULL);
    span = (end.tv_sec -start.tv_sec)*1000000LL + (end.tv_usec - start.tv_usec);
    std::cerr << "--Total Time: " << span/1000 << "ms" << endl;
    return 0;
}


Compiler output:
a.cc: In function 'void solve(std::vector<int>)':
a.cc:12:5: error: 'maxcoo' was not declared in this scope
   12 |     maxcoo = max_element(coo.begin(), coo.end());
      |     ^~~~~~
a.cc:13:5: error: 'mincoo' was not declared in this scope
   13 |     mincoo = min_element(coo.begin(), coo.end());
      |     ^~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

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

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

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

int main()
{
  int N;

  cin >> N;
  int t = N -1;
  int a[t];

  for(int c = 0; c < N;c++){
    cin >> a[c];
  }

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

  cout << a[t] - a[0] << "\n";
  
  return 0;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: no matching function for call to 'sort(int [101])'
   13 | sort(arr);
      | ~~~~^~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/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 <algorithm>
using namespace std;

int main()
{
  int N;

  cin >> N;
  int t = N -1;
  int a[t];

  for(int c = 0; c < N;c++){
    cin >> a[c];
  }

  sort(a[0],[t]);

  cout << a[N -1] - a[0] << "\n";
  
  return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:17:16: error: expected '{' before ')' token
   17 |   sort(a[0],[t]);
      |                ^
a.cc: In function 'int main()':
a.cc:17:7: error: no matching function for call to 'sort(int&, main()::<lambda()>)'
   17 |   sort(a[0],[t]);
      |   ~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/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:   template argument deduction/substitution failed:
a.cc:17:7: note:   deduced conflicting types for parameter '_RAIter' ('int' and 'main()::<lambda()>')
   17 |   sort(a[0],[t]);
      |   ~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

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

int main()
{
  int N;

  cin >> N;
  int t = N -1;
  int a[t];

  for(int c = 0; c < N;c++){
    cin >> a[c];
  }

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

  cout << a[N -1] - a[0] << "\n";
  
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
 int t;
int arr[101];
scanf("%d",&t);
for(int i=0;i<t;i++)
{
 scanf("%d",&arr[i]);
}
sort(arr);
printf("%d\n",arr[t-1]-arr[0]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: no matching function for call to 'sort(int [101])'
   12 | sort(arr);
      | ~~~~^~~~~
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 <algorithm>
using namespace std;

int main()
{
  int N;

  cin >> N;

  int a[N - 1];

  for(int c = 0; c < N,c++){
    cin >> a[c];
  }

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

  cout << a[N -1] - a[0] << "\n";
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: expected ';' before ')' token
   13 |   for(int c = 0; c < N,c++){
      |                           ^
      |                           ;
a.cc:17:10: error: request for member 'begin' in 'a', which is of non-class type 'int [(N + -1)]'
   17 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:17:20: error: request for member 'end' in 'a', which is of non-class type 'int [(N + -1)]'
   17 |   sort(a.begin(),a.end());
      |                    ^~~
Language: C++

#include<iostream>

using namespace std;

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

				
		
	
	return 0;
}

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

#include<bits/stdc++.h>
int main()
{
 int t;
int arr[101];
scanf("%d",&t);
for(int i=0;i<t;i++)
{
 scanf("%d",&arr[i]);
}
sort(arr);
printf("%d\n",arr[t-1]-arr[0]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:1: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   11 | sort(arr);
      | ^~~~
      | 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,
                 from a.cc:1:
/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 <stdio.h>

int main(){
    int n;
    scanf("%d",&n):
    int min=1001,max=-1,t;
    while(n--){
        scanf("%d",&t);
        if(t<min) min=t;
        if(t>max) max=t;
    }
    printf("%d\n",max-min);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: expected ';' before ':' token
    5 |     scanf("%d",&n):
      |                   ^
      |                   ;
a.cc:8:21: error: 't' was not declared in this scope
    8 |         scanf("%d",&t);
      |                     ^
a.cc:9:14: error: 'min' was not declared in this scope; did you mean 'main'?
    9 |         if(t<min) min=t;
      |              ^~~
      |              main
a.cc:10:14: error: 'max' was not declared in this scope
   10 |         if(t>max) max=t;
      |              ^~~
a.cc:12:19: error: 'max' was not declared in this scope
   12 |     printf("%d\n",max-min);
      |                   ^~~
a.cc:12:23: error: 'min' was not declared in this scope; did you mean 'main'?
   12 |     printf("%d\n",max-min);
      |                       ^~~
      |                       main
Language: C++

#include <stdio.h>

int main(){
    int n;
    scanf("%d",&n):
    int min=1001,max=-1,t;
    while(n--){
        scanf("%d",&t);
        if(t<min) min=t;
        if(t>max) max=t;
    }
    printf("%d\n",max-min);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: expected ';' before ':' token
    5 |     scanf("%d",&n):
      |                   ^
      |                   ;
a.cc:8:21: error: 't' was not declared in this scope
    8 |         scanf("%d",&t);
      |                     ^
a.cc:9:14: error: 'min' was not declared in this scope; did you mean 'main'?
    9 |         if(t<min) min=t;
      |              ^~~
      |              main
a.cc:10:14: error: 'max' was not declared in this scope
   10 |         if(t>max) max=t;
      |              ^~~
a.cc:12:19: error: 'max' was not declared in this scope
   12 |     printf("%d\n",max-min);
      |                   ^~~
a.cc:12:23: error: 'min' was not declared in this scope; did you mean 'main'?
   12 |     printf("%d\n",max-min);
      |                       ^~~
      |                       main
Language: C++

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

using namespace std;

int main(void) {
	int min = INT_MAX, max = 0, n, t;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> t;
		if (t < min) min = t;
		if (t > max) max = t;
	}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: 'INT_MAX' was not declared in this scope
    9 |         int min = INT_MAX, max = 0, n, t;
      |                   ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <vector>
  +++ |+#include <climits>
    5 | 
a.cc:10:16: error: 'n' was not declared in this scope
   10 |         cin >> n;
      |                ^
a.cc:12:24: error: 't' was not declared in this scope
   12 |                 cin >> t;
      |                        ^
a.cc:17:21: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   17 |         cout << max - min << endl;
      |                 ~~~~^~~~~
Language: C++

In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:

Rating 1-399 : gray
Rating 400-799 : brown
Rating 800-1199 : green
Rating 1200-1599 : cyan
Rating 1600-1999 : blue
Rating 2000-2399 : yellow
Rating 2400-2799 : orange
Rating 2800-3199 : red
Other than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.
Currently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of ai.
Find the minimum and maximum possible numbers of different colors of the users.

Compiler output:
a.cc:1:105: warning: missing terminating ' character
    1 | In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:
      |                                                                                                         ^
a.cc:1:105: error: missing terminating ' character
    1 | In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:
      |                                                                                                         ^~~~~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'In' does not name a type
    1 | In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:
      | ^~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <deque>
#include <vector>
#include <bitset>
#include <cmath>
#include <utility>
#define Maxn 100005
#define Maxm 1000005
#define lowbit(x) x&(-x)
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define PI acos(-1.0)
#define LL long long 
#define Inf (1LL<<62)
#define inf 0x3f3f3f3f
#define input freopen("input.txt","r",stdin)
#define output freopen("output.txt","w",stdout)
using namespace std;
int main()
{
	int arr[1005];
	while(cin>>n)
	{
		int _min=inf,_max=-1;
		for(int i=0;i<n;i++)
		{
			cin>>arr[i];
			_min=min(_min,arr[i]);
			_max=max(_max,arr[i]);
		}
		cout<<_max-_min<<endl;
	}
	return 0;
}

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

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
 vector<int> num;
 int n;
 cin>>n;
 for(int i=0;i<n;i++){
  int p;
  cin>>p;
  num.push_back(p);
 }
 sort(n.begin(),n.end());
 cout<<num.back()-num.front();
}

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

#include<iostream>
#include<vector>

using namespace std;

int main(){
int n;cin>>n;
int up=0;low=1001;
for(int i=0;i<n;i++){
int t;cin>>t;
up=max(up,t);
low=min(low,t);
}
cout<<up-low<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'low' was not declared in this scope
    8 | int up=0;low=1001;
      |          ^~~
Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <string>
#include <bitset>
#include <fstream>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef double db;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
typedef vector<pii> vii;

#define INF 1000000007ll
#define PB push_back
#define MP make_pair
#define X first
#define Y second
#define Min(a,b) (((a) < (b))?(a):(b))
#define Max(a,b) (((a) > (b))?(a):(b))
#define Abs(a) (((a) > 0)?(a):(-1)*(a))
#define cil(a,b) ( ((a)%(b) == 0)?((a)/(b)):((a)/(b)+1) )
#define SIZE 0

int main() {
   int n, mn = INF, mx = 0, a;
   cin >> n;
   for (int i = 0 ; i < n ; ++i) {
      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:40:4: error: 'cin' was not declared in this scope
   40 |    cin >> n;
      |    ^~~
a.cc:15:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   14 | #include <iomanip>
  +++ |+#include <iostream>
   15 | 
a.cc:46:4: error: 'cout' was not declared in this scope
   46 |    cout << mx - mn << endl;
      |    ^~~~
a.cc:46:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int maxi=0,mini=1e9;
for(int i=0;i<n;i++)
{
int a;
cin>>a;
maxi=max(maxi,a);
mini=min(mini,a));
}
cout<<maxi-mini<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: expected ';' before ')' token
   13 | mini=min(mini,a));
      |                 ^
      |                 ;
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> vec;
    for (int i = 0; i < N; i++) {
        int tmp;
        cin >> tmp;
        vec.push_back(tmp);
    }
    sort(vec.begin(), vec.end());
    cout << *max_element(vec.begin(), vec.end()) -
                *min_element(vec.begin(), vec.end())
         << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |     sort(vec.begin(), vec.end());
      |     ^~~~
      |     short
a.cc:16:14: error: 'max_element' was not declared in this scope
   16 |     cout << *max_element(vec.begin(), vec.end()) -
      |              ^~~~~~~~~~~
a.cc:17:18: error: 'min_element' was not declared in this scope
   17 |                 *min_element(vec.begin(), vec.end())
      |                  ^~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int maxi=0,mini=1e9;
for(int i=0;i<n;i++)
{
int a;
cin>>a;
maxi=max(maxi,a;
mini=min(mini,a));
}
cout<<maxi-mini<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected ')' before ';' token
   12 | maxi=max(maxi,a;
      |         ~      ^
      |                )
a.cc:13:17: error: expected ';' before ')' token
   13 | mini=min(mini,a));
      |                 ^
      |                 ;
Language: C++

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

using namespace std;
int a,b,c;

int main()
{
    cin>>n;
    maxi=0; mini=1001;
    for(i=1;i<=n;i++)
    {
        cin>>x;
        if(x>maxi) maxi=x;
        if(x<mini) mini=x;
    }
    cout<<maxi-mini<<'\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'n' was not declared in this scope
   11 |     cin>>n;
      |          ^
a.cc:12:5: error: 'maxi' was not declared in this scope
   12 |     maxi=0; mini=1001;
      |     ^~~~
a.cc:12:13: error: 'mini' was not declared in this scope
   12 |     maxi=0; mini=1001;
      |             ^~~~
a.cc:13:9: error: 'i' was not declared in this scope
   13 |     for(i=1;i<=n;i++)
      |         ^
a.cc:15:14: error: 'x' was not declared in this scope
   15 |         cin>>x;
      |              ^
Language: C

#include <stdio.h>
int main(void){
    
    int min,max;
    min=10000;
    max=-1:
    int kari;
    int N;
    scanf("%d",&N);
    for(int i=0;i<N;i++){
        
        scanf("%d",&kari);
        if(min>kari)min=kari;
        if(max<kari)max=kari;
    }
    printf("%d",max-min);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:11: error: expected ';' before ':' token
    6 |     max=-1:
      |           ^
      |           ;
main.c:12:21: error: 'kari' undeclared (first use in this function)
   12 |         scanf("%d",&kari);
      |                     ^~~~
main.c:12:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#define ll long long
using namespace std;


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

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