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

#include<iostream>
#include<string.h>
#include<algorithm>
using namespace std;
int a[200000];
int main(){
	int n,i,j;
	int max;
	memset(b,0,sizeof(b));
	memset(a,0,sizeof(a));
	cin>>n;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	max=a[1]-a[0];
	for(i=0;i<n;i++){
		for(j=n-1;j>i;j--){
			if(max<a[j]-a[i]){
				max=a[j]-a[i];
			}
		}
	}
	cout<<max<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'b' was not declared in this scope
    9 |         memset(b,0,sizeof(b));
      |                ^
Language: C++

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

#include"my_util.h"
using namespace std;

int main() 
{
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i=0; i<n; ++i) cin>>v[i];

  int max = v[1] - v[0];
  int min = v[0];
  for (int i=0; i<n; ++i) {
    max = (max < (v[i]-min))? (v[i]-min) : max;
    min = (min < v[i])? min : v[i];
  }

  cout << max << "\n";

  return 0;
}

Compiler output:
a.cc:7:9: fatal error: my_util.h: No such file or directory
    7 | #include"my_util.h"
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;
int r[200001], n;
int max = -999999999;
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> r[i];
	}
	for (int i = 0; i < n - 1; i++) {
		for (int j = i+1; j < n; j++) {
			if (r[j] - r[i] > max) {
				max = r[j] - r[i];
			}
		}
	}
	cout << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:43: error: reference to 'max' is ambiguous
   12 |                         if (r[j] - r[i] > max) {
      |                                           ^~~
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:303:5: note: candidates are: '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:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:4:5: note:                 'int max'
    4 | int max = -999999999;
      |     ^~~
a.cc:13:33: error: reference to 'max' is ambiguous
   13 |                                 max = r[j] - r[i];
      |                                 ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:4:5: note:                 'int max'
    4 | int max = -999999999;
      |     ^~~
a.cc:17:17: error: reference to 'max' is ambiguous
   17 |         cout << max << endl;
      |                 ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:4:5: note:                 'int max'
    4 | int max = -999999999;
      |     ^~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;
static const int MAX = 200000;

int main(int argc, const char * argv[]) {
    
    int R[MAX];
    int n;
    
    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> R[i];
    }
    
    long maxv = -20000000000;
    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(int, const char**)':
a.cc:21:19: error: no matching function for call to 'max(long int&, int)'
   21 |         maxv = max(maxv, R[i]-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: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:21:19: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   21 |         maxv = max(maxv, R[i]-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
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/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:21:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   21 |         maxv = max(maxv, R[i]-minv);
      |                ~~~^~~~~~~~~~~~~~~~~
Language: C++

<?php
$n=trim(fgets(STDIN));
$R=[];
for($i=0;$i<$n;$i++) $R[]=trim(fgets(STDIN));
$max=$R[1]-$R[0];
$N=$n-1;
for($i=0;$i<$N;$i++)
  for($j=$i+1;$j<$n;$j++)
    if($max<$m=$R[$j]-$R[$i]) $max=$m;
print $max;
?>

Compiler output:
a.cc:1:1: error: expected unqualified-id before '<' token
    1 | <?php
      | ^
a.cc:3:1: error: '$R' does not name a type
    3 | $R=[];
      | ^~
a.cc:4:1: error: expected unqualified-id before 'for'
    4 | for($i=0;$i<$n;$i++) $R[]=trim(fgets(STDIN));
      | ^~~
a.cc:4:10: error: '$i' does not name a type
    4 | for($i=0;$i<$n;$i++) $R[]=trim(fgets(STDIN));
      |          ^~
a.cc:4:16: error: '$i' does not name a type
    4 | for($i=0;$i<$n;$i++) $R[]=trim(fgets(STDIN));
      |                ^~
a.cc:5:1: error: '$max' does not name a type
    5 | $max=$R[1]-$R[0];
      | ^~~~
a.cc:6:1: error: '$N' does not name a type
    6 | $N=$n-1;
      | ^~
a.cc:7:1: error: expected unqualified-id before 'for'
    7 | for($i=0;$i<$N;$i++)
      | ^~~
a.cc:7:10: error: '$i' does not name a type
    7 | for($i=0;$i<$N;$i++)
      |          ^~
a.cc:7:16: error: '$i' does not name a type
    7 | for($i=0;$i<$N;$i++)
      |                ^~
a.cc:8:15: error: '$j' does not name a type
    8 |   for($j=$i+1;$j<$n;$j++)
      |               ^~
a.cc:8:21: error: '$j' does not name a type
    8 |   for($j=$i+1;$j<$n;$j++)
      |                     ^~
a.cc:10:1: error: 'print' does not name a type; did you mean 'int'?
   10 | print $max;
      | ^~~~~
      | int
a.cc:11:1: error: expected unqualified-id before '?' token
   11 | ?>
      | ^
Language: C++

#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
	long int n;
	long int num[200000];
	long int max=-1000000000;
	long int min=1000000000;
	long int sum;
	long int i; 
	cin>>n;
	for(i=0;i<n;i++){
		cin>>num[i];
	}
	min=num[0];
	for(i=1;i<n;i++){
		sub=num[i]-min;
		if(num[i]<min){
			min=num[i];
		}
		if(sub>max){
			max=sub;
		}
	}
	cout<<sub<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'sub' was not declared in this scope; did you mean 'sum'?
   17 |                 sub=num[i]-min;
      |                 ^~~
      |                 sum
a.cc:25:15: error: 'sub' was not declared in this scope; did you mean 'sum'?
   25 |         cout<<sub<<endl;
      |               ^~~
      |               sum
Language: C++

#include <iostream>

using namespace std;
static const int MAX = 200000;

int main()
{
	int a[MAX],n;
	cin >> n;
	int max,tmp;
	max = -1000000000;
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}
	for(int j=1;j<n;j++)
	{
		for(int i=0;i<j;i++)
		{
			tmp = a[j] - a[i];
			if(max < tmp)
			{
				max = tmp;
			}
		}
	}
	count << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'count' was not declared in this scope
   27 |         count << max << endl;
      |         ^~~~~
Language: C++

#include <iostream>

using namespace std;
static const int MAX = 200000;

int main()
{
	int a[MAX],n;
	cin >> n;
	int max,tmp;
	max = -1000000000;
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}
	for(int i=1;i<n;i++)
	{
		tmp = a[i] - min;
		if(max < tmp)
		{
			max = tmp;
		}
		if(min < a[i])
		{
			min = a[i];
		}
	}
	cout << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-'
   18 |                 tmp = a[i] - min;
      |                       ~~~~~^~~~~
a.cc:23:20: error: parse error in template argument list
   23 |                 if(min < a[i])
      |                    ^~~~~~~~~~
a.cc:23:30: error: cannot resolve overloaded function 'min' based on conversion to type 'bool'
   23 |                 if(min < a[i])
      |                              ^
a.cc:25:34: error: overloaded function with no contextual type information
   25 |                         min = a[i];
      |                                  ^
Language: C++

#include <iostream>

using namespace std;
static const int MAX = 200000;

int main()
{
	int a[MAX],n;
	cin >> n;
	int max,tmp;
	int min=a[0];
	max = -1000000000;
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}
	for(int i=1;i<n;i++)
	{
		tmp = a[i] - min;
		if(max < tmp)
		{
			max = tmp;
		}
		if(min < a[i])
		{
			min = a[i];
		}
	}
	count << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'count' was not declared in this scope
   29 |         count << max << endl;
      |         ^~~~~
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 < 0; i++ )
    cin >> R[i];

  int maxv = -200000; //???????°??????????????????????????¨????
  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: In function 'int main()':
a.cc:17:34: error: expected ';' before 'minv'
   17 |     maxv = max(maxv, R[i] - minv) // ?????§????????´??°
      |                                  ^
      |                                  ;
   18 |     minv = min(minv, R[i])       // ????°?????????????
      |     ~~~~
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 << endl;

	return ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   27 |         return ;
      |         ^~~~~~
Language: C++

#include<iostream>
#include<algorythm>
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 min = R[0];
	for (int i = 0; i < n; i++){
		maxv = max(maxv, R[i] - minv);
		minv = min(minv, R[i]);
	}
	con << maxv << endl;
	return 0;
}

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

#include<iostream>
#include<algorythm>
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 min = R[0];
	for (int i = 0; i < n; i++){
		maxv = max(maxv, R[i] - minv);
		minv = min(minv, R[i]);
	}
	con << maxv << endl;
	return 0;
}

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

#include<iostream>
#include<algorythm>
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 min = R[0];
	for (int i = 0; i < n; i++){
		maxv = max(maxv, R[i] - minv);
		minv = min(minv, R[i]);
	}
	con << maxv << endl;
	return 0;
}

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

#include<iostream>
#include<algorythm>
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 min = R[0];
	for (int i = 0; i < n; i++){
		maxv = max(maxv, R[i] - minv);
		minv = min(minv, R[i]);
	}
	con << maxv << endl;
	return 0;
}

Compiler output:
a.cc:2:9: fatal error: algorythm: No such file or directory
    2 | #include<algorythm>
      |         ^~~~~~~~~~~
compilation terminated.
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 min = R[0];
	for (int i = 0; i < n; i++){
		maxv = max(maxv, R[i] - minv);
		minv = min(minv, R[i]);
	}
	con << maxv << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:41: error: 'minv' was not declared in this scope; did you mean 'min'?
   13 |                 maxv = max(maxv, R[i] - minv);
      |                                         ^~~~
      |                                         min
a.cc:14:27: error: 'min' cannot be used as a function
   14 |                 minv = min(minv, R[i]);
      |                        ~~~^~~~~~~~~~~~
a.cc:16:9: error: 'con' was not declared in this scope
   16 |         con << maxv << endl;
      |         ^~~
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 min = 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:13:41: error: 'minv' was not declared in this scope; did you mean 'min'?
   13 |                 maxv = max(maxv, R[i] - minv);
      |                                         ^~~~
      |                                         min
a.cc:14:27: error: 'min' cannot be used as a function
   14 |                 minv = min(minv, R[i]);
      |                        ~~~^~~~~~~~~~~~
Language: C++

#include<stdio.h>

static const int Rt_MAX = 100000;

int main() {
	int n; //????????°
	int Rt[Rt_MAX]; //??????
	int max; //?????§??????
	int min; //????°???????

	//??\???
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf_s("%d", &Rt[i]);
	}

	//?¨????
	min = Rt[0];
		//+1??????????????????
	for (int i = 1; i < n; i++) {
		max = Rt[i] - min;
		if (Rt[i] < min) {
			min = Rt[i];
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   14 |                 scanf_s("%d", &Rt[i]);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int N, R;
	int minvalue;
	int maxprofit = INT_MIN;
	cin >> N;

	cin >> minvalue;
	for (int i = 1;i < N;i++)
	{
		cin >> R;

		maxprofit = max(maxprofit, R - minvalue);
		minvalue = min(minvalue, R);
	}

	cout << maxprofit << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: 'INT_MIN' was not declared in this scope
   10 |         int maxprofit = INT_MIN;
      |                         ^~~~~~~
a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <algorithm>
  +++ |+#include <climits>
    3 |
Language: C++

#include <iostream>
#include <algorithm>
#include <limits>

using namespace std;

int main()
{
	int N, R;
	int minvalue;
	int maxprofit = INT_MIN;
	cin >> N;

	cin >> minvalue;
	for (int i = 1;i < N;i++)
	{
		cin >> R;

		maxprofit = max(maxprofit, R - minvalue);
		minvalue = min(minvalue, R);
	}

	cout << maxprofit << endl;

	return 0;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: expected '}' at end of input
   19 |     cout << maxv << endl;
      |                          ^
a.cc:5:15: note: to match this '{'
    5 | int main(void){
      |               ^
Language: C++

#include<iostream>
#include<algoithm>
usinf 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=0;i<n;i++)
	{
		maxv = max(maxv,R[i]-minv);
		minv = min(minv,R[i]);
	}
	
	cont << maxv endl;
	
	return 0;
}

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

#include<iostream>
#include<algotithm>
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 = -20000000;
	int mixv = 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:2:9: fatal error: algotithm: No such file or directory
    2 | #include<algotithm>
      |         ^~~~~~~~~~~
compilation terminated.
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 = -20000000;
	int mixv = 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:12:38: error: 'minv' was not declared in this scope; did you mean 'mixv'?
   12 |                 maxv = max(maxv,R[i]-minv);
      |                                      ^~~~
      |                                      mixv
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;
static const int MAX = 200000;

int main(void){
	int R[MAX], n;
	
	cin >> n;
	for ( int i = 0; i < n; i++ ) cin >> R[i];
	
	int maxv = -2000000;
	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:21:25: error: 'end1' was not declared in this scope
   21 |         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 = -20000000;
	int mixv = 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:12:38: error: 'minv' was not declared in this scope; did you mean 'mixv'?
   12 |                 maxv = max(maxv,R[i]-minv);
      |                                      ^~~~
      |                                      mixv
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 = -2000000;
	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:18:29: error: expected ';' before 'i'
   18 |         for(int i = 1; i < n i++)
      |                             ^~
      |                             ;
Language: C++

#include<iostream>
#include<algorithm>
//alds1_1_d.cpp
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]);
	}
	
	cont << maxv << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: 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;
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=-20000000000;
	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:18: warning: overflow in conversion from 'long int' to 'int' changes value from '-20000000000' to '1474836480' [-Woverflow]
   10 |         int maxv=-20000000000;
      |                  ^~~~~~~~~~~~
a.cc:15:35: error: expected ')' before ';' token
   15 |                 minv=min(minv,R[i];
      |                         ~         ^
      |                                   )
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=-20000000000;
	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:11:18: warning: overflow in conversion from 'long int' to 'int' changes value from '-20000000000' to '1474836480' [-Woverflow]
   11 |         int maxv=-20000000000;
      |                  ^~~~~~~~~~~~
a.cc:16:35: error: expected ')' before ';' token
   16 |                 minv=min(minv,R[i];
      |                         ~         ^
      |                                   )
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=-20000000000;
	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:11:18: warning: overflow in conversion from 'long int' to 'int' changes value from '-20000000000' to '1474836480' [-Woverflow]
   11 |         int maxv=-20000000000;
      |                  ^~~~~~~~~~~~
a.cc:16:35: error: expected ')' before ';' token
   16 |                 minv=min(minv,R[i];
      |                         ~         ^
      |                                   )
Language: C++

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

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

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

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

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

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'inti' was not declared in this scope; did you mean 'int'?
   11 | for(inti=0;i<n;i++) cin>>R[i];
      |     ^~~~
      |     int
a.cc:11:12: error: 'i' was not declared in this scope
   11 | for(inti=0;i<n;i++) cin>>R[i];
      |            ^
a.cc:16:5: error: 'inti' was not declared in this scope; did you mean 'int'?
   16 | for(inti=1;i<n;i++){
      |     ^~~~
      |     int
a.cc:16:12: error: 'i' was not declared in this scope
   16 | for(inti=1;i<n;i++){
      |            ^
a.cc:17:10: error: 'maxsv' was not declared in this scope; did you mean 'maxv'?
   17 | maxv=max(maxsv,R[i]-minv);
      |          ^~~~~
      |          maxv
Language: C++

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

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

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

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

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

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'inti' was not declared in this scope; did you mean 'int'?
   10 | for(inti=0;i<n;i++) cin >> R[i];
      |     ^~~~
      |     int
a.cc:10:12: error: 'i' was not declared in this scope
   10 | for(inti=0;i<n;i++) cin >> R[i];
      |            ^
a.cc:15:5: error: 'inti' was not declared in this scope; did you mean 'int'?
   15 | for(inti=1;i<n;i++){
      |     ^~~~
      |     int
a.cc:15:12: error: 'i' was not declared in this scope
   15 | for(inti=1;i<n;i++){
      |            ^
a.cc:16:10: error: 'maxsv' was not declared in this scope; did you mean 'maxv'?
   16 | maxv=max(maxsv,R[i]-minv);
      |          ^~~~~
      |          maxv
Language: C++

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

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

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

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

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

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'inti' was not declared in this scope; did you mean 'int'?
   10 | for(inti=0;i<n;i++) cin >> R[i];
      |     ^~~~
      |     int
a.cc:10:12: error: 'i' was not declared in this scope
   10 | for(inti=0;i<n;i++) cin >> R[i];
      |            ^
a.cc:15:5: error: 'inti' was not declared in this scope; did you mean 'int'?
   15 | for(inti=1;i<n;i++){
      |     ^~~~
      |     int
a.cc:15:12: error: 'i' was not declared in this scope
   15 | for(inti=1;i<n;i++){
      |            ^
a.cc:16:10: error: 'maxsv' was not declared in this scope; did you mean 'maxv'?
   16 | maxv=max(maxsv,R[i]-minv);
      |          ^~~~~
      |          maxv
Language: C++

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

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

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

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

for(inti=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:5: error: 'inti' was not declared in this scope; did you mean 'int'?
   10 | for(inti=0;i<n;i++) cin >> R[i];
      |     ^~~~
      |     int
a.cc:10:12: error: 'i' was not declared in this scope
   10 | for(inti=0;i<n;i++) cin >> R[i];
      |            ^
a.cc:15:5: error: 'inti' was not declared in this scope; did you mean 'int'?
   15 | for(inti=1;i<n;i++){
      |     ^~~~
      |     int
a.cc:15:12: error: 'i' was not declared in this scope
   15 | for(inti=1;i<n;i++){
      |            ^
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 << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: expected ']' before ',' token
    7 |         int R[MAX, n;
      |                  ^
      |                  ]
a.cc:10:42: error: 'R' was not declared in this scope
   10 |         for( int i = 0; i< n; i++)cin >> R[i];
      |                                          ^
a.cc:13:20: error: 'R' was not declared in this scope
   13 |         int minv = R[0];
      |                    ^
Language: C++

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

int main(){
	//?????°
	int R[LIMIT];
	int n;
	int ans=-1*10**9;
	int bottom;
	
	//??\???
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> R[i];
	}
	bottom=R[0];
	
	//?¨????
	for(int i=0;i<n;i++){
		ans    = max(ans,R[i]-bottom);
		bottom = min(bottom,R[i]);
	}
	
	//??????
	cout<<ans<<endl;
	return 0;
}

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

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

int main(){
	//?????°
	int R[LIMIT];
	int n;
	int ans;
	int bottom;
	
	//??\???
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> R[i];
	}
	ans=10**9*-1
	bottom=R[0];
	
	//?¨????
	for(int i=0;i<n;i++){
		ans    = max(ans,R[i]-bottom);
		bottom = min(bottom,R[i]);
	}
	
	//??????
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: invalid type argument of unary '*' (have 'int')
   18 |         ans=10**9*-1
      |                ^~
Language: C++

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

int main(){
	//?????°
	int R[LIMIT];
	int n;
	int ans;
	int bottom;
	
	//??\???
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> R[i];
	}
	ans=10**9*(-1)
	bottom=R[0];
	
	//?¨????
	for(int i=0;i<n;i++){
		ans    = max(ans,R[i]-bottom);
		bottom = min(bottom,R[i]);
	}
	
	//??????
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: invalid type argument of unary '*' (have 'int')
   18 |         ans=10**9*(-1)
      |                ^~
Language: C++

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

int main(){
	//?????°
	int R[LIMIT];
	int n;
	int ans;
	int bottom;
	
	//??\???
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> R[i];
	}
	ans=10**9;
	ans*=-1;
	bottom=R[0];
	
	//?¨????
	for(int i=0;i<n;i++){
		ans    = max(ans,R[i]-bottom);
		bottom = min(bottom,R[i]);
	}
	
	//??????
	cout<<ans<<endl;
	return 0;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:4: error: 'a' was not declared in this scope
   13 |    a[0]=-9999999999;
      |    ^
Language: C++

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

int main(){
    int R[MAX],n;
    cin >>n;
    for(int i=o;i<n;i++)cin >>R[i];
    int maxv=-2000000000000;
    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:5:11: error: 'MAX' was not declared in this scope
    5 |     int R[MAX],n;
      |           ^~~
a.cc:7:15: error: 'o' was not declared in this scope
    7 |     for(int i=o;i<n;i++)cin >>R[i];
      |               ^
a.cc:7:31: error: 'R' was not declared in this scope
    7 |     for(int i=o;i<n;i++)cin >>R[i];
      |                               ^
a.cc:8:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-2000000000000' to '1454759936' [-Woverflow]
    8 |     int maxv=-2000000000000;
      |              ^~~~~~~~~~~~~~
a.cc:9:14: error: 'R' was not declared in this scope
    9 |     int minv=R[0];
      |              ^
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 = -20000000000
  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:12:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-20000000000' to '1474836480' [-Woverflow]
   12 |   int maxv = -20000000000
      |              ^~~~~~~~~~~~
a.cc:13:3: error: expected ',' or ';' before 'int'
   13 |   int minv = R[0]
      |   ^~~
a.cc:15:19: error: 'i' was not declared in this scope
   15 |   for (int i = 1; i< n; i++){
      |                   ^
a.cc:20:18: error: 'end1' was not declared in this scope
   20 |   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 = -20000000000
  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:14:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-20000000000' to '1474836480' [-Woverflow]
   14 |   int maxv = -20000000000
      |              ^~~~~~~~~~~~
a.cc:15:3: error: expected ',' or ';' before 'int'
   15 |   int minv = R[0]
      |   ^~~
a.cc:17:19: error: 'i' was not declared in this scope
   17 |   for (int i = 1; i< n; i++){
      |                   ^
a.cc:22:18: error: 'end1' was not declared in this scope
   22 |   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 = -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:7:10: error: expected ']' before '}' token
    7 | int R[MAX}, n;
      |          ^
      |          ]
a.cc: At global scope:
a.cc:7:11: error: mixing declarations and function-definitions is forbidden
    7 | int R[MAX}, n;
      |           ^
a.cc:9:1: error: 'cin' does not name a type
    9 | cin >> n;
      | ^~~
a.cc:10:1: error: expected unqualified-id before 'for'
   10 | for ( int i=0; i<n ;i++) cin >>R[i];
      | ^~~
a.cc:10:16: error: 'i' does not name a type
   10 | for ( int i=0; i<n ;i++) cin >>R[i];
      |                ^
a.cc:10:21: error: 'i' does not name a type
   10 | for ( int i=0; i<n ;i++) cin >>R[i];
      |                     ^
a.cc:13:12: error: 'R' was not declared in this scope
   13 | int minv = R[0];
      |            ^
a.cc:15:1: error: expected unqualified-id before 'for'
   15 | for (int i= 1;i< n;i++){
      | ^~~
a.cc:15:15: error: 'i' does not name a type
   15 | for (int i= 1;i< n;i++){
      |               ^
a.cc:15:20: error: 'i' does not name a type
   15 | for (int i= 1;i< n;i++){
      |                    ^
a.cc:20:1: error: 'cout' does not name a type
   20 | cout << maxv << end1;
      | ^~~~
a.cc:22:1: error: expected unqualified-id before 'return'
   22 | return 0;
      | ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
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 << endl

return0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: expected ';' before '}' token
   17 | minv = min(minv, R[i])
      |                       ^
      |                       ;
   18 | }
      | ~                      
a.cc:20:21: error: expected ';' before 'return0'
   20 | cout << maxv << endl
      |                     ^
      |                     ;
   21 | 
   22 | return0;
      | ~~~~~~~
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 << endl;

return0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:1: error: 'return0' was not declared in this scope
   22 | return0;
      | ^~~~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int n;
	int *Rt;
	int max;
	int i, j;
	
	scanf("%d", &n);

	Rt = (int *)malloc( sizeof(int) * n );

	for (i = 0; i < n; i++) {
		scanf("%d", &Rt[i]);
	}
	max = Rt[1] - Rt[0];

	for (i = 0; i < (n - 1); i++) {
		for (j = (i + 1); j < n; j++) {
			if ( Rt[j] - Rt[i] > max ) {
				max = Rt[j] - Rt[i];
			}
			max = (Rt[j] - Rt[i]) > max : (Rt[j] - Rt[i]) ? max;
		}
	}

	printf("%d\n", max);


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:52: error: expected ';' before ':' token
   24 |                         max = (Rt[j] - Rt[i]) > max : (Rt[j] - Rt[i]) ? max;
      |                                                    ^~
      |                                                    ;
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;
	
	return0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: 'end1' was not declared in this scope
   20 |         cout<<maxv<<end1;
      |                     ^~~~
a.cc:22:9: error: 'return0' was not declared in this scope
   22 |         return0;
      |         ^~~~~~~
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:20:25: error: 'end1' was not declared in this scope
   20 |         cout << maxv << end1;
      |                         ^~~~
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 = R[1] - R[0];
	int minv = R[0];
	
	for( int a = 1; a < n; i++){
		if( ( R[a] - minv ) > maxv ) maxv = R[a] - minv;
		if( R[a] < minv ) minv = R[a];
	} 
	
	cout << maxv << endl;
	
	return 0;
}

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

#include <stdio.h>
#include <iostream>
#include <utility>

#define MAX_N 200000
#define MAX_T 1000000000

int n;


void solve(){
    int tmax=0;
    int tmin=MAX_T+1;
    int difmax = -(MAX_T+1);
    int m[MAX_N];
    scanf("%d",&n);
    for(int i = 0; i < n; i++){
        scanf("%d",&m[i]);
    }

    for(int j = 0; j < n; j++){
        for(int i = 0; i<(n-1); i++){
            if(m[i] < tmin){
                tmin = m[i];
                i++;
                tmax = 1;
                for(;i<n;i++){
                    if(tmax < m[i]){
                        tmax = m[i];
                    }
                }
            
            }
        }
        if(difmax < (tmax - tmin)) difmax = tmax-tmin;
    }
    printf("%d\n",difmax);


}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <stdio.h>
#include <iostream>
#include <utility>


#define MAX_N 200000
#define MAX_T 1000000000

int n;


int main(){
    int tmax=0;
    int tmin=MAX_T+1;
    int difmax = -(MAX_T+1);
    int sorted[MAX_N];
    int original[MAX_N];
    scanf("%d",&n);
    for(int i = 0; i < n; i++){
        scanf("%d",&original[i]);
        sorted[i] = original[i];
    }
    sorted[0] = 0;
    std::sort(sorted,sorted+n);
    
    for(int i = 0; i < n; i++){
        printf("%d ",original[i]);
    }
    printf("\n");
    
    
    for(int i = 0; i < n; i++){
        printf("%d ",sorted[i]);
    }
    printf("\n");
    
    int largest_idx = n-1;
    tmax = sorted[largest_idx];
    

    for(int i = 0; i<n-1; i++){
        if(original[i] < tmin){
            tmin = original[i];
        }

        if(original[i+1] == sorted[largest_idx] && largest_idx > 1){
                tmax = sorted[--largest_idx];
        }

        if(difmax < (tmax - tmin)) difmax = tmax-tmin;
        printf("difmax %d tmax %d tmin %d\n", difmax, tmax, tmin);
    }

    printf("%d\n",difmax);
    
}

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

#include <iostream>
using namespace std;


int main() {
	const long long MAX_N=200000;
	long long max_dif,data,s[MAX_N];
	bool ans=false;
		max_dif=0;
			cin>>data;

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

	for(int i=1;i<data;++i){
		if(s[i]>s[i-1]){
			max_dif+=s[i]-s[i-1];
			ans=true;
			
		}
	}
	
	cout<<(ans==true)?max_dif:(-1)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:39: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   24 |         cout<<(ans==true)?max_dif:(-1)<<endl;
      |                                   ~~~~^~~~~~
Language: C++

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

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

	cin >> n;

	for (int i = 0; i < n; i++) cin R[i];
	int maxv = -20000000000;
	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:1:10: fatal error: bits\stdc++.h: No such file or directory
    1 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

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

	cin >> n;

	for (int i = 0; i < n; i++) cin R[i];
	int maxv = -20000000000;
	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:40: error: expected ';' before 'R'
   10 |         for (int i = 0; i < n; i++) cin R[i];
      |                                        ^~
      |                                        ;
a.cc:11:20: warning: overflow in conversion from 'long int' to 'int' changes value from '-20000000000' to '1474836480' [-Woverflow]
   11 |         int maxv = -20000000000;
      |                    ^~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;
static const int MAX = 200000;

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

	cin >> n;

	for (int i = 0; i < n; i++) cin R[i];
	int maxv = -20000000000;
	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:12:40: error: expected ';' before 'R'
   12 |         for (int i = 0; i < n; i++) cin R[i];
      |                                        ^~
      |                                        ;
a.cc:13:20: warning: overflow in conversion from 'long int' to 'int' changes value from '-20000000000' to '1474836480' [-Woverflow]
   13 |         int maxv = -20000000000;
      |                    ^~~~~~~~~~~~
Language: C++

#include "bits\stdc++.h"
using namespace std;
static const int MAX = 200000;

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

	cin >> n;

	for (int i = 0; i < n; i++) cin >> R[i];
	int maxv = -20000000000;
	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:1:10: fatal error: bits\stdc++.h: No such file or directory
    1 | #include "bits\stdc++.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

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

	cin >> n;

	for (int i = 0; i < n; i++) cin >> R[i];
	int maxv = -20000000000;
	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:1:10: fatal error: bits\stdc++.h: No such file or directory
    1 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

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

	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> R[i];
	}
	int maxv = -20000000000;
	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:1:10: fatal error: bits\stdc++.h: No such file or directory
    1 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<stdio.h>

int main(void){
	int n;
	lnt r[20005];
	int i,j,max;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&r[i]);
	}
	max=r[1]-r[0];
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			if(max<r[j]-r[i]){max=r[j]-r[i];}
		}
	}
printf("%d\n",max);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'lnt' was not declared in this scope; did you mean 'int'?
    5 |         lnt r[20005];
      |         ^~~
      |         int
a.cc:9:29: error: 'r' was not declared in this scope
    9 |                 scanf("%d",&r[i]);
      |                             ^
a.cc:11:13: error: 'r' was not declared in this scope
   11 |         max=r[1]-r[0];
      |             ^