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

int n, ans = INT32_MIN;
	cin >> n;
	int *p = new int[n];

	for (int i = 0; i < n; i++) cin >> p[i];
	
	for (int i = n - 1; i > 0; i--) {
		for (int j = i - 1; j >= 0; j--) {
			if ((p[i] - p[j]) > ans) ans = p[i] - p[j];
		}
	}
	cout << ans << "\n";
	delete[] p;
	return 0;

Compiler output:
a.cc:1:14: error: 'INT32_MIN' was not declared in this scope
    1 | int n, ans = INT32_MIN;
      |              ^~~~~~~~~
a.cc:2:9: error: 'cin' does not name a type
    2 |         cin >> n;
      |         ^~~
a.cc:5:9: error: expected unqualified-id before 'for'
    5 |         for (int i = 0; i < n; i++) cin >> p[i];
      |         ^~~
a.cc:5:25: error: 'i' does not name a type
    5 |         for (int i = 0; i < n; i++) cin >> p[i];
      |                         ^
a.cc:5:32: error: 'i' does not name a type
    5 |         for (int i = 0; i < n; i++) cin >> p[i];
      |                                ^
a.cc:7:9: error: expected unqualified-id before 'for'
    7 |         for (int i = n - 1; i > 0; i--) {
      |         ^~~
a.cc:7:29: error: 'i' does not name a type
    7 |         for (int i = n - 1; i > 0; i--) {
      |                             ^
a.cc:7:36: error: 'i' does not name a type
    7 |         for (int i = n - 1; i > 0; i--) {
      |                                    ^
a.cc:12:9: error: 'cout' does not name a type
   12 |         cout << ans << "\n";
      |         ^~~~
a.cc:13:9: error: expected unqualified-id before 'delete'
   13 |         delete[] p;
      |         ^~~~~~
a.cc:14:9: error: expected unqualified-id before 'return'
   14 |         return 0;
      |         ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int n, ans = INT32_MIN;
	cin >> n;
	int *p = new int[n];

	for (int i = 0; i < n; i++) cin >> p[i];
	
	for (int i = n - 1; i > 0; i--) {
		for (int j = i - 1; j >= 0; j--) {
			if ((p[i] - p[j]) > ans) ans = p[i] - p[j];
		}
	}
	cout << ans << "\n";
	delete[] p;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: 'INT32_MIN' was not declared in this scope
    6 |         int n, ans = INT32_MIN;
      |                      ^~~~~~~~~
Language: C++

import java.util.Scanner;

public class doll
{
    public static void main(String[] args)
    {
	Scanner In = new Scanner(System.in);

	int n;

	do
	    {
		n = In.nextInt();
	    }while(n >= 2 && n >= 200000);

	int []a = new int[n];

	for(int i = 0; i < n; i++)
	    {
		do	    
		    {
			a[i] = In.nextInt();
		    }while(1 >= a[i] && a[i] >= Math.pow(10,9));
	    }

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

	for(int j = 1; j <= n-1; j++)
	    {
		maxv = maxv > (a[j] - minv) ? maxv : (a[j] - minv);
		minv = minv < a[j] ? minv : a[j];
	    }
	System.out.println(maxv);
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class doll
      | ^~~~~~
Language: C++

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

int N;
int main(){
cin >> N;
int maxi=-1,mini=1000000009;
int res = 0;
for(int i=0;i<N;i++){
int a; cin >> a; maxi = max( maxi,a ); min = min( mini, a );
res = max( res, abs( maxi-a ) , abs( mini-a ) );
}
cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:59: error: overloaded function with no contextual type information
   10 | int a; cin >> a; maxi = max( maxi,a ); min = min( mini, a );
      |                                                           ^
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:11:10:   required from here
   11 | res = max( res, abs( maxi-a ) , abs( mini-a ) );
      |       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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

int N;
int main(){
cin >> N;
int maxi=-1,mini=1000000009;
int res = 0;
for(int i=0;i<N;i++){
int a; cin >> a; maxi = max( maxi,a ); mini = min( mini, a );
res = max( res, abs( maxi-a ) , abs( mini-a ) );
}
cout << res << endl;
}

Compiler output:
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:11:10:   required from here
   11 | res = max( res, abs( maxi-a ) , abs( mini-a ) );
      |       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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

int N;
int main(){
cin >> N;
int mini=1000000009;
int res = -mini;
for(int i=0;i<N;i++){
res = max( res, a-mini );
int a; cin >> a; mini = min( mini, a );
}
cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'a' was not declared in this scope
   10 | res = max( res, a-mini );
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
int main(){
cin >> N;
ll mini=LLONGMAX;
ll res = -mini;
for(int i=0;i<N;i++){
int a; cin >> a; 
res = max( res, a-mini );
mini = min( mini, a );
}
cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'LLONGMAX' was not declared in this scope; did you mean 'LLONG_MAX'?
    7 | ll mini=LLONGMAX;
      |         ^~~~~~~~
      |         LLONG_MAX
a.cc:12:11: error: no matching function for call to 'min(ll&, int&)'
   12 | mini = min( mini, a );
      |        ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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:12:11: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   12 | mini = min( mini, a );
      |        ~~~^~~~~~~~~~~
/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
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:12:11: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   12 | mini = min( mini, a );
      |        ~~~^~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
int main(){
cin >> N;
cin >> mini;
ll res = -1000000000000LL;
for(int i=1;i<N;i++){
int a; cin >> a; 
res = max( res, a-mini );
mini = min( mini, a );
}
cout << res << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
int main(){
cin >> N;
cin >> mini;
ll res = -1000000000000LL;
for(int i=1;i<N;i++){
int a; cin >> a; 
res = max( res, a-mini );
mini = min( mini, (ll)a );
}
cout << res << endl;
}

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

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

int main() {
	int minv=2000000, maxv=-2000000;
	int itmp=0, p=0, p0=0;
	scnaf("%d",&p0);
	while (p0>p) {
		scanf("%d",itmp);
		max(maxv,itmp-minv);
		min(minv,itmp);
		p++;
	}
	printf("%d",maxv);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
    8 |         scnaf("%d",&p0);
      |         ^~~~~
      |         scanf
a.cc:11:20: warning: ignoring return value of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]', declared with attribute 'nodiscard' [-Wunused-result]
   11 |                 max(maxv,itmp-minv);
      |                 ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: declared here
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:12:20: warning: ignoring return value of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]', declared with attribute 'nodiscard' [-Wunused-result]
   12 |                 min(minv,itmp);
      |                 ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: declared here
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
Language: C++

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

int main() {
	int minv=2000000, maxv=-2000000;
	int itmp=0, p=0, p0=0;
	scnaf("%d",&p0);
	while (p0>p) {
		scanf("%d",&itmp);
		max(maxv,itmp-minv);
		min(minv,itmp);
		p++;
	}
	printf("%d",maxv);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
    8 |         scnaf("%d",&p0);
      |         ^~~~~
      |         scanf
a.cc:11:20: warning: ignoring return value of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]', declared with attribute 'nodiscard' [-Wunused-result]
   11 |                 max(maxv,itmp-minv);
      |                 ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: declared here
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:12:20: warning: ignoring return value of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]', declared with attribute 'nodiscard' [-Wunused-result]
   12 |                 min(minv,itmp);
      |                 ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: declared here
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>

using namespace std;



int main(){
    int N,*A;
    cin >> N;
    A = (int *)malloc(sizeof(int)*N);
    
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    int min = 200000;
    int plf = -200000;
    for (int i = 1; i < N; i++) {
        if (min > A[l-1]) min = A[l-1];
        if(A[l] - min > plf) plf = A[l] - min;
    }
    cout << plf << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: 'l' was not declared in this scope
   21 |         if (min > A[l-1]) min = A[l-1];
      |                     ^
a.cc:22:14: error: 'l' was not declared in this scope
   22 |         if(A[l] - min > plf) plf = A[l] - min;
      |              ^
Language: C++

#include "stdafx.h"
#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;

int main()
{
	int n, minv = INT_MAX, maxd = INT_MIN, dis = 0;
	cin >> n;
	int *r = new int[n];
	for (int i = 0; i < n; i++) {
		cin >> r[i];
		if (i == 0) minv = r[i];
		else {
			maxd = max(maxd, r[i] - minv);
			minv = min(minv, r[i]);			
		}
	}
	cout << maxd << endl;
    return 0;
}

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

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

int main()
{
	int n, minv = INT_MAX, maxd = INT_MIN, dis = 0;
	cin >> n;
	int *r = new int[n];
	for (int i = 0; i < n; i++) {
		cin >> r[i];
		if (i == 0) minv = r[i];
		else {
			maxd = max(maxd, r[i] - minv);
			minv = min(minv, r[i]);
		}
	}
	cout << maxd << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: 'INT_MAX' was not declared in this scope
    7 |         int n, minv = INT_MAX, maxd = INT_MIN, dis = 0;
      |                       ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <algorithm>
  +++ |+#include <climits>
    3 | using namespace std;
a.cc:14:25: error: 'maxd' was not declared in this scope
   14 |                         maxd = max(maxd, r[i] - minv);
      |                         ^~~~
a.cc:18:17: error: 'maxd' was not declared in this scope
   18 |         cout << maxd << endl;
      |                 ^~~~
Language: C++

#include "stdafx.h"
#include <iostream>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cctype>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <regex>
using namespace std;

int main()
{
	int n, minv = INT_MAX, maxd = INT_MIN, dis = 0;
	cin >> n;
	int *r = new int[n];
	for (int i = 0; i < n; i++) {
		cin >> r[i];
		if (i == 0) minv = r[i];
		else {
			maxd = max(maxd, r[i] - minv);
			minv = min(minv, r[i]);
		}
	}
	cout << maxd << endl;
    return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
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];
	}

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

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: 'INT_MIN' was not declared in this scope
   14 |         int maxv = 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 |
Language: C++

#include <stdio.h>
#include <algorithm>
using namespace std;
int n, a[200007];
int main() {
	scanf("%d", &n);
	for(int i = 0; i < n; i++) scanf("%d", a + i);
	int s = 0, ret = -999999999;
	for(int i = 1; i <= n; i++) {
		if(d[i - 1] > d[i]) ret = max(ret, d[i] - d[s]), s = i;
	}
	printf("%d\n", ret);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: 'd' was not declared in this scope
   10 |                 if(d[i - 1] > d[i]) ret = max(ret, d[i] - d[s]), s = i;
      |                    ^
Language: C++

#include <stdio.h>
#include <algorithm>
using namespace std;
int n, m, a, r = -999999999;
int main() {
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		scanf("%d", &a);
		r = max(r, a - m):
		m = min(m, a);
	}
	printf("%d\n", r);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:34: error: expected ';' before ':' token
    9 |                 r = max(r, a - m):
      |                                  ^
      |                                  ;
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 = (minv, R[i]);
	}

	cout << maxv << endl;

rerurn 0;



}

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

#include <stdio.h>
#include <vector>

int main() {
	int n;
	scanf("%d", &n);
	std::vector<int> d;

	for (int i = 0; i < n; i++) {
		int b;
		scanf("%d", &b);
		d.push_back(b);
	}

	int profit = INT_MIN;
	for (int i = 0; i < n - 1; i++) {
		for (int j = i + 1; j < n; j++) {
			if (profit < d[j] - d[i]) profit = d[j] - d[i];
		}
	}
	printf("%d", profit);
}

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

#include <stdio.h>
#include <vector>
#include <limits>

int main() {
	int n;
	scanf("%d", &n);
	std::vector<int> d;

	for (int i = 0; i < n; i++) {
		int b;
		scanf("%d", &b);
		d.push_back(b);
	}

	int profit = INT_MIN;
	for (int i = 0; i < n - 1; i++) {
		for (int j = i + 1; j < n; j++) {
			if (profit < d[j] - d[i]) profit = d[j] - d[i];
		}
	}
	printf("%d", profit);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: 'INT_MIN' was not declared in this scope
   16 |         int profit = 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>
using namespace std;

int main???
         int id;
         int max;
         int num[id];
         cin >> id;

        for(int i = 0; i <= id; i++){
             cin >> num[i];

        }
        max = num[0];

        for(int i = 0; i < id;i++){
           if(max < num[i])
                max = num[i] - max; 

        } 
??????     cout << max;
}

Compiler output:
a.cc:4:9: error: expected initializer before '?' token
    4 | int main???
      |         ^
a.cc:7:18: error: 'id' was not declared in this scope; did you mean 'void'?
    7 |          int num[id];
      |                  ^~
      |                  void
a.cc:8:10: error: 'cin' does not name a type
    8 |          cin >> id;
      |          ^~~
a.cc:10:9: error: expected unqualified-id before 'for'
   10 |         for(int i = 0; i <= id; i++){
      |         ^~~
a.cc:10:24: error: 'i' does not name a type
   10 |         for(int i = 0; i <= id; i++){
      |                        ^
a.cc:10:33: error: 'i' does not name a type
   10 |         for(int i = 0; i <= id; i++){
      |                                 ^
a.cc:14:9: error: reference to 'max' is ambiguous
   14 |         max = num[0];
      |         ^~~
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:6:14: note:                 'int max'
    6 |          int max;
      |              ^~~
a.cc:16:9: error: expected unqualified-id before 'for'
   16 |         for(int i = 0; i < id;i++){
      |         ^~~
a.cc:16:24: error: 'i' does not name a type
   16 |         for(int i = 0; i < id;i++){
      |                        ^
a.cc:16:31: error: 'i' does not name a type
   16 |         for(int i = 0; i < id;i++){
      |                               ^
a.cc:21:1: error: expected unqualified-id before '?' token
   21 | ??????     cout << max;
      | ^
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include<iiostream>
#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[1] - R[0];
    int minv = R[0];

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

    return 0;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: expected ';' before 'maxv'
   15 |                 cin >> m
      |                         ^
      |                         ;
   16 |                 maxv = max(maxv, m - minv);
      |                 ~~~~
Language: C++

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

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

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:13:25: error: 'maxv' was not declared in this scope
   13 |                         maxv = maxv<rt[j]-rt[i] : rt[j]-rt[i] ? maxv;
      |                         ^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:48: error: expected ';' before ':' token
   14 |                         maxv = maxv<rt[j]-rt[i] : rt[j]-rt[i] ? maxv;
      |                                                ^~
      |                                                ;
Language: C++

#include <algorithm>
#include <iostream>
#include <typeinfo>

int main() {
  int total_time;
  std::cin >> total_time;

  int min_price;
  std::cin >> min_price;
  int max_profit = std::numeric_limits<int>::min();
  for (auto t = 1; t < total_time; t++) {
    int price;
    std::cin >> price;
    max_profit = std::max(max_profit, price - min_price);
    min_price = std::min(min_price, price);
  }
  std::cout << max_profit << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'numeric_limits' is not a member of 'std'
   11 |   int max_profit = std::numeric_limits<int>::min();
      |                         ^~~~~~~~~~~~~~
a.cc:11:40: error: expected primary-expression before 'int'
   11 |   int max_profit = std::numeric_limits<int>::min();
      |                                        ^~~
Language: C++

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

void main() {
	int n, a[200000], min;
	long long int ben = -10000000000;

	cin >> n;

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

	for (int i = 0; i < n; i++) {
		if (i) {
			if (min > a[i]) min = a[i];
			
			if (ben < a[i] - min) ben = a[i] - min;
		}
		else min = a[i];
	}

	cout << ben << endl;
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main() {
      | ^~~~
Language: C++

#include <iostream>
  
int main(){
  
  int n;
  while(std::cin >> n){ 
    int *array = new int[n];
    for(int i = 1; i < n;i++){
      std::cin >> array[i];
    }
    int maxv = array[1] - array[0];
    int minj;
    if(maxv < 0){
      minj = array[0];
    }else{
      minj = array[1];
    }
    for(int j = 2; j < n;j++){
      if(minj > array[j]){
	minj = array[j];
      }
      for(int i = 1; i < j;i++){
	if(max < array[j] - array[i]){
	  max = array[j] - array[i];
	}
      }
    }
    std::cout << max << std::endl;
    delete[] array;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: 'max' was not declared in this scope; did you mean 'std::max'?
   23 |         if(max < array[j] - array[i]){
      |            ^~~
      |            std::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: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:28:18: error: 'max' was not declared in this scope; did you mean 'std::max'?
   28 |     std::cout << max << std::endl;
      |                  ^~~
      |                  std::max
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

#include <iostream>

int main(void)
{
    int i;
    int n;

    cin >> n;

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

    int min = r[0];
    int ret = -99999;
    for (i = 1; i < n; i++) {
        int tmp = r[i] - min;
        ret = (tmp > ret)  ? tmp : ret;
        min = (r[i] < min) ? r[i] : min;
    }

    cout << ret << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |     cin >> n;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:23:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |     cout << ret << 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:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |     cout << ret << 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>
#include <climts>
using namespace std;

int main(void)
{
    int i;
    int n;
    int r[200000];

    cin >> n;

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

    int min = r[0];
    int ret = INT_MIN;
    for (i = 1; i < n; i++) {
        int tmp = r[i] - min;
        ret = (tmp > ret)  ? tmp : ret;
        min = (r[i] < min) ? r[i] : min;
    }

    cout << ret << endl;

    return 0;
}

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

#include <iostream>
#include <limts.h>
using namespace std;

int main(void)
{
    int i;
    int n;
    int r[200000];

    cin >> n;

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

    int min = r[0];
    int ret = INT_MIN;
    for (i = 1; i < n; i++) {
        int tmp = r[i] - min;
        ret = (tmp > ret)  ? tmp : ret;
        min = (r[i] < min) ? r[i] : min;
    }

    cout << ret << endl;

    return 0;
}

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


#include <iostream>

using namespace std;
#define NUMBER 200000

int main(){

	int ary[NUMBER];
	int min_register[NUMBER];


	int n;
	cin >> n;	//????´???°?????????

	cin >> ary[0];	//1?????????????´??????????
	int min=ary[0];
	min_register[0] = min;

	int max = -1000000001;
	for(int i = 1; i < n; i++){
		cin >> ary[i];
		min = (min > ary[i])?ary[i]:min;
		min_register[i] = min;
		max = max(max,ary[i] - min_register[i-1]);

	}
	cout << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:26: error: 'max' cannot be used as a function
   25 |                 max = max(max,ary[i] - min_register[i-1]);
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int M(vector<int> A){
	int m = 0;
	int d = A[1] - A[0];
	while(m < A.size()){
		for(int i = m + 1; i < A.size(); i++){
			if(A[i] - A[m] < 0) m = i, break;
			if(A[i] - A[m] > d) d = A[i] - A[m];
		}
		break;
	}
	return d;
}

int main(){
	int n;
	cin >> n;
	vector<int> A;
	for(int i = 0; i < n; i++){
		int a;
		cin >> a;
		A.push_back(a);
	}
	cout << M(A) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int M(std::vector<int>)':
a.cc:10:52: error: expected primary-expression before 'break'
   10 |                         if(A[i] - A[m] < 0) m = i, break;
      |                                                    ^~~~~
Language: C++

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

int MaxProfit(vector<int> A){
	int start_number = 0;
	int profit = A[1] - A[0];
	while(1){
		int i;
		for(i = start_number + 1; i < A.size(); i++){
			if(A[i] - A[start_number] < 0){
				start_number = i;
				break;
			}
			if(A[i] - A[start_number] > d){
				profit = A[i] - A[start_number];
			}
		}
		if(i >= A.size() - 1) break;
	}
	return profit;
}

int main(){
	int n;
	cin >> n;
	vector<int> A;
	for(int i = 0; i < n; i++){
		int a;
		cin >> a;
		A.push_back(a);
	}
	cout << MaxProfit(A) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int MaxProfit(std::vector<int>)':
a.cc:15:53: error: 'd' was not declared in this scope
   15 |                         if(A[i] - A[start_number] > d){
      |                                                     ^
Language: C++

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

int main() {
    intR[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:5: error: 'intR' was not declared in this scope; did you mean 'int'?
    7 |     intR[max], n;
      |     ^~~~
      |     int
a.cc:7:16: error: 'n' was not declared in this scope
    7 |     intR[max], n;
      |                ^
a.cc:10:40: 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>
#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:14: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
    7 |     int R[max], n;
      |              ^
a.cc:7:9: error: size of array 'R' has non-integral type '<unresolved overloaded function type>'
    7 |     int R[max], n;
      |         ^
Language: C++

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

  cin >> n;
  for(int i= 0; i< n; i++)
    cin >> R[i];
  int maxv = -2000000000000;
  int minv = min[R];
  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:9: error: 'MAX' was not declared in this scope
    5 |   int R[MAX],n;
      |         ^~~
a.cc:9:12: error: 'R' was not declared in this scope
    9 |     cin >> R[i];
      |            ^
a.cc:10:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-2000000000000' to '1454759936' [-Woverflow]
   10 |   int maxv = -2000000000000;
      |              ^~~~~~~~~~~~~~
a.cc:11:18: error: 'R' was not declared in this scope
   11 |   int minv = min[R];
      |                  ^
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 = -2000000000000;
  int minv = min[R];
  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:11:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-2000000000000' to '1454759936' [-Woverflow]
   11 |   int maxv = -2000000000000;
      |              ^~~~~~~~~~~~~~
a.cc:12:17: error: invalid types '<unresolved overloaded function type>[int [200000]]' for array subscript
   12 |   int minv = min[R];
      |                 ^
Language: C++

#include <stdio.h>
main(){
  int n;
  int rt[200000];
  int prof,x,minp;
  int i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&rt[i]);
  }
  prof = rt[1]-rt[0];
  minp = rt[0]
  for(i=1;i<n;i++){    
    x = rt[i]-minp;
    if(prof<x){
        prof=x;
    }
    if(minp>rt[i]){
      minp = rt[i];
    }
  }
  printf("%d\n",prof);
}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:12:15: error: expected ';' before 'for'
   12 |   minp = rt[0]
      |               ^
      |               ;
   13 |   for(i=1;i<n;i++){
      |   ~~~          
a.cc:13:18: error: expected ';' before ')' token
   13 |   for(i=1;i<n;i++){
      |                  ^
      |                  ;
Language: C++

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

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

  cin >> n;
  for (int i = 0; i < count; i++) {
    /* code */
    cin >> R[i];
  }
  int maxv = -200000000000;
  int minv = R[0];

  for (int i = 0; i < count; i++) {
    /* code */
    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:11:21: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   11 |   for (int i = 0; i < count; i++) {
      |                   ~~^~~~~~~
a.cc:15:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-200000000000' to '1863462912' [-Woverflow]
   15 |   int maxv = -200000000000;
      |              ^~~~~~~~~~~~~
a.cc:18:21: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   18 |   for (int i = 0; i < count; i++) {
      |                   ~~^~~~~~~
a.cc:21:27: error: expected ';' before '}' token
   21 |     minv = min(minv, R[i])
      |                           ^
      |                           ;
   22 |   }
      |   ~                        
a.cc:24:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   24 |   count << maxv << endl;
      |   ~~~~~~^~~~~~~
Language: C++

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

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

  cin >> n;
  for (int i = 0; i < n; i++) {
    /* code */
    cin >> R[i];
  }
  int maxv = -200000000000;
  int minv = R[0];

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

  count << maxv << endl;

  return 0;
}

Compiler output:
a.cc:3:17: error: 'name' is not a namespace-name
    3 | using namespace name std;
      |                 ^~~~
a.cc:3:21: error: expected ';' before 'std'
    3 | using namespace name std;
      |                     ^~~~
      |                     ;
a.cc:3:22: error: 'std' does not name a type
    3 | using namespace name std;
      |                      ^~~
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:15:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-200000000000' to '1863462912' [-Woverflow]
   15 |   int maxv = -200000000000;
      |              ^~~~~~~~~~~~~
a.cc:20:12: 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: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:21:12: 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:3: error: 'count' was not declared in this scope; did you mean 'std::count'?
   24 |   count << maxv << endl;
      |   ^~~~~
      |   std::count
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: 'std::count' declared here
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
a.cc:24:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   24 |   count << 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>
#include<algorithm>
using namespace std;
static const int MAX = 20000;

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

  cin >> n;
  for (int i = 0; i < n; i++) {
    /* code */
    cin >> R[i];
  }
  int maxv = -200000000000;
  int minv = R[0];

  for (int i = 0; i < n; i++) {
    /* code */
    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:15:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-200000000000' to '1863462912' [-Woverflow]
   15 |   int maxv = -200000000000;
      |              ^~~~~~~~~~~~~
a.cc:21:27: error: expected ';' before '}' token
   21 |     minv = min(minv, R[i])
      |                           ^
      |                           ;
   22 |   }
      |   ~
Language: C++

#include<iostream>
#include<math.h>
#include<stdlib.h>

#define INF -99999999999;
using namespace std;

class answer {
public:
	int s, e, ans;
	answer(){ s = 0; e = 0; ans = 0; }
	answer(int a, int b, int c) {
		s = a;
		e = b;
		ans = c;
	}
	void show3(void) { cout << s << " " << e << " " << ans; }
	void show1(void) { cout << ans << "\n"; }
};

answer fun2(int *B, int low, int mid, int high)
{
	int leftsum = INF;
	int rightsum = INF;
	int sum = 0;
	int maxleft, maxright;

	for (int i = mid; i >= low; i--) {
		sum += B[i];
		if (sum > leftsum) {
			leftsum = sum;
			maxleft = i;
		}
	}
	sum = 0;
	for (int j = mid + 1; j <= high; j++) {
		sum += B[j];
		if (sum > rightsum) {
			rightsum = sum;
			maxright = j;
		}
	}

	answer b(maxleft, maxright, leftsum + rightsum);
	return b;
}

answer fun3(int* B, int low, int high) {
	if (high == low) {
		answer a(low, high, B[low]);
		return a;
	}
	else {
		int mid = (int)floor((low + high) / 2);
		answer left = fun3(B, low, mid);
		answer right = fun3(B, mid + 1, high);
		answer cross = fun2(B, low, mid, high);

		if (left.ans >= right.ans&&left.ans >= cross.ans) {
			return left;
		}
		else if (right.ans >= left.ans&&right.ans >= cross.ans) {
			return  right;
		}
		else
			return cross;
	}

}



answer fun1(int *B,int n)
{
	int sum;
	int ans = -999999;
	int ansi, anse;
	for (int i = 1; i <= n; i++) {
		sum = 0;
		for (int j = i; j <= n; j++) {
			sum += B[j];
			if (sum > ans) {
				ans = sum;
				ansi = i;
				anse = j;
			}
		}
	}
	answer a(ansi, anse, ans);
	return a;
}



int main()
{
	// cout << "size--";
	int n;
	cin >> n;

	int*A;
	int*B;
	A = new int[n + 1];
	B = new int[n + 1];
	A[0] = 0;
	for (int i = 1; i <= n; i++){
		cin >> A[i];
		B[i] = A[i] - A[i - 1];
	}

	answer a=fun2(B, n);
	// answer a = fun3(B, 2, n);
	a.show1();

	delete A;
	delete B;

	return 0;
}

Compiler output:
a.cc: In function 'answer fun2(int*, int, int, int)':
a.cc:5:13: warning: overflow in conversion from 'long int' to 'int' changes value from '-99999999999' to '-1215752191' [-Woverflow]
    5 | #define INF -99999999999;
      |             ^~~~~~~~~~~~
a.cc:23:23: note: in expansion of macro 'INF'
   23 |         int leftsum = INF;
      |                       ^~~
a.cc:5:13: warning: overflow in conversion from 'long int' to 'int' changes value from '-99999999999' to '-1215752191' [-Woverflow]
    5 | #define INF -99999999999;
      |             ^~~~~~~~~~~~
a.cc:24:24: note: in expansion of macro 'INF'
   24 |         int rightsum = INF;
      |                        ^~~
a.cc: In function 'int main()':
a.cc:111:22: error: too few arguments to function 'answer fun2(int*, int, int, int)'
  111 |         answer a=fun2(B, n);
      |                  ~~~~^~~~~~
a.cc:21:8: note: declared here
   21 | answer fun2(int *B, int low, int mid, int high)
      |        ^~~~
Language: C++

#include "stdafx.h"
#include<iostream>
using namespace std;


int main(){
	int n,p[200010],M;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>p[i];
	}
	M=p[1]-p[0];
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			if(p[j]-p[i]>M)M=p[j]-p[i];
		}
	}
	cout<<M<<endl;
	return 0;
}

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

#include <iostream>
using namespace std;

int main() {
    int n, *a;

    cin >> n;
    a = new int[n];
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int c = n, f, d;
    int max = a[1] - a[0];
    int min = 
    while (c - 2) {
        
    }
    delete [] a;
    cout << max << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: expected primary-expression before 'while'
   15 |     while (c - 2) {
      |     ^~~~~
Language: C++

import sys
INF = (sys.maxint)/3

def MaximumProfit(R_list):
	minR = INF
	maxD = -INF
	for R in R_list:
		maxD = max(maxD, R - minR)
		minR = min(minR, R)
	return maxD

def main():
	n = input()
	R_list = []
	for i in range(n):
		R_list.append(input())
	print MaximumProfit(R_list)

if __name__ == '__main__':
	main()

Compiler output:
a.cc:19:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   19 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
#include<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=-1000000000;
  int minv=R[0];

  for(i=1;i<n;i++){

   maxv=(maxv,R[i]-minv);
   minv=(minv,R[i]);

 
}

  cout << maxv << endl; 



 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:38: error: expected ';' before 'int'
   12 |   for(int i=0; i<n ; i++) cin >> R[i]
      |                                      ^
      |                                      ;
   13 | 
   14 |   int maxv=-1000000000;
      |   ~~~                                 
a.cc:17:7: error: 'i' was not declared in this scope
   17 |   for(i=1;i<n;i++){
      |       ^
a.cc:19:4: error: 'maxv' was not declared in this scope
   19 |    maxv=(maxv,R[i]-minv);
      |    ^~~~
a.cc:25:11: error: 'maxv' was not declared in this scope
   25 |   cout << 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=-1000000000;
  int minv=R[0];

  for(int i=1;i<n;i++){

   maxv=(maxv,R[i]-minv);
   minv=(minv,R[i]);

 
}

  cout << maxv << endl; 



 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:38: error: expected ';' before 'int'
   12 |   for(int i=0; i<n ; i++) cin >> R[i]
      |                                      ^
      |                                      ;
   13 | 
   14 |   int maxv=-1000000000;
      |   ~~~                                 
a.cc:19:4: error: 'maxv' was not declared in this scope
   19 |    maxv=(maxv,R[i]-minv);
      |    ^~~~
a.cc:25:11: error: 'maxv' was not declared in this scope
   25 |   cout << 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=-1000000000;
  int minv=R[0];

  for(i=1;i<n;i++){

   maxv=(maxv,R[i]-minv);
   minv=(minv,R[i]);

 
}

  cout << maxv << endl; 



 return 0;
}

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

#include <iostream>

using namespace std;

int main() {

    int a, no[200000] = { 0 };
    int max = -200000;
    
    cin >> a;

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

    for(int i = 0;i < a - 1;i++) {
        for(int j = i + 1;j < a;j++){
            if(a[i] - a[j] > max)
                max = a[i] - a[j];
        }
    }
   
    cout << max << endl;

    return 0;
}

    

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: invalid types 'int[int]' for array subscript
   18 |             if(a[i] - a[j] > max)
      |                 ^
a.cc:18:24: error: invalid types 'int[int]' for array subscript
   18 |             if(a[i] - a[j] > max)
      |                        ^
a.cc:19:24: error: invalid types 'int[int]' for array subscript
   19 |                 max = a[i] - a[j];
      |                        ^
a.cc:19:31: error: invalid types 'int[int]' for array subscript
   19 |                 max = a[i] - a[j];
      |                               ^