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

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;
int main() {
	int n;
	cin >> n;
	
	int a;
	int maxa = 0, mina = 10^9
	for (int i = 0; i < n; i++) {
	    std::cin >> a;
	    maxa = max(maxa,a);
	    mina = min(mina,a);
	}
	
	std::cout << maxa - mina << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:32: warning: result of '10^9' is 3; did you mean '1e9'? [-Wxor-used-as-pow]
   12 |         int maxa = 0, mina = 10^9
      |                                ^
      |                              ---
      |                              1e
a.cc:12:30: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
   12 |         int maxa = 0, mina = 10^9
      |                              ^~
      |                              0xa
a.cc:13:9: error: expected ',' or ';' before 'for'
   13 |         for (int i = 0; i < n; i++) {
      |         ^~~
a.cc:13:25: error: 'i' was not declared in this scope
   13 |         for (int i = 0; i < n; i++) {
      |                         ^
Language: C++

#include <iostream>
#include <vector>

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

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

#include <iostream>
#include <thread>
#include <chrono>
#include <random>
#include <fstream>
#include <time.h>


int main()
{
    int N;
    int ans=0;

    std::cin >> N;

    std::vector<int> a(N);

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

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

    ans = a[a.size()-1] - a[0];

    std::cout<< ans << std::endl;

    return 0;
}

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

#include <iostream>
#include <thread>
#include <chrono>
#include <random>
#include <fstream>
#include <time.h>


int main()
{
    int N;
    int ans=0;

    std::cin >> N;

    std::vector<int> a(N);

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

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

    ans = a[a.size()-1] - a[0];

    std::cout<< ans << std::endl;

    return 0;
}

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

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

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

  // Input
  int n;
  cin >> n;
  vector<int> a(n);
  REP(i,n) cin >> a.at(i);
  sort(a.begin(), a.end());
  int answer;
  answer = a[n-1] - a[0];
  

  // Output
	cout << answer << "\n";
	return 0;
}

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

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


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

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

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |   int n;cin>>n;
      |         ^~~
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int>a(n);
      |   ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int>a(n);
      |          ^~~
a.cc:8:10: error: 'a' was not declared in this scope
    8 |     cin>>a.at(i);
      |          ^
a.cc:12:12: error: 'a' was not declared in this scope
   12 |        max=a.at(0),min=a.at(0);
      |            ^
a.cc:13:18: error: 'a' was not declared in this scope
   13 |      max=max(max,a.at(i));
      |                  ^
a.cc:13:25: error: 'max' cannot be used as a function
   13 |      max=max(max,a.at(i));
      |                         ^
a.cc:14:25: error: 'min' cannot be used as a function
   14 |      min=min(min,a.at(i));
      |                         ^
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout<<max-min<<endl;
      |   ^~~~
a.cc:16:18: error: 'endl' was not declared in this scope
   16 |   cout<<max-min<<endl;
      |                  ^~~~
Language: Java

import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.im);
    int n = Integer.parseInt(sc.nextLine());
    String m = sc.nextLine();
    String[] mm = m.split(" ");
    int[] o = new int[n];
    for (int i = 0; i < n; i++) {
      o[i] = Integer.parseInt(mm[i]);
    }
    Arrays.sort(o);
    System.out.println(o[n - 1] - o[0]);
  }
}

Compiler output:
Main.java:5: error: cannot find symbol
    Scanner sc = new Scanner(System.im);
                                   ^
  symbol:   variable im
  location: class System
1 error
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <numeric>
#include <random>
#include <queue>
#include <deque>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;

const int INF = (1 << 30) - 1;
const ll INFLL= (1LL << 61) - 1;
const int MOD = 1000000007;

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];
  sort(A.begin(),A.end());
  cout<<A[A.size()-1]-A[0]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:18: error: expected ',' or ';' before ':' token
   28 |   vector<int>A(N):
      |                  ^
a.cc:29:15: error: 'i' was not declared in this scope
   29 |   for(int i=0;i<N;i++)cin>>A[i];
      |               ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  
  int mi = 1000000000;
  int ma = 0;
  for (int i = 0; i < N; i++) {
    mi = min(mi, A.at(i));
    ma = max(ma, A.at(i));
  }
  
  cout << ma - mi << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> A(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> A(N);
      |          ^~~
a.cc:10:12: error: 'A' was not declared in this scope
   10 |     cin >> A.at(i);
      |            ^
a.cc:16:18: error: 'A' was not declared in this scope
   16 |     mi = min(mi, A.at(i));
      |                  ^
Language: C++

#include <bits/stdc++.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);
  }
  
  int a = -1;
  for (int i=0;i<N;i++) {
    if (a<vec.at(i)) {
      a = vec.at(i);
    }
  int b = 1000000000;
  for (int i=0;i<N;i++) {
    if (b>vec.at(i)) {
      b = vec.at(i);
    }
  }
    
  cout << a - b << endl;
}



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

#include <bits/stdc++.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);
  }
  
  int a = -1;
  for (int i=0;i<N;i++) {
    if (a<vec.at(i)) {
      a = vec.at(i);
    }
  int b = 10000000000;
  for (int i=0;i<N;i++) {
    if (b>vec.at(i)) {
      b = vec.at(i);
    }
    
  cout << a - b << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000000' to '1410065408' [-Woverflow]
   18 |   int b = 10000000000;
      |           ^~~~~~~~~~~
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:14:25: note: to match this '{'
   14 |   for (int i=0;i<N;i++) {
      |                         ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin>>N;
  
  vector<int> vec(N);
  for (int i=0;i<N;i++) {
    cin >> vec.at(i);
  }
  
  int a = -1;
  for (int i=0;i<N;i++) {
    if (a<vec.at(i)) {
      a = vec.at(i);
    }
  int b = 10000000000;
  for (int i=0;i<N;i++) {
    if (b>vec.at(i)) {
      b = vec.at(i);
    }
    
  cout << a - b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> vec(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> vec(N);
      |          ^~~
a.cc:10:12: error: 'vec' was not declared in this scope
   10 |     cin >> vec.at(i);
      |            ^~~
a.cc:15:11: error: 'vec' was not declared in this scope
   15 |     if (a<vec.at(i)) {
      |           ^~~
a.cc:18:11: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000000' to '1410065408' [-Woverflow]
   18 |   int b = 10000000000;
      |           ^~~~~~~~~~~
a.cc:20:11: error: 'vec' was not declared in this scope
   20 |     if (b>vec.at(i)) {
      |           ^~~
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:14:25: note: to match this '{'
   14 |   for (int i=0;i<N;i++) {
      |                         ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main () {
  int N;
  cin>>N;
  
  vector<int> vec(N);
  for (int i=0;i<N;i++) {
    cin >> vec.at(i);
  }
  
  int a = -1;
  for (int i=0;i<N;i++) {
    if (a<vec.at(i)) {
      a = vec.at(i);
    }
  int b = 10000000000;
  for (int i=0;i<N;i++) {
    if (b>vec.at(i)) {
      b = vec.at(i);
    }
    
  cout << a - b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> vec(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> vec(N);
      |          ^~~
a.cc:10:12: error: 'vec' was not declared in this scope
   10 |     cin >> vec.at(i);
      |            ^~~
a.cc:15:11: error: 'vec' was not declared in this scope
   15 |     if (a<vec.at(i)) {
      |           ^~~
a.cc:18:11: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000000' to '1410065408' [-Woverflow]
   18 |   int b = 10000000000;
      |           ^~~~~~~~~~~
a.cc:20:11: error: 'vec' was not declared in this scope
   20 |     if (b>vec.at(i)) {
      |           ^~~
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:14:25: note: to match this '{'
   14 |   for (int i=0;i<N;i++) {
      |                         ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:13: note: to match this '{'
    4 | int main () {
      |             ^
Language: C++

#include "bits/c++.h"
using namespace std;

int N;
vector<int> A;

int main() {
  cin >> N;
  int A_min, A_max;
  for(int i = 1; i <= N; i++) {
    int a;
    cin >> a;
    A.emplace_back(a);
    if(i == 1) {
      A_min = a;
      A_max = a;
    } else {
      if(a < A_min) A_min = a;
      if(a > A_max) A_max = a;
    }
  }
  int answer = A_max - A_min;
  cout << answer << endl;
}
  

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

#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(begin);i>(end);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
using namespace std;
#define ll long long

int main()
{
	stringstream ss;
	// 入力
	ll N;
	cin >> N;
	vector<ll> A(N);

	REP(i,N){
		cin>>A[i];
	}

	SORT(A);

	ans=abs(A[N-1]-A[0]);
	cout<<ans<<endl;

	return 0;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> A(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> A(N);
      |          ^~~
a.cc:9:12: error: 'A' was not declared in this scope
    9 |     cin >> A.at(i);
      |            ^
a.cc:11:13: error: 'A' was not declared in this scope
   11 |   int min = A.at(0), max = A.at(0)
      |             ^
a.cc:12:18: error: 'i' was not declared in this scope
   12 |   for (int i =0; i < N; i++) {
      |                  ^
a.cc:20:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   20 |   cout << max - min << endl;
      |           ~~~~^~~~~
Language: C++

import sys
input = sys.stdin.readline

n = input()
arr = sorted(map(int, input().split()))
print(abs(arr[0]-arr[-1]))

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++


#include<iostream>
#include<vector>
using namespace std;
int main(){
  int N;
  vector<int> A;
  cin >> N;

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

  sort(A.begin(),A.end());
  int ans = A[N-1] - A[0];

  cout << ans <<endl;


  return 0;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: 'n' was not declared in this scope
    7 |   for(int i=0; i<n; i++){
      |                  ^
a.cc:12:22: error: 'n' was not declared in this scope
   12 |   cout<<v.at(0)-v.at(n-1)<<endl;
      |                      ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: conflicting declaration 'std::vector<int> a'
    7 |   vector <int> a(a);
      |                ^
a.cc:6:7: note: previous declaration as 'int a'
    6 |   int a; cin>>a;
      |       ^
a.cc:8:31: error: request for member 'at' in 'a', which is of non-class type 'int'
    8 |   for(int i=0;i<a;i++) cin>>a.at(i);
      |                               ^~
a.cc:9:10: error: request for member 'begin' in 'a', which is of non-class type 'int'
    9 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:9:20: error: request for member 'end' in 'a', which is of non-class type 'int'
    9 |   sort(a.begin(),a.end());
      |                    ^~~
a.cc:10:11: error: request for member 'at' in 'a', which is of non-class type 'int'
   10 |   cout<<a.at(a-1)-a.at(0)<<endl;
      |           ^~
a.cc:10:21: error: request for member 'at' in 'a', which is of non-class type 'int'
   10 |   cout<<a.at(a-1)-a.at(0)<<endl;
      |                     ^~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: request for member 'at' in 'a', which is of non-class type 'int'
    8 |   for(int i=0;i<a;i++) cin>>a.at(i);
      |                               ^~
a.cc:9:10: error: request for member 'begin' in 'a', which is of non-class type 'int'
    9 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:9:20: error: request for member 'end' in 'a', which is of non-class type 'int'
    9 |   sort(a.begin(),a.end());
      |                    ^~~
a.cc:10:11: error: request for member 'at' in 'a', which is of non-class type 'int'
   10 |   cout<<a.at(a-1)-a.at(0)<<endl;
      |           ^~
a.cc:10:21: error: request for member 'at' in 'a', which is of non-class type 'int'
   10 |   cout<<a.at(a-1)-a.at(0)<<endl;
      |                     ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  int A[N]={};

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

  sort(A,A+N);

  cout << A.[N-1]-A[0]<<endl;




}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: expected unqualified-id before '[' token
   15 |   cout << A.[N-1]-A[0]<<endl;
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  int A[N]={};

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

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

  cout << A.end()-A.begin()<<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:13: error: request for member 'end' in 'A', which is of non-class type 'int [N]'
   15 |   cout << A.end()-A.begin()<<endl;
      |             ^~~
a.cc:15:21: error: request for member 'begin' in 'A', which is of non-class type 'int [N]'
   15 |   cout << A.end()-A.begin()<<endl;
      |                     ^~~~~
Language: C++

#include<iostream>
#include<algorithm>
#define MAX_N 101
#define INF 1000000001
using namepsace std;
int n, a[MAX_N];
int main(){
  cin >> n;
  for(int i=0; i<n; i++){
    cin >> a[i];
    }
  int ret = INF;
  for(int i=0; i<n; i++){
    for(int j=0; j<i; j++){
      ret = min(ret, abs(a[i]-a[j]));
      }
    }
  return 0;
  }

Compiler output:
a.cc:5:7: error: expected nested-name-specifier before 'namepsace'
    5 | using namepsace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   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:15:13: error: 'min' was not declared in this scope; did you mean 'std::min'?
   15 |       ret = min(ret, abs(a[i]-a[j]));
      |             ^~~
      |             std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include<iostream>
#include<algorithm>
#define MAX_N 101
#define INF 1000000001
using namedpace std;
int n, a[MAX_N];
int main(){
  cin >> n;
  for(int i=0; i<n; i++){
    cin >> a[i];
    }
  int ret = INF;
  for(int i=0; i<n; i++){
    for(int j=0; j<i; j++){
      ret = min(ret, abs(a[i]-a[j]));
      }
    }
  return 0;
  }

Compiler output:
a.cc:5:7: error: expected nested-name-specifier before 'namedpace'
    5 | using namedpace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   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:15:13: error: 'min' was not declared in this scope; did you mean 'std::min'?
   15 |       ret = min(ret, abs(a[i]-a[j]));
      |             ^~~
      |             std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
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, a + n);
  cout << a[a.size() - 1] - a[0] << endl;
  return 0;
}

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

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

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

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

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int N;
    vector<int> A;
    cin >> N;
    int tmp;
    for (int i = 0; i < N; i++){
        cin >> tmp;
        A.push_back(tmp);
    }

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

    cout << max - min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int> A;
      |     ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | 
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> A;
      |            ^~~
a.cc:14:9: error: 'A' was not declared in this scope
   14 |         A.push_back(tmp);
      |         ^
a.cc:17:28: error: 'A' was not declared in this scope
   17 |     int min = *min_element(A.begin(), A.end());
      |                            ^
Language: C++

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

int main(){
  int N, max = 0, min = 1000000000;
  
  cin >> N;
  for (int i = 0; i < N; i++){
    cin >> a;
    if(a > max){
      max = a;
    }
    if(a < min){
      min = a;
    }
  }
  
  cout << max - min;
  return 0;
}

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

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

int main(){
  int N, max = 0, min = 1000000000;
  
  cin >> N;
  for (int i = 0; i < N; i++){
    cin >> a;
    if(a > max){
      max = a;
    }
    if(a < min){
      min = a;
    }
  }
  
  cout << max - min;
  return 0;
}

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: missing template arguments before '[' token
    9 |     cin>>vector[i];
      |                ^
Language: C++

#include <iostream>
#include<math.h>
#include <vector>
#include <numeric>

using namespace std;

int main() {

    int N;
    cin >> N;

    vector<long long> A(N);
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
    }

    long long min = *min_element(A.begin(), A.end());
    long long max = *max_element(A.begin(), A.end());

    cout << max - min << endl;
}

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

#include <iostream>
#include<math.h>
#include <vector>
#include <numeric>

using namespace std;

int main() {

    int N;
    cin >> N;

    vector<long long> A(N);
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
    }

    long long min = *std::min_element(A.begin(), A.end());
    long long max = *std::max_element(A.begin(), A.end());

    cout << max - min << endl;
}

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

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

int main(){
int a,amax;
cin>>a;
  max=-1000;
vector<int>b(a);
  for(int i=0;i<a;i++){
  cin>>b[i];
  }
 
    for(int i=0;i<a;i++){
for(int j=0;j<i;j++){
 amax=max(amax,abs(b[i]-b[j]));
  

  }
}
cout<<amax<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: overloaded function with no contextual type information
    7 |   max=-1000;
      |        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main()
{
	int N;
	cin >> N;
	vector<int> v(N);

	rep(i,N){
		cin >> v[i];
	}

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

	int ans = 0;

	ans = v[N - 1] - v[0];

	cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:15: error: no match for call to '(std::vector<int>) ()'
   27 |         sort(v().begin(),v().end());
      |              ~^~
a.cc:27:27: error: no match for call to '(std::vector<int>) ()'
   27 |         sort(v().begin(),v().end());
      |                          ~^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main()
{
	int N;
	cin >> N;
	vector<int> v(N);

	rep(i,N){
		cin >> v(i);
	}

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

	int ans = 0;

	ans = v(N - 1) - v(0);

	cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:25: error: no match for call to '(std::vector<int>) (ll&)'
   24 |                 cin >> v(i);
      |                        ~^~~
a.cc:27:15: error: no match for call to '(std::vector<int>) ()'
   27 |         sort(v().begin(),v().end());
      |              ~^~
a.cc:27:27: error: no match for call to '(std::vector<int>) ()'
   27 |         sort(v().begin(),v().end());
      |                          ~^~
a.cc:31:16: error: no match for call to '(std::vector<int>) (int)'
   31 |         ans = v(N - 1) - v(0);
      |               ~^~~~~~~
a.cc:31:27: error: no match for call to '(std::vector<int>) (int)'
   31 |         ans = v(N - 1) - v(0);
      |                          ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: expected ';' before 'endl'
   21 |   rep(i, n) {  cin >> v[i] endl;}
      |                           ^~~~~
      |                           ;
a.cc:23:15: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int]' (did you forget the '()' ?)
   23 |   cout << v[v.size - 1] - v[0] << endl;
      |             ~~^~~~
      |                   ()
a.cc: At global scope:
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main()
{
	int N;
	cin >> N;
	vector<int> v(N);

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

	int ans = 0;

	ans = v(N - 1) - v(0);

	cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: no match for call to '(std::vector<int>) ()'
   23 |         sort(v().begin(),v().end());
      |              ~^~
a.cc:23:27: error: no match for call to '(std::vector<int>) ()'
   23 |         sort(v().begin(),v().end());
      |                          ~^~
a.cc:27:16: error: no match for call to '(std::vector<int>) (int)'
   27 |         ans = v(N - 1) - v(0);
      |               ~^~~~~~~
a.cc:27:27: error: no match for call to '(std::vector<int>) (int)'
   27 |         ans = v(N - 1) - v(0);
      |                          ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin>>N;
  vector<int>A(N);
  for(int i=0;i<N;i++)
    cin>>A[i];
  int max1=0;
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++)
      max1=max(max,abs(A[i]-A[j]));
  }
  cout<<max1<<endl;
      
}
 
  


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator-'
   18 |   cout<<max-min<<endl;
      |         ~~~^~~~
Language: C++

#include <iostream>
using namespace std;
int main() {
  int N;
  cin >>N;
  int A[N];
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
  int min =A.at(0);
  int max =A.at(0);
  for(int i=0;i<N;i++){
    if(min >A.at(i)){
      min =A.at(i);
    }
    if(max <A.at(i)){
      max =A.at(i);
    }
  }
  cout<<max-min<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: request for member 'at' in 'A', which is of non-class type 'int [N]'
    8 |     cin>>A.at(i);
      |            ^~
a.cc:10:14: error: request for member 'at' in 'A', which is of non-class type 'int [N]'
   10 |   int min =A.at(0);
      |              ^~
a.cc:11:14: error: request for member 'at' in 'A', which is of non-class type 'int [N]'
   11 |   int max =A.at(0);
      |              ^~
a.cc:13:15: error: request for member 'at' in 'A', which is of non-class type 'int [N]'
   13 |     if(min >A.at(i)){
      |               ^~
a.cc:14:14: error: request for member 'at' in 'A', which is of non-class type 'int [N]'
   14 |       min =A.at(i);
      |              ^~
a.cc:16:15: error: request for member 'at' in 'A', which is of non-class type 'int [N]'
   16 |     if(max <A.at(i)){
      |               ^~
a.cc:17:14: error: request for member 'at' in 'A', which is of non-class type 'int [N]'
   17 |       max =A.at(i);
      |              ^~
Language: C++

#include <iostream>
using namespace std;
int main() {
  int N;
  cin >>N;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
  int min =A.at(0);
  int max =A.at(0);
  for(int i=0;i<N;i++){
    if(min >A.at(i)){
      min =A.at(i);
    }
    if(max <A.at(i)){
      max =A.at(i);
    }
  }
  cout<<max-min<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> A(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> A(N);
      |          ^~~
a.cc:8:10: error: 'A' was not declared in this scope
    8 |     cin>>A.at(i);
      |          ^
a.cc:10:12: error: 'A' was not declared in this scope
   10 |   int min =A.at(0);
      |            ^
Language: C++

#include <iostream>
using namespace std;
int main() {
  int N;
  cin >>N;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
  int min =A.at(0);
  int max =A.at(0);
  for(int i=0;i<N;i++){
    if(min >A.at(i)){
      min =A.at(i)
    }
    if(max <A.at(i)){
      max =A.at(i)
    }
  }
  cout<<max-min<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> A(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> A(N);
      |          ^~~
a.cc:8:10: error: 'A' was not declared in this scope
    8 |     cin>>A.at(i);
      |          ^
a.cc:10:12: error: 'A' was not declared in this scope
   10 |   int min =A.at(0);
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin>>N;
  vector<int> A(N);
  
  for(int i =0; i<N ;i++){
    cin>>A.at(i);
    int min=1000000000,Max=1;
    if(Max <A.at(i)){
      Max=A.at(i);
    }
    if(min >A.at(i)){
      min =A.at(i);
    }
  }
  cout<< Max-min <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: 'Max' was not declared in this scope
   19 |   cout<< Max-min <<endl;
      |          ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: 'Max' was not declared in this scope; did you mean 'max'?
   12 |     if(Max <A.at(i)){
      |        ^~~
      |        max
a.cc:19:10: error: 'Max' was not declared in this scope
   19 |   cout<< Max-min <<endl;
      |          ^~~
Language: C++

#include <iostream>
using namespace std;
 
int main(){
  int N;
  cin>>N;
  vector<int> num(N);
  int min=1000000000,max=1;
  for(int i;i<N;i++){
    cin>> num.at(i);
    if(num.at(i)<min){
      min =num.at(i);
    }
    if(num.at(i)>max){
      max =num.at(i);
    }
  }
  cout << max-min <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> num(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> num(N);
      |          ^~~
a.cc:10:11: error: 'num' was not declared in this scope; did you mean 'enum'?
   10 |     cin>> num.at(i);
      |           ^~~
      |           enum
Language: C++

#include <iostream>
using namespace std;
 
int main(){
  int N;
  cin>>N;
  vector<int> A(N);
  int min=1000000000,max=1;
  for(int i;i<N;i++){
    cin>> A.at(i);
    if(A.at(i)<min){
      min =A.at(i);
    }
    if(A.at(i)>max){
      max =A.at(i);
    }
  }
  cout << max-min <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> A(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> A(N);
      |          ^~~
a.cc:10:11: error: 'A' was not declared in this scope
   10 |     cin>> A.at(i);
      |           ^
Language: C++

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

Compiler output:
a.cc:26:5: error: redefinition of 'int main()'
   26 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N ;
  cin>>N;
  vector<int> A(N);
  int min=1000000000,max=1;

  for(int i;i<N;i++){
    cin>> A.at(i);
    if(A.at(i)<min){
      min =A.at(i);
    }
    if(A.at(i)>max){
      max =A.at(i);
    }
  }
  cout << max-min <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> A(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> A(N);
      |          ^~~
a.cc:11:11: error: 'A' was not declared in this scope
   11 |     cin>> A.at(i);
      |           ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> A(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> A(N);
      |          ^~~
a.cc:10:11: error: 'A' was not declared in this scope
   10 |     cin>> A.at(i);
      |           ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> A(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> A(N);
      |          ^~~
a.cc:9:11: error: 'A' was not declared in this scope
    9 |     cin>> A.at(i);
      |           ^
Language: C++

#include <iostream>
using namespace std;

int abs(int x,int y){
  if(x>=y){
    return x-y
  }
  else{
    return y-x
  }
}
int main() {
  int N ;
  int min=1000000000,max=1;
  vector<int> A(N);
  for(int i;i<N;i++){
    cin>> A.at(i);
    if(A.at(i)<min){
      min =A.at(i);
    }
    if(A.at(i)>max){
      max =A.at(i);
    }
  }
  cout << abs(max,min)<,endl;
}

Compiler output:
a.cc: In function 'int abs(int, int)':
a.cc:6:15: error: expected ';' before '}' token
    6 |     return x-y
      |               ^
      |               ;
    7 |   }
      |   ~            
a.cc:9:15: error: expected ';' before '}' token
    9 |     return y-x
      |               ^
      |               ;
   10 |   }
      |   ~            
a.cc: In function 'int main()':
a.cc:15:3: error: 'vector' was not declared in this scope
   15 |   vector<int> A(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:15:10: error: expected primary-expression before 'int'
   15 |   vector<int> A(N);
      |          ^~~
a.cc:17:11: error: 'A' was not declared in this scope
   17 |     cin>> A.at(i);
      |           ^
a.cc:25:24: error: expected primary-expression before ',' token
   25 |   cout << abs(max,min)<,endl;
      |                        ^