criyle/codenet-compile-errors huggingface dataset:
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();
//        List<String> input = mockuop();

        int inputLength = Integer.valueOf(input.get(0));

        int minValue = Integer.MAX_VALUE;
        int maxValue = -Integer.MAX_VALUE;
        int minIndex = 0;
        int maxIndex = 0;
        for (int i=1; i <= inputLength; i++) {
            int Ri = input[i];
            if (Ri < minValue) {
                minValue = Ri;
                minIndex = i;
            }
            if (Ri > maxValue) {
                maxValue = Ri;
                maxIndex = i;
            }
        }
        if (minIndex < maxIndex) {
            System.out.println(maxValue - minValue);
            return;
        }

        int maxSubtruction = -Integer.MAX_VALUE;
        int maxSubtructionIndex = 1;
        int beforeSubtructionRi = Integer.MAX_VALUE;
        for (int i = 1; i < inputLength; i++) {
            int Ri = input[i];
            if (beforeSubtructionRi < Ri) {
                continue;
            }
            int start = maxSubtructionIndex > i + 1 ? maxSubtructionIndex : i + 1;
            for (int j = start; j <= inputLength; j++) {
                int Rj = input[j];
                if (Rj - Ri > maxSubtruction) {
                    maxSubtruction = Rj - Ri;
                    maxSubtructionIndex = j;
                    beforeSubtructionRi = Ri;
                }
            }
        }
        System.out.println(maxSubtruction);
    }

    public static List<String> mockuop() {
        List<String> input = Arrays.asList(
                "6",
                "5",
                "12",
                "11"
        );
        return input;
    }
    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:22: error: array required, but List<String> found
            int Ri = input[i];
                          ^
Main.java:41: error: array required, but List<String> found
            int Ri = input[i];
                          ^
Main.java:47: error: array required, but List<String> found
                int Rj = input[j];
                              ^
3 errors
Language: Java

import java.io.*;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while(line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
int[] r=new int[n];
for(int i=0;i<n;i++) r[i]=Integer.parseInt(br.readLine());
int ans=Integer.MIN_VALUE;
for(int i=1;i<n;i++){
for(int j=0;j<n&&i>j;j++){
ans=Math.max(ans,r[i]-r[j]);
}
}
out.println(ans);
out.flush();
}
}
}

Compiler output:
Main.java:10: error: illegal start of expression
while(line=br.readLine())!=null&&!line.isEmpty()){
                         ^
Main.java:10: error: not a statement
while(line=br.readLine())!=null&&!line.isEmpty()){
                               ^
Main.java:10: error: ';' expected
while(line=br.readLine())!=null&&!line.isEmpty()){
                                                ^
3 errors
Language: Java

import java.io.*;
  
class Main{
  
static final PrintWriter out=new PrintWriter(System.out);
  
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
int[] r=new int[n];
for(int i=0;i<n;i++) r[i]=Integer.parseInt(br.readLine());
int ans=Integer.MIN_VALUE;
int min=r[0];
for(int i=1;i<n;i++){
ans=Math.max(ans,r[i]-min);
min=Mat.min(min,r[i]);
}
out.println(ans);
out.flush();
}
}
}

Compiler output:
Main.java:18: error: cannot find symbol
min=Mat.min(min,r[i]);
    ^
  symbol:   variable Mat
  location: class Main
1 error
Language: Java

import java.util.*;
class Main{
	void Main(){
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int y;
		int min=200000;
		int x=-200000;
		for(int i=0;i<N;i++){
			y=sc.nextInt();
			if(y-min>x)x=y-min;
			if(min>y)min=y;
		}
		System.out.println(x);
	}
	public static void main(String[]arg){
		Main m=new Main();
		m.aaaa();
	}
}

Compiler output:
Main.java:18: error: cannot find symbol
		m.aaaa();
		 ^
  symbol:   method aaaa()
  location: variable m of type Main
1 error
Language: Java

import java.util.Scanner;


public class MAIN {
	public static void main(String[] args){
		int max = -200000;
		Scanner san = new Scanner(System.in);
		int listCount = san.nextInt();
		int[] list = new int[listCount];
		for(int i = 0; i < listCount; i++){
			list[i] = san.nextInt();
		}
		int min = list[0];
		for(int i = 1; i < listCount; i++){
			max = Math.max(max, list[i] - min);
			min = Math.min(min, list[i]);
		}
		System.out.println(max);
	}
}

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

import java.io.*;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] arr = new Array[count];
      int result = 0;
      for(int i = 0; i < count; i++) {
        arr[i] = Integer.parseInt(in.readLine());
      }
      for(int i = 0; i < count; i++) {
        int start = arr[i];
        int end = max(Array.copyOfRange(arr, i+1, count-1));
        if(end - start > result) {
          result = end - start;
        }
      }
      System.out.println(result);
      
    } catch (IOException) {
    }
  }

  public int max(int[] arr) {
    Array.sort(arr);
    return arr[arr.length() - 1];
  }
}

Compiler output:
Main.java:22: error: <identifier> expected
    } catch (IOException) {
                        ^
1 error
Language: Java

import java.io.*;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] arr = new Array[count];
      int result = 0;
      for(int i = 0; i < count; i++) {
        arr[i] = Integer.parseInt(in.readLine());
      }
      for(int i = 0; i < count; i++) {
        int start = arr[i];
        int end = max(Array.copyOfRange(arr, i+1, count-1));
        if(end - start > result) {
          result = end - start;
        }
      }
      System.out.println(result);
      
    } catch (IOException e) {
    }
  }

  public int max(int[] arr) {
    Array.sort(arr);
    return arr[arr.length() - 1];
  }
}

Compiler output:
Main.java:8: error: cannot find symbol
      int[] arr = new Array[count];
                      ^
  symbol:   class Array
  location: class Main
Main.java:15: error: cannot find symbol
        int end = max(Array.copyOfRange(arr, i+1, count-1));
                      ^
  symbol:   variable Array
  location: class Main
Main.java:27: error: cannot find symbol
    Array.sort(arr);
    ^
  symbol:   variable Array
  location: class Main
Main.java:28: error: cannot find symbol
    return arr[arr.length() - 1];
                  ^
  symbol:   method length()
  location: variable arr of type int[]
4 errors
Language: Java

import java.io.*;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] arr = new int[count];
      int result = 0;
      for(int i = 0; i < count; i++) {
        arr[i] = Integer.parseInt(in.readLine());
      }
      for(int i = 0; i < count; i++) {
        int start = arr[i];
        int end = max(Array.copyOfRange(arr, i+1, count-1));
        if(end - start > result) {
          result = end - start;
        }
      }
      System.out.println(result);
      
    } catch (IOException e) {
    }
  }

  public int max(int[] arr) {
    Array.sort(arr);
    return arr[arr.length() - 1];
  }
}

Compiler output:
Main.java:15: error: cannot find symbol
        int end = max(Array.copyOfRange(arr, i+1, count-1));
                      ^
  symbol:   variable Array
  location: class Main
Main.java:27: error: cannot find symbol
    Array.sort(arr);
    ^
  symbol:   variable Array
  location: class Main
Main.java:28: error: cannot find symbol
    return arr[arr.length() - 1];
                  ^
  symbol:   method length()
  location: variable arr of type int[]
3 errors
Language: Java

import java.io.*;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] arr = new int[count];
      int result = 0;
      for(int i = 0; i < count; i++) {
        arr[i] = Integer.parseInt(in.readLine());
      }
      for(int i = 0; i < count; i++) {
        int start = arr[i];
        int end = max(Arrays.copyOfRange(arr, i+1, count-1));
        if(end - start > result) {
          result = end - start;
        }
      }
      System.out.println(result);
      
    } catch (IOException e) {
    }
  }

  public int max(int[] arr) {
    Arrays.sort(arr);
    return arr[arr.length() - 1];
  }
}

Compiler output:
Main.java:15: error: cannot find symbol
        int end = max(Arrays.copyOfRange(arr, i+1, count-1));
                      ^
  symbol:   variable Arrays
  location: class Main
Main.java:27: error: cannot find symbol
    Arrays.sort(arr);
    ^
  symbol:   variable Arrays
  location: class Main
Main.java:28: error: cannot find symbol
    return arr[arr.length() - 1];
                  ^
  symbol:   method length()
  location: variable arr of type int[]
3 errors
Language: Java

import java.io.*;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] arr = new int[count];
      int result = 0;
      for(int i = 0; i < count; i++) {
        arr[i] = Integer.parseInt(in.readLine());
      }
      for(int i = 0; i < count; i++) {
        int start = arr[i];
        int end = max(Arrays.copyOfRange(arr, i+1, count-1));
        if(end - start > result) {
          result = end - start;
        }
      }
      System.out.println(result);
      
    } catch (IOException e) {
    }
  }

  public int max(int[] arr) {
    Arrays.sort(arr);
    return arr[arr.length() - 1];
  }
}

Compiler output:
Main.java:16: error: non-static method max(int[]) cannot be referenced from a static context
        int end = max(Arrays.copyOfRange(arr, i+1, count-1));
                  ^
Main.java:29: error: cannot find symbol
    return arr[arr.length() - 1];
                  ^
  symbol:   method length()
  location: variable arr of type int[]
2 errors
Language: Java

import java.io.*;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] arr = new int[count];
      int result = 0;
      for(int i = 0; i < count; i++) {
        arr[i] = Integer.parseInt(in.readLine());
      }
      for(int i = 0; i < count; i++) {
        int start = arr[i];
        int end = max(Arrays.copyOfRange(arr, i+1, count-1));
        if(end - start > result) {
          result = end - start;
        }
      }
      System.out.println(result);
      
    } catch (IOException e) {
    }
  }

  public static int max(int[] arr) {
    Arrays.sort(arr);
    return arr[arr.length() - 1];
  }
}

Compiler output:
Main.java:29: error: cannot find symbol
    return arr[arr.length() - 1];
                  ^
  symbol:   method length()
  location: variable arr of type int[]
1 error
Language: Java

import java.io.*;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] arr = new int[count];
      int result = -Math.pow(10, 9);
      for(int i = 0; i < count; i++) {
        arr[i] = Integer.parseInt(in.readLine());
      }
      for(int i = 0; i < count-1; i++) {
        int start = arr[i];
        int end = max(Arrays.copyOfRange(arr, i+1, count));
        if(end - start > result) {
          result = end - start;
        }
      }
      System.out.println(result);

    } catch (IOException e) {
    }
  }

  public static int max(int[] arr) {
    Arrays.sort(arr);
    return arr[arr.length - 1];
  }
}

Compiler output:
Main.java:10: error: incompatible types: possible lossy conversion from double to int
      int result = -Math.pow(10, 9);
                   ^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] arr = new int[count];
      int result = Math.pow(-10, 9);
      for(int i = 0; i < count; i++) {
        arr[i] = Integer.parseInt(in.readLine());
      }
      for(int i = 0; i < count-1; i++) {
        int start = arr[i];
        int end = max(Arrays.copyOfRange(arr, i+1, count));
        if(end - start > result) {
          result = end - start;
        }
      }
      System.out.println(result);

    } catch (IOException e) {
    }
  }

  public static int max(int[] arr) {
    Arrays.sort(arr);
    return arr[arr.length - 1];
  }
}

Compiler output:
Main.java:10: error: incompatible types: possible lossy conversion from double to int
      int result = Math.pow(-10, 9);
                           ^
1 error
Language: Java

import java.io.*;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] arr = new int[count];
      long result = Math.pow(-10, 9);
      for(int i = 0; i < count; i++) {
        arr[i] = Integer.parseInt(in.readLine());
      }
      for(int i = 0; i < count-1; i++) {
        int start = arr[i];
        int end = max(Arrays.copyOfRange(arr, i+1, count));
        if(end - start > result) {
          result = end - start;
        }
      }
      System.out.println(result);

    } catch (IOException e) {
    }
  }

  public static int max(int[] arr) {
    Arrays.sort(arr);
    return arr[arr.length - 1];
  }
}

Compiler output:
Main.java:10: error: incompatible types: possible lossy conversion from double to long
      long result = Math.pow(-10, 9);
                            ^
1 error
Language: Java

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


public class MaximumProfit {
	public static void main(String[] args) throws NumberFormatException, IOException {
		//????????????????????????
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		//????§??????°
		int num;
		
		//?????§???
		int max;
		
		//?¨??????¨?????°
		int maxValue = -2000000000;
		int minValue;
		
		
		num=Integer.parseInt(bf.readLine());
		int tmp[]=new int[num];
		
		for(int i=0;i<num;i++){
			tmp[i]=Integer.parseInt(bf.readLine());
		}
		
		minValue=tmp[0];
		for(int i=1;i<num;i++){
			maxValue= maxValue > tmp[i]-minValue ? maxValue:tmp[i]-minValue;
			minValue = tmp[i] > minValue ? minValue:tmp[i];
		}
		
		System.out.println(maxValue);
	}

}

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.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class ALDS1_1_D {
	public static void main(String[] args) {
		int answer = 0;
		boolean flag = false;
		Scanner scan =  new Scanner(System.in);
		ArrayList<Integer> list = new ArrayList<Integer>();
		int n = scan.nextInt();
		for(int i=0; i<n; i++){
			list.add(scan.nextInt());
		}
		ArrayList<Integer> distinctList = distinct(list);
		Collections.sort(distinctList);
		for(int i=1; i<distinctList.size()-1; i++){
			int maxIndex = list.lastIndexOf(distinctList.get(distinctList.size() - (i + 1)));
			List<Integer> tmpList = list.subList(0, maxIndex);
			//?????¨????????????????????\??????
			if(!flag){
				answer = distinctList.get(distinctList.size() - (i+1)) - Collections.min(tmpList);
				flag = true;
			}
			else if(answer < (distinctList.get(distinctList.size() - i) - Collections.min(tmpList))){
				answer = distinctList.get(distinctList.size() - (i+1)) - Collections.min(tmpList);
			}
		}
		System.out.println(answer);
	}
	public static ArrayList<Integer> distinct(ArrayList<Integer> list){
		ArrayList<Integer> distictList = new ArrayList<Integer>();
		for(int i: list){
			if(!distictList.contains(i))distictList.add(i);
		}
		return distictList;
	}
}

Compiler output:
Main.java:6: 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.Scanner;

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

	int n;

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

	int []a = new int[n];

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

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

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

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

import java.util.Arrays;
import java.util.List;

import util.FastReader;

/**
 * @see <a href='http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_D'>?????§?????????</a>
 */
public class ALDS1_1_D {
	static FastReader in = new FastReader();

	public static void main(String[] args) throws Exception {
		ALDS1_1_D main = new ALDS1_1_D();
		main.run();
	}

	void run() {
		int n = in.nextInt();
		List<Integer> nums = in.nextIntList(n);
		int[] a = nums.stream().map(i -> new int[]{i, Integer.MIN_VALUE, Integer.MAX_VALUE})
				.reduce(new int[]{Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE},
						(ints, integer) -> new int[]{Math.max(ints[0], integer[0] - ints[1]), Math.min(ints[1], integer[0])});
		System.out.println(a[0]);
	}
}

Compiler output:
Main.java:9: error: class ALDS1_1_D is public, should be declared in a file named ALDS1_1_D.java
public class ALDS1_1_D {
       ^
Main.java:4: error: package util does not exist
import util.FastReader;
           ^
Main.java:10: error: cannot find symbol
	static FastReader in = new FastReader();
	       ^
  symbol:   class FastReader
  location: class ALDS1_1_D
Main.java:10: error: cannot find symbol
	static FastReader in = new FastReader();
	                           ^
  symbol:   class FastReader
  location: class ALDS1_1_D
4 errors
Language: Java

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

public class ALDS1_1_D {

	public static final int MAXN = 200000;
	public static final int MINN = 2;

	public static void main(String[] args) throws Exception {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
		int n = readInt(r);
		int[] price1 = new int[n];
		for(int i = 0 ; i < n ; i++) {
			price1[i] = readInt(r);
		}

		int max = MINN - MAXN -1;
		for(int y = 0 ; y < n ; y++){
			for(int x = y+1; x < n; x++){
				if(max < price1[x] - price1[y]){
					max = price1[x] - price1[y];
				}
			}
		}
		System.out.println(max);
	}

	public static int readInt(BufferedReader r) throws Exception{
		return Integer.parseInt(r.readLine());
	}

}

Compiler output:
Main.java:4: 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.io.BufferedReader;

public class Main {

	public static final int MAXN = 200000;
	public static final int MINN = 2;

	public static void main(String[] args) throws Exception {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
		int n = readInt(r);
		int[] price1 = new int[n];
		for(int i = 0 ; i < n ; i++) {
			price1[i] = readInt(r);
		}

		int max = MINN - MAXN -1;
		for(int y = 0 ; y < n ; y++){
			for(int x = y+1; x < n; x++){
				if(max < price1[x] - price1[y]){
					max = price1[x] - price1[y];
				}
			}
		}
		System.out.println(max);
	}

	public static int readInt(BufferedReader r) throws Exception{
		return Integer.parseInt(r.readLine());
	}

}

Compiler output:
Main.java:9: error: cannot find symbol
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
		                                          ^
  symbol:   class InputStreamReader
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int[] R = new int[n];
		for (int i=0; i < n; i++) {
			R[i] = sc.nextInt();
		}
//
//		int max = R[1] - R[0];
//		for (int i =0; i < n-1; i++) {
//			for (int j=i+1; j < n; j++) {
//				if (max < R[j] - R[i])
//				max = R[j] - R[i];
//			}
//		}
//
//		System.out.println(max);

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

		System.out.println(max);

	}

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

import java.util.Scanner;

public class MaxProfit {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int[] R = new int[n];
		for (int i=0; i < n; i++) {
			R[i] = sc.nextInt();
		}
//
//		int max = R[1] - R[0];
//		for (int i =0; i < n-1; i++) {
//			for (int j=i+1; j < n; j++) {
//				if (max < R[j] - R[i])
//				max = R[j] - R[i];
//			}
//		}
//
//		System.out.println(max);

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

		System.out.println(max);

	}

}

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

public class Main{
  main( String[] args  ){
    int n = args.length;
    int dif;
    int m=0;
    for(  int i =0;i<n-1;i++){
       dif=args[i+1]-args[i];
       if(dif>m || (dif<0&&-dif>m    ))
              m=dif;
    }
    return dif;
}




}

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

import java.util.Scanner;

public class fx {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		String s = scan.next();
		int n = Integer.parseInt(s);

		int min = Integer.parseInt(s);
		int max_margin = Integer.MIN_VALUE;
		for(int i = 1; i < n; i++){
			String str = scan.next();
			int now = Integer.parseInt(str);
			int margin = now - min;
			
			if(margin > max_margin){
				max_margin = margin;
			}
			if(now < min){
				min = now;
			}
		}
		System.out.println(max_margin);
	}

}

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

import java.util.*;

public class currency {
	public static void main(String[] a) {
		Scanner input = new Scanner(System.in);
		int loop = input.nextInt();
		int max = -1;
		int[] num = new int[loop];

		if (loop >= 2 && loop <= 200000) {

			for (int i = 0; i < loop; i++) {
				int newNum = input.nextInt();

				if (newNum >= 1 && newNum <= 1000000000) {
					num[i] = newNum;
					if (i == 1)
						max = num[1] - num[0];

					if (i > 0) {

						for (int j = 0; j < i; j++) {
							max = newNum - num[j] >= max ? newNum - num[j]
									: max;
						}
					}
				}

			}

			System.out.println(max);

		}

	}

}

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

public class Main {

    static int[] a;
    static int n;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        n=Integer.parseInt(br.readLine());
        a=new int[n];
        for(int i=0;i<n;i++){ a[i]=Integer.parseInt(br.readLine()); }
        int mini=1000000000;
        int max=-1000000000;
        int max_index=1;
        for(int i=0;i<n;i++){
            if(mini>a[i]){ mini=a[i]; }
            if(i<n-1 && max<a[i+1]-mini){ max=a[i+1]-mini; }
        }System.out.println(max);
    }
    
}

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

class Main {

    static int[] a;
    static int n;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        n=Integer.parseInt(br.readLine());
        a=new int[n];
        for(int i=0;i<n;i++){ a[i]=Integer.parseInt(br.readLine()); }
        int mini=1000000000;
        int max=-1000000000;
        int max_index=1;
        for(int i=0;i<n;i++){
            if(mini>a[i]){ mini=a[i]; }
            if(i<n-1 && max<a[i+1]-mini){ max=a[i+1]-mini; }
        }System.out.println(max);
    }
    
}

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

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int n = scan.nextInt();
		int maxv, minv;
		
		for(int i = 0; i < n; i++){
			int n = scan.nextInt();
			if(i == 0)
				minv = n;
			maxv = Math.max(maxv, n - minv);
			minv = Math.min(minv, n);
		}
		System.out.printf("%d\n", maxv);
	}
}

Compiler output:
Main.java:11: error: variable n is already defined in method main(String[])
			int n = scan.nextInt();
			    ^
1 error
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int n = scan.nextInt();
		int maxv, minv;
		
		for(int i = 0; i < n; i++){
			int r = scan.nextInt();
			if(i == 0)
				minv = n;
			maxv = Math.max(maxv, r - minv);
			minv = Math.min(minv, r);
		}
		System.out.printf("%d\n", maxv);
	}
}

Compiler output:
Main.java:14: error: variable maxv might not have been initialized
			maxv = Math.max(maxv, r - minv);
			                ^
Main.java:14: error: variable minv might not have been initialized
			maxv = Math.max(maxv, r - minv);
			                          ^
Main.java:17: error: variable maxv might not have been initialized
		System.out.printf("%d\n", maxv);
		                          ^
3 errors
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int n = scan.nextInt();
		int maxv = -1E-9;
		int minv = 1E-9;
		
		for(int i = 0; i < n; i++){
			int r = scan.nextInt();
			if(i == 0)
				minv = n;
			maxv = Math.max(maxv, r - minv);
			minv = Math.min(minv, r);
		}
		System.out.printf("%d\n", maxv);
	}
}

Compiler output:
Main.java:8: error: incompatible types: possible lossy conversion from double to int
		int maxv = -1E-9;
		           ^
Main.java:9: error: incompatible types: possible lossy conversion from double to int
		int minv = 1E-9;
		           ^
2 errors
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int n = scan.nextInt();
		int maxv = 1E-6;
		int minv = 1E+6;
		
		for(int i = 0; i < n; i++){
			int r = scan.nextInt();
			if(i == 0)
				minv = n;
			maxv = Math.max(maxv, r - minv);
			minv = Math.min(minv, r);
		}
		System.out.printf("%d\n", maxv);
	}
}

Compiler output:
Main.java:8: error: incompatible types: possible lossy conversion from double to int
		int maxv = 1E-6;
		           ^
Main.java:9: error: incompatible types: possible lossy conversion from double to int
		int minv = 1E+6;
		           ^
2 errors
Language: Java

import java.util.Scanner;

/**
 * Created by hwzheng on 2017/3/26.
 */
public class MaximunProfit {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] R = new int[n];
        for (int i = 0; i < n; i++){
            R[i] = scanner.nextInt();
        }
        System.out.println(maxProfit(R));
    }

    public static int maxProfit(int[] R){
        int maxv = R[1] - R[0];
        int minv = R[0];
        for (int i = 1; i < R.length; i++){
            maxv = Math.max(R[i]-minv,maxv);
            minv = Math.min(R[i],minv);
        }
        return maxv;
    }
}

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

import java.util.*;
public class MaxProfit {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int  n  = sc.nextInt();
		int[] nums = new int[n];
		for(int i=0;i<nums.length;i++){
			nums[i] = sc.nextInt();
		}
		int max = Integer.MIN_VALUE;
		int min = nums[0];
		for(int i=1;i<nums.length;i++){
			max = Math.max(max, nums[i]-min);
			min = Math.min(min, nums[i]);
		}
		System.out.println(max);
	}
}

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

import java.util.*;
public class test {

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

Compiler output:
Main.java:2: error: class test is public, should be declared in a file named test.java
public class test {
       ^
Main.java:6: error: no suitable constructor found for Scanner(no arguments)
        Scanner sc = new Scanner();
                     ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
2 errors
Language: Java

import java.util.*;
public class test {

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int max_profit = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < n; ++i)
        {
            int data = sc.nextInt();
            int profit = data - min;
            if (profit > max_profit)
            {
                max_profit = profit;
            }
            if (data < min)
            {
                min = data;
            }
        }
        System.out.println(max_profit);
    }
}

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

import java.util.Scanner;

public class MaximumProfit {

    public static void main(String[] args) {

        // ?????\??°???
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scan.nextInt();
        }

    }

    public int maxProfit(int[] prices) {
        if (prices == null || prices.length <= 1) {
            throw new IllegalArgumentException("prices?????????null ??? ??????????????§???1");
        }

        int maxValIndex = 0;
        int maxVal = prices[maxValIndex];
        int minVal = Integer.MAX_VALUE;
        for (int i = 1; i < prices.length; i++) {
            if (prices[i] > maxVal) {
                maxVal = prices[i];
                maxValIndex = i;
            }
            if (i <= maxValIndex) {
                minVal = Math.min(minVal, prices[i - 1]);
            }
        }
        return maxVal - minVal;
    }

}

Compiler output:
Main.java:3: 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;



    public static void main(String[] args) {

        // ?????\??°???
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scan.nextInt();
        }

    }

    public int maxProfit(int[] prices) {
        if (prices == null || prices.length <= 1) {
            throw new IllegalArgumentException("prices?????????null ??? ??????????????§???1");
        }

        int maxValIndex = 0;
        int maxVal = prices[maxValIndex];
        int minVal = Integer.MAX_VALUE;
        for (int i = 1; i < prices.length; i++) {
            if (prices[i] > maxVal) {
                maxVal = prices[i];
                maxValIndex = i;
            }
            if (i <= maxValIndex) {
                minVal = Math.min(minVal, prices[i - 1]);
            }
        }
        return maxVal - minVal;
    }

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

import java.util.Scanner;

public class Solution{

    public static void main(String[] args) {

        // ?????\??°???
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scan.nextInt();
        }

    }

    public int maxProfit(int[] prices) {
        if (prices == null || prices.length <= 1) {
            throw new IllegalArgumentException("prices?????????null ??? ??????????????§???1");
        }

        int maxValIndex = 0;
        int maxVal = prices[maxValIndex];
        int minVal = Integer.MAX_VALUE;
        for (int i = 1; i < prices.length; i++) {
            if (prices[i] > maxVal) {
                maxVal = prices[i];
                maxValIndex = i;
            }
            if (i <= maxValIndex) {
                minVal = Math.min(minVal, prices[i - 1]);
            }
        }
        return maxVal - minVal;
    }

}

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

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

public class main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		List<Integer> list = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			list.add(in.nextInt());
		}

		int max = list.get(1) -list.get(0);
		for (int i = 0; i < n; i++) {
			for (int j = i+1; j < n; j++) {
				int x =list.get(j)-list.get(i);
				if(max < x){
					max = x;
				}
			}
		}
		System.out.println(max);
	}
}

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

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

public class main {
	public static void Main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		List<Integer> list = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			list.add(in.nextInt());
		}

		int max = list.get(1) -list.get(0);
		for (int i = 0; i < n; i++) {
			for (int j = i+1; j < n; j++) {
				int x =list.get(j)-list.get(i);
				if(max < x){
					max = x;
				}
			}
		}
		System.out.println(max);
	}
}

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

import java.io.*;
 
class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        int[] R = new int[t];
        int i, j;
 
        R[0] = Integer.parseInt(br.readLine());
        int max = R[0];
        int min = R[0];
        int mint =0;
 
        for(i=1; i<t; i++){
            R[i] = Integer.parseInt(br.readLine());
            if(R[i] < min) {min = R[i]; mint=i; max=R[i];}
            else if(R[i] > max && i>mint) max=R[i];
        }
        int bnf = max - min;
        System.out.println(bnf);
    }

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

import java.io.*;
      
class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        int[] R = new int[t];
        int i, j;
      
        R[0] = Integer.parseInt(br.readLine());
        int max = R[0];
        int min = R[0];
      
        for(i=1; i<t-1; i++){
            R[i] = Integer.parseInt(br.readLine());
            if(R[i] < min) {min = R[i]; mint=i; max=R[i];}
            else if(R[i] > max) max=R[i];
        }
        if(min == R[t-2]) max = R[t-1];
        else if(min != R[t-2] && max < R[t-1]) max = R[t-1];
        int bnf = max - min;
        System.out.println(bnf);
    }
}

Compiler output:
Main.java:16: error: cannot find symbol
            if(R[i] < min) {min = R[i]; mint=i; max=R[i];}
                                        ^
  symbol:   variable mint
  location: class Main
1 error
Language: Java

import java.io.*;
       
class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        int[] R = new int[t];
        int i, j;
       
        R[0] = Integer.parseInt(br.readLine());
        int max = R[0];
        int min = R[0];
        int bnf, a;
        bnf = max - min;
       
        for(i=1; i<t-1; i++){
            R[i] = Integer.parseInt(br.readLine());
            if(R[i] < min) {min = R[i]; mint=i; max=R[i];}
            else if(R[i] > max) max=R[i];
            a = max - min;
            if(bnf < a) bnf = a; 
        }
        if(min == R[t-2]) max = R[t-1];
        else if(min != R[t-2] && max < R[t-1]) max = R[t-1];
        
        System.out.println(bnf);
    }
}

Compiler output:
Main.java:18: error: cannot find symbol
            if(R[i] < min) {min = R[i]; mint=i; max=R[i];}
                                        ^
  symbol:   variable mint
  location: class Main
1 error
Language: Java

import java.io.*;
             
class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        int[] R = new int[t];
        int i, j;
             
        for(i=0; i<t; i++) R[i] = Integer.parseInt(br.readLine());
        bnf = R[1] - R[0];
             
        for(i=0; i<t-1; i++){
            for(j=i+1; j<t; j++){
                a = R[j] - R[i];
                if(bnf < a) bnf = a;
            }
        }
              
        System.out.println(bnf);
    }
}

Compiler output:
Main.java:11: error: cannot find symbol
        bnf = R[1] - R[0];
        ^
  symbol:   variable bnf
  location: class Main
Main.java:15: error: cannot find symbol
                a = R[j] - R[i];
                ^
  symbol:   variable a
  location: class Main
Main.java:16: error: cannot find symbol
                if(bnf < a) bnf = a;
                   ^
  symbol:   variable bnf
  location: class Main
Main.java:16: error: cannot find symbol
                if(bnf < a) bnf = a;
                         ^
  symbol:   variable a
  location: class Main
Main.java:16: error: cannot find symbol
                if(bnf < a) bnf = a;
                            ^
  symbol:   variable bnf
  location: class Main
Main.java:16: error: cannot find symbol
                if(bnf < a) bnf = a;
                                  ^
  symbol:   variable a
  location: class Main
Main.java:20: error: cannot find symbol
        System.out.println(bnf);
                           ^
  symbol:   variable bnf
  location: class Main
7 errors
Language: Java

import java.io.*;
              
class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        int[] R = new int[t];
        int i, j;
              
        for(i=0; i<t; i++) R[i] = Integer.parseInt(br.readLine());
        int bnf = R[1] - R[0];
              
        for(i=0; i<t-1; i++){
            for(j=i+1; j<t; j++){
                a = R[j] - R[i];
                if(bnf < a) bnf = a;
            }
        }
               
        System.out.println(bnf);
    }
}

Compiler output:
Main.java:15: error: cannot find symbol
                a = R[j] - R[i];
                ^
  symbol:   variable a
  location: class Main
Main.java:16: error: cannot find symbol
                if(bnf < a) bnf = a;
                         ^
  symbol:   variable a
  location: class Main
Main.java:16: error: cannot find symbol
                if(bnf < a) bnf = a;
                                  ^
  symbol:   variable a
  location: class Main
3 errors
Language: Java

import java.util.*;
                  
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        int[] R = new int[t];
        int i, j, a, bnf;
        R[0] = sc.nextInt();
        R[1] = sc.nextInt();
        int max = R[1];
        int min = R[0];
        bnf = max - min;
                  
        for(i=2; i<t; i++){
            R[i] = sc.nextInt();
            if(bnf<0 && R[i]<R[i-1]){
                a = R[i] - R[i-1];
                if(bnf < a) bnf = a;
            }else{
                if(min>R[i]){ 
                    a = max - min;
                    if(bnf<a) bnf = a;
                    min = R[i];
                    max = R[i];
                }else if(max<R[i]) max = R[i];
        }
                   
        System.out.println(bnf);
    }
}

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