node_ids listlengths 4 1.4k | edge_index listlengths 1 2.22k | text listlengths 4 1.4k | source stringlengths 14 427k |
|---|---|---|---|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
0,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
41,
13,
20,
41,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
180,
11
],
[
180,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.LinkedList;\nimport java.util.Queue;\nimport java.util.Scanner;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tString[] nAndQuantum = new String[2];\n\t\tnAndQuantum = input.nextLine().split(\" \");\n\t\tint n = Integer.parseInt... | import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String[] nAndQuantum = new String[2];
nAndQuantum = input.nextLine().split(" ");
int n = Integer.parseInt(nAndQuantum[0]);
int q... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
20,
4,
18,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
314,
5
],
[
314,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tstatic class Node<E> {\n\t\tpublic E value;\n\t\tpublic Node<E> next;\t\t\n\t\tpublic Node(E value) {\n\t\t\tthis.value = value;\n\t\t\tthis.next = null;\n\t\t}\n\t}\n\n\tstatic class SimpleQueue<E> {\n\t\t\n\t\tprivate Node<E> head;\n\t\tprivate Node<E> tail;\... | import java.util.Scanner;
public class Main {
static class Node<E> {
public E value;
public Node<E> next;
public Node(E value) {
this.value = value;
this.next = null;
}
}
static class SimpleQueue<E> {
private Node<E> head;
private Node<E> tail;
int size;
public SimpleQueue() {
siz... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.util.Iterator;\nimport java.util.LinkedList;\nimport java.util.List;\n\nclass Main{\n public static void main(String[] args) throws IOException{\n final PrintWriter out... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
class Main{
public static void main(String[] args) throws IOException{
final PrintWriter out = new PrintWri... |
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
20,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
213,
5
],
[
213,
6
],
[
6,
7
],
[
6,
8
],
[
213,
9
],
[
9,
10
],
[
9,
11
],
[
213,
12
],
[
12,
13
],
[
12,
14
... | [
"import java.util.Scanner;\n\npublic class Main {\n\tprivate static int head = 0;// キューの先頭ポインタ\n\tprivate static int tail = 0;// キューの末尾ポイント\n\tprivate static final int MAX = 100005; // 制約のプロセス数が10万なので少し多めに。\n\tprivate static Process[] queue = new Process[MAX];\n\n\tpublic static void main(String[] args) {\n\t\tScan... | import java.util.Scanner;
public class Main {
private static int head = 0;// キューの先頭ポインタ
private static int tail = 0;// キューの末尾ポイント
private static final int MAX = 100005; // 制約のプロセス数が10万なので少し多めに。
private static Process[] queue = new Process[MAX];
public static void main(String[] args) {
Scanner sc = new Scanner(... |
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
20,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
17,
0,
13,
17,
12,
13,
30,
14,
40,
4,
18,
36,
30,
0,
18,
13,
13,
13,
14,
2,
13,
2,
13,
17,
0,
13,
17,
40,
13,
23,
13,
12,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
4,
9
],
[
9,
10
],
[
9,
11
],
[
4,
13
],
[
13,
14
],
[
4,
15
],
[
... | [
"import java.util.Scanner;\n\nclass Queue{\n static int NUM = 100000;\n Process[] a = new Process[NUM];\n int head;\n int tail;\n\n Queue(){\n head = 0;\n tail = 0;\n }\n\n void enqueue(Process p){\n if(!this.isFull()){\n a[tail] = p;\n if(tail == NUM - 1)\n tail = 0;\n else\n ... | import java.util.Scanner;
class Queue{
static int NUM = 100000;
Process[] a = new Process[NUM];
int head;
int tail;
Queue(){
head = 0;
tail = 0;
}
void enqueue(Process p){
if(!this.isFull()){
a[tail] = p;
if(tail == NUM - 1)
tail = 0;
else
tail++;
}
... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
0,
13,
4,
18,
13,
41,
13,
4,
13,
4,
18,
13,
17,
4,
18,
13,
17,
41,
13,
4,
13,
4,
18,
13,
2,
4,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\n\nimport static java.lang.Integer.parseInt;\n\n/**\n * Elementary data structures - Queue\n */\npublic class Main {\n\n\tpublic static void main(String[] args) thro... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
import static java.lang.Integer.parseInt;
/**
* Elementary data structures - Queue
*/
public class Main {
public static void main(String[] args) throws IOException {
... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
13,
41,
13,
20,
41,
13,
41,
13,
17,
41,
13,
20,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.io.*;\nimport java.util.ArrayList;\n\nclass Main {\n public static void main (String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String[] input = br.readLine().split(\" \");\n int n = Integer.parseInt(input[0... | import java.io.*;
import java.util.ArrayList;
class Main {
public static void main (String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] input = br.readLine().split(" ");
int n = Integer.parseInt(input[0]);
int... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
20,
11,
1,
41,
13,
17,
40,
4,
18,
13,
30... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
174,
8
],
[
174,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
]... | [
"import java.util.LinkedList;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in); \n\n\t\tLinkedList<Process> processQueue = new LinkedList<Process>();\n\n\t\tint n = sc.nextInt();\n\t\tint quantum = sc.nextInt();\n\t\tfor (int i ... | import java.util.LinkedList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
LinkedList<Process> processQueue = new LinkedList<Process>();
int n = sc.nextInt();
int quantum = sc.nextInt();
for (int i = 0; i < n; i++) {
proces... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
156,
11
],
[
156,
12
],
[
12,
13
],
[
156,
14
]... | [
"import java.util.ArrayDeque;\nimport java.util.Queue;\nimport java.util.Scanner;\n\npublic class Main {\n\tint n,q;\n\tQueue<Process> process;\n\tpublic static void main(String args[]) {\n\t\tnew Main().run();\n\t}\n\tMain() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tn = scan.nextInt();\n\t\tq = scan.nextI... | import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;
public class Main {
int n,q;
Queue<Process> process;
public static void main(String args[]) {
new Main().run();
}
Main() {
Scanner scan = new Scanner(System.in);
n = scan.nextInt();
q = scan.nextInt();
process = new ArrayDequ... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
4... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.util.*;\nimport java.lang.*;\n\nclass Main{\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n int n = Integer.parseInt(line[0]);\n int work = Integer.parseInt(line[1]);\n int sumTime = 0... | import java.util.*;
import java.lang.*;
class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
String[] line = sc.nextLine().split(" ");
int n = Integer.parseInt(line[0]);
int work = Integer.parseInt(line[1]);
int sumTime = 0;
ArrayD... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
17,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
42,
2,
13,
17,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
116,
14
],
... | [
"import java.util.LinkedList;\nimport java.util.Queue;\nimport java.util.Scanner;\nimport java.util.Iterator;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n Queue<String> keys = new LinkedList<>();\n Queue<Integer> values = new Link... | import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.Iterator;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Queue<String> keys = new LinkedList<>();
Queue<Integer> values = new LinkedList<>();
... |
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
20,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
195,
5
],
[
195,
6
],
[
6,
7
],
[
6,
8
],
[
195,
9
],
[
9,
10
],
[
9,
11
],
[
195,
13
],
[
13,
14
],
[
195,
15... | [
"import java.util.*;\n\npublic class Main \n{\n\tfinal static int MAX=100005;\n\tstatic Pp[] object=new Pp[MAX];\n\tstatic int head,tail;\n\tpublic static void main(String[]args)\n\t{\n\t\t\n\t\tScanner scanner=new Scanner(System.in);\n\t\tint sum=0,c;\n\t\tint q,n;\n\t\tPp u;\n\t\tn=scanner.nextInt();\n\t\tq=scann... | import java.util.*;
public class Main
{
final static int MAX=100005;
static Pp[] object=new Pp[MAX];
static int head,tail;
public static void main(String[]args)
{
Scanner scanner=new Scanner(System.in);
int sum=0,c;
int q,n;
Pp u;
n=scanner.nextInt();
q=scanner.nextInt();
for(int i=1;i<=n;i++ )... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
41,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
112,
5
],
[
112,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.*;\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n Queue<String> name_queue = new ArrayDeque<>();\n Queue<Integer> queue = new ArrayDeque<>();\n int n = sc.nextInt();\n int q = sc.nextInt();\n for(i... | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
Queue<String> name_queue = new ArrayDeque<>();
Queue<Integer> queue = new ArrayDeque<>();
int n = sc.nextInt();
int q = sc.nextInt();
for(int i = 0 ; i ... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
201,
11
],
[
201,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.*;\nimport java.io.*;\nimport java.lang.*;\n\npublic class Main {\n static final int INF = 1000000000; \n \n public static void main(String[] args) throws Exception { \n Scanner input = new Scanner(System.in);\n int n, q;\n n = input.nextInt();\n ... | import java.util.*;
import java.io.*;
import java.lang.*;
public class Main {
static final int INF = 1000000000;
public static void main(String[] args) throws Exception {
Scanner input = new Scanner(System.in);
int n, q;
n = input.nextInt();
q = input.n... |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
23,
13,
23,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
29,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
4,
8
],
[
8,
9
],
[
4,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
... | [
"import java.util.*;\n \nclass process {\n \n private String name;\n private int time;\n \n public process(String name,int time){\n this.name = name;\n this.time = time;\n }\n \n public void setName(String name) {\n this.name = name;\n }\n \n public String getName() {\n... | 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;
... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.InputMismatchException;\nimport java.util.LinkedList;\nimport java.util.PriorityQueue;\n\n \npublic class Main {\n public static void main(String[] args) {\n InputReader sc = new In... | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.PriorityQueue;
public class Main {
public static void main(String[] args) {
InputReader sc = new InputReader(System... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Scanner;\nimport java.util.Stack;\n\nclass Main{\n\tpublic static void main(String args[]) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint q=sc.nextInt();\n\t\tString name[]=new String[n];\n\t\t... | import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Stack;
class Main{
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int q=sc.nextInt();
String name[]=new String[n];
String queue[]=new String... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
4... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
136,
5
],
[
136,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.*;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc= new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint q=sc.nextInt();\n\t\tint t=0;\n\t\tLinkedList<Process> list=new LinkedList<Process>();\n\t\tfor(int i=0;i<n;i++){\n\t\t\tString ps=sc.next();\n\t\t\tint p... | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc= new Scanner(System.in);
int n=sc.nextInt();
int q=sc.nextInt();
int t=0;
LinkedList<Process> list=new LinkedList<Process>();
for(int i=0;i<n;i++){
String ps=sc.next();
int pt=sc.nextInt();
Process pr=new P... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
2,
13,
17,
0,
13,
20,
2,
13,
17,
23,
13,
12,
13,
30,
0,
18,
13,
13,
13,
0,
18,
13,
13,
13,
14,
2,
40,
13,
2,
18,
13,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
7,
11
],
[
11,
12
],
[
7,
13
],
[
13,
14
],
[... | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\nclass Queue {\n\n\tprivate String[] names;\n\tprivate int[] times;\n\tprivate int head;\n\tprivate int tail;\n\tpublic Queue(int size) {\n\t\tnames = new String[size + 1];\n\t\ttimes = new int[size + 1];\n\t}\n\n\tpublic void enqueue(String name,... | import java.io.BufferedReader;
import java.io.InputStreamReader;
class Queue {
private String[] names;
private int[] times;
private int head;
private int tail;
public Queue(int size) {
names = new String[size + 1];
times = new int[size + 1];
}
public void enqueue(String name, int time) {
names[tail] = n... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
17,
42,
40,
4,
18,
13,
30,
0,
13,
4,
18,
13,
14,
2,
2,
18,
13,
13,
13,
17,
30,
0,
18,
13,
13,
2,
18,
13,
13,
13,
4,
18,
13,
13,
0,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
150,
11
],
[
150,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.Scanner;\nimport java.util.Queue;\nimport java.util.LinkedList;\n\n// ALDS1_3_B\npublic class Main {\n\tpublic static void calc(Queue<Info> qu, int q) {\n\t\tInfo info;\n\t\tint time = 0;\n\t\twhile (!qu.isEmpty()) {\n\t\t\tinfo = qu.remove();\n\t\t\tif (info.time - q > 0) {\n\t\t\t\tinfo.time = i... | import java.util.Scanner;
import java.util.Queue;
import java.util.LinkedList;
// ALDS1_3_B
public class Main {
public static void calc(Queue<Info> qu, int q) {
Info info;
int time = 0;
while (!qu.isEmpty()) {
info = qu.remove();
if (info.time - q > 0) {
info.time = info.time - q;
qu.add(info);
... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
20,
0,
18,
36,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
7,
11
],
[
11,
12
],
[
7,
13
],
[
13,
14
],
[... | [
"import java.util.ArrayList;\nimport java.util.Scanner;\n\nclass Process {\n String name;\n int time;\n int finishTime;\n\n Process(String name, int time, int finishTime) {\n this.name = name;\n this.time = time;\n this.finishTime = finishTime;\n }\n}\n\nclass Main {\n\n int s... | import java.util.ArrayList;
import java.util.Scanner;
class Process {
String name;
int time;
int finishTime;
Process(String name, int time, int finishTime) {
this.name = name;
this.time = time;
this.finishTime = finishTime;
}
}
class Main {
int size;
int quantum;
... |
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
0,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
20,
4... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
188,
5
],
[
188,
6
],
[
6,
7
],
[
188,
8
],
[
8,
9
],
[
8,
10
],
[
188,
11
],
[
11,
12
],
[
11,
13
],
[
13,
14... | [
"import java.util.Scanner;\n\npublic class Main {\n\n public Main() {\n }\n\n private Scanner sc;\n\n public static void main(String[] args) {\n new Main().solve();\n }\n\n private void solve() {\n sc = new Scanner(System.in);\n int n = sc.nextInt();\n int q = sc.nextIn... | import java.util.Scanner;
public class Main {
public Main() {
}
private Scanner sc;
public static void main(String[] args) {
new Main().solve();
}
private void solve() {
sc = new Scanner(System.in);
int n = sc.nextInt();
int q = sc.nextInt();
MyQueue ... |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
17,
41,
13,
20,
13,
41,
13,
20,
13,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
4,
13,
4,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
316,
5
],
[
316,
6
],
[
6,
7
],
[
6,
8
],
[
316,
9
],
[
9,
10
],
[
9,
11
],
[
316,
12
],
[
12,
13
],
[
12,
14
... | [
"import java.util.*;\n\npublic class Main{\n\tprivate static final Scanner scan = new Scanner(System.in);\n\tprivate static final int MAX = 100_001;\n\tprivate static String[] P = new String[MAX];\n\tprivate static int[] Q = new int[MAX];\n\tprivate static int head, tail;\n\tprivate static int headQ, tailQ;\n\n\tpu... | 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(... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
17,
41,
13,
20,
41,
13,
20,
11,
1,
41,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.io.*;\nimport java.util.Arrays;\nimport java.util.*;\n\nclass Main{\n\tpublic static void main(String[] args) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString[] fst = (br.readLine()).split(\" \");\n\t\tint n = Integer.parseInt(fst[0]);\n\t\t... | import java.io.*;
import java.util.Arrays;
import java.util.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] fst = (br.readLine()).split(" ");
int n = Integer.parseInt(fst[0]);
int quan = Integer.parseI... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
20,
41,
13,
20,
11,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
199,
8
],
[
199,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
]... | [
"import java.util.ArrayDeque;\nimport java.util.Scanner;\n\n\npublic class Main {\n\n\tstatic class MyProcess {\n\n\t\tString qName;\n\t\tint needTime;\n\t\tint finTime = 0;\n\n\t\tpublic int getFinTime() {\n\t\t\treturn finTime;\n\t\t}\n\n\t\tpublic String getqName() {\n\t\t\treturn qName;\n\t\t}\n\n\t\tpublic int... | import java.util.ArrayDeque;
import java.util.Scanner;
public class Main {
static class MyProcess {
String qName;
int needTime;
int finTime = 0;
public int getFinTime() {
return finTime;
}
public String getqName() {
return qName;
}
public int getNeedTime() {
return needTime;
}
publ... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
142,
11
],
[
142,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.LinkedList;\nimport java.util.Queue;\nimport java.util.Scanner;\n\npublic class Main{\n static class Pair {\n int quan=0;\n String val=\"\";\n Pair(int x , String y){\n this.quan = x;\n this.val = y;\n ... | import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class Main{
static class Pair {
int quan=0;
String val="";
Pair(int x , String y){
this.quan = x;
this.val = y;
}
... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
140,
8
],
[
140,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
]... | [
"import java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint q = sc.nextInt();\n\t\tint total = 0;\n\t\tint count = 0;\n\n\t\tArrayList<Integer> time = new ArrayList<>();\n... | import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int q = sc.nextInt();
int total = 0;
int count = 0;
ArrayList<Integer> time = new ArrayList<>();
ArrayList<String> name = new A... |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
41,
13,
20,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
30,
0,
13,
4,
18,
4,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
4,
8
],
[
8,
9
],
[
4,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
... | [
"import java.io.*;\n\nclass Main{\n\tprivate Node first, last;\n\n\tpublic Main(){\n\t\tint n, limit = 0, timeSt = 0;\n\t\tString[] tmp;\n\t\tNode[] process;\n\n\t\tBufferedReader br = \n\t\t\tnew BufferedReader(new InputStreamReader(System.in), 1);\n\t\ttry{\n\t\t\ttmp = br.readLine().split(\" \");\n\t\t\tn = Inte... | import java.io.*;
class Main{
private Node first, last;
public Main(){
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.p... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
20,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.Queue;\nimport java.util.Scanner;\nimport java.util.concurrent.ConcurrentLinkedQueue;\n\nclass Main {\n\n\t/*\n\t * 最初は10番目のテストケースでTLEになったのがショックでした\n\t */\n\n\tpublic static void main(String[] args) throws Exception {\n\t\t//入力と準... |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Queue;
import java.util.Scanner;
import java.util.concurrent.ConcurrentLinkedQueue;
class Main {
/*
* 最初は10番目のテストケースでTLEになったのがショックでした
*/
public static void main(String[] args) throws Exception {
//入力と準備
BufferedReader br = n... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
0,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
20... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
136,
8
],
[
136,
9
],
[
9,
10
],
[
136,
11
],
[
11,
12
],
[
11,
13
],
[
13,
14
... | [
"\nimport java.util.ArrayDeque;\nimport java.util.Scanner;\n\npublic class Main {\n\n\n private Scanner sc;\n\n public static void main(String[] args) {\n new Main().solve();\n }\n\n private void solve() {\n sc = new Scanner(System.in);\n java.util.Queue<q1_3> queue = new ArrayDeque... |
import java.util.ArrayDeque;
import java.util.Scanner;
public class Main {
private Scanner sc;
public static void main(String[] args) {
new Main().solve();
}
private void solve() {
sc = new Scanner(System.in);
java.util.Queue<q1_3> queue = new ArrayDeque<q1_3>();
in... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
41,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
174,
5
],
[
174,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner inp = new Scanner(System.in);\n\n ArrayList<String> name = new ArrayList<>();\n ArrayList<Integer> time = new ArrayList<>();\n\n int numberProc = inp.nextInt();\n int quantity = inp... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner inp = new Scanner(System.in);
ArrayList<String> name = new ArrayList<>();
ArrayList<Integer> time = new ArrayList<>();
int numberProc = inp.nextInt();
int quantity = inp.nextInt();
... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
29,
13,
12,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
198,
11
],
[
198,
12
],
[
12,
13
],
[
198,
14
]... | [
"\nimport java.util.LinkedList;\nimport java.util.Queue;\nimport java.util.Scanner;\n\npublic class Main {\n\t\n\tprivate String name;\n\tprivate int q;\n\n\t//construct a pair object to keep track of each process's quantum, and a bool to check if it is complete\n\tpublic Main(String name, int q) {\n\t\tthis.name =... |
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class Main {
private String name;
private int q;
//construct a pair object to keep track of each process's quantum, and a bool to check if it is complete
public Main(String name, int q) {
this.name = name;
this.q = q;
}
... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
40,
17,
0,
13,
40,
17,
0,
13,
13,
0,
13,
20,
13,
23,
13,
12,
13,
30,
0,
13,
17,
0,
18,
13,
2,
13,
13,
13,
23,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
10,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\nclass Que {\n int head, tail, length;\n Node[] Narray;\n\n public Que(int inputN) {\n head = -1;\n tail = -1;\n length = inputN;\n Narray = new Node[inputN];\n }\n\n public v... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Que {
int head, tail, length;
Node[] Narray;
public Que(int inputN) {
head = -1;
tail = -1;
length = inputN;
Narray = new Node[inputN];
}
public void enQue(Node node)... |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
41,
13,
41,
13,
17,
41,
13,
41,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
20,
12,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
4... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
179,
5
],
[
179,
6
],
[
6,
7
],
[
6,
8
],
[
179,
9
],
[
9,
10
],
[
179,
11
],
[
11,
12
],
[
179,
13
],
[
13,
1... | [
"import java.util.*;\npublic class Main {\n\t\n\tScanner sc = new Scanner(System.in);\n\tint n,q;\n\tint nowtime=0;\n\tInteger process;\n\tString name;\n\t\n\tQueue<String> jobname = new ArrayDeque<String>();\n\tQueue<Integer> queue = new ArrayDeque<Integer>();\n\t\n\tQueue<String> finishjob = new ArrayDeque<String... | import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
int n,q;
int nowtime=0;
Integer process;
String name;
Queue<String> jobname = new ArrayDeque<String>();
Queue<Integer> queue = new ArrayDeque<Integer>();
Queue<String> finishjob = new ArrayDeque<String>();
Queue<Integer> finish ... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
4,
18,
13,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
131,
11
],
[
131,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.LinkedList;\nimport java.util.Queue;\nimport java.util.Scanner;\n\npublic class Main{\t\n\npublic static void main(String[] args) {\n\t\tQueue<Integer> time = new LinkedList<Integer>();\n\t\tQueue<String> name = new LinkedList<String>();\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tint inp... | import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Queue<Integer> time = new LinkedList<Integer>();
Queue<String> name = new LinkedList<String>();
Scanner sc = new Scanner(System.in);
int input = sc.nextInt();
int qu... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
125,
11
],
[
125,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.ArrayDeque;\nimport java.util.Queue;\nimport java.util.Scanner;\n \npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int n = sc.nextInt();\n int q = sc.nextInt();\n Queue<Integer> task = new ArrayDeque<>();\... | import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int q = sc.nextInt();
Queue<Integer> task = new ArrayDeque<>();
String[... |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
4,
8
],
[
8,
9
],
[
4,
10
],
[
10,
11
],
[
4,
12
],
[
12,
13
],
[
4,
14
],
[... | [
"import java.util.Scanner;\n\nclass Main {\n static int n;\n static int q;\n static int head;\n static int tail;\n static Process[] a;\n static int elaps;\n\n public static void main(String[] args) {\n final Scanner sc = new Scanner(System.in);\n n = sc.nextInt();\n q = sc.... | import java.util.Scanner;
class Main {
static int n;
static int q;
static int head;
static int tail;
static Process[] a;
static int elaps;
public static void main(String[] args) {
final Scanner sc = new Scanner(System.in);
n = sc.nextInt();
q = sc.nextInt();
... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.*;\n\nclass Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt(); //プロセス数\n int q = sc.nextInt(); //クオンタム\n int R_time = 0; //実時間\n\n ArrayDeque<Proc> queue = new ArrayDeque<>(); //キュー\n ... | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(); //プロセス数
int q = sc.nextInt(); //クオンタム
int R_time = 0; //実時間
ArrayDeque<Proc> queue = new ArrayDeque<>(); //キュー
Proc tmp;
... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
17,
41,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
0,
13,
4,
18,
13,
0,
13,
20,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
157,
11
],
[
157,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.LinkedList;\nimport java.util.Queue;\nimport java.util.Scanner;\n\npublic class Main {\n\t\n\tpublic static void main(String[] args) {\n\t\t\n\t\tint numberOfProcesses;\n\t\tint quantum;\n\t\tint clock = 0;\n\t\tString line;\n\t\t\n\t\tQueue<String> taskQueue = new LinkedList<String>();\n\t\tQueue... | import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int numberOfProcesses;
int quantum;
int clock = 0;
String line;
Queue<String> taskQueue = new LinkedList<String>();
Queue<Integer> timeQueue = new LinkedList<... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
110,
5
],
[
110,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.*;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner cin=new Scanner(System.in);\n\t\t\n\t\tint n=cin.nextInt(),q=cin.nextInt(),TIME=0;\n\t\tQueue<String> name=new ArrayDeque<>();Queue<Integer>time=new ArrayDeque<>();\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tname.add(cin.ne... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner cin=new Scanner(System.in);
int n=cin.nextInt(),q=cin.nextInt(),TIME=0;
Queue<String> name=new ArrayDeque<>();Queue<Integer>time=new ArrayDeque<>();
for(int i=0;i<n;i++) {
name.add(cin.next());time.add(cin.nextInt()... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
11,
1,
41,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.LinkedList;\nimport java.util.Queue;\n\npublic class Main {\n private final static class Process {\n public String name = null;\n public int pt = 0;\n\n public Process(String name, int pt) {\n... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Queue;
public class Main {
private final static class Process {
public String name = null;
public int pt = 0;
public Process(String name, int pt) {
this.name... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
112,
8
],
[
112,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
]... | [
"import java.io.*;\nimport java.util.*;\n\npublic class Main\n{\n public static void main(String[] args)\n {\n Deque<String> name = new ArrayDeque<String>();\n Deque<Integer> time = new ArrayDeque<Integer>();\n Scanner scan = new Scanner(System.in);\n\n int n = scan.nextInt();\n ... | 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 ... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
38,
5,
13,
30,
4,
18,
13,
5,
13,
30,
4,
18,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
218,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayDeque;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tArrayDeque<Task> q = new ArrayDeque<Tas... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
public class Main {
public static void main(String[] args) {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
ArrayDeque<Task> q = new ArrayDeque<Task>();
ArrayDeque... |
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
20,
13,
41,
13,
20,
13,
12,
13,
30,
0,
13,
0,
13,
17,
12,
13,
30,
29,
2,
13,
13,
12,
13,
30,
29,
2,
13,
2,
2,
13,
17,
13,
12,
13,
30,
14,
4,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
257,
5
],
[
257,
6
],
[
6,
7
],
[
6,
8
],
[
257,
9
],
[
9,
10
],
[
9,
11
],
[
257,
12
],
[
12,
13
],
[
12,
14
... | [
"import java.util.*;\n\npublic class Main {\n static int head = 0;\n static int tail = 0;\n static int max = 100000;\n static int[] queue = new int[max];\n static String[] str = new String[max];\n\n public static void initialize() {\n head = tail = 0;\n }\n public static boolean isEmpty() {\n return h... | import java.util.*;
public class Main {
static int head = 0;
static int tail = 0;
static int max = 100000;
static int[] queue = new int[max];
static String[] str = new String[max];
public static void initialize() {
head = tail = 0;
}
public static boolean isEmpty() {
return head == tail;
}
... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
13,
41,
13,
20,
41,
13,
41,
13,
17,
41,
13,
20,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.io.*;\nimport java.util.concurrent.LinkedBlockingQueue;\n\nclass Main {\n public static void main (String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String[] input = br.readLine().split(\" \");\n int n = Int... | import java.io.*;
import java.util.concurrent.LinkedBlockingQueue;
class Main {
public static void main (String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] input = br.readLine().split(" ");
int n = Integer.parseInt(i... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
41,
13,
4,
18,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
4... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
306,
11
],
[
306,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static class Process {\n\t\tprivate String name;\n\t\tprivate int time;\n\n\t\tpublic Process(String name, int time) {\n\t\t\tthis.name = name;\n\t\t\tthis.time = time;\n\t\t}\n\n\t\tpu... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static class Process {
private String name;
private int time;
public Process(String name, int time) {
this.name = name;
this.time = time;
}
public void setTime(int time) {
this... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.IOException;\nimport java.io.InputStream;\nimport java.util.LinkedList;\nimport java.util.NoSuchElementException;\nimport java.util.Queue;\n\npublic class Main {\n\tprivate static FastScanner sc = new FastScanner();\n\n\tpublic static void main(String[] args) {\n\t\tint n = sc.nextInt();\n\t\tint q ... | import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedList;
import java.util.NoSuchElementException;
import java.util.Queue;
public class Main {
private static FastScanner sc = new FastScanner();
public static void main(String[] args) {
int n = sc.nextInt();
int q = sc.nextInt();
Q... |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
13,
0,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
17,
0,
13,
40,
17,
0,
13,
20,
13,
23,
13,
12,
13,
30,
0,
13,
2,
2,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
4,
8
],
[
8,
9
],
[
4,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
... | [
"import java.util.Scanner;\n\nclass Work {\n\tString name;\n\tint time;\n\t\n\tWork(String n,int t){\n\t\tname=n; time=t;\n\t}\n\t\n}\n\nclass Queue {\n\tint head;\n\tint tail;\n\tWork[] a;\n\t\n\t/*コンストラクタ*/\n\tQueue(int n){\n\t\thead=0; tail=-1; a=new Work[n];\n\t}\n\t\n\tvoid enqueue(Work x,int n){\n\t\ttail=(t... | import java.util.Scanner;
class Work {
String name;
int time;
Work(String n,int t){
name=n; time=t;
}
}
class Queue {
int head;
int tail;
Work[] a;
/*コンストラクタ*/
Queue(int n){
head=0; tail=-1; a=new Work[n];
}
void enqueue(Work x,int n){
tail=(tail+1)%n;
a[tail]=x;
}
Work dequeue(int n){... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
20,
4,
18,
13,
13,
4,
18,
13,
4... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
187,
11
],
[
187,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.ArrayDeque;\nimport java.util.Queue;\nimport java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint q = scan.nextInt();\n\t\tQueue<Data> queue = new ArrayDeque<Data>();\n\t\tfor(int i = ... | import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int q = scan.nextInt();
Queue<Data> queue = new ArrayDeque<Data>();
for(int i = 0; i < n; i++) {
Data d... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
17,
41,
13,
41,
13,
0,
13,
4,
18,
4,
18,
13,
17,
0,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\n\nclass Main{\n\n\tpublic static void main(String[] args) throws IOException{\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tQueue queue = new Queue();\n\t\tString[] input;\n\t\tin... | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Queue queue = new Queue();
String[] input;
int n, q;
int end_time = ... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
4,
18,
13,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\nimport java.util.InputMismatchException;\nimport java.util.StringTokenizer;\n\nclass Main {\n\t\n\tstatic class Queue {\n\t\tpublic voi... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.InputMismatchException;
import java.util.StringTokenizer;
class Main {
static class Queue {
public void queue (InputReader ... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
4,
18,
13,
17,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
17,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
193,
5
],
[
193,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n int ma =line.indexOf(\" \");\n int process = Integer.parseInt(line.substring(0, ma));\n int quantum = Integer.parseInt(li... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
int ma =line.indexOf(" ");
int process = Integer.parseInt(line.substring(0, ma));
int quantum = Integer.parseInt(line.substring(ma+... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
20,
13,
0,
13,
20,
13,
0,
13,
20,
13,
11,
1,
41,
13,
17... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
174,
5
],
[
174,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
... | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint n, q, sum = 0, num = 0;\n\t\tint[] time, end;\n\t\tString[] name;\n\t\t\n\t\tn = scan.nextInt();\n\t\tq = scan.nextInt();\n\n\t\ttime = new int[n];\n\t\tend = new ... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n, q, sum = 0, num = 0;
int[] time, end;
String[] name;
n = scan.nextInt();
q = scan.nextInt();
time = new int[n];
end = new int[n];
name = new String[n];
for... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
193,
5
],
[
193,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tTask2[] tasks = new Task2[100000];\n\n\t\tint n = Integer.parseInt(sc.next());\n\t\tint q = Integer.parseInt(sc.next());\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tString na... | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Task2[] tasks = new Task2[100000];
int n = Integer.parseInt(sc.next());
int q = Integer.parseInt(sc.next());
for (int i = 0; i < n; i++) {
String name = sc.next();
int second =... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
20,
0,
18,
13,
13,
4,
18,
13,
0,
18,
13,
13,
4,
18,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
117,
5
],
[
117,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.*;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tclass Combo {\n\t\t\tString name;\n\t\t\tlong time;\n\t\t}\n\t\t\n\t\tQueue<Combo> remain = new LinkedList<Combo>();\t\t\n\t\tScanner scanner = new Scanner(System.in);\n\t\t\n\t\tlong n = scanner.nextLong();\n\t\tlong q = s... | import java.util.*;
public class Main {
public static void main(String[] args) {
class Combo {
String name;
long time;
}
Queue<Combo> remain = new LinkedList<Combo>();
Scanner scanner = new Scanner(System.in);
long n = scanner.nextLong();
long q = scanner.nextLong();
for (int i = 0; i... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
20,
41,
13,
17,
42,
2,
4,
18,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.util.LinkedList;\nimport java.util.Scanner;\nimport java.util.Queue;\n\nclass Main {\n\n static class Process{\n String name;\n int time;\n\n Process(String n, int t){\n name = n;\n time = t;\n }\n void updateTime(int t){\n time -= ... | import java.util.LinkedList;
import java.util.Scanner;
import java.util.Queue;
class Main {
static class Process{
String name;
int time;
Process(String n, int t){
name = n;
time = t;
}
void updateTime(int t){
time -= t;
}
}
... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
20,
41,
13,
20,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
13,
41,
13,
18,
13,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
470,
11
],
[
470,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\n\n\npublic class Main {\n\tstatic int[] numStack = new int[100];\n\tstatic int numOfs= 0;\n\tstatic ArrayList<String> strList = new ArrayList<String>();\n\tstatic ArrayList<Integer> intList = new ArrayList<Integer>();\n... | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
static int[] numStack = new int[100];
static int numOfs= 0;
static ArrayList<String> strList = new ArrayList<String>();
static ArrayList<Integer> intList = new ArrayList<Integer>();
public static voi... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
17,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
4,
18,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
... | [
"import java.util.*;\n\nclass Main{\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n,t;\n int nowt=0;\n ArrayList<P> list = new ArrayList<P>();\n n = sc.nextInt();\n t = sc.nextInt();\n sc.nextLine();\n for(int i=0;i<... | import java.util.*;
class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int n,t;
int nowt=0;
ArrayList<P> list = new ArrayList<P>();
n = sc.nextInt();
t = sc.nextInt();
sc.nextLine();
for(int i=0;i<n;i++){
... |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
20,
41,
13,
20,
41,
13,
17,
42,
40,
4,
18,
13,
30,
4... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
190,
5
],
[
190,
6
],
[
6,
7
],
[
6,
8
],
[
190,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
... | [
"import java.util.*;\n\npublic class Main {\n\n Scanner sc = new Scanner(System.in);\n\n class Process {\n final String name;\n int time;\n public Process(String name, int time) {\n this.name = name;\n this.time = time;\n }\n\n public int run(int time) ... | import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
class Process {
final String name;
int time;
public Process(String name, int time) {
this.name = name;
this.time = time;
}
public int run(int time) {
int p... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
20,
42,
40,
4,
18,
13,
30,
41,
13,
4,
18,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.*;\n\nclass Main{\n public static void main(String[] args) {\n Scanner in=new Scanner(System.in);\n myQueue que=new myQueue();\n \n int n=in.nextInt(),limit=in.nextInt(),sum=0;\n for(int i=0;i<n;i++)que.push(new process(in.next(), in.nextInt()));\n\n wh... | import java.util.*;
class Main{
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
myQueue que=new myQueue();
int n=in.nextInt(),limit=in.nextInt(),sum=0;
for(int i=0;i<n;i++)que.push(new process(in.next(), in.nextInt()));
while(!que.isEmpt... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
4... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
147,
11
],
[
147,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.ArrayDeque;\nimport java.util.Queue;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n String[] values = scanner.nextLine().split(\" \");\n int n = Integer.parseInt(values[0]);\n ... | import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String[] values = scanner.nextLine().split(" ");
int n = Integer.parseInt(values[0]);
int limit = I... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
17,
41,
13,
41,
13,
41,
13,
20,
17,
41,
13,
20,
41,
13,
20,
41,
13,
20,
0,
13,
2,
17,
4,
18,
13,
0,
13,
4,
18,
13,
11,
1,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
11,
14
],
... | [
"import java.util.*;\nimport java.io.*;\nclass Main{\n public static void main(String args[]) throws IOException {\n\t\n\tint i,j,n,q,time=0,a;\n\tString c;\n\tString array[] = new String[100000];\n\tScanner scan = new Scanner(System.in);\n\tQueue<Integer> que = new ArrayDeque<Integer>();\n\tQueue<String> ques =... | import java.util.*;
import java.io.*;
class Main{
public static void main(String args[]) throws IOException {
int i,j,n,q,time=0,a;
String c;
String array[] = new String[100000];
Scanner scan = new Scanner(System.in);
Queue<Integer> que = new ArrayDeque<Integer>();
Queue<String> ques = new ArrayDeque<String... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
4,
18,
13,
17,
13,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
17,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
170,
5
],
[
170,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String line = sc.nextLine();\n int ma = line.indexOf(\" \");\n int jobAmount = Integer.parseInt(line.substring(0, ma));\n int quantum = Integer.parseI... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
int ma = line.indexOf(" ");
int jobAmount = Integer.parseInt(line.substring(0, ma));
int quantum = Integer.parseInt(line.substri... |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
4,
18,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
4,
8
],
[
8,
9
],
[
0,
10
],
[
145,
11
],
[
145,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.*;\n\nclass CPU{\n int time;\n String name;\n}\n\npublic class Main {\n public static void main(String[] Args){\n Scanner sc = new Scanner(System.in);\n Queue<CPU> que = new LinkedList<>();\n int n = sc.nextInt();\n CPU[] cc = new CPU[n];\n int q = sc.ne... | import java.util.*;
class CPU{
int time;
String name;
}
public class Main {
public static void main(String[] Args){
Scanner sc = new Scanner(System.in);
Queue<CPU> que = new LinkedList<>();
int n = sc.nextInt();
CPU[] cc = new CPU[n];
int q = sc.nextInt();
s... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
20,
2,
4,
18,
13,
18,
13,
17,
17,
41,
13,
4,
18,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
170,
11
],
[
170,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.Scanner;\nimport java.util.LinkedList; \nimport java.util.Queue; \n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint ts = 0;\n\t\t\n\t\tQueue<Integer> qN = new LinkedList<>(); \n\t\tQueue<String> qP = new LinkedList<>(); \n\t\t\n\t... | import java.util.Scanner;
import java.util.LinkedList;
import java.util.Queue;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int ts = 0;
Queue<Integer> qN = new LinkedList<>();
Queue<String> qP = new LinkedList<>();
String line = sc.nextLine();
... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
2,
13,
17,
41,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.io.IOException;\nimport java.util.Scanner;\nclass Main{\n\tpublic static void main(String[] args)throws NumberFormatException, IOException{\n//\t\tSystem.out.println(\" \");\n\t\tScanner scan = new Scanner(System.in);\n\t\tint queueAmount = scan.nextInt();\n\t\tint qTime = scan.nextInt();\n\t\tint tota... | import java.io.IOException;
import java.util.Scanner;
class Main{
public static void main(String[] args)throws NumberFormatException, IOException{
// System.out.println(" ");
Scanner scan = new Scanner(System.in);
int queueAmount = scan.nextInt();
int qTime = scan.nextInt();
int totalTime = 0;
int[] proNum ... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.util.ArrayList;\nimport java.util.LinkedList;\nimport java.util.Queue;\nimport java.util.Scanner;\nimport java.util.Stack;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t\n\t\tScanner in = new Scanner(System.in);\n\t\tint timePassed= 0;\n\t\tint n = in.nextInt();\n\t\tint q =... | import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int timePassed= 0;
int n = in.nextInt();
int q = in.nextInt();
Queue<Intege... |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
17,
41,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
20,
0,
18,
13,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
222,
5
],
[
222,
6
],
[
6,
7
],
[
222,
8
],
[
8,
9
],
[
8,
10
],
[
222,
11
],
[
11,
12
],
[
222,
13
],
[
13,
1... | [
"import java.util.Scanner;\n\npublic class Main {\n\tstatic Process[] stack;\n\tstatic int firstPointer = 0;\n\tstatic int lastPointer;\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint processNum = sc.nextInt();\n\t\tint quanTime = sc.nextInt();\n\t\tstack = new Proces... | import java.util.Scanner;
public class Main {
static Process[] stack;
static int firstPointer = 0;
static int lastPointer;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int processNum = sc.nextInt();
int quanTime = sc.nextInt();
stack = new Process[processNum + 1];
for(in... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
17,
41,
13,
41,
13,
17,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
193,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.LinkedList;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tfinal LinkedList<Process> processes = getProcesses();\n\t\tfinal String result = runProcessing(proc... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
public class Main {
public static void main(String[] args) throws IOException {
final LinkedList<Process> processes = getProcesses();
final String result = runProcessing(processes);
Syste... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.*;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint n = stdIn.nextInt();\n\t\tint q = stdIn.nextInt();\n\n\t\tQueue<String> queP = new LinkedList<String>();\n\t\tQueue<Integer> queT = new LinkedList<Integer>();\n\n\t\tint timeCount =... | import java.util.*;
class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int n = stdIn.nextInt();
int q = stdIn.nextInt();
Queue<String> queP = new LinkedList<String>();
Queue<Integer> queT = new LinkedList<Integer>();
int timeCount = 0;
for (int i=0; i<n; i++... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
160,
8
],
[
160,
9
],
[
9,
10
],
[
9,
11
],
[
160,
12
],
[
12,
13
],
[
12,
14
... | [
"import java.util.*;\nimport static java.lang.System.*;\n\npublic class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main(String[] args) {\n\t\tint n = sc.nextInt();\n\t\tint q = sc.nextInt();\n\t\tDeque<Process> deque = new ArrayDeque<>();\n\t\tString s;\n\t\tint a;\n\t\tfor (int i=0... | import java.util.*;
import static java.lang.System.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int n = sc.nextInt();
int q = sc.nextInt();
Deque<Process> deque = new ArrayDeque<>();
String s;
int a;
for (int i=0; i<n; i++) {
s = sc.next()... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
23,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.FileReader;\nimport java.io.InputStreamReader;\nimport java.util.ArrayDeque;\nimport java.util.Deque;\n\nclass Process {\n\tString name;\n\tint time;\n\t\n\tProcess(String name, int time) {\n\t\tthis.name = name;\n\t\tthis.time = time;\n\t}\n}\n\npublic class Main {\n... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
class Process {
String name;
int time;
Process(String name, int time) {
this.name = name;
this.time = time;
}
}
public class Main {
public static void main(String... |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
17,
0,
13,
17,
12,
13,
30,
29,
2,
13,
13,
12,
13,
30,
29,
2,
13,
2,
2,
13,
17,
13,
12,
13,
30,
14,
40,
4,
13,
30,
0,
18,
13,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
240,
5
],
[
240,
6
],
[
6,
7
],
[
240,
8
],
[
8,
9
],
[
240,
10
],
[
10,
11
],
[
240,
12
],
[
12,
13
],
[
240,
... | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tstatic int max;\n\tstatic int Q[];\n\tstatic String P[];\n\tstatic int head;\n\tstatic int tail;\n\n\tstatic void initialize() {\n\t\thead = 0;\n\t\ttail = 0;\n\t}\n\n\tstatic boolean isEmpty() {\n\t\treturn head == tail;\n\t}\n\n\tstatic boolean isFull() {\n\t... | import java.util.Scanner;
public class Main {
static int max;
static int Q[];
static String P[];
static int head;
static int tail;
static void initialize() {
head = 0;
tail = 0;
}
static boolean isEmpty() {
return head == tail;
}
static boolean isFull() {
return head == (tail+1)%max;
}
static ... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
41,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.io.*;\nimport java.util.*;\n \nclass Main {\n public static void main(String[] args) {\n BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );\n try {\n \n String[] str = kb.readLine().split( \" \" );\n int n = Integer.parseInt( str[0] );\n... | 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... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.LinkedList;\nimport java.util.Map;\nimport java.util.Scanner;\n\npublic class Main {\n\t\n\tpublic static void main(String args[]) {\n\t\tScanner sc ... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
20,
0,
13,
4,
18,
13,
4,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
247,
5
],
[
247,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
... | [
"import java.util.*;\n\npublic class Main{\n\tpublic static void main(String args[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n, q, time, i;\n\t\tqueue que = new queue();\n\t\t\n\t\tn = sc.nextInt();\n\t\tq = sc.nextInt();\n\t\t\n\t\tfor(i = 0; i < n; i++){\n\t\t\tString name = new String(sc.next());\n\t... | import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int n, q, time, i;
queue que = new queue();
n = sc.nextInt();
q = sc.nextInt();
for(i = 0; i < n; i++){
String name = new String(sc.next());
time = sc.nextInt();
que.enque... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
153,
8
],
[
153,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
]... | [
"\nimport java.util.LinkedList;\nimport java.util.Scanner;\n\n/**\n * Created by sd on 2016/11/22.\n */\npublic class Main {\n static class Pair{\n String name;\n int left;\n Pair(String name, int left){\n this.name = name;\n this.left = left;\n }\n }\n\n p... |
import java.util.LinkedList;
import java.util.Scanner;
/**
* Created by sd on 2016/11/22.
*/
public class Main {
static class Pair{
String name;
int left;
Pair(String name, int left){
this.name = name;
this.left = left;
}
}
public static void main... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
42,
2,
40,
13,
17,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
182,
5
],
[
182,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
13,
14
],... | [
"import java.util.*;\n\npublic class Main {\n \n public static void main(String[] args) {\n Main main = new Main();\n main.solv();\n }\n \n private void solv() {\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int q = input.nextInt();\n ... | import java.util.*;
public class Main {
public static void main(String[] args) {
Main main = new Main();
main.solv();
}
private void solv() {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int q = input.nextInt();
Deque<Proc> st = ... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
41,
13,
42,
40,
4,
18,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
13,
2,
4,
18,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"\nimport java.util.AbstractMap;\nimport java.util.LinkedList;\nimport java.util.Map;\nimport java.util.Queue;\nimport java.util.Scanner;\n\n// the simulation of the round robin scheduler\npublic class Main {\n\t// log in the order of termination\n\tpublic static void simulate(Queue<Map.Entry<String, Integer>> budg... |
import java.util.AbstractMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
// the simulation of the round robin scheduler
public class Main {
// log in the order of termination
public static void simulate(Queue<Map.Entry<String, Integer>> budgets, int q) {
i... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayDeque;\nimport java.util.Arrays;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.Queue;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws NumberFor... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
public class Main {
public static void main(String[] args) throws NumberFormatException,
I... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n ... | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
Scanner in = n... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
20,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
17,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
11,
1,
41,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
7,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.io.*;\nimport java.util.*;\n\nclass Main {\n\tfinal static BufferedReader br = new BufferedReader(new InputStreamReader(\n\t\t\tSystem.in));\n\tfinal static StringBuilder out = new StringBuilder();\n\tpublic static void main(String[] Args) throws IOException {\n\t\tQueue<Process> p = new ArrayDeque<Pro... | import java.io.*;
import java.util.*;
class Main {
final static BufferedReader br = new BufferedReader(new InputStreamReader(
System.in));
final static StringBuilder out = new StringBuilder();
public static void main(String[] Args) throws IOException {
Queue<Process> p = new ArrayDeque<Process>();
Process wo... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayDeque;\nimport java.util.Queue;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException,\n\t\t\tIOException {\n\t\tBufferedReader reader = new BufferedRead... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Queue;
public class Main {
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader reader = new BufferedReader(new InputStreamRead... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
17,
41,
13,
20,
41,
13,
20,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
42,
4,
18,
13,
30,
0,
18,
13,
13,
4,
18,
13,
0,
18,
13,
13,
4,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
255,
5
],
[
255,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
... | [
"import java.util.*;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner cin = new Scanner(System.in);\n\t\tint n, q, time_cost = 0;\n\t\tTask temp = new Task();\n\t\tQueue costQueue = new Queue(), endQueue = new Queue();\n\t\tn = cin.nextInt();\n\t\tq = cin.nextInt();\n\t\twhile (cin.ha... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
int n, q, time_cost = 0;
Task temp = new Task();
Queue costQueue = new Queue(), endQueue = new Queue();
n = cin.nextInt();
q = cin.nextInt();
while (cin.hasNext()) {
temp.name = cin.... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
11,
1,
41,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.LinkedList;\nimport java.util.Queue;\n\npublic class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(Syste... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Queue;
public class Main {
public static void main(String args[]) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
20,
17,
41,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
371,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\n \npublic class Main {\n\tprivate static final String EOF = System.lineSeparator();\n\tprivate MyIntQueue queue = new MyIntQueue();\n\tprivate ProcessManager pm = new ProcessManager();\n ... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Main {
private static final String EOF = System.lineSeparator();
private MyIntQueue queue = new MyIntQueue();
private ProcessManager pm = new ProcessManager();
public static vo... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
245,
5
],
[
245,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.Scanner;\npublic class Main {\n public static void main (String[] args) {\n\tScanner scan = new Scanner(System.in);\n\tString[] initial = scan.nextLine().split(\" \");\n\tint n = Integer.parseInt(initial[0]);\n\tint q = Integer.parseInt(initial[1]);\n\tMyQueue processes = new MyQueue(n);\n\tfor... | import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner scan = new Scanner(System.in);
String[] initial = scan.nextLine().split(" ");
int n = Integer.parseInt(initial[0]);
int q = Integer.parseInt(initial[1]);
MyQueue processes = new MyQueue(n);
for (int i = 0; i < n; i... |
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
172,
5
],
[
172,
6
],
[
6,
7
],
[
6,
8
],
[
172,
9
],
[
9,
10
],
[
9,
11
],
[
172,
12
],
[
12,
13
],
[
12,
14
... | [
"import java.util.*;\n\npublic class Main{\n\tfinal static int MOD = 1000000007;\n\tfinal static int INF = 1000000000;\n\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tQueue<Process> que = new ArrayDeque<Process>();\n\t\tint n = Integer.parseInt(sc.next());\n\t\tint q = In... | import java.util.*;
public class Main{
final static int MOD = 1000000007;
final static int INF = 1000000000;
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
Queue<Process> que = new ArrayDeque<Process>();
int n = Integer.parseInt(sc.next());
int q = Integer.parseInt(sc.next());... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
17,
41,
13,
20,
42,
4,
18,
13,
30,
41,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
138,
8
],
[
138,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
]... | [
"import java.util.LinkedList;\nimport java.util.Scanner;\n\npublic class Main {\n\t\n\tprivate static class Process{\n\t\tpublic String n;\n\t\tpublic int t;\n\t\t\n\t\tpublic Process(String name, int time) {\n\t\t\tn = name;\n\t\t\tt = time;\n\t\t}\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner in... | import java.util.LinkedList;
import java.util.Scanner;
public class Main {
private static class Process{
public String n;
public int t;
public Process(String name, int time) {
n = name;
t = time;
}
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String first =... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
191,
11
],
[
191,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.ArrayDeque;\nimport java.util.Queue;\nimport java.util.Scanner;\n\n/**\n * ZAKIREN第5章\n *\n * @author K.Yamauchi\n *\n */\npublic class Main {\n\n\t/** 入力用 */\n\tprivate static Scanner scan = new Scanner(System.in);\n\n\t/** 出力用 */\n\tprivate static StringBuilder stringBuilder = new StringBuilder(... | import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;
/**
* ZAKIREN第5章
*
* @author K.Yamauchi
*
*/
public class Main {
/** 入力用 */
private static Scanner scan = new Scanner(System.in);
/** 出力用 */
private static StringBuilder stringBuilder = new StringBuilder();
/**
* メイン。
* @pa... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
165,
8
],
[
165,
9
],
[
9,
10
],
[
9,
11
],
[
165,
12
],
[
12,
13
],
[
12,
14
... | [
"import java.io.*;\nimport java.util.*;\n\npublic class Main\n{\n\tstatic StringBuilder sb = new StringBuilder();\n\tpublic static void main(String[] args)throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t//Scanner sc = new Scanner(System.in);\n\t\tDeque<Str... | import java.io.*;
import java.util.*;
public class Main
{
static StringBuilder sb = new StringBuilder();
public static void main(String[] args)throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//Scanner sc = new Scanner(System.in);
Deque<String> nameQue = new Array... |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
0,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
120,
8
],
[
120,
9
],
[
9,
10
],
[
120,
11
],
[
11,
12
],
[
11,
13
],
[
13,
14
... | [
"import java.util.LinkedList;\nimport java.util.Scanner;\n\npublic class Main {\n\tprivate static Scanner sc;\n\tpublic static void main(String[] args){\n\t\tsc=new Scanner(System.in);\n\t\tLinkedList<String> name=new LinkedList<String>();\n\t\tLinkedList<Integer> time=new LinkedList<Integer>();\n\t\tint n=sc.nextI... | import java.util.LinkedList;
import java.util.Scanner;
public class Main {
private static Scanner sc;
public static void main(String[] args){
sc=new Scanner(System.in);
LinkedList<String> name=new LinkedList<String>();
LinkedList<Integer> time=new LinkedList<Integer>();
int n=sc.nextInt();
int q=sc.nextInt... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
4,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
242,
5
],
[
242,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int size = Integer.parseInt(scanner.next());\n int quantum = Integer.parseInt(scanner.next());\n int sum = 0;\n Queue queue = new Queue();\... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int size = Integer.parseInt(scanner.next());
int quantum = Integer.parseInt(scanner.next());
int sum = 0;
Queue queue = new Queue();
for (... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
42,
40,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
0,
13,
13,
4,
18,
18,
13,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
142,
11
],
[
142,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.ArrayDeque;\nimport java.util.Queue;\nimport java.util.Scanner;\n\npublic class Main {\n\t\n\tpublic static void runSchedule(Queue<String[]> tasks, int quantum) {\n\t\tint totalTime = 0;\n\t\t\n\t\twhile (!tasks.isEmpty()) {\n\t\t\tString[] elem = tasks.poll();\n\t\t\tint reqTime = Integer.valueOf... | import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;
public class Main {
public static void runSchedule(Queue<String[]> tasks, int quantum) {
int totalTime = 0;
while (!tasks.isEmpty()) {
String[] elem = tasks.poll();
int reqTime = Integer.valueOf(elem[1]);
int timeElapsed ... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
19,
18,
13,
4,
18,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
181,
11
],
[
181,
12
],
[
12,
13
],
[
12,
14
],... | [
"\nimport java.util.Scanner;\nimport java.util.LinkedList;\nimport java.util.Queue;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint numProcesses = in.nextInt();\n\t\tint quantum = in.nextInt();\n\t\tMain r = new Main();\n\t\tQueue<Process> q = ... |
import java.util.Scanner;
import java.util.LinkedList;
import java.util.Queue;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int numProcesses = in.nextInt();
int quantum = in.nextInt();
Main r = new Main();
Queue<Process> q = new LinkedList<Process>();
... |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
38,
30,
41,
13,
20,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
42,
2,
0,
13,
4,
18,
13,
17,
30,
41,
13,
4,
18,
13,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
162,
11
],
[
162,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.ArrayDeque;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n // TODO ?????????????????????????????????????????????\n // System.out.println(\"0\".compareTo(\"1\"));\n\t\tArrayDeque... | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
public class Main {
public static void main(String[] args) throws Exception {
// TODO ?????????????????????????????????????????????
// System.out.println("0".compareTo("1"));
ArrayDeque<String> queue1 = new... |
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
20,
13,
41,
13,
20,
13,
41,
13,
17,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
4,
9
],
[
9,
10
],
[
9,
11
],
[
4,
13
],
[
13,
14
],
[
13,
15
],
[... | [
"import java.util.*;\n\nclass Main {\n\n static int LENGTH = 100000;\n static int [] queue = new int[LENGTH];\n static String [] name = new String[LENGTH];\n static int tail = 0;\n static int head = 0;\n public static void main(String args[]){\n //宣言\n Scanner sc = new Scanner(System.in);\n int n = s... | import java.util.*;
class Main {
static int LENGTH = 100000;
static int [] queue = new int[LENGTH];
static String [] name = new String[LENGTH];
static int tail = 0;
static int head = 0;
public static void main(String args[]){
//宣言
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
107,
5
],
[
107,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws Exception {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tlong[] S = new long[n];\n\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tS[i] = sc.nextLong();\n\t\t}\n\n\t\tint q = sc.nextInt();\n\... | import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long[] S = new long[n];
for(int i = 0; i < n; i++) {
S[i] = sc.nextLong();
}
int q = sc.nextInt();
int count = 0;
for(int j = 0; j ... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
13,
20,
13,
11,
1,
41,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
191,
5
],
[
191,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.Scanner;\npublic class Main{\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int [] s = new int[n];\n int [] t;\n for (int x = 0; x < n; x++){\n s[x] = scan.nextInt();\n }\n ... | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int [] s = new int[n];
int [] t;
for (int x = 0; x < n; x++){
s[x] = scan.nextInt();
}
int q = scan... |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
174,
5
],
[
174,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String arg[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint S[] = new int[n+1];\n\t\tint key = 0;\n\t\tint ans = 0;\n\n\t\tfor(int i=0; i<n; i++){\n\t\t\tS[i] = sc.nextInt();\n\t\t}\n\t\tint q = sc.nextInt(... | import java.util.Scanner;
public class Main {
public static void main(String arg[]){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int S[] = new int[n+1];
int key = 0;
int ans = 0;
for(int i=0; i<n; i++){
S[i] = sc.nextInt();
}
int q = sc.nextInt();
int T[] = new int[q];
for(int i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.