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

#include<stdio.h>
  
int main(){
    int i,j,n,Max=0;
    int A[200001];
      
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&A[i]);
    } 
     
    //Max=A[2]-A[1];
        for(i=n;i>2;i--){
            for(j=i;j>1;j--){
//if(A[j-1]<A[1]){           
if(A[i]>A[j-1]){
                if(Max<A[i]-A[j-1]){
            Max=A[i]-A[j-1];}}
            }}
        } 
            printf("%d\n",Max);
            return 0;
        }
	

Compiler output:
main.c:21:20: error: expected declaration specifiers or '...' before string constant
   21 |             printf("%d\n",Max);
      |                    ^~~~~~
main.c:21:27: error: unknown type name 'Max'
   21 |             printf("%d\n",Max);
      |                           ^~~
main.c:22:13: error: expected identifier or '(' before 'return'
   22 |             return 0;
      |             ^~~~~~
main.c:23:9: error: expected identifier or '(' before '}' token
   23 |         }
      |         ^
Language: C

#include<stdio.h>
  
int main(){
    long int i,j,n,Max,count=0;
    long int A[200001];
      
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&A[i]);
    } 
    
   //Max=A[2]-A[1];
for(i=n;i>=2;i--){   
if(count==1) break;         
for(j=i;j>1;j--){
            if(A[i]>A[j-1]){
            Max=A[i]-A[j-1];
count++;
break;}
            }
}}




   for(i=n;i>=2;i--){
if(A[i]>Max){   
         for(j=i;j>1;j--){
            if(Max<A[i]-A[j-1]){
            Max=A[i]-A[j-1];}
            }
}}

        
            printf("%d\n",Max);
            return 0;
        }
	

Compiler output:
main.c:26:4: error: expected identifier or '(' before 'for'
   26 |    for(i=n;i>=2;i--){
      |    ^~~
main.c:26:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
   26 |    for(i=n;i>=2;i--){
      |             ^~
main.c:26:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
   26 |    for(i=n;i>=2;i--){
      |                  ^~
main.c:35:20: error: expected declaration specifiers or '...' before string constant
   35 |             printf("%d\n",Max);
      |                    ^~~~~~
main.c:35:27: error: unknown type name 'Max'
   35 |             printf("%d\n",Max);
      |                           ^~~
main.c:36:13: error: expected identifier or '(' before 'return'
   36 |             return 0;
      |             ^~~~~~
main.c:37:9: error: expected identifier or '(' before '}' token
   37 |         }
      |         ^
Language: C

#include<stdio.h>
  
int main(){
    long int i,j,n,Max,key=0,count=0;
    long int A[200001];
      
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&A[i]);
    } 
    
   Max=A[2]-A[1];

for(i=n;i>=2;i--){
//if(A[i]>Max){   
         for(j=i;j>1;j--){
  if(count==0){
 if(Max<A[i]-A[j-1]){
            Max=A[i]-A[j-1];
key=A[j-1];}
else{
if(Max<A[i]-A[j-1]){
            Max=A[i]-A[j-1];}}
}}


        
            printf("%d\n",Max);
            return 0;
        }
	

Compiler output:
main.c: In function 'main':
main.c:30:9: error: expected declaration or statement at end of input
   30 |         }
      |         ^
Language: C

#include<stdio.h>
  
int main(){
    long int i,j,n,Max,key=0,count=0;
    long int A[200001];
      
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&A[i]);
    } 
    
   Max=A[2]-A[1];

for(i=n;i>=2;i--){
         for(j=i;j>1;j--){
  if(count==0){
 if(Max<A[i]-A[j-1]){
            Max=A[i]-A[j-1];
key=A[j-1];}
else{
if(Max<A[i]-A[j-1] && key<A[j-1] ){
 Max=A[i]-A[j-1];
key=A[j-1];}
}
count=0;}

        
            printf("%d\n",Max);
            return 0;
        }
	

Compiler output:
main.c: In function 'main':
main.c:30:9: error: expected declaration or statement at end of input
   30 |         }
      |         ^
main.c:30:9: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
#include<iostream>
int main(){
    int N,i,j;
    long long int R[200000],m=0;
     
    scanf("%d",&N);
    for(i=0;i<N;++i)scanf("%d",&R[i]);
     
    for(i=0;i<N;++i){
        for(j=i;j<N;++j){
            if(R[j]-R[i]>m)m=R[j]-R[i];
        }
    }
     
    printf("%d\n",m);
     
}

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

#include<stdio.h>
   
int main(){
    int i,j,n,Max,key=0,count=1;
    int A[200001];
       
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&A[i]);
    }
     
   Max=A[2]-A[1];
 key2=A[n];
for(i=n;i>=2;i--){
	
		if(key2<=A[i]){
	for(j=i,count=1;j>1;j--){
 
	
    if(key>A[j-1]){
	if(Max<A[i]-A[j-1]){
 	Max=A[i]-A[j-1];
	key=A[j-1];}

    	key2=A[i];
    }
          count=1;  
             
}
		}}
         
            printf("%d\n",Max);
            return 0;

Compiler output:
main.c: In function 'main':
main.c:13:2: error: 'key2' undeclared (first use in this function); did you mean 'key'?
   13 |  key2=A[n];
      |  ^~~~
      |  key
main.c:13:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:13: error: expected declaration or statement at end of input
   33 |             return 0;
      |             ^~~~~~
Language: C

#include<stdio.h>
   
int main(){
    int i,j,n,Max,key=0,count=1;
    int A[200001];
       
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&A[i]);
    }
     
   Max=A[2]-A[1];
 key2=A[n];
for(i=n;i>=2;i--){
	
		if(key2<=A[i]){
	for(j=i,count=1;j>1;j--){
 
	
    if(key>A[j-1]){
	if(Max<A[i]-A[j-1]){
 	Max=A[i]-A[j-1];
	key=A[j-1];}

    	
    }
          count=1;  
             
}
		}}
         
            printf("%d\n",Max);
            return 0;

Compiler output:
main.c: In function 'main':
main.c:13:2: error: 'key2' undeclared (first use in this function); did you mean 'key'?
   13 |  key2=A[n];
      |  ^~~~
      |  key
main.c:13:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:13: error: expected declaration or statement at end of input
   33 |             return 0;
      |             ^~~~~~
Language: C

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		long[] data = new long[n];
		long max = 0;
		for(int i = 0 ; i < n ; i++){
			data[i]=scan.nextInt();
		}
		for(int i = n-1 ; i >= 0 ; i --){
			for(int j = 0 ; j < i ; j ++){
				if(i==n-1&&j==0){
					max=data[i]-data[j];
				}
				if(max<(data[i]-data[j])){
					max= data[i]-data[j];
				}			}
		}
		System.out.println(max);
	}
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:2:1: error: unknown type name 'public'
    2 | public class Main {
      | ^~~~~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    2 | public class Main {
      |              ^~~~
Language: C++

#include <iostream>
using namespace std;

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

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

	max = INT_MIN;
	min = a[0];

	for (int i=1; i<N; i++) {
		max = (max < a[i]-min)? a[i]-max: max;
		min = (min > a[i])? a[i]: min;
	}


	cout << max << endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'INT_MIN' was not declared in this scope
   12 |         max = INT_MIN;
      |               ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

#include <iostream>
using namespace std;

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

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

	max = numeric_limits<int>::min();
	min = a[0];

	for (int i=1; i<N; i++) {
		max = (max < a[i]-min)? a[i]-max: max;
		min = (min > a[i])? a[i]: min;
	}


	cout << max << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'numeric_limits' was not declared in this scope
   12 |         max = numeric_limits<int>::min();
      |               ^~~~~~~~~~~~~~
a.cc:12:30: error: expected primary-expression before 'int'
   12 |         max = numeric_limits<int>::min();
      |                              ^~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

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

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

    int ans = 0;
    for (int i = 0; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) {
            ans = max(ans, nums[j] - nums[i]);
        }
    }

    cout << ans << endl; 

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)'
   16 |             ans = max(ans, nums[j] - nums[i]);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:16:22: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type' {aka 'long int'})
   16 |             ans = max(ans, nums[j] - nums[i]);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

using namespace std;
int main()
{
  int n;
  vector<int> r;
  
  //input
  cin>>n; r.resize(n);
  for(int i=0;i<n;i++) cin>>r[i];
  
  //process
  int max=-INT_MAX;
  int minR=INT_MAX;
  int dif;
  for(int i=0;i<n;i++){
    if(r[i]<minR){
      minR=r[i];
       for(int j=i+1;j<n;j++){
	dif=r[j]-r[i];
	if(dif<max) break;
	if(dif>max) max=dif;
      }
    }
  }
  cout<<max<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> r;
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> r;
      |          ^~~
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin>>n; r.resize(n);
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:8:11: error: 'r' was not declared in this scope
    8 |   cin>>n; r.resize(n);
      |           ^
a.cc:12:12: error: 'INT_MAX' was not declared in this scope
   12 |   int max=-INT_MAX;
      |            ^~~~~~~
a.cc:1:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
  +++ |+#include <climits>
    1 | using namespace std;
a.cc:25:3: error: 'cout' was not declared in this scope
   25 |   cout<<max<<endl;
      |   ^~~~
a.cc:25:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:14: error: 'endl' was not declared in this scope
   25 |   cout<<max<<endl;
      |              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

√#include<iostream>
using namespace std;
int Max = 200000;

int main(){
  int A[Max], n, i;
  int maxv, minv;

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

  maxv = A[1] - A[0];
  minv = A[0];

  for(i = 1; i < n; i++) {
    maxv = (maxv > (A[i] - minv))?maxv:(A[i] - minv);
    minv = (minv < A[i])?minv:A[i];
  }

  cout<<maxv<<endl;

  return 0;

}



Compiler output:
a.cc:1:1: error: extended character √ is not valid in an identifier
    1 | √#include<iostream>
      | ^
a.cc:1:2: error: stray '#' in program
    1 | √#include<iostream>
      |  ^
a.cc:1:1: error: '\U0000221a' does not name a type
    1 | √#include<iostream>
      | ^
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> n;
      |   ^~~
a.cc:22:3: error: 'cout' was not declared in this scope
   22 |   cout<<maxv<<endl;
      |   ^~~~
a.cc:22:15: error: 'endl' was not declared in this scope
   22 |   cout<<maxv<<endl;
      |               ^~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespase std;
static const int MAX = 200000;

int main(){
    int R[MAX], n;
    
    cin >> n;
    for( int i = 0; i < n; i++ ) cin >> R[i];
    
    int maxv = -2000000000; //十分小さい値を初期値に設定
    int minv = R[0];
    
    for( int i = 1; i < n; i++ ){ //ここで毎回R[i]を読み込めば配列は不要
        maxv = max(maxv, R[i] - minv); //最大値を更新
        minv = min(minv, R[i]);
    }
    
    cout << maxv << endl;
    
    return 0;
}


Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namespase'
    3 | using namespase std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |     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:16:16: error: 'max' was not declared in this scope; did you mean 'std::max'?
   16 |         maxv = max(maxv, R[i] - minv); //最大値を更新
      |                ^~~
      |                std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:17:16: error: 'min' was not declared in this scope; did you mean 'std::min'?
   17 |         minv = min(minv, R[i]);
      |                ^~~
      |                std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:20:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |     cout << maxv << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |     cout << maxv << endl;
      |                     ^~~~
      |                     std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

n=int(raw_input().strip())
lst=[]
minval=0x3f3f3f3f
ans=-0x3f3f3f3f
for i in xrange(n):
    val=int(raw_input().strip())
    if(i>1):
        #print val,minval
        ans=max(ans,val-minval)
    minval = min(minval, val)
print ans



Compiler output:
a.cc:8:10: error: invalid preprocessing directive #print
    8 |         #print val,minval
      |          ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(raw_input().strip())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  long int n,a,b=-1000000000,s,i;
  cin>>n>>s;
  for(a=s,i=1;i<n;i++){
    cin>>s;
    b=max(b,s-a);
    a=min(a,s);
  }
  cout<<b<<endl;
}


Compiler output:
a.cc:4:1: error: extended character   is not valid in an identifier
    4 |   long int n,a,b=-1000000000,s,i;
      | ^
a.cc:4:1: error: extended character   is not valid in an identifier
a.cc:5:1: error: extended character   is not valid in an identifier
    5 |   cin>>n>>s;
      | ^
a.cc:5:1: error: extended character   is not valid in an identifier
a.cc:6:1: error: extended character   is not valid in an identifier
    6 |   for(a=s,i=1;i<n;i++){
      | ^
a.cc:6:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
    7 |     cin>>s;
      | ^
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:7:1: error: extended character   is not valid in an identifier
a.cc:8:1: error: extended character   is not valid in an identifier
    8 |     b=max(b,s-a);
      | ^
a.cc:8:1: error: extended character   is not valid in an identifier
a.cc:8:1: error: extended character   is not valid in an identifier
a.cc:8:1: error: extended character   is not valid in an identifier
a.cc:9:1: error: extended character   is not valid in an identifier
    9 |     a=min(a,s);
      | ^
a.cc:9:1: error: extended character   is not valid in an identifier
a.cc:9:1: error: extended character   is not valid in an identifier
a.cc:9:1: error: extended character   is not valid in an identifier
a.cc:10:1: error: extended character   is not valid in an identifier
   10 |   }
      | ^
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:11:1: error: extended character   is not valid in an identifier
   11 |   cout<<b<<endl;
      | ^
a.cc:11:1: error: extended character   is not valid in an identifier
a.cc: In function 'int main()':
a.cc:4:1: error: '\U000000a0\U000000a0long' was not declared in this scope
    4 |   long int n,a,b=-1000000000,s,i;
      | ^~~~~~
a.cc:5:1: error: '\U000000a0\U000000a0cin' was not declared in this scope
    5 |   cin>>n>>s;
      | ^~~~~
a.cc:5:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   cin>>n>>s;
      |        ^
      |        yn
a.cc:5:11: error: 's' was not declared in this scope
    5 |   cin>>n>>s;
      |           ^
a.cc:6:7: error: 'a' was not declared in this scope
    6 |   for(a=s,i=1;i<n;i++){
      |       ^
a.cc:6:11: error: 'i' was not declared in this scope
    6 |   for(a=s,i=1;i<n;i++){
      |           ^
a.cc:11:1: error: '\U000000a0\U000000a0cout' was not declared in this scope
   11 |   cout<<b<<endl;
      | ^~~~~~
a.cc:11:9: error: 'b' was not declared in this scope
   11 |   cout<<b<<endl;
      |         ^
Language: C++

#include<stdio.h>
int a[200000];
int main()
{
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
int minl=a[1];
int maxl=-1000000000;
 
for(int i=2;i<=n;i++)
{
if((a[i]-minl)>maxl)
{
maxl=a[i]-minl;
}
if(a[i]<minl)
{
 minl=a[i];
}
}
printf("%d\n",maxl);
 
return 0;
}


Compiler output:
a.cc:13:1: error: extended character   is not valid in an identifier
   13 |  
      | ^
a.cc:22:1: error: extended character   is not valid in an identifier
   22 |  minl=a[i];
      | ^
a.cc:26:1: error: extended character   is not valid in an identifier
   26 |  
      | ^
a.cc: In function 'int main()':
a.cc:13:1: error: '\U000000a0' was not declared in this scope
   13 |  
      | ^
a.cc:14:13: error: 'i' was not declared in this scope
   14 | for(int i=2;i<=n;i++)
      |             ^
a.cc:26:2: error: expected ';' before 'return'
   26 |  
      |  ^
      |  ;
   27 | return 0;
      | ~~~~~~
Language: C++

#include <iostream>
#include <algorithm>

static const int MAX_PROFIT = -2000000000;
static const int MAX_NUN = 200000;

int main(int argc, char const *argv[])
{
    int R[MAX_NUM], n;

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

    int maxv = MAX_PROFIT;
    int minv = R[0];

    for(int i = 1;i < n;i++){
        maxv = max(maxv,R[i] - minv);
        minv = min(min,R[i]);
    }

    std::cout << maxv << std::endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:9:11: error: 'MAX_NUM' was not declared in this scope; did you mean 'MAX_NUN'?
    9 |     int R[MAX_NUM], n;
      |           ^~~~~~~
      |           MAX_NUN
a.cc:13:42: error: 'R' was not declared in this scope
   13 |     for(int i = 0;i < n;i++) std::cin >> R[n];
      |                                          ^
a.cc:16:16: error: 'R' was not declared in this scope
   16 |     int minv = R[0];
      |                ^
a.cc:19:16: error: 'max' was not declared in this scope; did you mean 'std::max'?
   19 |         maxv = max(maxv,R[i] - minv);
      |                ^~~
      |                std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:20:20: error: 'min' was not declared in this scope; did you mean 'std::min'?
   20 |         minv = min(min,R[i]);
      |                    ^~~
      |                    std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:20:16: error: 'min' was not declared in this scope; did you mean 'std::min'?
   20 |         minv = min(min,R[i]);
      |                ^~~
      |                std::min
/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++

// 時系列
// 計算量 O(n^2) のアルゴリズムを避ける
#include <iostream>

using namespace std;

auto larger(int j, int k) {
  if (j >= k)
    return j;
  else
    return k;
}

auto smaller(int j, int k) {
  if (j <= k)
    return j;
  else
    return k;
}

int main() {
  int n, minv, maxv;
  array<int> R;
  cin >> n;
  for (auto it = 0; it < n; ++it) {
    cin >> R[it];
  }
  minv = R[0];
  maxv = 0;
  for (auto it = 1; it < n; ++it) {
    maxv = larger(maxv, R[it] - minv);
    minv = smaller(minv, R[it]);
  }
  cout << maxv << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: wrong number of template arguments (1, should be 2)
   23 |   array<int> R;
      |            ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:26:13: error: invalid types 'int[int]' for array subscript
   26 |     cin >> R[it];
      |             ^
a.cc:28:11: error: invalid types 'int[int]' for array subscript
   28 |   minv = R[0];
      |           ^
a.cc:31:26: error: invalid types 'int[int]' for array subscript
   31 |     maxv = larger(maxv, R[it] - minv);
      |                          ^
a.cc:32:27: error: invalid types 'int[int]' for array subscript
   32 |     minv = smaller(minv, R[it]);
      |                           ^
Language: C++

// 時系列
// 計算量 O(n^2) のアルゴリズムを避ける
#include <iostream>

using namespace std;

int larger(int j, int k) {
  if (j >= k)
    return j;
  else
    return k;
}

int smaller(int j, int k) {
  if (j <= k)
    return j;
  else
    return k;
}

int main() {
  int n, minv, maxv;
  array<int> R;
  cin >> n;
  for (auto it = 0; it < n; ++it) {
    cin >> R[it];
  }
  minv = R[0];
  maxv = 0;
  for (auto it = 1; it < n; ++it) {
    maxv = larger(maxv, R[it] - minv);
    minv = smaller(minv, R[it]);
  }
  cout << maxv << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: wrong number of template arguments (1, should be 2)
   23 |   array<int> R;
      |            ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:26:13: error: invalid types 'int[int]' for array subscript
   26 |     cin >> R[it];
      |             ^
a.cc:28:11: error: invalid types 'int[int]' for array subscript
   28 |   minv = R[0];
      |           ^
a.cc:31:26: error: invalid types 'int[int]' for array subscript
   31 |     maxv = larger(maxv, R[it] - minv);
      |                          ^
a.cc:32:27: error: invalid types 'int[int]' for array subscript
   32 |     minv = smaller(minv, R[it]);
      |                           ^
Language: C++

// 時系列
// 計算量 O(n^2) のアルゴリズムを避ける
#include <iostream>

using namespace std;

int larger(int j, int k) {
  if (j >= k)
    return j;
  else
    return k;
}

int smaller(int j, int k) {
  if (j <= k)
    return j;
  else
    return k;
}

int main() {
  int n, minv, maxv;
  int R[];
  cin >> n;
  for (auto it = 0; it < n; ++it) {
    cin >> R[it];
  }
  minv = R[0];
  maxv = 0;
  for (auto it = 1; it < n; ++it) {
    maxv = larger(maxv, R[it] - minv);
    minv = smaller(minv, R[it]);
  }
  cout << maxv << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:7: error: storage size of 'R' isn't known
   23 |   int R[];
      |       ^
Language: C++

//cで提出　事故る
#include<iostream>
#include<algorithm> //min,max

static const int MAX = 200000;
//static 存在し続ける
//const 値を書き換えない

int main() {
    int R[MAX], n;
    
    cin >> n;
    for ( int i = 0;i < n; i++ ) cin >> R[i];
    
    int maxv = -2000000000; //こんなとこで定義？
    int minv = R[0];
    
    for (int i = 0;i < n; i++ ) {
        maxv = max(maxv, R[i] - minv);
        minv = min(minv, R[i]);
    }
    
    cout << maxv << endl; 
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   12 |     cin >> n;
      |     ^~~
      |     std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:19:16: error: 'max' was not declared in this scope; did you mean 'std::max'?
   19 |         maxv = max(maxv, R[i] - minv);
      |                ^~~
      |                std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:20:16: error: 'min' was not declared in this scope; did you mean 'std::min'?
   20 |         minv = min(minv, R[i]);
      |                ^~~
      |                std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:23:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |     cout << maxv << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:23:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |     cout << maxv << endl;
      |                     ^~~~
      |                     std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

//cで提出　事故る
#include<iostream>
#include<algorithm> //min,max
usint namespace std; //cin cout
static const int MAX = 200000;

//static 存在し続ける
//const 値を書き換えない

int main() {
    int R[MAX], n;
    
    cin >> n;
    for ( int i = 0;i < n; i++ ) cin >> R[i];
    
    int maxv = -2000000000; //こんなとこで定義？
    int minv = R[0];
    
    for (int i = 0;i < n; i++ ) {
        maxv = max(maxv, R[i] - minv);
        minv = min(minv, R[i]);
    }
    
    cout << maxv << endl; 
    
    return 0;
}


Compiler output:
a.cc:4:1: error: 'usint' does not name a type; did you mean 'uint'?
    4 | usint namespace std; //cin cout
      | ^~~~~
      | uint
a.cc: In function 'int main()':
a.cc:13:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   13 |     cin >> n;
      |     ^~~
      |     std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:16: error: 'max' was not declared in this scope; did you mean 'std::max'?
   20 |         maxv = max(maxv, R[i] - minv);
      |                ^~~
      |                std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:21:16: error: 'min' was not declared in this scope; did you mean 'std::min'?
   21 |         minv = min(minv, R[i]);
      |                ^~~
      |                std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:24:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   24 |     cout << maxv << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:24:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   24 |     cout << maxv << endl;
      |                     ^~~~
      |                     std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
    
    int n,maxn=200000,r[maxn];
    cin >> n;

    for( int i=0; i<n; i++) cin >> r[i];
    
    int maxv = -1000000000;
    int minv = 1000000000
    
    for( int i=0; i<n; i++ ) {
        maxv = max( maxv, r[i] - minv);
        minv = min( minv, r[i]);
    }
    
    cout << maxv << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: expected ',' or ';' before 'for'
   14 |     for( int i=0; i<n; i++ ) {
      |     ^~~
a.cc:14:19: error: 'i' was not declared in this scope
   14 |     for( int i=0; i<n; i++ ) {
      |                   ^
Language: C++

#include "stdio.h"
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
  int a[200000], n;

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

  int maxv = -2000000;
  int minv = a[0];

  for (int i = 0; i < n; i++) {
    maxv = max(maxv, a[i] - minv);
    minv = min(minv, a[i]);
  }

  cont << maxv << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: 'cont' was not declared in this scope; did you mean 'const'?
   21 |   cont << maxv << endl;
      |   ^~~~
      |   const
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main() {
  int a[200000], n;

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

  int maxv = -2000000;
  int minv = a[0];

  for (int i = 0; i < n; i++) {
    maxv = max(maxv, a[i] - minv);
    minv = min(minv, a[i]);
  }

  cont << maxv << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: 'cont' was not declared in this scope; did you mean 'const'?
   20 |   cont << maxv << endl;
      |   ^~~~
      |   const
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main() {
  int R[200000], n;

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

  int maxv = -2000000;
  int minv = R[0];

  for (int i = 0; i < n; i++) {
    maxv = max(maxv, R[i] - minv);
    minv = min(minv, R[i]);
  }

  cont << maxv << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: 'cont' was not declared in this scope; did you mean 'const'?
   20 |   cont << maxv << endl;
      |   ^~~~
      |   const
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 200000;

int main(){
	int R[MAX], n;
	cin >> n;
	for(int i = 0;i < n;i++) cin >> R[i];
	
	int maxv = -2000000000;
	int minv = R[0];
	
	for(int i = 1;i < n;i++)
	{ 
		maxv = max(maxv, R[i] - minv);
		minv = min(minv, R[i]);
	}
	cout << maxv << end1;
	
	return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: 'end1' was not declared in this scope
   19 |         cout << maxv << end1;
      |                         ^~~~
Language: C++

# include <iostream>
# include <algorithm>
using namespace std;
static const int MAX = 200000;

int main() {
    int R[MAX], n;

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

    int maxv = -1e10;
    int minv = R[0];

    for (int i = 0; i < n; i++) {
        maxv = max(maxv, R[i] - minv);
        minv = min(minv, R[i]);
    }

    cout << maxv << endl;

    return 0;
}
/*
#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
    int r[n];
    for (int i = 0; i < n; i++) {
        cin >> r[i];
    }
    int diff_max = -1e9;
    for (int i = 0; i < n; i++) {
        for (int j = i; j < n; j++) {
           int diff;
           diff = r[j] - r[i];
           if (diff_max < diff) {
               diff_max = diff;
           }
        }
    }
    cout << diff_max << endl;
}


Compiler output:
a.cc:24:1: error: unterminated comment
   24 | /*
      | ^
a.cc: In function 'int main()':
a.cc:12:16: warning: overflow in conversion from 'double' to 'int' changes value from '-1.0e+10' to '-2147483648' [-Woverflow]
   12 |     int maxv = -1e10;
      |                ^~~~~
Language: C++

n = int(input())
ls = [int(input()) for _ in range(n)]

small = 200000
big = 0
for i in range(len(ls)-1):
    if ls[i] < small:
        small = ls[i]
        big = ls[i+1]
    if ls[i+1] > big:
        big = ls[i+1]

print(big-small)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 200000;

int main(){
    int R[Max], n;

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

    int maxv = 0; //制約を下回る値
    int minv = R[0];

    //max()は2つの引数のうち大きい方を､
    //min()は小さい方を返す

    for(int i = 1;i < n;i++){ //毎回R[i]を読み込めば配列はいらない｡
        maxv = max(maxv,R[i] - minv); //更新
        cout << maxv;
        minv = min(minv,R[i]); //最小値の保持
    }

    cout << maxv << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'Max' was not declared in this scope; did you mean 'MAX'?
    7 |     int R[Max], n;
      |           ^~~
      |           MAX
a.cc:10:36: error: 'R' was not declared in this scope
   10 |     for(int i = 0;i < n;i++)cin >> R[i];
      |                                    ^
a.cc:13:16: error: 'R' was not declared in this scope
   13 |     int minv = R[0];
      |                ^
Language: C++

#include <iostream>

using namespace std;

static const int MAX =200000;
int main()
{

	int n, buff[MAX];
	cin >> n;

	for(int i=0;i<n;i++) cin >> buff[i];
	
	int max=-1*10**10, min=10000;
	int val=0;
	for(int i=0;i<n-1;i++){
		for(int j=i+1;j<n;j++){
			val=buff[j]-buff[i];
			if(val>max) max=val;
		}
	}

	cout <<max <<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: invalid type argument of unary '*' (have 'int')
   14 |         int max=-1*10**10, min=10000;
      |                       ^~~
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	unsigned int n;
	int ans = INT_MIN;
	int min = INT_MIN;
	cin >> n;
	for (unsigned int i = 0; i < n; ++i) {
		int x;
		cin >> x;
		if (min > INT_MIN)
			ans = max(ans, x - min);
		min = min(min, x);
	}
	cout << ans << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: 'INT_MIN' was not declared in this scope
    9 |         int ans = INT_MIN;
      |                   ^~~~~~~
a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <cmath>
  +++ |+#include <climits>
    3 | 
a.cc:17:26: error: 'min' cannot be used as a function
   17 |                 min = min(min, x);
      |                       ~~~^~~~~~~~
Language: C++

#include <iostream>
#include <climits>
#include <algorithm>

using namespace std;

int main()
{
	unsigned int n;
	int ans = INT_MIN;
	int min = INT_MIN;
	cin >> n;
	for (unsigned int i = 0; i < n; ++i) {
		int x;
		cin >> x;
		if (min > INT_MIN)
			ans = max(ans, x - min);
		min = min(min, x);
	}
	cout << ans << endl;
	return 0;
}



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

#include <iostream>
#include <algorithm>
using namespace std;
static const int MAX = 200000;

int main(int argc, char const *argv[])
{
    int R[MAX], n;
    
    cin >> n;
    for ( int i = 0; i < n; i++ ){ cin >> R[i]; }

    int maxv = - MAX;
    int minimum = R[0];
    
    for(int i = 1; i < n; i++)
    {
        maxv = max(maxv, R[i]-min);
        minimum = min(minimum, R[i]);
    }

    cout << maxv << endl;
    

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:18:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-'
   18 |         maxv = max(maxv, R[i]-min);
      |                          ~~~~^~~~
Language: C++


#include<iostream>
#include<cmath>
#include<iomanip>
#include<string>
#include<vector>
using namespace std;

int main(){
    vector<long long> a;
    long long n,r;
    cin>>n;
    
    
    int maxv=-2000000000, minv=2000000000;
    
    for(int i=0; i<n; i++){
        cin>>r;
        maxv=max(maxv, r-minv);
        minv=min(minv, r);
    }
    cout<<maxv<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: no matching function for call to 'max(int&, long long int)'
   19 |         maxv=max(maxv, r-minv);
      |              ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:19:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   19 |         maxv=max(maxv, r-minv);
      |              ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
a.cc:20:17: error: no matching function for call to 'min(int&, long long int&)'
   20 |         minv=min(minv, r);
      |              ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:20:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   20 |         minv=min(minv, r);
      |              ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
static const int MAX = 200000;

int main() {
  int R[MAX], n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> R[i];

  int maxv = - 10 ** 10;
  int minv = R[0];

  for (int i = 1; i < n; i++) {
    maxv = max(maxv, R[i]-minv);
    minv = min(minv, R[i]);
  }

  cout << maxv << endl;

  return 0;
  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: invalid type argument of unary '*' (have 'int')
   10 |   int maxv = - 10 ** 10;
      |                    ^~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 200000;

int main() {
    int R[MAX], n;

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

    int maxv = R[0]; 
    int minv = R[0];
    for(int i = 1; i < n; i++) {
        maxv = max(maxv, R[i]);
        minv = min(minv, R[i];)
    }
    cout << maxv - minv << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:30: error: expected ')' before ';' token
   16 |         minv = min(minv, R[i];)
      |                   ~          ^
      |                              )
a.cc:16:31: error: expected primary-expression before ')' token
   16 |         minv = min(minv, R[i];)
      |                               ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 20000;

int main(){
  int R[MAX], n;

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

  int maxv = -2000000000;
  int minv = R[0];

  for ( int i = 1; i < n; i++){
    maxv = max(maxv, R[i] - minv);
    minv = min(minv, R[i])
  }

  count << maxv << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: expected ';' before '}' token
   17 |     minv = min(minv, R[i])
      |                           ^
      |                           ;
   18 |   }
      |   ~                        
a.cc:20:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   20 |   count << maxv << endl;
      |   ~~~~~~^~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
    int R[n];
    for(int i=0; i<n; i++){
        cin >> R[i];
    }
    
    minv = R[0]
for (int j=1 j<=n-1; j++{
  maxv = ((maxv > R[j]-minv)? maxv : R[j]-minv);
  minv = ((minv < R[j])? minv : R[j]);
}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'minv' was not declared in this scope
   12 |     minv = R[0]
      |     ^~~~
a.cc:13:22: error: 'j' was not declared in this scope
   13 | for (int j=1 j<=n-1; j++{
      |                      ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
    int R[n];
    for(int i=0; i<n; i++){
        cin >> R[i];
    }
    
    minv = R[0]
for (int j=1 j<=n-1; j++){
  maxv = ((maxv > R[j]-minv)? maxv : R[j]-minv);
  minv = ((minv < R[j])? minv : R[j]);
}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'minv' was not declared in this scope
   12 |     minv = R[0]
      |     ^~~~
a.cc:13:22: error: 'j' was not declared in this scope
   13 | for (int j=1 j<=n-1; j++){
      |                      ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
    int R[n];
    for(int i=0; i<n; i++){
        cin >> R[i];
    }
    
    minv = R[0];
for (int j=1 j<=n-1; j++){
  maxv = ((maxv > R[j]-minv)? maxv : R[j]-minv);
  minv = ((minv < R[j])? minv : R[j]);
}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'minv' was not declared in this scope
   12 |     minv = R[0];
      |     ^~~~
a.cc:13:13: error: expected ';' before 'j'
   13 | for (int j=1 j<=n-1; j++){
      |             ^~
      |             ;
a.cc:14:3: error: 'maxv' was not declared in this scope
   14 |   maxv = ((maxv > R[j]-minv)? maxv : R[j]-minv);
      |   ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
    int R[n];
    for(int i=0; i<n; i++){
        cin >> R[i];
    }
    
    minv = R[0];
    maxv = R[0];
for (int j=1 j<=n-1; j++){
  maxv = ((maxv > R[j]-minv)? maxv : R[j]-minv);
  minv = ((minv < R[j])? minv : R[j]);
}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'minv' was not declared in this scope
   12 |     minv = R[0];
      |     ^~~~
a.cc:13:5: error: 'maxv' was not declared in this scope
   13 |     maxv = R[0];
      |     ^~~~
a.cc:14:13: error: expected ';' before 'j'
   14 | for (int j=1 j<=n-1; j++){
      |             ^~
      |             ;
Language: C++

#include<iostream>
using namespace std;

int main(){
    int n, minv, maxv;
    cin >> n;
    int R[n];
    for(int i=0; i<n; i++){
        cin >> R[i];
    }
    
    minv = R[0];
    maxv = R[0];
for (int j=1 j<=n-1; j++){
  maxv = ((maxv > R[j]-minv)? maxv : R[j]-minv);
  minv = ((minv < R[j])? minv : R[j]);
}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected ';' before 'j'
   14 | for (int j=1 j<=n-1; j++){
      |             ^~
      |             ;
Language: C++

#include <iostream>

int main(int argc, char *argv[])
{
  int n;
  std::cin >> n;
  int r[n];
  for (int t = 0; t <= n - 1; t++)
  {
    std::cin >> r[t];
  }
  int max;
  max = INT_MIN;
  for (int i = 0; i <= n - 2; i++)
  {
    for (int j = i + 1; j <= n - 1; j++)
    {
      if (max < r[j] - r[i])
      {
        max = r[j] - r[i];
      }
    }
  }
  std::cout << max << std::endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:13:9: error: 'INT_MIN' was not declared in this scope
   13 |   max = INT_MIN;
      |         ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 |