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

#include <iostream>
 
using namespace std;
 
int main() {
 
    int a, no[200000] = { 0 }, i, j;
    int max = -200000;
     
    cin >> a;
 
    for(i = 0;i < a;i++)
        cin >> no[i];
 
    for(i = 0;i < a - 1;i++) {
        for(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:17:17: error: invalid types 'int[int]' for array subscript
   17 |             if(a[i] - a[j] > max)
      |                 ^
a.cc:17:24: error: invalid types 'int[int]' for array subscript
   17 |             if(a[i] - a[j] > max)
      |                        ^
a.cc:18:24: error: invalid types 'int[int]' for array subscript
   18 |                 max = a[i] - a[j];
      |                        ^
a.cc:18:31: error: invalid types 'int[int]' for array subscript
   18 |                 max = a[i] - a[j];
      |                               ^
Language: C++

#include <stdio.h>
 
int main(){
   int t, m, n, nn, k, z;
   int rt[200000]
   n=0;m=-999999;
   scanf("%d\n",&t);
   for(;t-1>n;n++){
      scanf("%d\n",&rt[n]);
   }
   n=0;
   for(;t-1>n;n++){
      nn=n+1;
      k=rt[n];
      for(;t-1>nn;nn++){
         z=k-rt[nn];
         if(z > m){
            m=z;
         }
      }
   }
   printf("%d\n", m);
   return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:6:4: error: expected initializer before 'n'
    6 |    n=0;m=-999999;
      |    ^
a.cc:9:21: error: 'rt' was not declared in this scope; did you mean 't'?
    9 |       scanf("%d\n",&rt[n]);
      |                     ^~
      |                     t
a.cc:14:9: error: 'rt' was not declared in this scope; did you mean 't'?
   14 |       k=rt[n];
      |         ^~
      |         t
Language: C++

#include <iostream>
  
using namespace std;
  
int main() {
  
    int a, no[2000], i, j;
    int max = -200000;
      
    cin >> a;
  
    for(i = 0;i < a;i++)
        cin >> no[i];
  
    for(i = 0;i < a - 1;i++) {
        for(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:17:17: error: invalid types 'int[int]' for array subscript
   17 |             if(a[i] - a[j] > max)
      |                 ^
a.cc:17:24: error: invalid types 'int[int]' for array subscript
   17 |             if(a[i] - a[j] > max)
      |                        ^
a.cc:18:24: error: invalid types 'int[int]' for array subscript
   18 |                 max = a[i] - a[j];
      |                        ^
a.cc:18:31: error: invalid types 'int[int]' for array subscript
   18 |                 max = a[i] - a[j];
      |                               ^
Language: C++

#include <stdio.h>
 
int main(){
   int t, m, n, a, k, z;
   int rt[200000]={ 0 };
   n=0;m=-20000;
   scanf("%d\n",&t);
   for(;t>n;n++){
      scanf("%d\n",&rt[n]);
   }
   n=0;
   for(;t>n;n++){
      nn=n+1;
      k=rt[n];
      for(;t>a;a++){
         z=k-rt[a];
         if(z > m){
            m=z;
         }
      }
   }
   printf("%d\n", m);
   return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'nn' was not declared in this scope; did you mean 'n'?
   13 |       nn=n+1;
      |       ^~
      |       n
Language: C++

#include <iostream>
   
using namespace std;
   
int main() {
   
    int a, no[20000] = {0};
    int max = -200000, i, j;
       
    cin >> a;
   
    for(i = 0;i < a;i++)
        cin >> no[i];
   
    for(i = 0;i < a - 1;i++) {
        for(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:17:17: error: invalid types 'int[int]' for array subscript
   17 |             if(a[i] - a[j] > max) {
      |                 ^
a.cc:17:24: error: invalid types 'int[int]' for array subscript
   17 |             if(a[i] - a[j] > max) {
      |                        ^
a.cc:18:24: error: invalid types 'int[int]' for array subscript
   18 |                 max = a[i] - a[j];
      |                        ^
a.cc:18:31: error: invalid types 'int[int]' for array subscript
   18 |                 max = a[i] - a[j];
      |                               ^
Language: C++

include<stdio.h>

int main (void) {
  int r[200000], n, min, p = 0, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &r[i]);
  }

  for (i = 0; i < n; i++) {
    if (i > 0) {
      if (r[i] - min > p) {
        p = r[i] - min;
      } else if (r[i] < min) {
        min = r[i];
      }
    } else {
    min = r[i];
    }
  }
  
  printf("%d\n", p);
  
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 | if(x>max)
      |    ~^~~~
Language: C++

#include<stdio.h>
int main(void)
{
int x[200000];
int n, i, j, a, maxv=-1000000000, minv=x[0];
scanf("%d", &n);
for(i=0;i<n;i++){
scanf("%d", &x[i]);
}
for(j=1;j<n;j++){
minv=min(minv,x[i]);
maxv=max(maxv,x[i]-minv);
}
printf("%d\n", maxv);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: 'min' was not declared in this scope; did you mean 'minv'?
   11 | minv=min(minv,x[i]);
      |      ^~~
      |      minv
a.cc:12:6: error: 'max' was not declared in this scope; did you mean 'maxv'?
   12 | maxv=max(maxv,x[i]-minv);
      |      ^~~
      |      maxv
Language: C++

#include <stdio.h>

int main() {
 int n,i,j,a;
 int a[n],maxv;

 scanf ("%d", &n);
  
  for (i = 0; i < n; i++)
   scanf ("%d", &a[i]);
   
  for (i = 0; i < n-1; i++) {
   for (j = 1; j < n; j++) {
  a = a[j] -a[i];
   if (a > maxv) {
    maxv = a;
}
}
}

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:6: error: conflicting declaration 'int a [n]'
    5 |  int a[n],maxv;
      |      ^
a.cc:4:12: note: previous declaration as 'int a'
    4 |  int n,i,j,a;
      |            ^
a.cc:10:19: error: invalid types 'int[int]' for array subscript
   10 |    scanf ("%d", &a[i]);
      |                   ^
a.cc:14:8: error: invalid types 'int[int]' for array subscript
   14 |   a = a[j] -a[i];
      |        ^
a.cc:14:14: error: invalid types 'int[int]' for array subscript
   14 |   a = a[j] -a[i];
      |              ^
a.cc:21:17: error: expected primary-expression before ')' token
   21 |  printf("%d\n", );
      |                 ^
Language: C++

#include <bits\stdc++.h>
#define rep(i,o,u) for(int i = o;i <= u; i++)
using namespace std;

int main(){
	int n;
	cin >> n;
	int a[200005];
	rep(i,1,n){
		cin >> a[i];
	}
	int mn = a[1],mx = -2000000000;
	rep(i,2,n){
		mx = max(mx,a[i]-mn);
		mn = min(mn,a[i]);
	}
	cout << mx << 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 <iostream>
#include <algorithm>
using namespace std;
static const int MAX = 200000

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

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

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

  for (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:6:1: error: expected ',' or ';' before 'int'
    6 | int main(){
      | ^~~
Language: C++

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

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

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

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

  for (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:8: error: 'i' was not declared in this scope
   11 |   for (i = 0, i < n, i++) cin >> R[i];
      |        ^
a.cc:14:3: error: expected primary-expression before 'int'
   14 |   int minv = R[0];
      |   ^~~
a.cc:13:26: error: expected ')' before 'int'
   13 |   int maxv = -2000000000;
      |                          ^
      |                          )
   14 |   int minv = R[0];
      |   ~~~                     
a.cc:11:7: note: to match this '('
   11 |   for (i = 0, i < n, i++) cin >> R[i];
      |       ^
a.cc:16:8: error: 'i' was not declared in this scope
   16 |   for (i = 1, i < n, i++){
      |        ^
a.cc:21:11: error: 'maxv' was not declared in this scope
   21 |   cout << maxv << endl;
      |           ^~~~
a.cc:23:3: error: expected primary-expression before 'return'
   23 |   return 0;
      |   ^~~~~~
a.cc:21:24: error: expected ')' before 'return'
   21 |   cout << maxv << endl;
      |                        ^
      |                        )
   22 | 
   23 |   return 0;
      |   ~~~~~~                
a.cc:16:7: note: to match this '('
   16 |   for (i = 1, i < n, i++){
      |       ^
Language: C++

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

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

  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:17:35: error: expected primary-expression before '?' token
   17 |     maxv = max(maxv, R[i] - minv)???
      |                                   ^
a.cc:17:36: error: expected primary-expression before '?' token
   17 |     maxv = max(maxv, R[i] - minv)???
      |                                    ^
a.cc:18:28: error: expected primary-expression before '?' token
   18 |     minv = min(minv, R[i])???
      |                            ^
a.cc:18:29: error: expected primary-expression before '?' token
   18 |     minv = min(minv, R[i])???
      |                             ^
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
a.cc:18:30: error: expected ':' before '}' token
   18 |     minv = min(minv, R[i])???
      |                              ^
      |                              :
   19 |   }
      |   ~                           
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
a.cc:18:30: error: expected ':' before '}' token
   18 |     minv = min(minv, R[i])???
      |                              ^
      |                              :
   19 |   }
      |   ~                           
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
a.cc:18:30: error: expected ':' before '}' token
   18 |     minv = min(minv, R[i])???
      |                              ^
      |                              :
   19 |   }
      |   ~                           
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
a.cc:18:30: error: expected ':' before '}' token
   18 |     minv = min(minv, R[i])???
      |                              ^
      |                              :
   19 |   }
      |   ~                           
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
a.cc:18:30: error: expected ':' before '}' token
   18 |     minv = min(minv, R[i])???
      |                              ^
      |                              :
   19 |   }
      |   ~                           
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
a.cc:18:30: error: expected ':' before '}' token
   18 |     minv = min(minv, R[i])???
      |                              ^
      |                              :
   19 |   }
      |   ~                           
a.cc:19:3: error: expected primary-expression before '}' token
   19 |   }
      |   ^
Language: C++

#include <stdio.h>
#define n 200000

int main() {
 int n,i,j,b;
 int a[n],maxv;

 scanf ("%d", &n);
  
  for (i = 0; i < n; i++) {
   scanf ("%d", &a[i]);
}
   
  for (i = 0; i < n-1; i++) {
   for (j = 1; j < n; j++) {
  b = a[j] -a[i];
   if (b > maxv) {
    maxv = b;
}
}
}

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:11: error: expected unqualified-id before numeric constant
    2 | #define n 200000
      |           ^~~~~~
a.cc:5:6: note: in expansion of macro 'n'
    5 |  int n,i,j,b;
      |      ^
a.cc:2:11: error: lvalue required as unary '&' operand
    2 | #define n 200000
      |           ^~~~~~
a.cc:8:16: note: in expansion of macro 'n'
    8 |  scanf ("%d", &n);
      |                ^
a.cc:10:8: error: 'i' was not declared in this scope
   10 |   for (i = 0; i < n; i++) {
      |        ^
a.cc:14:8: error: 'i' was not declared in this scope
   14 |   for (i = 0; i < n-1; i++) {
      |        ^
a.cc:15:9: error: 'j' was not declared in this scope
   15 |    for (j = 1; j < n; j++) {
      |         ^
a.cc:16:3: error: 'b' was not declared in this scope
   16 |   b = a[j] -a[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:25:2: error: expected class-name at end of input
   25 | ~
      |  ^
Language: C++

int GetMaxProfit(int R[], int N) {
    int max, min;
    min = R[0];
    max = R[1] - R[0];
    for (int i = 1; i < N; ++i) {
        max = std::max(R[i] - min, max);
        min = std::min(R[i], min);
    }
    return max;
}

int main() {
    int N;
    int R[200000];

    scanf("%d", &N);
    for (int i = 0; i < N; ++i) {
        scanf("%d", &R[i]);
    }

    int result = GetMaxProfit(R, N);
    printf("%d\n", result);

    return 0;
}

Compiler output:
a.cc: In function 'int GetMaxProfit(int*, int)':
a.cc:6:20: error: 'max' is not a member of 'std'
    6 |         max = std::max(R[i] - min, max);
      |                    ^~~
a.cc:7:20: error: 'min' is not a member of 'std'
    7 |         min = std::min(R[i], min);
      |                    ^~~
a.cc: In function 'int main()':
a.cc:16:5: error: 'scanf' was not declared in this scope
   16 |     scanf("%d", &N);
      |     ^~~~~
a.cc:22:5: error: 'printf' was not declared in this scope
   22 |     printf("%d\n", result);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int GetMaxProfit(int R[], int N) {
Language: C++

#include <stdio.h>

int main()
{
   int n, i, x, y, min2, max=1, min=1000*1000*1000;

   scanf("%d",&n);

   for(i=0; i<n; i++){
   scanf("%d",&x);
   if(min>x) {min2=min; min=x;}
   if(min<x && max<x) {max=x; y=min}
   if(max==1 && i+1==n) {max=min; y=min2;}
   }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:36: error: expected ';' before '}' token
   12 |    if(min<x && max<x) {max=x; y=min}
      |                                    ^
      |                                    ;
Language: C++

#include <stdio.h>
  
int main(){
   int t, m, n, x, y, k, z;
   int rt[200000]={ 0 };
 
   scanf("%d",&t);
   for(n=0;t>n;n++){
      scanf("%d",&rt[n]);
   }
  x=0
   for(n=0;t-1>n;n++){
      x = n+1;
      k = rt[n];
      for(;t>x;x++){
         z = rt[x]-k;
         if(x == 0){
            m = z;
            x = 1;
         if(z > m){
            m = z;
         }
      }
   }
 
   printf("%d\n", m);
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: expected ';' before 'for'
   11 |   x=0
      |      ^
      |      ;
   12 |    for(n=0;t-1>n;n++){
      |    ~~~
a.cc:12:21: error: expected ';' before ')' token
   12 |    for(n=0;t-1>n;n++){
      |                     ^
      |                     ;
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <stdio.h>
  
int main(){
   int t, m, n, x, y, k, z;
   int rt[200000]={ 0 };
 
   scanf("%d",&t);
   for(n=0;t>n;n++){
      scanf("%d",&rt[n]);
   }
  x=0
   for(n=0;t-1>n;n++){
      x = n+1;
      k = rt[n];
      for(;t>x;x++){
         z = rt[x]-k;
         if(x == 0){
            m = z;
            x = 1;
         }
         if(z > m){
            m = z;
         }
      }
   }
 
   printf("%d\n", m);
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: expected ';' before 'for'
   11 |   x=0
      |      ^
      |      ;
   12 |    for(n=0;t-1>n;n++){
      |    ~~~
a.cc:12:21: error: expected ';' before ')' token
   12 |    for(n=0;t-1>n;n++){
      |                     ^
      |                     ;
Language: C++

#include <stdio.h>
  
int main(){
   int t, m, n, x, y, k, z;
   int rt[200000]={ 0 };
 
   scanf("%d",&t);
   for(n=0;t>n;n++){
      scanf("%d",&rt[n]);
   }
  x=0;
   for(n=0;t-1>n;n++){
      x = n+1;
      k = rt[n];
      for(;t>x;x++){
         z = rt[x]-k;
         if(x == 0){
            m = z;
            x = 1;
         }
         if(z > m){
            m = z;
         }
      }
   }

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: expected '}' at end of input
   25 |    }
      |     ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <stdio.h>
  
int main(){
   int t, m, n, x, y, k, z;
   int rt[200000]={ 0 };
 
   scanf("%d",&t);
   for(n=0;t>n;n++){
      scanf("%d",&rt[n]);
   }
  x=0;
   for(n=0;t-1>n;n++){
      x = n+1;
      k = rt[n];
      for(;t>x;x++){
         z = rt[x]-k;
         if(x == 0){
            m = z;
            x = 1;
         }
         if(z > m){
            m = z;
         }
      }
 
   printf("%d\n", m);
   return 0;
}

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

#include <iostream>
using namespace std;

static const int MAX_COUNT = 20000;

void main()
{
	int n;
	int R[MAX_COUNT];
	
	cin >> n;

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

	int max = R[1] - R[0];
	int min = R[0];

	for (int i = 2; i < n; i++)
	{
		if (max < R[i] - min)
			max = R[i] - min;

		if (min > R[i])
			min = R[i];
	}

	cout << max << endl;

	return;
}

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

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

static const int MAX_COUNT = 200000;

void main()
{
	int n;
	int R[MAX_COUNT];
	
	cin >> n;

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

	int max = R[1] - R[0];
	int min = R[0];

	for (int i = 1; i < n; i++)
	{
		if (max < R[i] - min)
			max = R[i] - min;

		if (min > R[i])
			min = R[i];
	}

	cout << max << endl;

	return 0;
}

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

#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
const int N =200000+5;
int a[N];
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    long long maxv=-2e9;
    long long  minv=a[0];
    for(int i=1;i<n;i++)
    {
        maxv=max(maxv,a[i]-minv);
        minv=min(minv,a[i]);
    }
    cout<<maxv<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: no matching function for call to 'min(long long int&, int&)'
   18 |         minv=min(minv,a[i]);
      |              ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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:18:17: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   18 |         minv=min(minv,a[i]);
      |              ~~~^~~~~~~~~~~
/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,
                 from a.cc:3:
/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:18:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   18 |         minv=min(minv,a[i]);
      |              ~~~^~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>

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

  int max = INT_MIN;
  for(int i = 0; i<n; ++i){
    for(int j = i; j<n; ++j){
      int r = vec[j] - vec[i];
      if(max<r){
	max = r;
      }
    }
  }
  std::cout << max << std::endl;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:12:13: error: 'INT_MIN' was not declared in this scope
   12 |   int max = 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 <iostream>
void int main(int argc, char const *argv[]) {
  /* code */
  int values[10000];
  int  a;
  int i=0;
  while(cin>>values[i]){
   cout << values[i++] << flush;

  }
  return 0;
}

Compiler output:
a.cc:2:1: error: two or more data types in declaration of 'main'
    2 | void int main(int argc, char const *argv[]) {
      | ^~~~
Language: C++

#include <iostream>
int main(int argc, char const *argv[]) {
  /* code */
  int values[10000];
  int  a;
  int i=0;
  while(cin>>values[i]){
   cout << values[i++] << flush;

  }
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   while(cin>>values[i]){
      |         ^~~
      |         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:8:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |    cout << values[i++] << flush;
      |    ^~~~
      |    std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:8:27: error: 'flush' was not declared in this scope; did you mean 'std::flush'?
    8 |    cout << values[i++] << flush;
      |                           ^~~~~
      |                           std::flush
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:766:5: note: 'std::flush' declared here
  766 |     flush(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~~
Language: C++

#include<iostream>
#include<algorihm>
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 = -200000000;
  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:2:9: fatal error: algorihm: No such file or directory
    2 | #include<algorihm>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>

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 = -200000000;
  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:9: error: reference to 'max' is ambiguous
    7 |   int R[max], n;
      |         ^~~
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:18: note:                 'const int max'
    4 | static const int max = 200000;
      |                  ^~~
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:14: error: 'R' was not declared in this scope
   13 |   int minv = R[0];
      |              ^
a.cc:16:12: error: reference to 'max' is ambiguous
   16 |     maxv = max(maxv, R[i] - minv);
      |            ^~~
/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:18: note:                 'const int max'
    4 | static const int max = 200000;
      |                  ^~~
Language: C++

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

using namespace std;

int main()
{
	string str;
	getline(cin, str);
	int num;
	stringstream num_ss(str);
	num_ss >> num;

	int counter = 0;
	int* ary = new int[num];
	for (int i = 0; i < num; i++) {
		getline(cin, str);
		stringstream tmp_ss(str);
		tmp_ss >> ary[i];
	}
	
	cout << getMaxProfit(ary, num) << endl;
	return 0;
}


int getMaxProfit(int* ary, int ary_size) {
	int max_prf = ary[1] - ary[0];
	for (int i = 2; i < ary_size; i++) {
		for (int j = 0; j < i; j++) {
			int tmp = ary[i] - ary[j];
			if (tmp > max_prf) {
				max_prf = tmp;
			}
		}
	}
	return max_prf;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: 'getMaxProfit' was not declared in this scope
   23 |         cout << getMaxProfit(ary, num) << endl;
      |                 ^~~~~~~~~~~~
Language: C++

n = int(input())
stack = []
for _ in range(n):
    stack.append(int(input()))
length = len(stack)

candidate = [-float('inf')]
for i in range(1, length // 2 + 1):
    for r1, r2 in zip(stack[::1], stack[i::1]):
        if r2 - r1 > candidate[0]:
            candidate.append(r2 - r1)
    if i - length != i:
        for r1, r2 in zip(stack[::1], stack[length - i::1]):
            if r2 - r1 > candidate[0]:
                candidate.append(r2 - r1)
    candidate = [max(candidate)]

print(candidate[0])

Compiler output:
a.cc:7:21: warning: multi-character character constant [-Wmultichar]
    7 | candidate = [-float('inf')]
      |                     ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include <iostream>
#define MAX_N 200000
using namespace std;

int main(void) {
	int n;
	int profits[MAX_N+1];

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

	int _max = -2000000000;
	int _min = profits[0];
	for(int i = 1; i < n; i++) {
		_max = max(_max, profits[i] - _min);
		_min = min(_min, profits[i];
	}

	cout << _max << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:44: error: expected ')' before ';' token
   18 |                 _min = min(_min, profits[i];
      |                           ~                ^
      |                                            )
Language: C++

#include<iostream>
#include<cstdio>

using namespace std;

const int MAX_N = 200000;

int R[MAX_N];

int main()
{
	int n;
	int max = -1000000000;
	cin >> n;
	for(int i=0;i<n;i++){
		scanf("%d",&R[i]);
	}
	minr = R[0];
	for(int i=1;i<n;i++){
		if(max < R[i] - minr){
			max = R[i]-minr;
		}
		if(R[i] < minr){
			minr = R[i];
		}
	}
	cout << max << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'minr' was not declared in this scope
   18 |         minr = R[0];
      |         ^~~~
Language: C++

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

int main{
int R[MAX],n;

cin >> n;
for(int i=0;i<n;i++){

int maxv=-20000000000;
int manv=min(minv,R[i]);
}

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

Compiler output:
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main{
      |     ^~~~
a.cc:6:1: error: expected primary-expression before 'int'
    6 | int R[MAX],n;
      | ^~~
a.cc:6:1: error: expected '}' before 'int'
a.cc:5:9: note: to match this '{'
    5 | int main{
      |         ^
a.cc:8:1: error: 'cin' does not name a type
    8 | cin >> n;
      | ^~~
a.cc:9:1: error: expected unqualified-id before 'for'
    9 | for(int i=0;i<n;i++){
      | ^~~
a.cc:9:13: error: 'i' does not name a type
    9 | for(int i=0;i<n;i++){
      |             ^
a.cc:9:17: error: 'i' does not name a type
    9 | for(int i=0;i<n;i++){
      |                 ^
a.cc:15:1: error: 'cout' does not name a type
   15 | cout << maxv << endl;
      | ^~~~
a.cc:16:1: error: expected unqualified-id before 'return'
   16 | return 0;
      | ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
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:8:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 | cin >> n;
      | ^~~
      | std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:15:6: error: 'max' was not declared in this scope; did you mean 'std::max'?
   15 | 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:16:6: error: 'min' was not declared in this scope; did you mean 'std::min'?
   16 | 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:19:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 | cout << maxv << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 | cout << maxv << endl;
      |                 ^~~~
      |                 std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

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 = -2000000000, minv = R[0];
    for(int i=1 i<n; i++){
        if(maxv < R[i] - minv) maxv = R[i] - minv;
        if(minv > R[i]) minv = R[i];
    }
    
    cout << maxv << endl;
    return 0;
    
}

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

#include <iostream>

int main()
{
	int n;
	std::cin >> n;
	int base = INT_MAX;
	int input;
	int maxProfit = INT_MIN;
	for (int i = 0; i < n; i++)
	{
		std::cin >> input;
		if (input - base > maxProfit)
		{
			maxProfit = input - base;
		}
		if (input < base)
		{
			base = input;
		}
	}
	std::cout << maxProfit << std::endl;
}

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

#include <iostream>

int main()
{
	int n;

	int inputMaximum = (int)std::pow(10, 9);

	std::cin >> n;
	int minimumValue = inputMaximum + 1;
	int nextValue;
	int maxProfit = -inputMaximum - 1;

	for (int i = 0; i < n; i++)
	{
		std::cin >> nextValue;
		if (i >= 1 && nextValue - minimumValue > maxProfit)//????????´??°
		{
			maxProfit = nextValue - minimumValue;
		}
		if (nextValue < minimumValue)//????°??????´??°
		{
			minimumValue = nextValue;
		}
	}
	std::cout << maxProfit << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:38: error: 'pow' is not a member of 'std'
    7 |         int inputMaximum = (int)std::pow(10, 9);
      |                                      ^~~
Language: C++

#include <iostream>
#include <algorithm>

using namaspace std;

static count int MAX=200000;

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

  cin >>n;
  for(int i=1;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:4:7: error: expected nested-name-specifier before 'namaspace'
    4 | using namaspace std;
      |       ^~~~~~~~~
a.cc:6:8: error: 'count' does not name a type
    6 | static count int MAX=200000;
      |        ^~~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'MAX' was not declared in this scope
    9 |   int R[MAX],n;
      |         ^~~
a.cc:11:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   11 |   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:13:11: error: 'R' was not declared in this scope
   13 |     cin >>R[i];
      |           ^
a.cc:16:12: error: 'R' was not declared in this scope
   16 |   int minv=R[0];
      |            ^
a.cc:19:10: error: 'max' was not declared in this scope; did you mean 'std::max'?
   19 |     maxv=max(maxv,R[i]-minv);
      |          ^~~
      |          std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:20:10: error: 'min' was not declared in this scope; did you mean 'std::min'?
   20 |     minv=min(minv,R[i]);
      |          ^~~
      |          std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:23:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |   cout << maxv <<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:23:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |   cout << maxv <<endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

  int max = Rt[1] - Rt[0];

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


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

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'scanf' was not declared in this scope
    3 |   scanf("%d",&n);
      |   ^~~~~
a.cc:24:3: error: 'printf' was not declared in this scope
   24 |   printf("%d", max);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main() {
Language: C++

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

int main() {
  int n;
  scanf("%d",&n);
  int Rt[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &Rt[i]);
  }
 
  int max = Rt[1] - Rt[0];
 
  for (int j = 1; j < n; j++) {
    int min = Rt[0];
    for (int i = 1; i < j; i++) {
      if (Rt[i] < min) {
        min = Rt[i];
      }
    }
    if (Rt[j] - min > max) {
      max = Rt[j] - min;
    }
  }
 
 
  printf("%d", max);
  return 0;
}

Compiler output:
a.cc:3:16: error: expected identifier before ':' token
    3 | using namespace:std;
      |                ^
a.cc:3:16: error: expected ';' before ':' token
    3 | using namespace:std;
      |                ^
      |                ;
a.cc:3:16: error: expected unqualified-id before ':' token
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;

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

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


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

Compiler output:
a.cc:3:2: error: stray '\20' in program
    3 | u<U+0010>sing namespace std;
      |  ^~~~~~~~
a.cc:3:1: error: 'u' does not name a type
    3 | using namespace std;
      | ^
a.cc: In function 'int main()':
a.cc:17:12: error: 'min' was not declared in this scope; did you mean 'std::min'?
   17 |     minv = min(minv, Rt[j-1]);
      |            ^~~
      |            std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:18:12: error: 'max' was not declared in this scope; did you mean 'std::max'?
   18 |     maxv = max(maxv, Rt[j] - minv);
      |            ^~~
      |            std::max
/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: At global scope:
a.cc:23:9: error: expected constructor, destructor, or type conversion before '(' token
   23 |   printf("%d\n", max);
      |         ^
a.cc:24:3: error: expected unqualified-id before 'return'
   24 |   return 0;
      |   ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#define INPUT_FROM_FILE (0)

#if INPUT_FROM_FILE
#include <fstream>
#endif


int main(int argc, char **argv) {
#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif
	int n = 0;
	int max_v = INT_MIN;
	int min_v = INT_MAX;


#if INPUT_FROM_FILE
	ifs >> n;
#else
	std::cin >> n;
#endif

#if INPUT_FROM_FILE
	ifs >> min_v;
#else
	std::cin >> min_v;
#endif

	for(int i = 1; i < n; i++){
		int num = 0;
#if INPUT_FROM_FILE
		ifs >> num;
#else
		std::cin >> num;
#endif
		max_v = std::max(max_v, num - min_v);
		min_v = std::min(min_v, num);
	}

	std::cout << max_v << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:16:21: error: 'INT_MIN' was not declared in this scope
   16 |         int max_v = INT_MIN;
      |                     ^~~~~~~
a.cc:4:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 | #define INPUT_FROM_FILE (0)
a.cc:17:21: error: 'INT_MAX' was not declared in this scope
   17 |         int min_v = INT_MAX;
      |                     ^~~~~~~
a.cc:17:21: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <limits>
#define INPUT_FROM_FILE (0)

#if INPUT_FROM_FILE
#include <fstream>
#endif


int main(int argc, char **argv) {
#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif
	int n = 0;
	int max_v = INT_MIN;
	int min_v = INT_MAX;


#if INPUT_FROM_FILE
	ifs >> n;
#else
	std::cin >> n;
#endif

#if INPUT_FROM_FILE
	ifs >> min_v;
#else
	std::cin >> min_v;
#endif

	for(int i = 1; i < n; i++){
		int num = 0;
#if INPUT_FROM_FILE
		ifs >> num;
#else
		std::cin >> num;
#endif
		max_v = std::max(max_v, num - min_v);
		min_v = std::min(min_v, num);
	}

	std::cout << max_v << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:17:21: error: 'INT_MIN' was not declared in this scope
   17 |         int max_v = INT_MIN;
      |                     ^~~~~~~
a.cc:5:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <limits>
  +++ |+#include <climits>
    5 | #define INPUT_FROM_FILE (0)
a.cc:18:21: error: 'INT_MAX' was not declared in this scope
   18 |         int min_v = INT_MAX;
      |                     ^~~~~~~
a.cc:18:21: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

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

using namespace std;

int main()
{
	int val = 0;
	cin >> val;
	int minVal = INT_MAX;
	int maxPro = INT_MIN;
	while (cin >> val)
	{
		minVal = std::min(minVal, val);
		maxPro = std::max(maxPro, val - minVal);
	}
	cout << maxPro << endl;
	return 0;
}

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

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

using namespace std;

int main()
{
	int val = 0;
	cin >> val;
	int minVal = INT_MAX;
	int maxPro = INT_MIN;
	while (cin >> val)
	{
		minVal = std::min(minVal, val);
		maxPro = std::max(maxPro, val - minVal);
	}
	cout << maxPro << endl;
	return 0;
}

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

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

using namespace std;

int main()
{
	int val = 0;
	cin >> val;
	int minVal = INT_MAX;
	int maxPro = -1;
	cin >> minVal;
	while (cin >> val)
	{
		maxPro = std::max(maxPro, val - minVal);
		minVal = std::min(minVal, val);
	}
	cout << maxPro << endl;
	return 0;
}

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

#include <algorithm>
#include <limits>

#define INT_MAX 2147483647
#define INT_MIN -2147483647
using namespace std;

int main()
{
	int maxProf = -2000000000;
	int minVal = 0;
	cin >> minVal;
	int val = 0;
	while (cin >> val)
	{
		maxProf = std::max(maxProf, val - minVal);
		minVal = std::min(minVal, val);
	}
	cout << maxProf << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'cin' was not declared in this scope
   12 |         cin >> minVal;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <limits>
  +++ |+#include <iostream>
    3 | 
a.cc:19:9: error: 'cout' was not declared in this scope
   19 |         cout << maxProf << endl;
      |         ^~~~
a.cc:19:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:28: error: 'endl' was not declared in this scope
   19 |         cout << maxProf << endl;
      |                            ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <limits>
  +++ |+#include <ostream>
    3 |