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

#include <iostream>
#include <cstdio>
#include <cstring>
#include <stack>
using namespace std;
stack<int> s;
char op[3333];
int main(){
    gets(op);
    int len = strlen(op);
    int n = 0;
    for(int i = 0; i < len; i++){
        if(op[i] >= '0' && op[i] <= '9'){
            n = n*10 + (op[i]-'0');
        }
        else if(op[i] == ' ' && op[i-1] >= '0' && op[i-1] <= '9'){
            s.push(n);
            n = 0;
        }
        else if(op[i] == '+' || op[i] == '-' || op[i] == '*' || op[i] == '/'){
            int y = s.top();
            s.pop();
            int x = s.top();
            s.pop();
            if(op[i] == '+'){
                s.push(x+y);
            }
            else if(op[i] == '-'){
                s.push(x-y);
            }
            else if(op[i] == '*'){
                s.push(x*y);
            }
            else if(op[i] == '/'){
                s.push(x/y);
            }
        }
    }
    cout << s.top();
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |     gets(op);
      |     ^~~~
      |     getw
Language: C++

#include<iostream>
#include<stack>
using namespace std;
int main(void){
    char num;
    int a,b;
    stack<int> st;
    for(int i=0;i<200;i++){
        if(!(cin >> num;))break;
        if(num=='+'){
            a = st.top();
            b = st.top();
            st.pop();
            st.pop();
            st.push(a+b);
        }else if(num=='-'){
            a = st.top();
            b = st.top();
            st.pop();
            st.pop();
            st.push(a-b);
        }else if(num=='*'){
            a = st.top();
            b = st.top();
            st.pop();
            st.pop();
            st.push(a*b);
        }else{
            st.push(num);
        }
    }
    cout << st.top() << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: expected ')' before ';' token
    9 |         if(!(cin >> num;))break;
      |             ~          ^
      |                        )
a.cc:9:24: error: expected ')' before ';' token
    9 |         if(!(cin >> num;))break;
      |           ~            ^
      |                        )
a.cc:9:25: error: expected primary-expression before ')' token
    9 |         if(!(cin >> num;))break;
      |                         ^
Language: C++

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

int Blan(){
	stack<int> a;
	int x,y;
	string s;
	while(cin>>s){
		if(s[0] == '+'){
			x = a.top();a.pop() ;
			y = a.top(); a.pop() ;
			a.push(x+y);  
		}
		else if(s[0] == '-'){
			x = a.top();a.pop() ;
			y = a.top(); a.pop() ;
			a.push(y-x);
		}
		else if(s[0] == '*'){
			x = a.top();a.pop() ;
			y = a.top(); a.pop() ;
			a.push(x*y);  
		}
		else{
			a.push(atoi(s));
		}
	}
	cout<<a.top() ;
	return 0;
}
int main(){
	Blan();
	return 0;
}


Compiler output:
a.cc: In function 'int Blan()':
a.cc:29:37: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   29 |                         a.push(atoi(s));
      |                                     ^
      |                                     |
      |                                     std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <stack>
using namespace std;
int main(void)
{
    int a,b;
    stack<int> stack;
    string instr;
    getline(cin,instr);
    for(int i=0;i<str.length();i++){
        if(input[i]==' ') continue;
        if(0<=atoi(&instr[i])&&atoi(&instr[i])<=9){
            stack.push(atoi(&instr[i]));
        }
        else{
            b=stack.top();stack.pop();
            a=stack.top();stack.pop();
            if(input[i]=='+') stack.push(a+b);
            if(input[i]=='-') stack.push(a-b);
            if(input[i]=='*') stack.push(a*b);
        }
    }
    cout << stack.top() << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: 'str' was not declared in this scope; did you mean 'std'?
   11 |     for(int i=0;i<str.length();i++){
      |                   ^~~
      |                   std
a.cc:12:12: error: 'input' was not declared in this scope; did you mean 'int'?
   12 |         if(input[i]==' ') continue;
      |            ^~~~~
      |            int
a.cc:19:16: error: 'input' was not declared in this scope; did you mean 'int'?
   19 |             if(input[i]=='+') stack.push(a+b);
      |                ^~~~~
      |                int
a.cc:20:16: error: 'input' was not declared in this scope; did you mean 'int'?
   20 |             if(input[i]=='-') stack.push(a-b);
      |                ^~~~~
      |                int
a.cc:21:16: error: 'input' was not declared in this scope; did you mean 'int'?
   21 |             if(input[i]=='*') stack.push(a*b);
      |                ^~~~~
      |                int
Language: C++

#include <iostream>
#include <stack>
#include <string>
#include <sstream>
using namespace std;
int main()
{
	double a,b;
	string s;
	stack <double> stack;
	getline(cin,s);
	stringstream ss(s);
	while( ss >> s ){
		if(s=="+"||s=="-"||s=="*"||s=="/"){
			b=stack.top();stack.pop();
			a=stack.top();stack.pop();
			if(s=="+") stack.push(a+b);
			else if(s=="-") stack.push(a-b);
			else if(s=="*") stack.push(a*b);
		}
		else stack.push(atoi(s));
	}
	cout << stack.top() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:38: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   21 |                 else stack.push(atoi(s));
      |                                      ^
      |                                      |
      |                                      std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: Java

import java.util.Scanner;

public class Main {

	public static int LEN = 100005;

	public static P[] Q = new P[LEN];
	public static int head, tail, n;

	public static void enqueue(P x) {
		Q[tail] = x;
		tail = (tail + 1) % LEN;
	}

	public static P dequeue() {
		P x = Q[head];
		head = (head + 1) % LEN;
		return x;
	}

	public static int min(int a, int b) {
		return a < b ? a : b;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < LEN; i++) {
			Q[i] = new P();
		}
		int elaps = 0, c;
		int i, q;
		P u;
		n = sc.nextInt();
		q = sc.nextInt();
		for (i = 1; i <= n; i++) {
			Q[i].setName(sc.next());
			Q[i].setTime(sc.nextInt());
		}

		while (head != tail) {
			u = dequeue();
			c = min(q, u.getTime());
			u.setTime(u.getTime() - c);
			elaps += c;
			if (u.getTime() > 0) {
				enqueue(u);
			} else {

			}
		}
		sc.close();
	}
}



Compiler output:
Main.java:7: error: cannot find symbol
	public static P[] Q = new P[LEN];
	              ^
  symbol:   class P
  location: class Main
Main.java:10: error: cannot find symbol
	public static void enqueue(P x) {
	                           ^
  symbol:   class P
  location: class Main
Main.java:15: error: cannot find symbol
	public static P dequeue() {
	              ^
  symbol:   class P
  location: class Main
Main.java:7: error: cannot find symbol
	public static P[] Q = new P[LEN];
	                          ^
  symbol:   class P
  location: class Main
Main.java:16: error: cannot find symbol
		P x = Q[head];
		^
  symbol:   class P
  location: class Main
Main.java:28: error: cannot find symbol
			Q[i] = new P();
			           ^
  symbol:   class P
  location: class Main
Main.java:32: error: cannot find symbol
		P u;
		^
  symbol:   class P
  location: class Main
7 errors
Language: Java

import java.util.Scanner;

public class Main {

	static int LEN = 100005;

	static P[] Q = new P[LEN];
	static int head, tail, n;

	static void enqueue(P x) {
		Q[tail] = x;
		tail = (tail + 1) % LEN;
	}

	static P dequeue() {
		P x = Q[head];
		head = (head + 1) % LEN;
		return x;
	}

	static int min(int a, int b) {
		return a < b ? a : b;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < LEN; i++) {
			Q[i] = new P();
		}
		int elaps = 0, c;
		int i, q;
		P u;
		n = sc.nextInt();
		q = sc.nextInt();
		for (i = 1; i <= n; i++) {
			Q[i].setName(sc.next());
			Q[i].setTime(sc.nextInt());
		}

		while (head != tail) {
			u = dequeue();
			c = min(q, u.getTime());
			u.setTime(u.getTime() - c);
			elaps += c;
			if (u.getTime() > 0) {
				enqueue(u);
			} else {

			}
		}
		sc.close();
	}
}



Compiler output:
Main.java:7: error: cannot find symbol
	static P[] Q = new P[LEN];
	       ^
  symbol:   class P
  location: class Main
Main.java:10: error: cannot find symbol
	static void enqueue(P x) {
	                    ^
  symbol:   class P
  location: class Main
Main.java:15: error: cannot find symbol
	static P dequeue() {
	       ^
  symbol:   class P
  location: class Main
Main.java:7: error: cannot find symbol
	static P[] Q = new P[LEN];
	                   ^
  symbol:   class P
  location: class Main
Main.java:16: error: cannot find symbol
		P x = Q[head];
		^
  symbol:   class P
  location: class Main
Main.java:28: error: cannot find symbol
			Q[i] = new P();
			           ^
  symbol:   class P
  location: class Main
Main.java:32: error: cannot find symbol
		P u;
		^
  symbol:   class P
  location: class Main
7 errors
Language: Java

import java.util.Scanner;

public class Main {

	public static int LEN = 100005;

	public static P[] Q = new P[LEN];
	public static int head, tail, n;

	public static void enqueue(P x) {
		Q[tail] = x;
		tail = (tail + 1) % LEN;
	}

	public static P dequeue() {
		P x = Q[head];
		head = (head + 1) % LEN;
		return x;
	}

	public static int min(int a, int b) {
		return a < b ? a : b;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < LEN; i++) {
			Q[i] = new P();
		}
		int elaps = 0, c;
		int i, q;
		P u;
		n = sc.nextInt();
		q = sc.nextInt();
		for (i = 1; i <= n; i++) {
			Q[i].setName(sc.next());
			Q[i].setTime(sc.nextInt());
		}

		while (head != tail) {
			u = dequeue();
			c = min(q, u.getTime());
			u.setTime(u.getTime() - c);
			elaps += c;
			if (u.getTime() > 0) {
				enqueue(u);
			} else {

			}
		}
		sc.close();
	}
}

package alds1_3_b_Queue;

public class P {

	private String name;
	private int time;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getTime() {
		return time;
	}

	public void setTime(int time) {
		this.time = time;
	}
}



Compiler output:
Main.java:55: error: class, interface, enum, or record expected
package alds1_3_b_Queue;
^
1 error
Language: Java

import java.util.Scanner;

public class Main {

	public static int LEN = 100005;

	public static P[] Q = new P[LEN];
	public static int head, tail, n;

	public static void enqueue(P x) {
		Q[tail] = x;
		tail = (tail + 1) % LEN;
	}

	public static P dequeue() {
		P x = Q[head];
		head = (head + 1) % LEN;
		return x;
	}

	public static int min(int a, int b) {
		return a < b ? a : b;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < LEN; i++) {
			Q[i] = new P();
		}
		int elaps = 0, c;
		int i, q;
		P u;
		n = sc.nextInt();
		q = sc.nextInt();
		for (i = 1; i <= n; i++) {
			Q[i].setName(sc.next());
			Q[i].setTime(sc.nextInt());
		}

		while (head != tail) {
			u = dequeue();
			c = min(q, u.getTime());
			u.setTime(u.getTime() - c);
			elaps += c;
			if (u.getTime() > 0) {
				enqueue(u);
			} else {

			}
		}
		sc.close();
	}
}

public class P {

	private String name;
	private int time;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getTime() {
		return time;
	}

	public void setTime(int time) {
		this.time = time;
	}
}



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


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;

class Main {

	/*
	 * 10番目のテストケースでTLEになったのがショックでした
	 */

	public static void main(String[] args) throws Exception {
		//入力と準備
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner scanner = new Scanner(br.readLine());
		int n = scanner.nextInt();
		int quantum = scanner.nextInt();
		scanner.close();
		String name[] = new String[n];
		int time[] = new int[n];
		Queue<Integer> queue = new ArrayDeque<Integer>(n);
		for(int i=0; i<n; i++) {
			scanner = new Scanner(br.readLine());
			name[i] = scanner.next();
			time[i] = scanner.nextInt();
			scanner.close();
			queue.add(i);
		}
		int currentTime =  0;
		//順に処理
		for(;!queue.isEnpty;) {
			int taskNo = queue.poll();
			time[taskNo] -= quantum;
			currentTime += quantum;
			if(time[taskNo] <= 0) {
				currentTime += time[taskNo];//超過しているので戻す
				System.out.println(name[taskNo]+" "+String.valueOf(currentTime));
				continue;
			}
			queue.add(taskNo);
		}

	}

}



Compiler output:
Main.java:33: error: cannot find symbol
		for(;!queue.isEnpty;) {
		           ^
  symbol:   variable isEnpty
  location: variable queue of type Queue<Integer>
1 error
Language: Java


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;

class Main {

	/*
	 * 10番目のテストケースでTLEになったのがショックでした
	 */

	public static void main(String[] args) throws Exception {
		//入力と準備
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner scanner = new Scanner(br.readLine());
		int n = scanner.nextInt();
		int quantum = scanner.nextInt();
		scanner.close();
		String name[] = new String[n];
		int time[] = new int[n];
		Queue<Integer> queue = new ArrayDeque<Integer>(n);
		for(int i=0; i<n; i++) {
			scanner = new Scanner(br.readLine());
			name[i] = scanner.next();
			time[i] = scanner.nextInt();
			scanner.close();
			queue.add(i);
		}
		int currentTime =  0;
		//順に処理
		for(;!queue.isEnpty();) {
			int taskNo = queue.poll();
			time[taskNo] -= quantum;
			currentTime += quantum;
			if(time[taskNo] <= 0) {
				currentTime += time[taskNo];//超過しているので戻す
				System.out.println(name[taskNo]+" "+String.valueOf(currentTime));
				continue;
			}
			queue.add(taskNo);
		}

	}

}



Compiler output:
Main.java:33: error: cannot find symbol
		for(;!queue.isEnpty();) {
		           ^
  symbol:   method isEnpty()
  location: variable queue of type Queue<Integer>
1 error
Language: Java


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;

class Main {

	/*
	 * 10番目のテストケースでTLEになったのがショックでした
	 */

	public static void main(String[] args) throws Exception {
		//入力と準備
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner scanner = new Scanner(br.readLine());
		int n = scanner.nextInt();
		int quantum = scanner.nextInt();
		scanner.close();
		String name[] = new String[n];
		int time[] = new int[n];
		Queue<Integer> queue = new ConcurrentLinkedQueue<Integer>();
		for(int i=0; i<n; i++) {
			scanner = new Scanner(br.readLine());
			name[i] = scanner.next();
			time[i] = scanner.nextInt();
			scanner.close();
			queue.add(i);
		}
		int currentTime =  0;
		//順に処理
		for(;!queue.isEmpty();) {
			int taskNo = queue.poll();
			time[taskNo] -= quantum;
			currentTime += quantum;
			if(time[taskNo] <= 0) {
				currentTime += time[taskNo];//超過しているので戻す
				System.out.println(name[taskNo]+" "+String.valueOf(currentTime));
				continue;
			}
			queue.add(taskNo);
		}

	}

}



Compiler output:
Main.java:23: error: cannot find symbol
		Queue<Integer> queue = new ConcurrentLinkedQueue<Integer>();
		                           ^
  symbol:   class ConcurrentLinkedQueue
  location: class Main
1 error
Language: Java

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

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int q = sc.nextInt();
		Orique oq = new Orique();
		for (int i = 0; i < n; i++) {
			oq.inque(sc.next(), sc.nextInt());
		}
		sc.close();
		oq.RoundRobinScheduling(q);
	}
}

class Orique {
	private class kakunou {
		String kstr;
		int kint;
		int kprenum;

		void setkakunou(String s, int i, int pre) {
			kstr = s;
			kint = i;
			kprenum = pre;
		}
	}

	private int length = 0;
	ArrayList<String> str = new ArrayList<String>();
	ArrayList<Integer> in = new ArrayList<Integer>();
	kakunou k;
	private ArrayList<Integer> prenumber = new ArrayList<Integer>();

	Orique() {
		k = new kakunou();
	}

	public void inque(String t, int i) {
		str.add(t);
		in.add(i);
		prenumber.add(i);
		length++;
	}

	private void inque(kakunou k) {
		str.add(k.kstr);
		in.add(k.kint);
		prenumber.add(k.kprenum);
		length++;
	}

	private void deque() {
		k.setkakunou(str.get(0), in.get(0), prenumber.get(0));
		str.remove(0);
		in.remove(0);
		prenumber.remove(0);
		length--;

	}
    public void RoundRobinScheduling(int q) {
		
		int total=0;
		deque();
		while(true){
			int t1=k.kint-q;
			if(t1>0){
				total=total+q;
				k.kint=t1;
				inque(k);
				
			}else{
				total=total+k.kint;
				System.out.println(k.kstr+" "+total);
				}
			if(length>0)deque();
			else break;
		}
		}

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

import java.util.Scanner;


public class Main{

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String[] one = s.nextLine().split(" ");
		QueueImpl qqq = new Queue().new QueueImpl();
		for(int i=0 ; i<new Integer(one[0]).intValue() ; i++){
			String[] two = s.nextLine().split(" ");
			Process p = new Queue().new Process(two[0], new Integer(two[1]).intValue());
			qqq.enqueue(p);
		}

		int quon = new Integer(one[1]).intValue();
		int totalTime = 0;
		while(! qqq.isEmpty()) {
			Process p = qqq.dequeue();
			if(quon >= p.time) {
				totalTime += p.time;
				System.out.println(p.name + " " + totalTime);
			}else {
				p.time = p.time - quon;
				qqq.enqueue(p);
				totalTime += quon;
			}
		}
	}

	public class QueueImpl {
		Process[] array;
		int head;
		int tail;
		public QueueImpl() {
			array = new Process[100000];
			head = -1;
			tail = -1;
		}

		public void enqueue(Process obj) {
			if(tail == 99999)
				tail = -1;
			tail++;
			array[tail] = obj;
		}

		public Process dequeue() {
			if(head == 99999)
				head = -1;
			head++;
			Process tmp = array[head];
			array[head] = null;
			return tmp;
		}

		public boolean isEmpty(){
			return this.head == this.tail;
		}
	}

	public class Process {
		String name;
		int time;
		public Process(String name, int time) {
			this.name = name;
			this.time = time;
		}
	}
}

Compiler output:
Main.java:9: error: cannot find symbol
		QueueImpl qqq = new Queue().new QueueImpl();
		                    ^
  symbol:   class Queue
  location: class Main
Main.java:10: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
		for(int i=0 ; i<new Integer(one[0]).intValue() ; i++){
		                ^
Main.java:12: error: cannot find symbol
			Process p = new Queue().new Process(two[0], new Integer(two[1]).intValue());
			                ^
  symbol:   class Queue
  location: class Main
Main.java:12: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
			Process p = new Queue().new Process(two[0], new Integer(two[1]).intValue());
			                                            ^
Main.java:16: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
		int quon = new Integer(one[1]).intValue();
		           ^
2 errors
3 warnings
Language: Java

import java.util.Scanner;


public class Main{

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String[] one = s.nextLine().split(" ");
		Queue.QueueImpl qqq = new Queue().new QueueImpl();
		for(int i=0 ; i<new Integer(one[0]).intValue() ; i++){
			String[] two = s.nextLine().split(" ");
			Queue.Process p = new Queue().new Process(two[0], new Integer(two[1]).intValue());
			qqq.enqueue(p);
		}

		int quon = new Integer(one[1]).intValue();
		int totalTime = 0;
		while(! qqq.isEmpty()) {
			Queue.Process p = qqq.dequeue();
			if(quon >= p.time) {
				totalTime += p.time;
				System.out.println(p.name + " " + totalTime);
			}else {
				p.time = p.time - quon;
				qqq.enqueue(p);
				totalTime += quon;
			}
		}
	}

	public class QueueImpl {
		Process[] array;
		int head;
		int tail;
		public QueueImpl() {
			array = new Process[100000];
			head = -1;
			tail = -1;
		}

		public void enqueue(Process obj) {
			if(tail == 99999)
				tail = -1;
			tail++;
			array[tail] = obj;
		}

		public Process dequeue() {
			if(head == 99999)
				head = -1;
			head++;
			Process tmp = array[head];
			array[head] = null;
			return tmp;
		}

		public boolean isEmpty(){
			return this.head == this.tail;
		}
	}

	public class Process {
		String name;
		int time;
		public Process(String name, int time) {
			this.name = name;
			this.time = time;
		}
	}
}

Compiler output:
Main.java:9: error: package Queue does not exist
		Queue.QueueImpl qqq = new Queue().new QueueImpl();
		     ^
Main.java:9: error: cannot find symbol
		Queue.QueueImpl qqq = new Queue().new QueueImpl();
		                          ^
  symbol:   class Queue
  location: class Main
Main.java:10: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
		for(int i=0 ; i<new Integer(one[0]).intValue() ; i++){
		                ^
Main.java:12: error: package Queue does not exist
			Queue.Process p = new Queue().new Process(two[0], new Integer(two[1]).intValue());
			     ^
Main.java:12: error: cannot find symbol
			Queue.Process p = new Queue().new Process(two[0], new Integer(two[1]).intValue());
			                      ^
  symbol:   class Queue
  location: class Main
Main.java:12: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
			Queue.Process p = new Queue().new Process(two[0], new Integer(two[1]).intValue());
			                                                  ^
Main.java:16: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
		int quon = new Integer(one[1]).intValue();
		           ^
Main.java:19: error: package Queue does not exist
			Queue.Process p = qqq.dequeue();
			     ^
5 errors
3 warnings
Language: Java

import java.util.Scanner;


public class Main{

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String[] one = s.nextLine().split(" ");
		QueueImpl qqq = new Queue().new QueueImpl();
		for(int i=0 ; i<new Integer(one[0]).intValue() ; i++){
			String[] two = s.nextLine().split(" ");
			Process p = new Queue().new Process(two[0], new Integer(two[1]).intValue());
			qqq.enqueue(p);
		}

		int quon = new Integer(one[1]).intValue();
		int totalTime = 0;
		while(! qqq.isEmpty()) {
			Process p = qqq.dequeue();
			if(quon >= p.time) {
				totalTime += p.time;
				System.out.println(p.name + " " + totalTime);
			}else {
				p.time = p.time - quon;
				qqq.enqueue(p);
				totalTime += quon;
			}
		}
	}

	class QueueImpl {
		Process[] array;
		int head;
		int tail;
		public QueueImpl() {
			array = new Process[100000];
			head = -1;
			tail = -1;
		}

		public void enqueue(Process obj) {
			if(tail == 99999)
				tail = -1;
			tail++;
			array[tail] = obj;
		}

		public Process dequeue() {
			if(head == 99999)
				head = -1;
			head++;
			Process tmp = array[head];
			array[head] = null;
			return tmp;
		}

		public boolean isEmpty(){
			return this.head == this.tail;
		}
	}

	class Process {
		String name;
		int time;
		public Process(String name, int time) {
			this.name = name;
			this.time = time;
		}
	}
}

Compiler output:
Main.java:9: error: cannot find symbol
		QueueImpl qqq = new Queue().new QueueImpl();
		                    ^
  symbol:   class Queue
  location: class Main
Main.java:10: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
		for(int i=0 ; i<new Integer(one[0]).intValue() ; i++){
		                ^
Main.java:12: error: cannot find symbol
			Process p = new Queue().new Process(two[0], new Integer(two[1]).intValue());
			                ^
  symbol:   class Queue
  location: class Main
Main.java:12: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
			Process p = new Queue().new Process(two[0], new Integer(two[1]).intValue());
			                                            ^
Main.java:16: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
		int quon = new Integer(one[1]).intValue();
		           ^
2 errors
3 warnings
Language: Java

import java.io.*;

public class Queue{
	private Node first, last;

	public Queue(){
		int n, limit = 0, timeSt = 0;
		String[] tmp;
		Node[] process;

		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in), 1);
		try{
			tmp = br.readLine().split(" ");
			n = Integer.parseInt(tmp[0]);
			limit = Integer.parseInt(tmp[1]);
			process = new Node[n];

			for(int i=0; i < n; i++){
				tmp = br.readLine().split(" ");
				process[i] = 
					new Node(tmp[0], Integer.parseInt(tmp[1]));
				enqueue(process[i]);
			}

		}catch(IOException e){
			System.out.println(e);
		}
		Node node = null;
		while( (node = dequeue()) != null){
			if( node.getTime() <= limit){
				timeSt += node.getTime(); 
				System.out.println(node+" "+timeSt);
			}else{
				timeSt += limit;
				int t = node.getTime();
				node.setTime(t - limit);
				enqueue(node);
			}
		}
	}

	void enqueue(Node p){
		if(first == null){
			last = p;
			first = last; 
		} else{
			last.next = p;
			last = last.next;
		}
	}
	Node dequeue(){
		if(first != null){
			Node tmp = first;
			first = first.next;
			tmp.next = null;
			return tmp;
		}
		return null;
	}

	void printQueue(){
		Node n = first;
		while(n != null){
			System.out.println(n);
			n = n.next;
			System.out.println("aaaaa");
		}
	}
	
	public static void main(String[] args){
		new Queue();
	}
}

class Node{
	private String name;
	private int time;
	Node next;

	Node(String name, int time){
		this.name = name;
		this.time = time;
	}
	int getTime(){
		return this.time;
	}
	void setTime(int time){
		this.time = time;
	}
	void setNext(Node n){
		next = n;
	}
	@Override
	public String toString(){
		return name;
	}
}

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

import java.io.*;

class Main{
	private Node first, last;

	public Queue(){
		int n, limit = 0, timeSt = 0;
		String[] tmp;
		Node[] process;

		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in), 1);
		try{
			tmp = br.readLine().split(" ");
			n = Integer.parseInt(tmp[0]);
			limit = Integer.parseInt(tmp[1]);
			process = new Node[n];

			for(int i=0; i < n; i++){
				tmp = br.readLine().split(" ");
				process[i] = 
					new Node(tmp[0], Integer.parseInt(tmp[1]));
				enqueue(process[i]);
			}

		}catch(IOException e){
			System.out.println(e);
		}
		Node node = null;
		while( (node = dequeue()) != null){
			if( node.getTime() <= limit){
				timeSt += node.getTime(); 
				System.out.println(node+" "+timeSt);
			}else{
				timeSt += limit;
				int t = node.getTime();
				node.setTime(t - limit);
				enqueue(node);
			}
		}
	}

	void enqueue(Node p){
		if(first == null){
			last = p;
			first = last; 
		} else{
			last.next = p;
			last = last.next;
		}
	}
	Node dequeue(){
		if(first != null){
			Node tmp = first;
			first = first.next;
			tmp.next = null;
			return tmp;
		}
		return null;
	}

	void printQueue(){
		Node n = first;
		while(n != null){
			System.out.println(n);
			n = n.next;
			System.out.println("aaaaa");
		}
	}
	
	public static void main(String[] args){
		new Main();
	}
}

class Node{
	private String name;
	private int time;
	Node next;

	Node(String name, int time){
		this.name = name;
		this.time = time;
	}
	int getTime(){
		return this.time;
	}
	void setTime(int time){
		this.time = time;
	}
	void setNext(Node n){
		next = n;
	}
	@Override
	public String toString(){
		return name;
	}
}

Compiler output:
Main.java:6: error: invalid method declaration; return type required
	public Queue(){
	       ^
1 error
Language: Java

import java.io.*;
import java.util.*;
  
class Main {
    public static void main(String[] args) {
        BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        try {
  
            String[] str = kb.readLine().split( " " );
            int n = Integer.parseInt( str[0] );
            int q = Integer.parseInt( str[1] );
             
            LinkedList<Ps> queue = new LinkedList<Ps>();
             
            for( int i=0; i<n; i++ ) {
                str = kb.readLine().split( " " );
                queue.offer( new Ps( str[0], Integer.parseInt( str[1] ) ) );
            }
 
            StringBuilder output = new  StringBuilder( );   
            Ps ps;         
            int time;
           	time = 0;
            while( null != ( ps = queue.poll() ) ) {
            	
                if( ps.t <= q ) {
                    output.append( ps.name );
                    output.append( " " );
                    time += ps.t;    
                    output.append(  time );
                    output.append( "\n" );
          
                } else {
                	ps.t -= q;
                    queue.offer( ps );
                    time += q;           
                }
            }
            System.out.print( output );
              
        } catch( IOException e ) {
            System.err.println( e );
        }
    }
}

Compiler output:
Main.java:13: error: cannot find symbol
            LinkedList<Ps> queue = new LinkedList<Ps>();
                       ^
  symbol:   class Ps
  location: class Main
Main.java:13: error: cannot find symbol
            LinkedList<Ps> queue = new LinkedList<Ps>();
                                                  ^
  symbol:   class Ps
  location: class Main
Main.java:17: error: cannot find symbol
                queue.offer( new Ps( str[0], Integer.parseInt( str[1] ) ) );
                                 ^
  symbol:   class Ps
  location: class Main
Main.java:21: error: cannot find symbol
            Ps ps;         
            ^
  symbol:   class Ps
  location: class Main
4 errors
Language: Java

import java.io.*;

class Main{
        static ArrayDeque<Elem> dq;
        static int size;
        static int max;
        static int time = 0;

        static class Elem{
                String s;
                Integer i;
                public Elem(String s, Integer i){
                        this.s = s;
                        this.i = i;
                }
                public int minus(int i){
                        int j = this.i>=i ? i : this.i;
                        this.i -= j;
                        return j;
                }
        }

        static void runqueue(){
                while(!dq.isEmpty()){
                        Elem e = dq.pollFirst();
                        time += e.minus(max);

                        if(e.i>0)
                                dq.offerLast(e);
                        else
                                System.out.println(e.s + " " + time);
                }
        }

        public static void main(String[] args) throws IOException{
                BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                String[] line = br.readLine().split(" ");
                size = Integer.parseInt(line[0]);
                max = Integer.parseInt(line[1]);

                dq = new ArrayDeque<>();
                for(int i=0; i<size; i++){
                        line = br.readLine().split(" ");
                        Elem e = new Elem(line[0], Integer.parseInt(line[1]));
                        dq.offerLast(e);
                }
                runqueue();
        }
}

Compiler output:
Main.java:4: error: cannot find symbol
        static ArrayDeque<Elem> dq;
               ^
  symbol:   class ArrayDeque
  location: class Main
Main.java:41: error: cannot find symbol
                dq = new ArrayDeque<>();
                         ^
  symbol:   class ArrayDeque
  location: class Main
2 errors
Language: Java

import java.util.AbstractMap;
import java.util.ArrayDeque;
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 q = sc.nextInt();
		sc.nextLine();

		String[] p = new String[n];
		int[] t = new int[n];
//		LinkedHashMap<String, Integer> hmi = new LinkedHashMap<>();
//		LinkedHashMap[] hm = new LinkedHashMap[n];
		ArrayDeque<AbstractMap.SimpleEntry<String, Integer>> ad =
				new ArrayDeque<>();
		for (int i = 0; i < n; i++) {
			p[i] = sc.next();
			t[i] = sc.nextInt();
//			hmi.put(p[i], t[i]);
//			( (LinkedHashMap<String, Integer>) hm[i] ).put(p[i], t[i]);
			AbstractMap.SimpleEntry<String, Integer> pair =
					new AbstractMap.SimpleEntry<>(p[i], t[i]);
			ad.add(pair);
		}

//		System.out.println(Arrays.toString(p));
//		System.out.println(Arrays.toString(t));
//		System.out.println(ad.poll());

		int time = 0;
		while (!ad.isEmpty()) {
			AbstractMap.SimpleEntry<String, Integer> pair = ad.poll();
			// pt: pair time
			int pt = pair.getValue() - q;
			// pp : pair name
			String pn = pair.getKey();

			if (pt > 0) {
				pair.setValue(pt);
				ad.add(pair);
				time += q;
			} else {
				time += pair.getValue();
				System.out.println(pn + " " + time);
			}
		}
	}

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

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

public class Main
{
    public static void main(String[] args)
    {
        Deque<String> name = new ArrayDeque<String>();
        Deque<Integer> time = new ArrayDeque<Integer>();
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();
        int quantum = scan.nextInt();

        for(int i=0; i<n; i++)
        {
            name.offerLast(scan.next());
            time.offerLast(scan.nextInt());
        }

        String process_name;
        int process_time;
        int elapsed_time;
        while((process_name = name.pollFirst)!=null)
        {
            process_time = time.pollFirst;
            if(process_time > quantum)
            {
                name.offerLast(process_name);
                time.offerLast(process_time - quantum);
                elapsed_time += quantum;
            }
            else
            {
                elapsed_time += process_time;
                Sytem.out.println(process_name + " " + elapsed_time)
            }
        }
    }
}

Compiler output:
Main.java:36: error: ';' expected
                Sytem.out.println(process_name + " " + elapsed_time)
                                                                    ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;

class Main {

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] str = br.readLine().split(" ");

		int n = Integer.parseInt(str[0]);

		int q = Integer.parseInt(str[1]);

		Deque<String> dq = new ArrayDeque<>();

		for (int i = 0; i < n; i++) {
			String[] name_time = br.readLine().split(" ");

			dq.offerLast(name_time[0]);
			dq.offerLast(name_time[1]);

		}

		int[] total_time = new int[n];
		String[] name = new String[n];

		int a = 0;
		int p = 0;
		while (!(dq.isEmpty())) {

			String Now_name = dq.pollFirst();

			int now_time = Integer.parseInt(dq.pollFirst());
			/*
			 * System.out.println(Now_name+" "+now_time);
			 */
			if (now_time - q > 0) {
				dq.offerLast(Now_name);
				dq.offerLast(String.valueOf(now_time - q));

				a += q;
			} else {
				a += now_time;
				total_time[p] = a;
				name[p] = Now_name;

				p++;
			}

		}

		for (int i = 0; i < n; i++) {
			System.out.println(name[i] + " " + total_time[i]);
		}
	}

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

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);
	private static final int MAX = 100_001;
	private static String[] P = new String[MAX];
	private static int[] Q = new int[MAX];
	private static int head, tail;
	private static int headQ, tailQ;

	public static void main(String[] args){

		initialize();
		initializeQ();
		int n = scan.nextInt();
		int q = scan.nextInt();
		String[] p = new String[n];
		for(int i = 0; i < n; i++){
			String s = scan.next();
			int m = scan.nextInt();
			enqueue(s);
			enqueseQ(m);
		}
		int total = 0;
		for(;;){
			String s = dequeue();
			int m = dequeueQ();
			if(m >q){
				total += q;
				m = m - q;
				enqueue(s);
				enqueueQ(m);
			}else{
				total += m;
				System.out.printf("%s ", s);
				System.out.printf("%d\n", total);
				if(isEmpty() && isEmptyQ())
					break;
			}
		}
	}

	private static void initializeQ(){
		headQ = tailQ = 0;
	}
	private static boolean isEmptyQ(){
		return headQ == tailQ;
	}
	private static boolean isFullQ(){
		return headQ == (tailQ + 1) % MAX;
	}
	public static void enqueueQ(int y){
		if(isFullQ())
			System.out.printf("%s\n", "???????????????????????§???");
		Q[tailQ] = y;
		if(tailQ + 1 == MAX)
			tailQ = 0;
		else
			tailQ++;
	}
	public static int dequeueQ(){
		if(isEmptyQ())
			System.out.printf("%s\n", "??¢????????????????????§???");
		int y = Q[headQ];
		if(headQ + 1 == MAX)
			headQ = 0;
		else
			headQ++;
		return y;
	}

	private static void initialize(){
		head = tail = 0;
	}
	private static boolean isEmpty(){
		return head == tail;
	}
	private static boolean isFull(){
		return head == (tail + 1) % MAX;
	}
	public static void enqueue(String x){
		if(isFull())
			System.out.printf("%s\n", "???????????????????????§???");
		P[tail] = x;
		if(tail + 1 == MAX)
			tail = 0;
		else
			tail++;
	}
	public static String dequeue(){
		if(isEmpty())
			System.out.printf("%s\n", "??¢????????????????????§???");
		String x = P[head];
		if(head + 1 == MAX)
			head = 0;
		else
			head++;
		return x;
	}
}

Compiler output:
Main.java:22: error: cannot find symbol
			enqueseQ(m);
			^
  symbol:   method enqueseQ(int)
  location: class Main
1 error
Language: Java

import java.util.*;

class process {
  private String name;
  private int time;

  public process(String name,int time){
    this.name = name;
    this.time = time;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getName() {
    return name;
  }

  public void setTime(int time) {
    this.time = time;
  }

  public int getTime() {
    return time;
  }
}


public class QueueArray {
  int length, front, rear;
  process[] queue;

  // ??????????????????????????????????????????????????????????????????
  QueueArray(int len) {
    queue = new process[len];
  }

  // ??????????????¨????????\???
  void enqueue(process val) {
    if (queue.length == length) {
      System.out.println("Fatal error: the queue is full.");
      System.exit(1);
    }

    queue[rear] = val;
    rear = (rear+1)%queue.length;
    length++;
  }

  // ????????????????????\???
  process dequeue() {
    if (length == 0) {
      System.out.println("Fatal error: the queue is empty.");
      System.exit(1);
    }

    process ret = queue[front];
    front = (front+1)%queue.length;
    length--;
    return ret;
  }

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

    QueueArray queue = new QueueArray(n);
    for (int i=0; i<n; i++) {
      queue.enqueue(new process(sc.next(), Integer.parseInt(sc.next())));
    }
    QueueArray result = new QueueArray(n);

    int elapsed = 0;
    int n_ = n;
    while (n > 0) {
      process p = queue.dequeue();
      if (p.getTime() - q <= 0) {
        elapsed += p.getTime();
        result.enqueue(new process(p.getName(), elapsed));
        n--;
      } else {
        elapsed += q;
        queue.enqueue(new process(p.getName(), p.getTime()-q));
      }
    }

    while (n_-- > 0) {
      process r = result.dequeue();
      System.out.println(r.getName() + " " + String.valueOf(r.getTime()));
    }
  }
}

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

import java.util.*;

class process {
  private String name;
  private int time;

  public process(String name,int time){
    this.name = name;
    this.time = time;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getName() {
    return name;
  }

  public void setTime(int time) {
    this.time = time;
  }

  public int getTime() {
    return time;
  }
}


public class Main {
  int length, front, rear;
  process[] queue;

  // ??????????????????????????????????????????????????????????????????
  Main(int len) {
    queue = new process[len];
  }

  // ??????????????¨????????\???
  void enqueue(process val) {
    if (queue.length == length) {
      System.out.println("Fatal error: the queue is full.");
      System.exit(1);
    }

    queue[rear] = val;
    rear = (rear+1)%queue.length;
    length++;
  }

  // ????????????????????\???
  process dequeue() {
    if (length == 0) {
      System.out.println("Fatal error: the queue is empty.");
      System.exit(1);
    }

    process ret = queue[front];
    front = (front+1)%queue.length;
    length--;
    return ret;
  }

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

    QueueArray queue = new QueueArray(n);
    for (int i=0; i<n; i++) {
      queue.enqueue(new process(sc.next(), Integer.parseInt(sc.next())));
    }
    QueueArray result = new QueueArray(n);

    int elapsed = 0;
    int n_ = n;
    while (n > 0) {
      process p = queue.dequeue();
      if (p.getTime() - q <= 0) {
        elapsed += p.getTime();
        result.enqueue(new process(p.getName(), elapsed));
        n--;
      } else {
        elapsed += q;
        queue.enqueue(new process(p.getName(), p.getTime()-q));
      }
    }

    while (n_-- > 0) {
      process r = result.dequeue();
      System.out.println(r.getName() + " " + String.valueOf(r.getTime()));
    }
  }
}

Compiler output:
Main.java:70: error: cannot find symbol
    QueueArray queue = new QueueArray(n);
    ^
  symbol:   class QueueArray
  location: class Main
Main.java:70: error: cannot find symbol
    QueueArray queue = new QueueArray(n);
                           ^
  symbol:   class QueueArray
  location: class Main
Main.java:74: error: cannot find symbol
    QueueArray result = new QueueArray(n);
    ^
  symbol:   class QueueArray
  location: class Main
Main.java:74: error: cannot find symbol
    QueueArray result = new QueueArray(n);
                            ^
  symbol:   class QueueArray
  location: class Main
4 errors
Language: Java

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

public class P2{

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] items = br.readLine().split(" ");
        int length = Integer.parseInt(items[0]);
        int qms = Integer.parseInt(items[1]);
        ArrayDeque<P> queue = new ArrayDeque<P>();
        for(int i = 0; i < length; i++){
            items = br.readLine().split(" ");
            P p = new P();
            p.name = items[0];
            p.time = Integer.parseInt(items[1]);
            queue.addLast(p);
        }

        StringBuilder sb = new StringBuilder();
        System.out.println();

        int sTime = 0;
        while (!queue.isEmpty()) {
        P p = new P();
          p = queue.pollFirst();
          if(p.time - qms <= 0){
              sTime += p.time;
              sb.append(p.name).append(" ").append(sTime).append("\n");
            }else if(p.time - qms > 0){
              p.time = p.time - qms;
              queue.addLast(p);
              sTime = sTime + qms;
            }
          }

        System.out.print(sb);
    }
}

class P{
    String name;
    int time;
}

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

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

public class P2{

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] items = br.readLine().split(" ");
        int length = Integer.parseInt(items[0]);
        int qms = Integer.parseInt(items[1]);
        ArrayDeque<P> queue = new ArrayDeque<P>();
        for(int i = 0; i < length; i++){
            items = br.readLine().split(" ");
            P p = new P();
            p.name = items[0];
            p.time = Integer.parseInt(items[1]);
            queue.addLast(p);
        }

        StringBuilder stringBuilder = new StringBuilder();
        System.out.println();

        int sTime = 0;
        while (!queue.isEmpty()) {
        P p = new P();
          p = queue.pollFirst();
          if(p.time - qms <= 0){
              sTime += p.time;
              stringBuilder.append(p.name).append(" ").append(sTime).append("\n");
            }else if(p.time - qms > 0){
              p.time = p.time - qms;
              queue.addLast(p);
              sTime = sTime + qms;
            }
          }

        System.out.print(stringBuilder);
    }
}

class P{
    String name;
    int time;
}

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