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

#include <iostream>
using namespace std;

bool IsPrime(int x) {
  return true;  /* ダミー: 全て素数と判定 */
}

int main(void){
   int count = 0, n;
   cin >> n; /* n個整数を読む */
   for(int i = 0; i < n; i++) {
       int p;
       cin >> p;
       if(IsPrime(p)) {
         bool IsPrime(int n) {
    for(int i = 2; i*i <= n; i++) {
        if(n % i == 0) {
            return false;
        }
    }
    return true;
}

 /* ここは自分で埋める */
       }
   }
   cout << count << endl;
   return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:15:30: error: a function-definition is not allowed here before '{' token
   15 |          bool IsPrime(int n) {
      |                              ^
Language: C++

#include <iostream>using namespace std;
// エラトステネスの篩//
 bool primes[100000000] = {true};bool IsPrime(int n) {  
int count = 0;  
for(int i=1;i<=n;i++){      
if(n % i == 0) {       
   count++;      }    
  if(count > 2){       
   return false;    
  } 
 } 
 return (count == 2);}int main(void){   
 int count = 0;  
  int n;  
  cin >> n;   
 for(int i = 0; i < n; i++) {    
    int p;       
 cin >> p;        
if(IsPrime(p)) {    
        count++;    
    }   
 }   
 cout << count << endl; 
   return 0;


Compiler output:
a.cc:1:26: warning: extra tokens at end of #include directive
    1 | #include <iostream>using namespace std;
      |                          ^~~~~~~~~
a.cc:1:10: fatal error: iostream>usin: No such file or directory
    1 | #include <iostream>using namespace std;
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;

bool IsPrime(int x) {
  return true;  /* ダミー: 全て素数と判定 */
}

int main(void){
   int count = 0, n;
   cin >> n; /* n個整数を読む */
   for(int i = 0; i < n; i++) {
       int p;
       cin >> p;
       if(IsPrime(p)) {
         bool IsPrime(int n) {
    for(int i = 2; i*i <= n; i++) {
        if(n % i == 0) {
            return false;
        }
    }
    return true;
}

 /* ここは自分で埋める */
       }
   }
   cout << count << endl;
   return 0;
}
}




Compiler output:
a.cc: In function 'int main()':
a.cc:15:30: error: a function-definition is not allowed here before '{' token
   15 |          bool IsPrime(int n) {
      |                              ^
a.cc: At global scope:
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include <iostream>using namespace std;

 bool primes[100000000] = {true};
bool IsPrime(int n) {  
int count = 0;  
for(int i=1;i<=n;i++){      
if(n % i == 0) {       
   count++;  
    }    
  if(count > 2){       
   return false;    
  } 
 } 
 return (count == 2);}int main(void){   
 int count = 0;  
  int n;  
  cin >> n;   
 for(int i = 0; i < n; i++) {    
    int p;       
 cin >> p;        
if(IsPrime(p)) {    
        count++;    
    }   
 }   
 cout << count << endl; 
   return 0;


Compiler output:
a.cc:1:26: warning: extra tokens at end of #include directive
    1 | #include <iostream>using namespace std;
      |                          ^~~~~~~~~
a.cc:1:10: fatal error: iostream>usin: No such file or directory
    1 | #include <iostream>using namespace std;
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;

 bool primes[100000000] = {true};
bool IsPrime(int n) {  
int count = 0;  
for(int i=1;i<=n;i++){      
if(n % i == 0) {       
   count++;  
    }    
  if(count > 2){       
   return false;    
  } 
 } 
 return (count == 2);}int main(void){   
 int count = 0;  
  int n;  
  cin >> n;   
 for(int i = 0; i < n; i++) {    
    int p;       
 cin >> p;        
if(IsPrime(p)) {    
        count++;    
    }   
 }   
 cout << count << endl; 
   return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: expected '}' at end of input
   27 |    return 0;
      |             ^
a.cc:15:37: note: to match this '{'
   15 |  return (count == 2);}int main(void){
      |                                     ^
Language: C++

#include <iostream>
using namespace std;

 bool primes[100000000] = {true};
bool IsPrime(int n) {  
int count = 0;  
for(int i=1;i<=n;i++){      
if(n % i == 0) {       
   count++;  
    }    
  if(count > 2){       
   return false;    
  } 
 } 
 return (count == 2);
  }

int main(void){   
 int count = 0;  
  int n;  
  cin >> n;   
 for(int i = 0; i < n; i++) {    
    int p;       
 cin >> p;        
if(IsPrime(p)) {    
        count++;    
    }   
 }   
 cout << count << endl; 
   return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:30:13: error: expected '}' at end of input
   30 |    return 0;
      |             ^
a.cc:18:15: note: to match this '{'
   18 | int main(void){
      |               ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
using namespace std;

bool judge(int n){
    if(n<=1){return false;}
    for(int i=2;i*i<=n;i++){
        if(n%i==0){return false;}
    }
    return true;
}


int main(){
    int n,a;
    cin>>n;
    int count=0;
    for(int i=0;i<n;i++){
        cin>>a;
        if(judge a){count++;}
    }
    

    cout<<count<<endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: expected ')' before 'a'
   28 |         if(judge a){count++;}
      |           ~     ^~
      |                 )
Language: C++


#include<bits/stdc++.h>

using namespace std;

int isprime(int x)
{
    if(x<2){
        return 0;
    }else if(x==2){
        return 1;
    }
    if(x%2==0){
        return 0;
    }
    int temp=(ceil)sqrt(x);
    for(int i=3;i<=temp;i+=2){
        if(x%i==0){
            return 0;
        }
    }
    return 1;
}

int main()
{
    int n,x,cnt=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&x);
        if(isprime(x)){
            cnt++;
        }
    }
    printf("%d\n",cnt);
    return 0;
}
/*
6
2
3
4
5
6
7
*/


Compiler output:
a.cc: In function 'int isprime(int)':
a.cc:16:19: error: cannot resolve overloaded function 'ceil' based on conversion to type 'int'
   16 |     int temp=(ceil)sqrt(x);
      |                   ^
Language: C++

#include<stdio.h>
#include<math.h>

int isPrime(int x){
  if(x==2){
    return true;
  }
  if(x<2 || x%2==0){
    return false;
  }

  int i=3;
  while(i<=sqrt(x)){
    if(x%i==0){
      return false;
    }
    i = i+2;
  }

  return true;
}

int main(){
  int n;
  scanf("%d",&n);

  int N[n];
  int c=0;
  for(int i=0;i<n;i++){
    cin >> N[i];
    if(isPrime(N[i])){
      c++;
    }
  }
  printf("%d\n",c);

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'cin' was not declared in this scope; did you mean 'sin'?
   30 |     cin >> N[i];
      |     ^~~
      |     sin
Language: C++

#include <iostream>
#include <cassert>

#define MAX_N (100000000)

bool ptable[MAX_N];

void init_ptable()
{
    memset(ptable, false, MAX_N * sizeof(bool));

    ptable[0] = true;
    int base = 2;

    while (base <= MAX_N / 2) {
        //std::cout << "base: " << base << std::endl;
        for (int cur = base * 2; cur <= MAX_N; cur += base) {
            assert(1 <= cur && cur <= MAX_N);
            ptable[cur - 1] = true;
        }
        ++base;
        while (ptable[base - 1] == true) ++base;
    }
    return;
}

void dump_ptable()
{
    for (int i = 0; i < MAX_N; i++) {
        std::cout << ptable[i];
    }
    return;
}

int main(void)
{
    int N;
    std::cin >> N;
    int *a;
    a = new int[N];
    for (int i = 0; i < N; i++) {
        std::cin >> a[i];
    }
    //std::cout << "input success" << std::endl;

    init_ptable();
    //dump_ptable();

    //std::cout << "ptable scan success" << std::endl;
    int num_of_prime = 0;
    for (int i = 0; i < N; i++) {
        if (ptable[a[i] - 1] == false) ++num_of_prime;
    }
    
    //std::cout << "ptable check success" << std::endl;
    std::cout << num_of_prime << std::endl;

    return 0;
}



Compiler output:
a.cc: In function 'void init_ptable()':
a.cc:10:5: error: 'memset' was not declared in this scope
   10 |     memset(ptable, false, MAX_N * sizeof(bool));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cassert>
  +++ |+#include <cstring>
    3 |
Language: C++

#include <iostream>
#include <cassert>

#define MAX_N (100000000)

bool ptable[MAX_N];

void init_ptable()
{
    memset(ptable, false, MAX_N * sizeof(bool));

    ptable[0] = true;
    int base = 2;

    while (base <= MAX_N / 2) {
        //std::cout << "base: " << base << std::endl;
        for (int cur = base * 2; cur <= MAX_N; cur += base) {
            assert(1 <= cur && cur <= MAX_N);
            ptable[cur - 1] = true;
        }
        ++base;
        while (ptable[base - 1] == true) ++base;
    }
    return;
}

bool is_prime(int n)
{
    for (int i = 2; i * i <= n; i++) {
        if (n % i == 0)
            return false;
    }
    return true;
}


void dump_ptable()
{
    for (int i = 0; i < MAX_N; i++) {
        std::cout << ptable[i];
    }
    return;
}

int main(void)
{
    int N;
    std::cin >> N;
    int *a;
    a = new int[N];
    for (int i = 0; i < N; i++) {
        std::cin >> a[i];
    }
    //std::cout << "input success" << std::endl;

    //init_ptable();
    //dump_ptable();

    //std::cout << "ptable scan success" << std::endl;
    int num_of_prime = 0;
    for (int i = 0; i < N; i++) {
        //if (ptable[a[i] - 1] == false) ++num_of_prime;
        if (is_prime(a[i])) ++num_of_prime;
    }
    
    //std::cout << "ptable check success" << std::endl;
    std::cout << num_of_prime << std::endl;

    return 0;
}



Compiler output:
a.cc: In function 'void init_ptable()':
a.cc:10:5: error: 'memset' was not declared in this scope
   10 |     memset(ptable, false, MAX_N * sizeof(bool));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cassert>
  +++ |+#include <cstring>
    3 |
Language: C++

#include <stdio.h>
#include <stdbool.h>
#define N 10000

bool isPrime(int n){
  int i;

  if(n == 2) return true;

  if(n < 2 || n%2 == 0) return false;

  i = 3;
  while(i <= sqrt(n)){
    if(n%i == 0) return false;
    i = i+2;
  }

  return true;
}

int main(){
  int num[N];
  int i,n,p=0;

  scanf("%d",&n);

  for(i = 0; i < n; i++) scanf("%d",&num[i]);

  for(i = 0; i < n; i++){
    if(isPrime(num[i]) == true) p++;
    else continue;
  }

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

  return 0;
}




Compiler output:
a.cc: In function 'bool isPrime(int)':
a.cc:13:14: error: 'sqrt' was not declared in this scope
   13 |   while(i <= sqrt(n)){
      |              ^~~~
Language: C++

#include<stdio.h>
#include<math.h>
int main(){
  int n=0,i=0;
  int num[10000];
  int count=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&num[i]);
  }
  for(i=0;i<n;i++){
    if(Sosu(num[i])==2){
      count++;
    }
  }
  printf("%d\n",count);
  return 0;
}
int Sosu(int x){
  int i=0;
  if(x==2)return 2;
  if(x%2==0||x<2)return 1;
  
  for(i=3;i<=sqrt((double)x);i+=2){
    if(x%i==0)return 1;
  }
  return 2;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: 'Sosu' was not declared in this scope
   12 |     if(Sosu(num[i])==2){
      |        ^~~~
Language: C++

#include <iostream>
#include <vector>

int isPrime(int n);
//returns 1 instead of true
//also 0 - false

int main(){
    using namespace std;
    int n;
    arrcin >> n;

    arrvector<int> vec(n);
    for(auto& e : vec){
        arrcin >> e;
    }

    int numOfPrime = 0;
    for(const auto& e : vec){
        numOfPrime += isPrime(e);
    }

    arrcout << numOfPrime << '\n';
}

int isPrime(int n){
    if(n == 2){
        return 1;
    }

    if(!(n % 2)){
        return 0;
    }

    for(int div = 2; div < n / 2; ++div){
        if(!(n % div)){
            return 0;
        }
    }
    return 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'arrcin' was not declared in this scope
   11 |     arrcin >> n;
      |     ^~~~~~
a.cc:13:5: error: 'arrvector' was not declared in this scope
   13 |     arrvector<int> vec(n);
      |     ^~~~~~~~~
a.cc:13:15: error: expected primary-expression before 'int'
   13 |     arrvector<int> vec(n);
      |               ^~~
a.cc:14:19: error: 'vec' was not declared in this scope
   14 |     for(auto& e : vec){
      |                   ^~~
a.cc:19:25: error: 'vec' was not declared in this scope
   19 |     for(const auto& e : vec){
      |                         ^~~
a.cc:23:5: error: 'arrcout' was not declared in this scope
   23 |     arrcout << numOfPrime << '\n';
      |     ^~~~~~~
Language: C++

#include <stdio.h>
double main(){
  int A[10000],j;
  int i,count=0,a;

  scanf("%d",&i);
  for(a=0;a<i;a++)
       scanf("%d",&A[a]);

  for(a=0;a<i+1;a++){
       for(j=2;j<A[a];j++){
         if(A[a]%j==0) {
           count++;
           printf("%d\n",A[a]);
           break;
         }
       }
    }

  printf("%d\n",i-count);

  return 0;
}



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

#include <stdio.h>
double main(){
  int A[10000],j;
  int i,count=0,a;

  scanf("%d",&i);
  for(a=0;a<i;a++)
       scanf("%d",&A[a]);

  for(a=0;a<i+1;a++){
       for(j=2;j<A[a];j++){
         if(A[a]%j==0) {
           count++;
           break;
         }
       }
    }

  printf("%d\n",i-count);

  return 0;
}



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

include <stdio.h>
int main(){
  int A[10000],j;
  int i,count=0,a;

  scanf("%d",&i);
  for(a=0;a<i;a++)
       scanf("%d",&A[a]);

  for(a=0;a<i+1;a++){
       for(j=2;j<A[a];j++){
         if(A[i]==2)continue;
         if(A[a]%j==0) {
           count++;
           printf("%d\n",A[a]);
           break;
         }
       }
    }

  printf("%d\n",i-count);

  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(){
  int A[10000],j;
  int i,count=0,a;

  scanf("%d",&i);
  for(a=0;a<i;a++)
       scanf("%d",&A[a]);

  for(a=0;a<i;a++){
       for(j=2;j<sqrt(A[a]);j++){
         if(A[j]%2==0)break;
         if(A[j]%j==0) {
           count++;
           break;
         }
       }
    }

  printf("%d\n",i-count);

  return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: 'sqrt' was not declared in this scope
   11 |        for(j=2;j<sqrt(A[a]);j++){
      |                  ^~~~
Language: C++

#include <stdio.h>
#include <math.h>

int isPrime(int x){
	int i;
	
	if ( x == 1) return 0;
	else if ( x == 2 ) return 1;
	if ( x%2 == 0 ) return 0;
	for ( i = 3; i * i <= x; i+= 2){
		if( x%i == 0 ) return 0;
	}
	return 1;
}

int main(){
	int n,, m, cnt = 0;
	int i;
	
	scanf("%d", &n);
	for ( int i = 0; i < n; i++){
		scanf("%d , &m");
		if ( isPrime(m) == 1){
			cut++;
		}
	}
	printf( "%d\n",cut);
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: expected unqualified-id before ',' token
   17 |         int n,, m, cnt = 0;
      |               ^
a.cc:24:25: error: 'cut' was not declared in this scope; did you mean 'cnt'?
   24 |                         cut++;
      |                         ^~~
      |                         cnt
a.cc:27:24: error: 'cut' was not declared in this scope; did you mean 'cnt'?
   27 |         printf( "%d\n",cut);
      |                        ^~~
      |                        cnt
Language: C++

#include <stdio.h>

int main() {
  int a[100000] = {};
  int b[100000] = {};
  int k = 0;
  int n;
  int count = 0;
  scanf("%d", &n);
  for(int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }

  for(int i = 0; i < n; i++) {
    for(int j = 1; j <= a[i]; j++)
      if(a[i] / j = 0) count++;
    if(count == 2) {
      b[k] = a[i];
      k++;
    }
    count = 0;
  }

  for(int i = 0; i < k; i++) {
    printf("%d", b[i]);
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: lvalue required as left operand of assignment
   16 |       if(a[i] / j = 0) count++;
      |          ~~~~~^~~
Language: C++

#include <stdio.h>

int main() {
  int a[100000] = {};
  int b[100000] = {};
  int k = 0;
  int n;
  int count = 0;
  scanf("%d", &n);
  for(int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }

  for(i = 0; i < n; i++) {
    for(int j = 1; j <= a[i]; j++)
      if(a[i] % j == 0) count++;
    if(count == 2) {
      b[k] = a[i];
      k++;
    }
    count = 0;
  }

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


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

#include <iostream>
#include <algorithm>
 
using namespace std;
 
bool setPrime ( int size, bool isPrime[] )
{
  isPrime[0] = isPrime[1] = false;

  for (int i = 2; i < size; ++i)
  {
    isPrime[i] = true;
  }

  for (int i = 2; (i*i) < size; ++i)
  {
    if (!isPrime[i]) { continue; }

    for (int j = i+i; j < size; j += i)
    {
      isPrime[j] = false;
    }
  }
}

int main ( void )
{
  const int size = 100000001;
  int n, count = 0;
  int *isPrime = new int[size];

  setPrime(size, isPrime);

  cin >> n;
 
  for (int i = 0; i < n; ++i)
  {
    int p;
 
    cin >> p;
 
    if (isPrime[p]) { ++count; }
  }
 
  cout << count << endl;

  delete [] size;
 
  return 0;
}

Compiler output:
a.cc: In function 'bool setPrime(int, bool*)':
a.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type]
   24 | }
      | ^
a.cc: In function 'int main()':
a.cc:32:18: error: cannot convert 'int*' to 'bool*'
   32 |   setPrime(size, isPrime);
      |                  ^~~~~~~
      |                  |
      |                  int*
a.cc:6:32: note:   initializing argument 2 of 'bool setPrime(int, bool*)'
    6 | bool setPrime ( int size, bool isPrime[] )
      |                           ~~~~~^~~~~~~~~
a.cc:47:13: error: type 'const int' argument given to 'delete', expected pointer
   47 |   delete [] size;
      |             ^~~~
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef vector <int> IVEC;

int seive(IVEC &A, int n){
	IVEC num(n+1,1);
	num[0]=0, num[1]=0;
	int count=1, limit=int(sqrt(n));
	for (int i=3; i<=n; i+=2)
		if (num[i]){
			count++;
			if (i<=limit)
				for (int j=3*i; j<=n; j+=2*i) num[j]=0;
		}

	A.resize(count);
	A[0] = 2;
	int j=1;
	for (int i=3; i<=n; i+=2)
		if (num[i]==1) A[j++]=i;
	return 0;
}

int main(void){
	IVEC primes, nums;
	int n;

	cin>>n;
	nums.resize(n);
	for (int i=0; i<n; i++)
		cin>>nums[i];
	sort(nums.begin(),nums.end());

	int max_num=nums[nums.size()-1];
	seive(primes, max_num);

	for (int i=0; i<(int)primes.size(); i++)
		for (int j=0; j<(int)nums.size(); j++)
			if ((nums[j] >= pow(primes[i],2)) &&  (nums[j] % primes[i] == 0))
				nums[j]=0;

	int count=0;
	for (int i=0; i<(int)nums.size(); i++)
		if (nums[i]) count++;

	cout<<count<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int seive(IVEC&, int)':
a.cc:10:32: error: 'sqrt' was not declared in this scope
   10 |         int count=1, limit=int(sqrt(n));
      |                                ^~~~
a.cc: In function 'int main()':
a.cc:41:41: error: 'pow' was not declared in this scope
   41 |                         if ((nums[j] >= pow(primes[i],2)) &&  (nums[j] % primes[i] == 0))
      |                                         ^~~
Language: C++

#include <iostream>
#include <functional>
using namespace std;
int main(){
	int N,t,f,ans=0,s;
	cin>>N;
	int data[10000]={0};
	for(int i=0;i<N;i++){
		cin>>t;
		data[i]=t;
	}
	sort(data,data+N,greater<int>());
	for(int j=0;j<N;j++){
		int cnt=0;
		int m=data[j];
		for(int k=2;k<m;k++){
				if(m%k==0){
				cnt=1; 
			}
		}
		if(data[j]==2){
				cnt=0;
			}
		else if(data[j]==1){
				cnt=1;
			}
		if(cnt==0)ans++;
	}

cout<<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |         sort(data,data+N,greater<int>());
      |         ^~~~
      |         short
Language: Java

import java.util.*;

public class Math {
    public static void main(String args[]) {
        // input

        int num;

        Scanner inp = new Scanner(System.in);

        num = inp.nextInt();

        int min = inp.nextInt();
        int max = (int) -(Math.pow(10,9));

        for (int i = 0; i < num-1; i++) {
            int r = inp.nextInt();
            max = Math.max(max, r-min);
            min = Math.min(min,r);
        }

        System.out.println(max);
    }
}


Compiler output:
Main.java:3: error: class Math is public, should be declared in a file named Math.java
public class Math {
       ^
Main.java:14: error: cannot find symbol
        int max = (int) -(Math.pow(10,9));
                              ^
  symbol:   method pow(int,int)
  location: class Math
Main.java:18: error: cannot find symbol
            max = Math.max(max, r-min);
                      ^
  symbol:   method max(int,int)
  location: class Math
Main.java:19: error: cannot find symbol
            min = Math.min(min,r);
                      ^
  symbol:   method min(int,int)
  location: class Math
4 errors
Language: Java

import java.util.Scanner;


public class MaximumProfit {

    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        int[] ls = new int[200001];

        ls[0] = sc.nextInt();
        ls[1] = sc.nextInt();

        int maxProfit = ls[1] - ls[0];

        int index = 2;
        while(sc.hasNextInt()){
            int next = sc.nextInt();


            for(int i = 0; i < index; i++)
                if (maxProfit < next - ls[i]) maxProfit = next - ls[i];

            ls[index] = next;
            index++;
        }


        System.out.println(maxProfit);
    }
}



Compiler output:
Main.java:4: error: class MaximumProfit is public, should be declared in a file named MaximumProfit.java
public class MaximumProfit {
       ^
1 error
Language: Java

import java.util.Scanner;

class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int maxNum = 0;
int minNum = 10000000000;
for(int i = 0; i < n; i++){
  int num = sc.nextInt();
  if(num > maxNum){
   maxNum = num;
   }
  if(num < minNum){
   minNum = num;
   }
  }
 System.out.println(maxNum-minNum);
 }
}


Compiler output:
Main.java:8: error: integer number too large
int minNum = 10000000000;
             ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
public static main(String[] args){
Scanner sc = new Scanner(System.in);
int min = 10000000000;
int profit = -1000000000;
int maxP = -1000000000;
int n = sc.nextInt();
for(int i = 0;i<n;I++){
int val = sc.nextInt();
profit = val - min;
if(profit > maxP){
 maxP = profit;
} 
if(val < min){
 min = val; 
}
 }
}
}


Compiler output:
Main.java:4: error: invalid method declaration; return type required
public static main(String[] args){
              ^
Main.java:6: error: integer number too large
int min = 10000000000;
          ^
2 errors
Language: Java

import java.util.Scanner;

public class Main{
public static main(String[] args){
Scanner sc = new Scanner(System.in);
int min = 1000000000;
int profit = -1000000000;
int maxP = -1000000000;
int n = sc.nextInt();
for(int i = 0;i<n;I++){
int val = sc.nextInt();
profit = val - min;
if(profit > maxP){
 maxP = profit;
} 
if(val < min){
 min = val; 
}
 }
}
}


Compiler output:
Main.java:4: error: invalid method declaration; return type required
public static main(String[] args){
              ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int min = 1000000000;
int profit = -1000000000;
int maxP = -1000000000;
int n = sc.nextInt();
for(int i = 0;i<n;I++){
int val = sc.nextInt();
profit = val - min;
if(profit > maxP){
 maxP = profit;
} 
if(val < min){
 min = val; 
}
 }
}
}


Compiler output:
Main.java:10: error: cannot find symbol
for(int i = 0;i<n;I++){
                  ^
  symbol:   variable I
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int min = 1000000000;
int profit = -1000000000;
int maxP = -1000000000;
int n = sc.nextInt();
for(int i = 0; i < n ; I++){
int val = sc.nextInt();
profit = val - min;
if(profit > maxP){
 maxP = profit;
} 
if(val < min){
 min = val; 
}
 }
}
}


Compiler output:
Main.java:10: error: cannot find symbol
for(int i = 0; i < n ; I++){
                       ^
  symbol:   variable I
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int min = 1000000000;
int profit = -1000000000;
int maxP = -1000000000;
int n = sc.nextInt();
for(int i = 0; i < n ; i++){
int val = sc.nextInt();
if(i = 0){
min = val;
continue
}
profit = val - min;
if(profit > maxP){
 maxP = profit;
} 
if(val < min){
 min = val; 
}
 }
System.out.println(maxP);
}
}


Compiler output:
Main.java:14: error: ';' expected
continue
        ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int min = 1000000000;
int profit = -1000000000;
int maxP = -1000000000;
int n = sc.nextInt();
for(int i = 0; i < n ; i++){
int val = sc.nextInt();
if(i = 0){
min = val;
continue;
}
profit = val - min;
if(profit > maxP){
 maxP = profit;
} 
if(val < min){
 min = val; 
}
 }
System.out.println(maxP);
}
}


Compiler output:
Main.java:12: error: incompatible types: int cannot be converted to boolean
if(i = 0){
     ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int min = 0;
int profit = -1000000000;
int maxP = -1000000000;
int n = sc.nextInt();
for(int i = 0; i < n; i++){
int R[i] =sc.nextInt() } 
min = R[0];

for(int i = 1; i < n; i++){
maxP = Math.max(maxP,R[i]-min);
min = Math.min(min,R[i]);
}
System.pout.println(maxP);
}
}


Compiler output:
Main.java:11: error: ']' expected
int R[i] =sc.nextInt() } 
      ^
Main.java:11: error: ';' expected
int R[i] =sc.nextInt() } 
       ^
Main.java:11: error: ';' expected
int R[i] =sc.nextInt() } 
                      ^
3 errors
Language: Java

import java.util.Scanner;

public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int min = 0;
int profit = -1000000000;
int maxP = -1000000000;
int n = sc.nextInt();
list<String> R[] = new Arraylist<String>();
for(int i = 0; i < n; i++){
R[i] =sc.nextInt() } 
min = R[0];

for(int i = 1; i < n; i++){
maxP = Math.max(maxP,R[i]-min);
min = Math.min(min,R[i]);
}
System.pout.println(maxP);
}
}


Compiler output:
Main.java:12: error: ';' expected
R[i] =sc.nextInt() } 
                  ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int min = 0;
int profit = -1000000000;
int maxP = -1000000000;
int n = sc.nextInt();
list<String> R[] = new Arraylist<String>(){
for(int i = 0; i < n; i++){
add R[i] =sc.nextInt() }
}
min = R[0];

for(int i = 1; i < n; i++){
maxP = Math.max(maxP,R[i]-min);
min = Math.min(min,R[i]);
}
System.pout.println(maxP);
}
}


Compiler output:
Main.java:11: error: illegal start of type
for(int i = 0; i < n; i++){
^
Main.java:11: error: > or ',' expected
for(int i = 0; i < n; i++){
                    ^
Main.java:11: error: <identifier> expected
for(int i = 0; i < n; i++){
                       ^
Main.java:12: error: ']' expected
add R[i] =sc.nextInt() }
      ^
Main.java:12: error: ';' expected
add R[i] =sc.nextInt() }
       ^
Main.java:12: error: ';' expected
add R[i] =sc.nextInt() }
                      ^
Main.java:13: error: ';' expected
}
 ^
7 errors
Language: Java

import java.util.Scanner;
 
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int min = 0;
int profit = -1000000000;
int maxP = -1000000000;
int n = sc.nextInt();
list<String> R[] = new Arraylist<String>(200000);
for(int i = 0; i < n; i++){
R[i] =sc.nextInt() }

min = R[0];
 
for(int i = 1; i < n; i++){
maxP = Math.max(maxP,R[i]-min);
min = Math.min(min,R[i]);
}
System.pout.println(maxP);
}
}


Compiler output:
Main.java:12: error: ';' expected
R[i] =sc.nextInt() }
                  ^
1 error
Language: Java

import java.util.Scanner;
 
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int min = 0;
int profit = -1000000000;
int maxP = -1000000000;
int n = sc.nextInt();
list<String> R[] = new Arraylist<String>(200000);
for(int i = 0; i < n; i++){
R.add(sc.nextInt()) }

min = R[0];
 
for(int i = 1; i < n; i++){
maxP = Math.max(maxP,R[i]-min);
min = Math.min(min,R[i]);
}
System.pout.println(maxP);
}
}


Compiler output:
Main.java:12: error: ';' expected
R.add(sc.nextInt()) }
                   ^
1 error
Language: Java

public class Main {
	
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
	
	public static void main(String[] args) throws NumberFormatException, IOException {
		int n = Integer.parseInt(br.readLine());
		
		int maxv = Integer.MIN_VALUE;
		int min = Integer.MAX_VALUE;
		
		for(int i = 0; i < n; i++){
			int r = Integer.parseInt(br.readLine());
			maxv = Math.max(maxv, r - min);
			min = Math.min(min, r);
		}
		
		System.out.println(maxv);
		
	}
}


Compiler output:
Main.java:3: error: cannot find symbol
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	               ^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
	public static void main(String[] args) throws NumberFormatException, IOException {
	                                                                     ^
  symbol:   class IOException
  location: class Main
Main.java:3: error: cannot find symbol
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	                                       ^
  symbol:   class BufferedReader
  location: class Main
Main.java:3: error: cannot find symbol
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	                                                          ^
  symbol:   class InputStreamReader
  location: class Main
4 errors
Language: Java

public static void main(Integer[] list) {
	// write your code here
        Integer size = list.length;
        Integer max = 0;
        for (Integer i = 0; i < size; i++) {
            for (Integer j = i; j >= 0; j--) {
                Integer v = list[i] - list[j];
                max = v > max ? v : max;
            }
        }
        System.out.println(max);
    }


Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(Integer[] list) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

/**
 * Created by zhangrunfeng on 2019-04-29
 */
import java.util.Scanner;

public class MaximumProfit {
    private static final int MAXSIZE = 200000;

    public static void main(String[] args) {
        int[] R = new int[MAXSIZE];

        Scanner sc = new Scanner(System.in);
        int rLength = sc.nextInt();

        for (int idx = 0; idx < rLength; idx++) {
            R[idx] = sc.nextInt();
        }

        int res = Integer.MIN_VALUE;
        int currMin = R[0];
        for (int idx = 1; idx < rLength; idx++) {
            res = Math.max(res, R[idx] - currMin);
            currMin = Math.min(currMin, R[idx]);
        }

        System.out.println(res);
    }
}



Compiler output:
Main.java:6: error: class MaximumProfit is public, should be declared in a file named MaximumProfit.java
public class MaximumProfit {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("sample.txt"));
		
		int n=Integer.parseInt(br.readLine());
		int [] in=new int[n];
		int max=0;
		
		for(int i=0;i<n;i++)
			in[i]=Integer.parseInt(br.readLine());
			
		for(int i=0;i<n-1;n++){
			for(int j=i+1;j<n;j++){
				int tmp=in[i]-in[j];
				if(tmp>max) max=tmp;
			}
		}
System.out.println(nummax);




	}

}

Compiler output:
Main.java:26: error: cannot find symbol
System.out.println(nummax);
                   ^
  symbol:   variable nummax
  location: class Main
1 error
Language: Java


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
  
public class Main {
  
    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //BufferedReader br = new BufferedReader(new FileReader("sample.txt"));
          
        int n=Integer.parseInt(br.readLine());
        int [] in=new int[n];
        int max=Integer.MIN_VALUE;
          
        for(int i=0;i<n;i++)
            in[i]=Integer.parseInt(br.readLine());
              
        for(int i=0;i<n-1;i++){
            for(int j=i+1;j<n;j++){
                int tmp=in[j]-in[i];
                if(tmp>max) max=tmp;
            }
        }
System.out.println(max);
  
  
  
  
    }
  
}

Compiler output:
Main.java:2: error: class, interface, enum, or record expected
1
^
Main.java:36: error: class, interface, enum, or record expected
import java.io.FileNotFoundException;
^
Main.java:37: error: class, interface, enum, or record expected
import java.io.FileReader;
^
Main.java:38: error: class, interface, enum, or record expected
import java.io.IOException;
^
Main.java:39: error: class, interface, enum, or record expected
import java.io.InputStreamReader;
^
5 errors
Language: Java

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
  
public class Main {
  
    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //BufferedReader br = new BufferedReader(new FileReader("sample.txt"));
          
        int n=Integer.parseInt(br.readLine());
        int [] in=new int[n];
        int max=Integer.MIN_VALUE;
        int mini=0;  
        for(int i=0;i<n;i++)
            in[i]=Integer.parseInt(br.readLine());
              
        for(int i=0;i<n-1;i++){if(in[i]>in[mini])continue;
            for(int j=i+1;j<n;j++){
                int tmp=in[j]-in[i];
                if(tmp>max) {max=tmp;mini=i;
            }
        }
System.out.println(max);
  
  
  
  
    }
  
}

Compiler output:
Main.java:33: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		 BufferedReader br = new BufferedReader(new
		 InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("sample.txt"));

		int n = Integer.parseInt(br.readLine());
		int[] in = new int[n];
		int max = Integer.MIN_VALUE;
		int mini = 0;
		int maxj=0;
		boolean con=false;
		
		for (int i = 0; i < n; i++)
			in[i] = Integer.parseInt(br.readLine());
		

		for (int i = 0; i < n - 1; i++) {
			if (in[i] > in[mini])
				continue;
			for (int j = i + 1; j < n; j++) {System.out.println(i+"  :  "+j);
				if(i!=0&&con&&i<maxj){
					mini=i;
					max=in[maxj]-in[i];
					break;}
				else if(max+in[i<in[j]]){
					max=in[j]-in[i];
					mini=i;
					maxj=j;
					con=false;
				}
			}con=true;
		}
		System.out.println(max);

	}

}

Compiler output:
Main.java:34: error: incompatible types: boolean cannot be converted to int
				else if(max+in[i<in[j]]){
				                ^
Main.java:34: error: incompatible types: int cannot be converted to boolean
				else if(max+in[i<in[j]]){
				           ^
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		 BufferedReader br = new BufferedReader(new
		 InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("sample.txt"));

		int n = Integer.parseInt(br.readLine());
		int[] in = new int[n];
		int max = Integer.MIN_VALUE;
		int mini = 0;
		int maxj=0;
		boolean con=false;
		
		for (int i = 0; i < n; i++)
			in[i] = Integer.parseInt(br.readLine());
		

		for (int i = 0; i < n - 1; i++) {
			if (in[i] > in[mini])
				continue;
			for (int j = i + 1; j < n; j++) 
				if(i!=0&&con&&i<maxj){
					mini=i;
					max=in[maxj]-in[i];
					break;}
				else if(max+in[i]<in[j]){
					max=in[j]-in[i];
					mini=i;
					maxj=j;
					con=false;
				}
			}con=true;
		}
		System.out.println(max);

	}

}

Compiler output:
Main.java:42: error: <identifier> expected
		System.out.println(max);
		                  ^
Main.java:42: error: <identifier> expected
		System.out.println(max);
		                      ^
Main.java:46: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		 BufferedReader br = new BufferedReader(new
		 InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("sample.txt"));

		int n = Integer.parseInt(br.readLine());
		int[] in = new int[n];
		int max = Integer.MIN_VALUE;
		int mini = 0;
		int maxj=0;
		boolean con=false;
		
		for (int i = 0; i < n; i++)
			in[i] = Integer.parseInt(br.readLine());
		

		for (int i = 0; i < n - 1; i++) {
			if (in[i] > in[mini])continue;
			for (int j = i + 1; j < n; j++) 
				if(i!=0&&con&&i<maxj){
					mini=i;
					max=in[maxj]-in[i];
					break;}
				else if(max+in[i]<in[j]){
					max=in[j]-in[i];
					mini=i;
					maxj=j;
					con=false;
				}
			}con=true;
		}
		System.out.println(max);

	}

}

Compiler output:
Main.java:41: error: <identifier> expected
		System.out.println(max);
		                  ^
Main.java:41: error: <identifier> expected
		System.out.println(max);
		                      ^
Main.java:45: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

 class Main{

	public static void main(String[] args) throws IOException {
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));		

		int n = Integer.parseInt(br.readLine());
		int[] in = new int[n];
		int max = Integer.MIN_VALUE;
		int mini = 0;
		int maxj=0;
		boolean con=false;
		
		for (int i = 0; i < n; i++)
			in[i] = Integer.parseInt(br.readLine());
		
		for (int i = 0; i < n - 1; i++) {
			if (in[i] > in[mini])continue;
			for (int j = i + 1; j < n; j++){
				
				else if(max+in[i]<in[j]){
					max=in[j]-in[i];
					mini=i;
					maxj=j;
					con=false;
				}
			}con=true;
		}
		System.out.println(max);
	}}

Compiler output:
Main.java:24: error: 'else' without 'if'
				else if(max+in[i]<in[j]){
				^
1 error
Language: Java

import java.util.Scanner;

public class Maint {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];

        for(int i=0; i<n; i++){
            array[i] = sc.nextInt();
        }

        System.out.println(cal(array));
    }

    static int cal(int[] array){
        int ans=-100000000;
        for(int i=0; i < array.length; i++){
            if(i > 1){
                if(array[i] > array[i-1]) continue;
            }
            for(int j=i+1; j < array.length; j++){
                if(array[j]-array[i] > ans) ans = array[j] - array[i];
            }
        }
        return ans;
    }
}

Compiler output:
Main.java:3: error: class Maint is public, should be declared in a file named Maint.java
public class Maint {
       ^
1 error
Language: Java


public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int minv = Integer.MAX_VALUE;
		int maxv = Integer.MIN_VALUE;
		for (int i = 0; i < n; i++) {
			int j = scanner.nextInt();
			maxv = Math.max(maxv, j - minv);
			minv = Math.min(minv, j);
		}
		System.out.println(maxv);
	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner scanner = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner scanner = new Scanner(System.in);
		                      ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.Scanner;


public class MaximumProfit {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		int[] values = null;
		int cnt = s.nextInt();
		values = new int[cnt];
		int i = 0;
		for(int j=0 ; j<cnt ; j++){
			values[i] = s.nextInt();
			i++;
		}
		solve(values);
	}

	public static void solve(int[] values) {
		int mini = values[0];
		int max = Integer.MIN_VALUE;

		for(int i=1 ; i<values.length ; i++) {
			max = Math.max(values[i] - mini, max);
			mini = Math.min(mini, values[i]);
		}
		System.out.println(max);
	}
}

Compiler output:
Main.java:4: error: class MaximumProfit is public, should be declared in a file named MaximumProfit.java
public class MaximumProfit {
       ^
1 error
Language: Java

class Main{
    public static void main(String[] args){
    	//final int MAX =200000;
    	
    	int n;
    	Scanner sc = new Scanner(System.in);
    	n=sc.nextInt();
    	int R[]=new int[n];
    	Scanner sc1 = new Scanner(System.in);
    	for(int i=0;i<n;i++){
    		 R[i]=sc1.nextInt();
    	}
    	int maxv=-2000000000;
    			 
    	int minv=R[0];
    	for(int i=1;i<n;i++){
    		maxv=Math.max(maxv,R[i]-minv);
    		minv=Math.min(minv,R[i]);
    	}
    	System.out.print(maxv);
    	
    }
}

Compiler output:
Main.java:6: error: cannot find symbol
    	Scanner sc = new Scanner(System.in);
    	^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
    	Scanner sc = new Scanner(System.in);
    	                 ^
  symbol:   class Scanner
  location: class Main
Main.java:9: error: cannot find symbol
    	Scanner sc1 = new Scanner(System.in);
    	^
  symbol:   class Scanner
  location: class Main
Main.java:9: error: cannot find symbol
    	Scanner sc1 = new Scanner(System.in);
    	                  ^
  symbol:   class Scanner
  location: class Main
4 errors
Language: Java

import java.util.*;
class Main{
    public static void main(String[] args){
    	//final int MAX =200000;
    	
    
    	Scanner sc = new Scanner(System.in);
    	//int n = Integer.parseInt(sc.next());
    	int n =sc.nextInt();
    	int[] R=new int[n];
    	
    	for(int i=0;i<n;i++){
    		// R[i]=Integer.parseInt(sc.next());
    		 R[i]=sc.nextInt();
    	}
    	int maxv=-2000000000;
    			 
    	int minv=R[0];
    	for(int i=1;i<n;i++){
    		maxv=Math.max(maxv,R[i]-minv);
    		minv=Math.min(minv,R[i]);
    	}
    	System.out.println(maxv);
    	
    }
}s

Compiler output:
Main.java:26: error: reached end of file while parsing
}s
 ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
   
    
    public static void main(String[] args){
        int n;
        int[] R;
        
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        R = new int[n];
  
        for( int i = 0; i < n; i++) R[i] = sc.nextInt();
        
        int a = 1;
        
    for ( int i = 1; i < n; i++){
        int m = 100000000;
        if ( R[i] < m);
       
            if (R[j] < m ) m = R[j];
        }
        if ( R[i] - m > a ) a = R[i] - m;
    }
    System.out.println(a);
  
    }
}

Compiler output:
Main.java:26: error: <identifier> expected
    System.out.println(a);
                      ^
Main.java:26: error: <identifier> expected
    System.out.println(a);
                        ^
Main.java:29: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

package love.d28jp.martin;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

/**
 * Created by martin-d28jp-love on 15/04/01.
 */
public class ALDS1_1_D {

    public static void main(String[] args) {
List<String> input = input();

        int inputLength = input.size();
        int maxSubtruction = 0;
        for (int i = 0; i < inputLength; i++) {
            for (int j = i; j < inputLength; j++) {
                int Ri = Integer.valueOf(input.get(i));
                int Rj = Integer.valueOf(input.get(j));
                if (Ri - Rj > maxSubtruction) {
                    maxSubtruction = Ri - Rj;
                }
            }
        }
        System.out.print(maxSubtruction);
    }

    public static List<String> mockuop() {
        List<String> input = Arrays.asList(
                "6",
                "5",
                "12",
                "11"
        );
    }
    public static List<String> input() {
        Scanner in = new Scanner(System.in);
        List<String> input = new ArrayList<String>();
        while(in.hasNext()) {
            String buf = in.nextLine();
            input.add(buf);
        }
        in.close();
        return input;
    }
}

Compiler output:
Main.java:11: error: class ALDS1_1_D is public, should be declared in a file named ALDS1_1_D.java
public class ALDS1_1_D {
       ^
1 error
Language: Java


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

/**
 * Created by martin-d28jp-love on 15/04/01.
 */
public class Main {

    public static void main(String[] args) {
List<String> input = input();

        int inputLength = input.size();
        int maxSubtruction = 0;
        for (int i = 0; i < inputLength; i++) {
            for (int j = i; j < inputLength; j++) {
                int Ri = Integer.valueOf(input.get(i));
                int Rj = Integer.valueOf(input.get(j));
                if (Ri - Rj > maxSubtruction) {
                    maxSubtruction = Ri - Rj;
                }
            }
        }
        System.out.print(maxSubtruction);
    }

    public static List<String> mockuop() {
        List<String> input = Arrays.asList(
                "6",
                "5",
                "12",
                "11"
        );
    }
    public static List<String> input() {
        Scanner in = new Scanner(System.in);
        List<String> input = new ArrayList<String>();
        while(in.hasNext()) {
            String buf = in.nextLine();
            input.add(buf);
        }
        in.close();
        return input;
    }
}

Compiler output:
Main.java:36: error: missing return statement
    }
    ^
1 error