Language: Java

package Queue;

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

public class Sample_Queue {
	static String ERRORMSG = "WHAT!?";

	static class Process {
		// ?????§???????????°?????????
		final int MIN_NAME_LENGTH = 1;
		final int MIN_TIME = 1;
		final int MAX_NAME_LENGTH = 10;
		final int MAX_TIME = 50000;

		// ?±???§?????????
		private String name = "";
		private int time = 0;

		// ??????????????????????????????
		public Process() {
			super();
		}

		public Process(String name, int time) throws Exception {
			if (inputchk(name, time)) {
				this.name = name;
				this.time = time;
			} else
				throw new Exception();
		}

		// ??\????????§?????????????????????????????????
		boolean inputchk(String name, int time) {
			if (name.length() >= MIN_NAME_LENGTH && name.length() <= MAX_NAME_LENGTH) {
				if (time >= MIN_TIME && time <= MAX_TIME) {
					return true;
				} else {
					ERRORMSG = "QUANTUM_TIME OVER ERROR!";
					return false;
				}
			} else {
				ERRORMSG = "PROCESS OVER ERROR!";
				return false;
			}
		}
	}

	static class Queue {
		// ?????§???????????°?????????
		final int MIN_PROCESS = 1;
		final int MIN_QUANTUM = 1;
		final int MIN_TOTALTIME = 1;
		final int MAX_PROCESS = 100000;
		final int MAX_QUANTUM = 1000;
		final int MAX_TOTALTIME = 1000000;

		// ?±???§?????????
		private int head = 0;
		private int tail = 0;
		private int qtime = 0;
		private Process[] values;

		// ??????????????????????????????
		public Queue(int N, int T) throws Exception {
			if (inputchk(N, T)) {
				values = new Process[N];
				qtime = T;
			} else
				throw new Exception();
		}

		// ??\????????§??????????????\???????????????
		boolean inputchk(int N, int T) {
			if (N >= MIN_PROCESS && N <= MAX_PROCESS) {
				if (T >= MIN_QUANTUM && T <= MAX_QUANTUM) {
					return true;
				} else {
					ERRORMSG = "QUANTUM_TIME OVER ERROR!";
					return false;
				}
			} else {
				ERRORMSG = "PROCESS OVER ERROR!";
				return false;
			}
		}

		// ??¨????????\???
		boolean enqueue(Process data) {
			if (data == null)
				return false;
			for (int i = head; i > tail; i--) {
				Process tmp = new Process();
				tmp = values[i - 1];
				values[i] = tmp;
			}
			values[tail] = data;
			head++;
			return true;
		}

		// ????????\???
		Process dequeue() {
			Process data = null;
			data = values[head - 1];
			head--;
			return data;
		}

		// ?????\??????????????????????¢????
		boolean isEmpty() {
			return (tail == head);
		}
	}

	public static void main(String[] args) {
		// ??\?????¨????????°
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		int N = 0, T = 0, Prctime = 0;
		try {
			System.out.println("??????????????°??¨????????????????????\?????????????????????");
			String[] stAr = br.readLine().split("\\s");

			// ??????????????°??¨??????????????????????????\????????????
			N = Integer.parseInt(stAr[0]);
			T = Integer.parseInt(stAr[1]);
			Queue que = new Queue(N, T);
			Queue rslt = new Queue(N, T);

			// ?????????????????¨???????????????????????\???
			System.out.println("?????????????????¨?????????????????????" + N + "????????\????????????????????????");
			for (int i = 0; i < N; i++) {
				String[] prcAr = br.readLine().split("\\s");
				String name;
				int time;

				// ?????????????????????
				name = prcAr[0];
				time = Integer.parseInt(prcAr[1]);
				Process prc = new Process(name, time);

				// ?????\????????????
				que.enqueue(prc);
			}

			// ????????????????????????????£?
			while (!que.isEmpty()) {
				Process tmp = que.dequeue();
				if (tmp.time > que.qtime) {
					tmp.time -= que.qtime;
					Prctime += que.qtime;
					que.enqueue(tmp);
				} else {
					Prctime += tmp.time;
					tmp.time = Prctime;
					rslt.enqueue(tmp);
				}
			}

			// ???????????¨???
			while (!rslt.isEmpty()) {
				Process view = rslt.dequeue();
				System.out.println(view.name + " " + view.time);
			}

		} catch (Exception e) {
			System.out.println(ERRORMSG);
		}
	}
}

Compiler output:
Main.java:122: error: illegal escape character
			System.out.println("??????????????????????????????????????\?????????????????????");
			                                                           ^
Main.java:132: error: illegal escape character
			System.out.println("???????????????????????????????????????" + N + "????????\????????????????????????");
			                                                                             ^
2 errors