node_ids
sequencelengths 4
1.4k
| edge_index
sequencelengths 1
2.22k
| text
sequencelengths 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,
41,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
0,
13,
4,
18,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
30,
0,
13,
13,
4,
18,
13,
13,
4,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
4,
18,
13,
13,
4,
18,
13,
2,
13,
17,
14,
2,
13,
13,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
123,
11
],
[
123,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
25,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
30,
32
],
[
14,
33
],
[
33,
34
],
[
33,
35
],
[
14,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
14,
41
],
[
41,
42
],
[
14,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
43,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
55,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
55,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
14,
77
],
[
77,
78
],
[
78,
79
],
[
14,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
80,
88
],
[
88,
89
],
[
89,
90
],
[
80,
91
],
[
92,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
95,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
103,
104
],
[
103,
105
],
[
92,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
14,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
12,
120
],
[
120,
121
],
[
0,
122
],
[
122,
123
],
[
122,
124
]
] | [
"import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tList<Integer> num = new ArrayList<>();\n\t\tList<Integer> min = new ArrayList<>();\n\t\tint n, m = Integer.MAX_VALUE, M = Integer.MIN_VALUE;\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tn = sc.nextInt();\n\t\tint tmp;\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ttmp = sc.nextInt();\n\t\t\tif (tmp < m) {\n\t\t\t\tm = tmp;\n\t\t\t}\n\t\t\tnum.add(tmp);\n\t\t\tmin.add(m);\n\t\t}\n\t\tsc.close();\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ttmp = num.get(i) - min.get(i - 1);\n\t\t\tif (tmp > M) {\n\t\t\t\tM = tmp;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(M);\n\t}\n}\n",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tList<Integer> num = new ArrayList<>();\n\t\tList<Integer> min = new ArrayList<>();\n\t\tint n, m = Integer.MAX_VALUE, M = Integer.MIN_VALUE;\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tn = sc.nextInt();\n\t\tint tmp;\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ttmp = sc.nextInt();\n\t\t\tif (tmp < m) {\n\t\t\t\tm = tmp;\n\t\t\t}\n\t\t\tnum.add(tmp);\n\t\t\tmin.add(m);\n\t\t}\n\t\tsc.close();\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ttmp = num.get(i) - min.get(i - 1);\n\t\t\tif (tmp > M) {\n\t\t\t\tM = tmp;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(M);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tList<Integer> num = new ArrayList<>();\n\t\tList<Integer> min = new ArrayList<>();\n\t\tint n, m = Integer.MAX_VALUE, M = Integer.MIN_VALUE;\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tn = sc.nextInt();\n\t\tint tmp;\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ttmp = sc.nextInt();\n\t\t\tif (tmp < m) {\n\t\t\t\tm = tmp;\n\t\t\t}\n\t\t\tnum.add(tmp);\n\t\t\tmin.add(m);\n\t\t}\n\t\tsc.close();\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ttmp = num.get(i) - min.get(i - 1);\n\t\t\tif (tmp > M) {\n\t\t\t\tM = tmp;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(M);\n\t}",
"main",
"{\n\t\tList<Integer> num = new ArrayList<>();\n\t\tList<Integer> min = new ArrayList<>();\n\t\tint n, m = Integer.MAX_VALUE, M = Integer.MIN_VALUE;\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tn = sc.nextInt();\n\t\tint tmp;\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ttmp = sc.nextInt();\n\t\t\tif (tmp < m) {\n\t\t\t\tm = tmp;\n\t\t\t}\n\t\t\tnum.add(tmp);\n\t\t\tmin.add(m);\n\t\t}\n\t\tsc.close();\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ttmp = num.get(i) - min.get(i - 1);\n\t\t\tif (tmp > M) {\n\t\t\t\tM = tmp;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(M);\n\t}",
"List<Integer> num = new ArrayList<>();",
"num",
"new ArrayList<>()",
"List<Integer> min = new ArrayList<>();",
"min",
"new ArrayList<>()",
"int n",
"n",
"m = Integer.MAX_VALUE",
"m",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"M = Integer.MIN_VALUE;",
"M",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"n = sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int tmp;",
"tmp",
"for (int i = 0; i < n; i++) {\n\t\t\ttmp = sc.nextInt();\n\t\t\tif (tmp < m) {\n\t\t\t\tm = tmp;\n\t\t\t}\n\t\t\tnum.add(tmp);\n\t\t\tmin.add(m);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ttmp = sc.nextInt();\n\t\t\tif (tmp < m) {\n\t\t\t\tm = tmp;\n\t\t\t}\n\t\t\tnum.add(tmp);\n\t\t\tmin.add(m);\n\t\t}",
"{\n\t\t\ttmp = sc.nextInt();\n\t\t\tif (tmp < m) {\n\t\t\t\tm = tmp;\n\t\t\t}\n\t\t\tnum.add(tmp);\n\t\t\tmin.add(m);\n\t\t}",
"tmp = sc.nextInt()",
"tmp",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if (tmp < m) {\n\t\t\t\tm = tmp;\n\t\t\t}",
"tmp < m",
"tmp",
"m",
"{\n\t\t\t\tm = tmp;\n\t\t\t}",
"m = tmp",
"m",
"tmp",
"num.add(tmp)",
"num.add",
"num",
"tmp",
"min.add(m)",
"min.add",
"min",
"m",
"sc.close()",
"sc.close",
"sc",
"for (int i = 1; i < n; i++) {\n\t\t\ttmp = num.get(i) - min.get(i - 1);\n\t\t\tif (tmp > M) {\n\t\t\t\tM = tmp;\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ttmp = num.get(i) - min.get(i - 1);\n\t\t\tif (tmp > M) {\n\t\t\t\tM = tmp;\n\t\t\t}\n\t\t}",
"{\n\t\t\ttmp = num.get(i) - min.get(i - 1);\n\t\t\tif (tmp > M) {\n\t\t\t\tM = tmp;\n\t\t\t}\n\t\t}",
"tmp = num.get(i) - min.get(i - 1)",
"tmp",
"num.get(i) - min.get(i - 1)",
"num.get(i)",
"num.get",
"num",
"i",
"min.get(i - 1)",
"min.get",
"min",
"i - 1",
"i",
"1",
"if (tmp > M) {\n\t\t\t\tM = tmp;\n\t\t\t}",
"tmp > M",
"tmp",
"M",
"{\n\t\t\t\tM = tmp;\n\t\t\t}",
"M = tmp",
"M",
"tmp",
"System.out.println(M)",
"System.out.println",
"System.out",
"System",
"System.out",
"M",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tList<Integer> num = new ArrayList<>();\n\t\tList<Integer> min = new ArrayList<>();\n\t\tint n, m = Integer.MAX_VALUE, M = Integer.MIN_VALUE;\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tn = sc.nextInt();\n\t\tint tmp;\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ttmp = sc.nextInt();\n\t\t\tif (tmp < m) {\n\t\t\t\tm = tmp;\n\t\t\t}\n\t\t\tnum.add(tmp);\n\t\t\tmin.add(m);\n\t\t}\n\t\tsc.close();\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ttmp = num.get(i) - min.get(i - 1);\n\t\t\tif (tmp > M) {\n\t\t\t\tM = tmp;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(M);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tList<Integer> num = new ArrayList<>();\n\t\tList<Integer> min = new ArrayList<>();\n\t\tint n, m = Integer.MAX_VALUE, M = Integer.MIN_VALUE;\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tn = sc.nextInt();\n\t\tint tmp;\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ttmp = sc.nextInt();\n\t\t\tif (tmp < m) {\n\t\t\t\tm = tmp;\n\t\t\t}\n\t\t\tnum.add(tmp);\n\t\t\tmin.add(m);\n\t\t}\n\t\tsc.close();\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ttmp = num.get(i) - min.get(i - 1);\n\t\t\tif (tmp > M) {\n\t\t\t\tM = tmp;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(M);\n\t}\n}",
"Main"
] | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
List<Integer> num = new ArrayList<>();
List<Integer> min = new ArrayList<>();
int n, m = Integer.MAX_VALUE, M = Integer.MIN_VALUE;
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
int tmp;
for (int i = 0; i < n; i++) {
tmp = sc.nextInt();
if (tmp < m) {
m = tmp;
}
num.add(tmp);
min.add(m);
}
sc.close();
for (int i = 1; i < n; i++) {
tmp = num.get(i) - min.get(i - 1);
if (tmp > M) {
M = tmp;
}
}
System.out.println(M);
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
0,
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,
2,
18,
13,
17,
18,
13,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
18,
13,
13,
3,
14,
2,
13,
2,
18,
13,
13,
18,
13,
13,
30,
0,
13,
2,
18,
13,
13,
18,
13,
13,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
128,
5
],
[
128,
6
],
[
6,
7
],
[
128,
8
],
[
8,
9
],
[
8,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
10,
19
],
[
19,
20
],
[
19,
21
],
[
10,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
36,
40
],
[
40,
41
],
[
41,
42
],
[
10,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
49,
51
],
[
10,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
10,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
57,
67
],
[
67,
68
],
[
68,
69
],
[
57,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
72,
79
],
[
79,
80
],
[
79,
81
],
[
72,
82
],
[
82,
83
],
[
83,
84
],
[
72,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
87,
93
],
[
86,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
101,
103
],
[
94,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
111,
112
],
[
111,
113
],
[
104,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
10,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
8,
125
],
[
125,
126
],
[
0,
127
],
[
127,
128
],
[
127,
129
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\t\n\tstatic Scanner scan;\n\t\n\tpublic static void main(String[] main) {\n\t\tscan = new Scanner(System.in);\n\t\t\n\t\t// Get the input number of array's elements.\n\t\tfinal int n = scan.nextInt();\n\t\t\n\t\t// Get the input array.\n\t\tint list[] = new int[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tlist[i] = scan.nextInt();\n\t\t}\n\t\t\n\t\t// Calculate the max profit.\n\t\tint max = list[1] - list[0];\n\t\tint key = list[0];\n\t\tfor(int i = 0; i < n-1; i++) {\n\t\t\tfor(int j = i+1; j < n; j++) {\n\t\t\t\tif(key < list[i]) break;\n\t\t\t\tif(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Output the result.\n\t\tSystem.out.println(max);\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\t\n\tstatic Scanner scan;\n\t\n\tpublic static void main(String[] main) {\n\t\tscan = new Scanner(System.in);\n\t\t\n\t\t// Get the input number of array's elements.\n\t\tfinal int n = scan.nextInt();\n\t\t\n\t\t// Get the input array.\n\t\tint list[] = new int[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tlist[i] = scan.nextInt();\n\t\t}\n\t\t\n\t\t// Calculate the max profit.\n\t\tint max = list[1] - list[0];\n\t\tint key = list[0];\n\t\tfor(int i = 0; i < n-1; i++) {\n\t\t\tfor(int j = i+1; j < n; j++) {\n\t\t\t\tif(key < list[i]) break;\n\t\t\t\tif(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Output the result.\n\t\tSystem.out.println(max);\n\t}\n}",
"Main",
"static Scanner scan;",
"scan",
"public static void main(String[] main) {\n\t\tscan = new Scanner(System.in);\n\t\t\n\t\t// Get the input number of array's elements.\n\t\tfinal int n = scan.nextInt();\n\t\t\n\t\t// Get the input array.\n\t\tint list[] = new int[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tlist[i] = scan.nextInt();\n\t\t}\n\t\t\n\t\t// Calculate the max profit.\n\t\tint max = list[1] - list[0];\n\t\tint key = list[0];\n\t\tfor(int i = 0; i < n-1; i++) {\n\t\t\tfor(int j = i+1; j < n; j++) {\n\t\t\t\tif(key < list[i]) break;\n\t\t\t\tif(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Output the result.\n\t\tSystem.out.println(max);\n\t}",
"main",
"{\n\t\tscan = new Scanner(System.in);\n\t\t\n\t\t// Get the input number of array's elements.\n\t\tfinal int n = scan.nextInt();\n\t\t\n\t\t// Get the input array.\n\t\tint list[] = new int[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tlist[i] = scan.nextInt();\n\t\t}\n\t\t\n\t\t// Calculate the max profit.\n\t\tint max = list[1] - list[0];\n\t\tint key = list[0];\n\t\tfor(int i = 0; i < n-1; i++) {\n\t\t\tfor(int j = i+1; j < n; j++) {\n\t\t\t\tif(key < list[i]) break;\n\t\t\t\tif(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Output the result.\n\t\tSystem.out.println(max);\n\t}",
"scan = new Scanner(System.in)",
"scan",
"new Scanner(System.in)",
"final int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int list[] = new int[n];",
"list",
"new int[n]",
"n",
"for(int i = 0; i < n; i++) {\n\t\t\tlist[i] = scan.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tlist[i] = scan.nextInt();\n\t\t}",
"{\n\t\t\tlist[i] = scan.nextInt();\n\t\t}",
"list[i] = scan.nextInt()",
"list[i]",
"list",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int max = list[1] - list[0];",
"max",
"list[1] - list[0]",
"list[1]",
"list",
"1",
"list[0]",
"list",
"0",
"int key = list[0];",
"key",
"list[0]",
"list",
"0",
"for(int i = 0; i < n-1; i++) {\n\t\t\tfor(int j = i+1; j < n; j++) {\n\t\t\t\tif(key < list[i]) break;\n\t\t\t\tif(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = i+1; j < n; j++) {\n\t\t\t\tif(key < list[i]) break;\n\t\t\t\tif(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = i+1; j < n; j++) {\n\t\t\t\tif(key < list[i]) break;\n\t\t\t\tif(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = i+1; j < n; j++) {\n\t\t\t\tif(key < list[i]) break;\n\t\t\t\tif(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}\n\t\t\t}",
"int j = i+1;",
"int j = i+1;",
"j",
"i+1",
"i",
"1",
"j < n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(key < list[i]) break;\n\t\t\t\tif(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(key < list[i]) break;\n\t\t\t\tif(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}\n\t\t\t}",
"if(key < list[i]) break;",
"key < list[i]",
"key",
"list[i]",
"list",
"i",
"break;",
"if(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}",
"max < list[j] - list[i]",
"max",
"list[j] - list[i]",
"list[j]",
"list",
"j",
"list[i]",
"list",
"i",
"{\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}",
"max = list[j] - list[i]",
"max",
"list[j] - list[i]",
"list[j]",
"list",
"j",
"list[i]",
"list",
"i",
"key = list[i]",
"key",
"list[i]",
"list",
"i",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] main",
"main",
"public class Main {\n\t\n\tstatic Scanner scan;\n\t\n\tpublic static void main(String[] main) {\n\t\tscan = new Scanner(System.in);\n\t\t\n\t\t// Get the input number of array's elements.\n\t\tfinal int n = scan.nextInt();\n\t\t\n\t\t// Get the input array.\n\t\tint list[] = new int[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tlist[i] = scan.nextInt();\n\t\t}\n\t\t\n\t\t// Calculate the max profit.\n\t\tint max = list[1] - list[0];\n\t\tint key = list[0];\n\t\tfor(int i = 0; i < n-1; i++) {\n\t\t\tfor(int j = i+1; j < n; j++) {\n\t\t\t\tif(key < list[i]) break;\n\t\t\t\tif(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Output the result.\n\t\tSystem.out.println(max);\n\t}\n}",
"public class Main {\n\t\n\tstatic Scanner scan;\n\t\n\tpublic static void main(String[] main) {\n\t\tscan = new Scanner(System.in);\n\t\t\n\t\t// Get the input number of array's elements.\n\t\tfinal int n = scan.nextInt();\n\t\t\n\t\t// Get the input array.\n\t\tint list[] = new int[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tlist[i] = scan.nextInt();\n\t\t}\n\t\t\n\t\t// Calculate the max profit.\n\t\tint max = list[1] - list[0];\n\t\tint key = list[0];\n\t\tfor(int i = 0; i < n-1; i++) {\n\t\t\tfor(int j = i+1; j < n; j++) {\n\t\t\t\tif(key < list[i]) break;\n\t\t\t\tif(max < list[j] - list[i]) {\n\t\t\t\t\tmax = list[j] - list[i];\n\t\t\t\t\tkey = list[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Output the result.\n\t\tSystem.out.println(max);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
static Scanner scan;
public static void main(String[] main) {
scan = new Scanner(System.in);
// Get the input number of array's elements.
final int n = scan.nextInt();
// Get the input array.
int list[] = new int[n];
for(int i = 0; i < n; i++) {
list[i] = scan.nextInt();
}
// Calculate the max profit.
int max = list[1] - list[0];
int key = list[0];
for(int i = 0; i < n-1; i++) {
for(int j = i+1; j < n; j++) {
if(key < list[i]) break;
if(max < list[j] - list[i]) {
max = list[j] - list[i];
key = list[i];
}
}
}
// Output the result.
System.out.println(max);
}
}
|
[
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,
2,
18,
13,
17,
18,
13,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
97,
5
],
[
97,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
70,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
67,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
81,
85
],
[
85,
86
],
[
85,
87
],
[
8,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
6,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
]
] | [
"import java.util.*;\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[] R=new int[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tR[i]=sc.nextInt();\n\t\t}\n\t\tint maxv=R[1]-R[0];\n\t\tint minv=R[0];\n\t\tfor(int j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv,R[j]-minv);\n\t\t\tminv=Math.min(minv,R[j]);\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public 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[] R=new int[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tR[i]=sc.nextInt();\n\t\t}\n\t\tint maxv=R[1]-R[0];\n\t\tint minv=R[0];\n\t\tfor(int j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv,R[j]-minv);\n\t\t\tminv=Math.min(minv,R[j]);\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint[] R=new int[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tR[i]=sc.nextInt();\n\t\t}\n\t\tint maxv=R[1]-R[0];\n\t\tint minv=R[0];\n\t\tfor(int j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv,R[j]-minv);\n\t\t\tminv=Math.min(minv,R[j]);\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint[] R=new int[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tR[i]=sc.nextInt();\n\t\t}\n\t\tint maxv=R[1]-R[0];\n\t\tint minv=R[0];\n\t\tfor(int j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv,R[j]-minv);\n\t\t\tminv=Math.min(minv,R[j]);\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] R=new int[n];",
"R",
"new int[n]",
"n",
"for(int i=0;i<n;i++){\n\t\t\tR[i]=sc.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tR[i]=sc.nextInt();\n\t\t}",
"{\n\t\t\tR[i]=sc.nextInt();\n\t\t}",
"R[i]=sc.nextInt()",
"R[i]",
"R",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int maxv=R[1]-R[0];",
"maxv",
"R[1]-R[0]",
"R[1]",
"R",
"1",
"R[0]",
"R",
"0",
"int minv=R[0];",
"minv",
"R[0]",
"R",
"0",
"for(int j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv,R[j]-minv);\n\t\t\tminv=Math.min(minv,R[j]);\n\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\tmaxv=Math.max(maxv,R[j]-minv);\n\t\t\tminv=Math.min(minv,R[j]);\n\t\t}",
"{\n\t\t\tmaxv=Math.max(maxv,R[j]-minv);\n\t\t\tminv=Math.min(minv,R[j]);\n\t\t}",
"maxv=Math.max(maxv,R[j]-minv)",
"maxv",
"Math.max(maxv,R[j]-minv)",
"Math.max",
"Math",
"maxv",
"R[j]-minv",
"R[j]",
"R",
"j",
"minv",
"minv=Math.min(minv,R[j])",
"minv",
"Math.min(minv,R[j])",
"Math.min",
"Math",
"minv",
"R[j]",
"R",
"j",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String[] args",
"args",
"public 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[] R=new int[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tR[i]=sc.nextInt();\n\t\t}\n\t\tint maxv=R[1]-R[0];\n\t\tint minv=R[0];\n\t\tfor(int j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv,R[j]-minv);\n\t\t\tminv=Math.min(minv,R[j]);\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}\n}",
"public 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[] R=new int[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tR[i]=sc.nextInt();\n\t\t}\n\t\tint maxv=R[1]-R[0];\n\t\tint minv=R[0];\n\t\tfor(int j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv,R[j]-minv);\n\t\t\tminv=Math.min(minv,R[j]);\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int[] R=new int[n];
for(int i=0;i<n;i++){
R[i]=sc.nextInt();
}
int maxv=R[1]-R[0];
int minv=R[0];
for(int j=1;j<n;j++){
maxv=Math.max(maxv,R[j]-minv);
minv=Math.min(minv,R[j]);
}
System.out.println(maxv);
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
12,
13,
30,
0,
13,
20,
4,
18,
20,
23,
13,
12,
13,
30,
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,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
104,
5
],
[
104,
6
],
[
6,
7
],
[
104,
8
],
[
8,
9
],
[
8,
10
],
[
104,
11
],
[
11,
12
],
[
11,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
104,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
24,
30
],
[
30,
31
],
[
30,
32
],
[
24,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
52,
53
],
[
24,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
24,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
24,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
76,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
90,
94
],
[
94,
95
],
[
94,
96
],
[
24,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
0,
103
],
[
103,
104
],
[
103,
105
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n private static Scanner sc;\n\n public Main() {\n }\n\n public static void main(String[] args) {\n sc = new Scanner(System.in);\n new Main().solve();\n }\n\n private void solve() {\n int n = sc.nextInt();\n int[] R = new int[n];\n\n for (int i = 0; i < n; i++) {\n R[i] = sc.nextInt();\n }\n\n int ans = Integer.MIN_VALUE;\n int min = R[0];\n for (int i = 1; i < n; i++) {\n ans = Math.max(ans, R[i] - min);\n min = Math.min(min, R[i]);\n }\n\n System.out.println(ans);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n private static Scanner sc;\n\n public Main() {\n }\n\n public static void main(String[] args) {\n sc = new Scanner(System.in);\n new Main().solve();\n }\n\n private void solve() {\n int n = sc.nextInt();\n int[] R = new int[n];\n\n for (int i = 0; i < n; i++) {\n R[i] = sc.nextInt();\n }\n\n int ans = Integer.MIN_VALUE;\n int min = R[0];\n for (int i = 1; i < n; i++) {\n ans = Math.max(ans, R[i] - min);\n min = Math.min(min, R[i]);\n }\n\n System.out.println(ans);\n }\n}",
"Main",
"private static Scanner sc;",
"sc",
"public Main() {\n }",
"Main",
"{\n }",
"public static void main(String[] args) {\n sc = new Scanner(System.in);\n new Main().solve();\n }",
"main",
"{\n sc = new Scanner(System.in);\n new Main().solve();\n }",
"sc = new Scanner(System.in)",
"sc",
"new Scanner(System.in)",
"new Main().solve()",
"new Main().solve",
"new Main()",
"String[] args",
"args",
"private void solve() {\n int n = sc.nextInt();\n int[] R = new int[n];\n\n for (int i = 0; i < n; i++) {\n R[i] = sc.nextInt();\n }\n\n int ans = Integer.MIN_VALUE;\n int min = R[0];\n for (int i = 1; i < n; i++) {\n ans = Math.max(ans, R[i] - min);\n min = Math.min(min, R[i]);\n }\n\n System.out.println(ans);\n }",
"solve",
"{\n int n = sc.nextInt();\n int[] R = new int[n];\n\n for (int i = 0; i < n; i++) {\n R[i] = sc.nextInt();\n }\n\n int ans = Integer.MIN_VALUE;\n int min = R[0];\n for (int i = 1; i < n; i++) {\n ans = Math.max(ans, R[i] - min);\n min = Math.min(min, R[i]);\n }\n\n System.out.println(ans);\n }",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] R = new int[n];",
"R",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n R[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n R[i] = sc.nextInt();\n }",
"{\n R[i] = sc.nextInt();\n }",
"R[i] = sc.nextInt()",
"R[i]",
"R",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int ans = Integer.MIN_VALUE;",
"ans",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int min = R[0];",
"min",
"R[0]",
"R",
"0",
"for (int i = 1; i < n; i++) {\n ans = Math.max(ans, R[i] - min);\n min = Math.min(min, R[i]);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n ans = Math.max(ans, R[i] - min);\n min = Math.min(min, R[i]);\n }",
"{\n ans = Math.max(ans, R[i] - min);\n min = Math.min(min, R[i]);\n }",
"ans = Math.max(ans, R[i] - min)",
"ans",
"Math.max(ans, R[i] - min)",
"Math.max",
"Math",
"ans",
"R[i] - min",
"R[i]",
"R",
"i",
"min",
"min = Math.min(min, R[i])",
"min",
"Math.min(min, R[i])",
"Math.min",
"Math",
"min",
"R[i]",
"R",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"public class Main {\n\n private static Scanner sc;\n\n public Main() {\n }\n\n public static void main(String[] args) {\n sc = new Scanner(System.in);\n new Main().solve();\n }\n\n private void solve() {\n int n = sc.nextInt();\n int[] R = new int[n];\n\n for (int i = 0; i < n; i++) {\n R[i] = sc.nextInt();\n }\n\n int ans = Integer.MIN_VALUE;\n int min = R[0];\n for (int i = 1; i < n; i++) {\n ans = Math.max(ans, R[i] - min);\n min = Math.min(min, R[i]);\n }\n\n System.out.println(ans);\n }\n}",
"public class Main {\n\n private static Scanner sc;\n\n public Main() {\n }\n\n public static void main(String[] args) {\n sc = new Scanner(System.in);\n new Main().solve();\n }\n\n private void solve() {\n int n = sc.nextInt();\n int[] R = new int[n];\n\n for (int i = 0; i < n; i++) {\n R[i] = sc.nextInt();\n }\n\n int ans = Integer.MIN_VALUE;\n int min = R[0];\n for (int i = 1; i < n; i++) {\n ans = Math.max(ans, R[i] - min);\n min = Math.min(min, R[i]);\n }\n\n System.out.println(ans);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
private static Scanner sc;
public Main() {
}
public static void main(String[] args) {
sc = new Scanner(System.in);
new Main().solve();
}
private void solve() {
int n = sc.nextInt();
int[] R = new int[n];
for (int i = 0; i < n; i++) {
R[i] = sc.nextInt();
}
int ans = Integer.MIN_VALUE;
int min = R[0];
for (int i = 1; i < n; i++) {
ans = Math.max(ans, R[i] - min);
min = Math.min(min, R[i]);
}
System.out.println(ans);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
13,
0,
13,
13,
9,
14,
2,
13,
17,
30,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
9,
14,
2,
2,
13,
13,
2,
2,
13,
13,
2,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
137,
11
],
[
137,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
14,
29
],
[
29,
30
],
[
29,
31
],
[
14,
32
],
[
32,
33
],
[
32,
34
],
[
14,
35
],
[
35,
36
],
[
35,
37
],
[
14,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
50,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
57,
58
],
[
50,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
67,
68
],
[
67,
69
],
[
63,
70
],
[
50,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
79,
80
],
[
79,
81
],
[
75,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
75,
90
],
[
50,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
100,
101
],
[
100,
102
],
[
91,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
50,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
115,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
50,
123
],
[
123,
124
],
[
123,
125
],
[
14,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
131,
133
],
[
12,
134
],
[
134,
135
],
[
0,
136
],
[
136,
137
],
[
136,
138
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(br.readLine());\n\t\tint max = 0;\n\t\tint min = 0;\n\t\tint prospectMin = 0;\n\t\tint beforeN = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint a = Integer.parseInt(br.readLine());\n\t\t\tif (i == 0) {\n\t\t\t\tmin = a;\n\t\t\t\tprospectMin = a;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (i == 1) {\n\t\t\t\tmax = a;\n\t\t\t\tbeforeN = a;\n\t\t\t\tif (a < min) {\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (beforeN <= a && max - min < a - prospectMin) {\n\t\t\t\tmax = a;\n\t\t\t\tif (min > prospectMin) {\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a < prospectMin) {\n\t\t\t\tprospectMin = a;\n\t\t\t}\n\t\t\tbeforeN = a;\n\t\t}\n\t\tSystem.out.println(max - min);\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(br.readLine());\n\t\tint max = 0;\n\t\tint min = 0;\n\t\tint prospectMin = 0;\n\t\tint beforeN = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint a = Integer.parseInt(br.readLine());\n\t\t\tif (i == 0) {\n\t\t\t\tmin = a;\n\t\t\t\tprospectMin = a;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (i == 1) {\n\t\t\t\tmax = a;\n\t\t\t\tbeforeN = a;\n\t\t\t\tif (a < min) {\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (beforeN <= a && max - min < a - prospectMin) {\n\t\t\t\tmax = a;\n\t\t\t\tif (min > prospectMin) {\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a < prospectMin) {\n\t\t\t\tprospectMin = a;\n\t\t\t}\n\t\t\tbeforeN = a;\n\t\t}\n\t\tSystem.out.println(max - min);\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(br.readLine());\n\t\tint max = 0;\n\t\tint min = 0;\n\t\tint prospectMin = 0;\n\t\tint beforeN = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint a = Integer.parseInt(br.readLine());\n\t\t\tif (i == 0) {\n\t\t\t\tmin = a;\n\t\t\t\tprospectMin = a;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (i == 1) {\n\t\t\t\tmax = a;\n\t\t\t\tbeforeN = a;\n\t\t\t\tif (a < min) {\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (beforeN <= a && max - min < a - prospectMin) {\n\t\t\t\tmax = a;\n\t\t\t\tif (min > prospectMin) {\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a < prospectMin) {\n\t\t\t\tprospectMin = a;\n\t\t\t}\n\t\t\tbeforeN = a;\n\t\t}\n\t\tSystem.out.println(max - min);\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(br.readLine());\n\t\tint max = 0;\n\t\tint min = 0;\n\t\tint prospectMin = 0;\n\t\tint beforeN = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint a = Integer.parseInt(br.readLine());\n\t\t\tif (i == 0) {\n\t\t\t\tmin = a;\n\t\t\t\tprospectMin = a;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (i == 1) {\n\t\t\t\tmax = a;\n\t\t\t\tbeforeN = a;\n\t\t\t\tif (a < min) {\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (beforeN <= a && max - min < a - prospectMin) {\n\t\t\t\tmax = a;\n\t\t\t\tif (min > prospectMin) {\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a < prospectMin) {\n\t\t\t\tprospectMin = a;\n\t\t\t}\n\t\t\tbeforeN = a;\n\t\t}\n\t\tSystem.out.println(max - min);\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int n = Integer.parseInt(br.readLine());",
"n",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int max = 0;",
"max",
"0",
"int min = 0;",
"min",
"0",
"int prospectMin = 0;",
"prospectMin",
"0",
"int beforeN = 0;",
"beforeN",
"0",
"for (int i = 0; i < n; i++) {\n\t\t\tint a = Integer.parseInt(br.readLine());\n\t\t\tif (i == 0) {\n\t\t\t\tmin = a;\n\t\t\t\tprospectMin = a;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (i == 1) {\n\t\t\t\tmax = a;\n\t\t\t\tbeforeN = a;\n\t\t\t\tif (a < min) {\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (beforeN <= a && max - min < a - prospectMin) {\n\t\t\t\tmax = a;\n\t\t\t\tif (min > prospectMin) {\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a < prospectMin) {\n\t\t\t\tprospectMin = a;\n\t\t\t}\n\t\t\tbeforeN = a;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tint a = Integer.parseInt(br.readLine());\n\t\t\tif (i == 0) {\n\t\t\t\tmin = a;\n\t\t\t\tprospectMin = a;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (i == 1) {\n\t\t\t\tmax = a;\n\t\t\t\tbeforeN = a;\n\t\t\t\tif (a < min) {\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (beforeN <= a && max - min < a - prospectMin) {\n\t\t\t\tmax = a;\n\t\t\t\tif (min > prospectMin) {\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a < prospectMin) {\n\t\t\t\tprospectMin = a;\n\t\t\t}\n\t\t\tbeforeN = a;\n\t\t}",
"{\n\t\t\tint a = Integer.parseInt(br.readLine());\n\t\t\tif (i == 0) {\n\t\t\t\tmin = a;\n\t\t\t\tprospectMin = a;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (i == 1) {\n\t\t\t\tmax = a;\n\t\t\t\tbeforeN = a;\n\t\t\t\tif (a < min) {\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (beforeN <= a && max - min < a - prospectMin) {\n\t\t\t\tmax = a;\n\t\t\t\tif (min > prospectMin) {\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a < prospectMin) {\n\t\t\t\tprospectMin = a;\n\t\t\t}\n\t\t\tbeforeN = a;\n\t\t}",
"int a = Integer.parseInt(br.readLine());",
"a",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"if (i == 0) {\n\t\t\t\tmin = a;\n\t\t\t\tprospectMin = a;\n\t\t\t\tcontinue;\n\t\t\t}",
"i == 0",
"i",
"0",
"{\n\t\t\t\tmin = a;\n\t\t\t\tprospectMin = a;\n\t\t\t\tcontinue;\n\t\t\t}",
"min = a",
"min",
"a",
"prospectMin = a",
"prospectMin",
"a",
"continue;",
"if (i == 1) {\n\t\t\t\tmax = a;\n\t\t\t\tbeforeN = a;\n\t\t\t\tif (a < min) {\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}",
"i == 1",
"i",
"1",
"{\n\t\t\t\tmax = a;\n\t\t\t\tbeforeN = a;\n\t\t\t\tif (a < min) {\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}",
"max = a",
"max",
"a",
"beforeN = a",
"beforeN",
"a",
"if (a < min) {\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}",
"a < min",
"a",
"min",
"{\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}",
"prospectMin = a",
"prospectMin",
"a",
"continue;",
"if (beforeN <= a && max - min < a - prospectMin) {\n\t\t\t\tmax = a;\n\t\t\t\tif (min > prospectMin) {\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}\n\t\t\t}",
"beforeN <= a && max - min < a - prospectMin",
"beforeN <= a",
"beforeN",
"a",
"max - min < a - prospectMin",
"max - min",
"max",
"min",
"a - prospectMin",
"a",
"prospectMin",
"{\n\t\t\t\tmax = a;\n\t\t\t\tif (min > prospectMin) {\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}\n\t\t\t}",
"max = a",
"max",
"a",
"if (min > prospectMin) {\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}",
"min > prospectMin",
"min",
"prospectMin",
"{\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}",
"min = prospectMin",
"min",
"prospectMin",
"if (a < prospectMin) {\n\t\t\t\tprospectMin = a;\n\t\t\t}",
"a < prospectMin",
"a",
"prospectMin",
"{\n\t\t\t\tprospectMin = a;\n\t\t\t}",
"prospectMin = a",
"prospectMin",
"a",
"beforeN = a",
"beforeN",
"a",
"System.out.println(max - min)",
"System.out.println",
"System.out",
"System",
"System.out",
"max - min",
"max",
"min",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(br.readLine());\n\t\tint max = 0;\n\t\tint min = 0;\n\t\tint prospectMin = 0;\n\t\tint beforeN = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint a = Integer.parseInt(br.readLine());\n\t\t\tif (i == 0) {\n\t\t\t\tmin = a;\n\t\t\t\tprospectMin = a;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (i == 1) {\n\t\t\t\tmax = a;\n\t\t\t\tbeforeN = a;\n\t\t\t\tif (a < min) {\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (beforeN <= a && max - min < a - prospectMin) {\n\t\t\t\tmax = a;\n\t\t\t\tif (min > prospectMin) {\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a < prospectMin) {\n\t\t\t\tprospectMin = a;\n\t\t\t}\n\t\t\tbeforeN = a;\n\t\t}\n\t\tSystem.out.println(max - min);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tint n = Integer.parseInt(br.readLine());\n\t\tint max = 0;\n\t\tint min = 0;\n\t\tint prospectMin = 0;\n\t\tint beforeN = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint a = Integer.parseInt(br.readLine());\n\t\t\tif (i == 0) {\n\t\t\t\tmin = a;\n\t\t\t\tprospectMin = a;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (i == 1) {\n\t\t\t\tmax = a;\n\t\t\t\tbeforeN = a;\n\t\t\t\tif (a < min) {\n\t\t\t\t\tprospectMin = a;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (beforeN <= a && max - min < a - prospectMin) {\n\t\t\t\tmax = a;\n\t\t\t\tif (min > prospectMin) {\n\t\t\t\t\tmin = prospectMin;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (a < prospectMin) {\n\t\t\t\tprospectMin = a;\n\t\t\t}\n\t\t\tbeforeN = a;\n\t\t}\n\t\tSystem.out.println(max - min);\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int max = 0;
int min = 0;
int prospectMin = 0;
int beforeN = 0;
for (int i = 0; i < n; i++) {
int a = Integer.parseInt(br.readLine());
if (i == 0) {
min = a;
prospectMin = a;
continue;
}
if (i == 1) {
max = a;
beforeN = a;
if (a < min) {
prospectMin = a;
}
continue;
}
if (beforeN <= a && max - min < a - prospectMin) {
max = a;
if (min > prospectMin) {
min = prospectMin;
}
}
if (a < prospectMin) {
prospectMin = a;
}
beforeN = a;
}
System.out.println(max - min);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
41,
13,
4,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
84,
5
],
[
84,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
34,
38
],
[
8,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
39,
49
],
[
49,
50
],
[
50,
51
],
[
39,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
53,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
61,
65
],
[
65,
66
],
[
65,
67
],
[
53,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
70,
74
],
[
8,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
6,
81
],
[
81,
82
],
[
0,
83
],
[
83,
84
],
[
83,
85
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint count = sc.nextInt();\n\n\t\tint x1 =sc.nextInt();\n\t\tint x2 =sc.nextInt();\n\n\t\tint max = x2-x1;\n\t\tint min = Math.min(x1,x2);\n\n\t\tfor(int i=0; i<count-2; i++) {\n\t\t\tint price = sc.nextInt();\n\t\t\tmax = Math.max(max, price-min);\n\t\t\tmin = Math.min(min, price);\n\t\t}\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint count = sc.nextInt();\n\n\t\tint x1 =sc.nextInt();\n\t\tint x2 =sc.nextInt();\n\n\t\tint max = x2-x1;\n\t\tint min = Math.min(x1,x2);\n\n\t\tfor(int i=0; i<count-2; i++) {\n\t\t\tint price = sc.nextInt();\n\t\t\tmax = Math.max(max, price-min);\n\t\t\tmin = Math.min(min, price);\n\t\t}\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint count = sc.nextInt();\n\n\t\tint x1 =sc.nextInt();\n\t\tint x2 =sc.nextInt();\n\n\t\tint max = x2-x1;\n\t\tint min = Math.min(x1,x2);\n\n\t\tfor(int i=0; i<count-2; i++) {\n\t\t\tint price = sc.nextInt();\n\t\t\tmax = Math.max(max, price-min);\n\t\t\tmin = Math.min(min, price);\n\t\t}\n\t\tSystem.out.println(max);\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint count = sc.nextInt();\n\n\t\tint x1 =sc.nextInt();\n\t\tint x2 =sc.nextInt();\n\n\t\tint max = x2-x1;\n\t\tint min = Math.min(x1,x2);\n\n\t\tfor(int i=0; i<count-2; i++) {\n\t\t\tint price = sc.nextInt();\n\t\t\tmax = Math.max(max, price-min);\n\t\t\tmin = Math.min(min, price);\n\t\t}\n\t\tSystem.out.println(max);\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int count = sc.nextInt();",
"count",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int x1 =sc.nextInt();",
"x1",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int x2 =sc.nextInt();",
"x2",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int max = x2-x1;",
"max",
"x2-x1",
"x2",
"x1",
"int min = Math.min(x1,x2);",
"min",
"Math.min(x1,x2)",
"Math.min",
"Math",
"x1",
"x2",
"for(int i=0; i<count-2; i++) {\n\t\t\tint price = sc.nextInt();\n\t\t\tmax = Math.max(max, price-min);\n\t\t\tmin = Math.min(min, price);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<count-2",
"i",
"count-2",
"count",
"2",
"i++",
"i++",
"i",
"{\n\t\t\tint price = sc.nextInt();\n\t\t\tmax = Math.max(max, price-min);\n\t\t\tmin = Math.min(min, price);\n\t\t}",
"{\n\t\t\tint price = sc.nextInt();\n\t\t\tmax = Math.max(max, price-min);\n\t\t\tmin = Math.min(min, price);\n\t\t}",
"int price = sc.nextInt();",
"price",
"sc.nextInt()",
"sc.nextInt",
"sc",
"max = Math.max(max, price-min)",
"max",
"Math.max(max, price-min)",
"Math.max",
"Math",
"max",
"price-min",
"price",
"min",
"min = Math.min(min, price)",
"min",
"Math.min(min, price)",
"Math.min",
"Math",
"min",
"price",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint count = sc.nextInt();\n\n\t\tint x1 =sc.nextInt();\n\t\tint x2 =sc.nextInt();\n\n\t\tint max = x2-x1;\n\t\tint min = Math.min(x1,x2);\n\n\t\tfor(int i=0; i<count-2; i++) {\n\t\t\tint price = sc.nextInt();\n\t\t\tmax = Math.max(max, price-min);\n\t\t\tmin = Math.min(min, price);\n\t\t}\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint count = sc.nextInt();\n\n\t\tint x1 =sc.nextInt();\n\t\tint x2 =sc.nextInt();\n\n\t\tint max = x2-x1;\n\t\tint min = Math.min(x1,x2);\n\n\t\tfor(int i=0; i<count-2; i++) {\n\t\t\tint price = sc.nextInt();\n\t\t\tmax = Math.max(max, price-min);\n\t\t\tmin = Math.min(min, price);\n\t\t}\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int count = sc.nextInt();
int x1 =sc.nextInt();
int x2 =sc.nextInt();
int max = x2-x1;
int min = Math.min(x1,x2);
for(int i=0; i<count-2; i++) {
int price = sc.nextInt();
max = Math.max(max, price-min);
min = Math.min(min, price);
}
System.out.println(max);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
2,
13,
13,
14,
2,
13,
13,
0,
13,
13,
11,
1,
41,
13,
17,
41,
13,
41,
13,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
14,
2,
0,
13,
2,
13,
13,
13,
0,
13,
13,
14,
2,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
108,
11
],
[
108,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
26,
27
],
[
16,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
34,
35
],
[
16,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
41,
42
],
[
42,
43
],
[
16,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
16,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
53,
55
],
[
16,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
61,
62
],
[
57,
63
],
[
63,
64
],
[
56,
65
],
[
65,
66
],
[
65,
67
],
[
56,
68
],
[
68,
69
],
[
69,
70
],
[
56,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
78,
79
],
[
79,
80
],
[
72,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
82,
88
],
[
81,
89
],
[
89,
90
],
[
89,
91
],
[
72,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
96,
98
],
[
16,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
12,
105
],
[
105,
106
],
[
0,
107
],
[
107,
108
],
[
107,
109
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n public static void main(String[] args) throws IOException {\n \n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n int n = Integer.parseInt(br.readLine());\n int minv = Integer.parseInt(br.readLine());\n int n1 = Integer.parseInt(br.readLine());\n int maxv = n1- minv;\n if ( n1 < minv ) minv = n1;\n\n for( int i=2,r,mv; i<n; i++) {\n r = Integer.parseInt(br.readLine());\n if ( (mv = r-minv) > maxv ) maxv = mv;\n if ( r < minv ) minv = r; \n }\n\n System.out.println(maxv);\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n \n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n int n = Integer.parseInt(br.readLine());\n int minv = Integer.parseInt(br.readLine());\n int n1 = Integer.parseInt(br.readLine());\n int maxv = n1- minv;\n if ( n1 < minv ) minv = n1;\n\n for( int i=2,r,mv; i<n; i++) {\n r = Integer.parseInt(br.readLine());\n if ( (mv = r-minv) > maxv ) maxv = mv;\n if ( r < minv ) minv = r; \n }\n\n System.out.println(maxv);\n }\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n \n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n int n = Integer.parseInt(br.readLine());\n int minv = Integer.parseInt(br.readLine());\n int n1 = Integer.parseInt(br.readLine());\n int maxv = n1- minv;\n if ( n1 < minv ) minv = n1;\n\n for( int i=2,r,mv; i<n; i++) {\n r = Integer.parseInt(br.readLine());\n if ( (mv = r-minv) > maxv ) maxv = mv;\n if ( r < minv ) minv = r; \n }\n\n System.out.println(maxv);\n }\n }",
"main",
"{\n \n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n int n = Integer.parseInt(br.readLine());\n int minv = Integer.parseInt(br.readLine());\n int n1 = Integer.parseInt(br.readLine());\n int maxv = n1- minv;\n if ( n1 < minv ) minv = n1;\n\n for( int i=2,r,mv; i<n; i++) {\n r = Integer.parseInt(br.readLine());\n if ( (mv = r-minv) > maxv ) maxv = mv;\n if ( r < minv ) minv = r; \n }\n\n System.out.println(maxv);\n }\n }",
"try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n int n = Integer.parseInt(br.readLine());\n int minv = Integer.parseInt(br.readLine());\n int n1 = Integer.parseInt(br.readLine());\n int maxv = n1- minv;\n if ( n1 < minv ) minv = n1;\n\n for( int i=2,r,mv; i<n; i++) {\n r = Integer.parseInt(br.readLine());\n if ( (mv = r-minv) > maxv ) maxv = mv;\n if ( r < minv ) minv = r; \n }\n\n System.out.println(maxv);\n }",
"{\n\n int n = Integer.parseInt(br.readLine());\n int minv = Integer.parseInt(br.readLine());\n int n1 = Integer.parseInt(br.readLine());\n int maxv = n1- minv;\n if ( n1 < minv ) minv = n1;\n\n for( int i=2,r,mv; i<n; i++) {\n r = Integer.parseInt(br.readLine());\n if ( (mv = r-minv) > maxv ) maxv = mv;\n if ( r < minv ) minv = r; \n }\n\n System.out.println(maxv);\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in))",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in))",
"new BufferedReader(new InputStreamReader(System.in))",
"int n = Integer.parseInt(br.readLine());",
"n",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int minv = Integer.parseInt(br.readLine());",
"minv",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int n1 = Integer.parseInt(br.readLine());",
"n1",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int maxv = n1- minv;",
"maxv",
"n1- minv",
"n1",
"minv",
"if ( n1 < minv ) minv = n1;",
"n1 < minv",
"n1",
"minv",
"minv = n1",
"minv",
"n1",
"for( int i=2,r,mv; i<n; i++) {\n r = Integer.parseInt(br.readLine());\n if ( (mv = r-minv) > maxv ) maxv = mv;\n if ( r < minv ) minv = r; \n }",
"int i=2,r,mv;",
"int i=2",
"i",
"2",
"r",
"r",
"mv;",
"mv",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n r = Integer.parseInt(br.readLine());\n if ( (mv = r-minv) > maxv ) maxv = mv;\n if ( r < minv ) minv = r; \n }",
"{\n r = Integer.parseInt(br.readLine());\n if ( (mv = r-minv) > maxv ) maxv = mv;\n if ( r < minv ) minv = r; \n }",
"r = Integer.parseInt(br.readLine())",
"r",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"if ( (mv = r-minv) > maxv ) maxv = mv;",
"(mv = r-minv) > maxv",
"(mv = r-minv)",
"mv",
"r-minv",
"r",
"minv",
"maxv",
"maxv = mv",
"maxv",
"mv",
"if ( r < minv ) minv = r;",
"r < minv",
"r",
"minv",
"minv = r",
"minv",
"r",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n \n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n int n = Integer.parseInt(br.readLine());\n int minv = Integer.parseInt(br.readLine());\n int n1 = Integer.parseInt(br.readLine());\n int maxv = n1- minv;\n if ( n1 < minv ) minv = n1;\n\n for( int i=2,r,mv; i<n; i++) {\n r = Integer.parseInt(br.readLine());\n if ( (mv = r-minv) > maxv ) maxv = mv;\n if ( r < minv ) minv = r; \n }\n\n System.out.println(maxv);\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n \n try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {\n\n int n = Integer.parseInt(br.readLine());\n int minv = Integer.parseInt(br.readLine());\n int n1 = Integer.parseInt(br.readLine());\n int maxv = n1- minv;\n if ( n1 < minv ) minv = n1;\n\n for( int i=2,r,mv; i<n; i++) {\n r = Integer.parseInt(br.readLine());\n if ( (mv = r-minv) > maxv ) maxv = mv;\n if ( r < minv ) minv = r; \n }\n\n System.out.println(maxv);\n }\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
int n = Integer.parseInt(br.readLine());
int minv = Integer.parseInt(br.readLine());
int n1 = Integer.parseInt(br.readLine());
int maxv = n1- minv;
if ( n1 < minv ) minv = n1;
for( int i=2,r,mv; i<n; i++) {
r = Integer.parseInt(br.readLine());
if ( (mv = r-minv) > maxv ) maxv = mv;
if ( r < minv ) minv = r;
}
System.out.println(maxv);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
40,
17,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
38,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
46,
50
],
[
50,
51
],
[
50,
52
],
[
38,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
55,
59
],
[
8,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
6,
66
],
[
66,
67
]
] | [
"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\n\t\tint ans = -1000000000;\n\t\tint min = stdIn.nextInt();\n\n\t\tfor (int i=1; i<n; i++) {\n\t\t\tint r = stdIn.nextInt();\n\t\t\tans = Math.max(ans,r-min);\n\t\t\tmin = Math.min(min,r);\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint n = stdIn.nextInt();\n\n\t\tint ans = -1000000000;\n\t\tint min = stdIn.nextInt();\n\n\t\tfor (int i=1; i<n; i++) {\n\t\t\tint r = stdIn.nextInt();\n\t\t\tans = Math.max(ans,r-min);\n\t\t\tmin = Math.min(min,r);\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint n = stdIn.nextInt();\n\n\t\tint ans = -1000000000;\n\t\tint min = stdIn.nextInt();\n\n\t\tfor (int i=1; i<n; i++) {\n\t\t\tint r = stdIn.nextInt();\n\t\t\tans = Math.max(ans,r-min);\n\t\t\tmin = Math.min(min,r);\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint n = stdIn.nextInt();\n\n\t\tint ans = -1000000000;\n\t\tint min = stdIn.nextInt();\n\n\t\tfor (int i=1; i<n; i++) {\n\t\t\tint r = stdIn.nextInt();\n\t\t\tans = Math.max(ans,r-min);\n\t\t\tmin = Math.min(min,r);\n\t\t}\n\n\t\tSystem.out.println(ans);\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int n = stdIn.nextInt();",
"n",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int ans = -1000000000;",
"ans",
"-1000000000",
"1000000000",
"int min = stdIn.nextInt();",
"min",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"for (int i=1; i<n; i++) {\n\t\t\tint r = stdIn.nextInt();\n\t\t\tans = Math.max(ans,r-min);\n\t\t\tmin = Math.min(min,r);\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tint r = stdIn.nextInt();\n\t\t\tans = Math.max(ans,r-min);\n\t\t\tmin = Math.min(min,r);\n\t\t}",
"{\n\t\t\tint r = stdIn.nextInt();\n\t\t\tans = Math.max(ans,r-min);\n\t\t\tmin = Math.min(min,r);\n\t\t}",
"int r = stdIn.nextInt();",
"r",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"ans = Math.max(ans,r-min)",
"ans",
"Math.max(ans,r-min)",
"Math.max",
"Math",
"ans",
"r-min",
"r",
"min",
"min = Math.min(min,r)",
"min",
"Math.min(min,r)",
"Math.min",
"Math",
"min",
"r",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args"
] | import java.util.*;
class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int n = stdIn.nextInt();
int ans = -1000000000;
int min = stdIn.nextInt();
for (int i=1; i<n; i++) {
int r = stdIn.nextInt();
ans = Math.max(ans,r-min);
min = Math.min(min,r);
}
System.out.println(ans);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
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,
4,
18,
13,
4,
18,
18,
13,
13,
4,
13,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
17,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
18,
13,
13,
13,
13,
0,
13,
2,
18,
13,
13,
13,
14,
2,
18,
13,
13,
13,
0,
13,
18,
13,
13,
29,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
14,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
30,
38
],
[
38,
39
],
[
39,
40
],
[
30,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
14,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
12,
61
],
[
61,
62
],
[
10,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
65,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
65,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
76,
86
],
[
86,
87
],
[
87,
88
],
[
76,
89
],
[
90,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
92,
98
],
[
91,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
90,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
106,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
65,
117
],
[
117,
118
],
[
63,
119
],
[
119,
120
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\nclass Main{\n public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int[] arr = new int[n];\n for(int i=0;i<n;i++){\n arr[i] = Integer.parseInt(br.readLine());\n }\n\n System.out.println(maxDif(arr));\n }\n private static int maxDif(int[] arr){\n int min = arr[0],\n maxDif = Integer.MIN_VALUE;\n\n for(int i=1; i<arr.length; i++){\n if(arr[i] - min > maxDif) maxDif = arr[i] - min;\n if(arr[i] < min)min = arr[i];\n }\n return maxDif;\n }\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"class Main{\n public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int[] arr = new int[n];\n for(int i=0;i<n;i++){\n arr[i] = Integer.parseInt(br.readLine());\n }\n\n System.out.println(maxDif(arr));\n }\n private static int maxDif(int[] arr){\n int min = arr[0],\n maxDif = Integer.MIN_VALUE;\n\n for(int i=1; i<arr.length; i++){\n if(arr[i] - min > maxDif) maxDif = arr[i] - min;\n if(arr[i] < min)min = arr[i];\n }\n return maxDif;\n }\n\n}",
"Main",
"public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int[] arr = new int[n];\n for(int i=0;i<n;i++){\n arr[i] = Integer.parseInt(br.readLine());\n }\n\n System.out.println(maxDif(arr));\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int[] arr = new int[n];\n for(int i=0;i<n;i++){\n arr[i] = Integer.parseInt(br.readLine());\n }\n\n System.out.println(maxDif(arr));\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int n = Integer.parseInt(br.readLine());",
"n",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int[] arr = new int[n];",
"arr",
"new int[n]",
"n",
"for(int i=0;i<n;i++){\n arr[i] = Integer.parseInt(br.readLine());\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = Integer.parseInt(br.readLine());\n }",
"{\n arr[i] = Integer.parseInt(br.readLine());\n }",
"arr[i] = Integer.parseInt(br.readLine())",
"arr[i]",
"arr",
"i",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"System.out.println(maxDif(arr))",
"System.out.println",
"System.out",
"System",
"System.out",
"maxDif(arr)",
"maxDif",
"arr",
"String[] args",
"args",
"private static int maxDif(int[] arr){\n int min = arr[0],\n maxDif = Integer.MIN_VALUE;\n\n for(int i=1; i<arr.length; i++){\n if(arr[i] - min > maxDif) maxDif = arr[i] - min;\n if(arr[i] < min)min = arr[i];\n }\n return maxDif;\n }",
"maxDif",
"{\n int min = arr[0],\n maxDif = Integer.MIN_VALUE;\n\n for(int i=1; i<arr.length; i++){\n if(arr[i] - min > maxDif) maxDif = arr[i] - min;\n if(arr[i] < min)min = arr[i];\n }\n return maxDif;\n }",
"int min = arr[0]",
"min",
"arr[0]",
"arr",
"0",
"maxDif = Integer.MIN_VALUE;",
"maxDif",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"for(int i=1; i<arr.length; i++){\n if(arr[i] - min > maxDif) maxDif = arr[i] - min;\n if(arr[i] < min)min = arr[i];\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n if(arr[i] - min > maxDif) maxDif = arr[i] - min;\n if(arr[i] < min)min = arr[i];\n }",
"{\n if(arr[i] - min > maxDif) maxDif = arr[i] - min;\n if(arr[i] < min)min = arr[i];\n }",
"if(arr[i] - min > maxDif) maxDif = arr[i] - min;",
"arr[i] - min > maxDif",
"arr[i] - min",
"arr[i]",
"arr",
"i",
"min",
"maxDif",
"maxDif = arr[i] - min",
"maxDif",
"arr[i] - min",
"arr[i]",
"arr",
"i",
"min",
"if(arr[i] < min)min = arr[i];",
"arr[i] < min",
"arr[i]",
"arr",
"i",
"min",
"min = arr[i]",
"min",
"arr[i]",
"arr",
"i",
"return maxDif;",
"maxDif",
"int[] arr",
"arr"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int[] arr = new int[n];
for(int i=0;i<n;i++){
arr[i] = Integer.parseInt(br.readLine());
}
System.out.println(maxDif(arr));
}
private static int maxDif(int[] arr){
int min = arr[0],
maxDif = Integer.MIN_VALUE;
for(int i=1; i<arr.length; i++){
if(arr[i] - min > maxDif) maxDif = arr[i] - min;
if(arr[i] < min)min = arr[i];
}
return maxDif;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
12,
13,
30,
41,
13,
40,
13,
41,
13,
13,
41,
13,
20,
38,
5,
13,
30,
4,
18,
13,
30,
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,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
90,
11
],
[
90,
12
],
[
12,
13
],
[
12,
14
],
[
90,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
17,
22
],
[
22,
23
],
[
22,
24
],
[
17,
25
],
[
25,
26
],
[
25,
27
],
[
17,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
28,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
41,
42
],
[
42,
43
],
[
35,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
56,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
63,
64
],
[
56,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
67,
71
],
[
71,
72
],
[
71,
73
],
[
56,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
76,
80
],
[
17,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
15,
87
],
[
87,
88
],
[
0,
89
],
[
89,
90
],
[
89,
91
]
] | [
"import java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.BufferedReader;\n\n \npublic class Main {\n \n public static final int BIG_NUM = 2000000000;\n \n public static void main(String[] args) {\n int max = -BIG_NUM, min = BIG_NUM;\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n try {\n int N = Integer.parseInt(br.readLine());\n \n for(int loop = 0; loop < N; loop++){\n int tmp = Integer.parseInt(br.readLine());\n max = Math.max(max, tmp - min);\n min = Math.min(min, tmp);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n System.out.println(max);\n }\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"public class Main {\n \n public static final int BIG_NUM = 2000000000;\n \n public static void main(String[] args) {\n int max = -BIG_NUM, min = BIG_NUM;\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n try {\n int N = Integer.parseInt(br.readLine());\n \n for(int loop = 0; loop < N; loop++){\n int tmp = Integer.parseInt(br.readLine());\n max = Math.max(max, tmp - min);\n min = Math.min(min, tmp);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n System.out.println(max);\n }\n}",
"Main",
"public static final int BIG_NUM = 2000000000;",
"BIG_NUM",
"2000000000",
"public static void main(String[] args) {\n int max = -BIG_NUM, min = BIG_NUM;\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n try {\n int N = Integer.parseInt(br.readLine());\n \n for(int loop = 0; loop < N; loop++){\n int tmp = Integer.parseInt(br.readLine());\n max = Math.max(max, tmp - min);\n min = Math.min(min, tmp);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n System.out.println(max);\n }",
"main",
"{\n int max = -BIG_NUM, min = BIG_NUM;\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n try {\n int N = Integer.parseInt(br.readLine());\n \n for(int loop = 0; loop < N; loop++){\n int tmp = Integer.parseInt(br.readLine());\n max = Math.max(max, tmp - min);\n min = Math.min(min, tmp);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n System.out.println(max);\n }",
"int max = -BIG_NUM",
"max",
"-BIG_NUM",
"BIG_NUM",
"min = BIG_NUM;",
"min",
"BIG_NUM",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"try {\n int N = Integer.parseInt(br.readLine());\n \n for(int loop = 0; loop < N; loop++){\n int tmp = Integer.parseInt(br.readLine());\n max = Math.max(max, tmp - min);\n min = Math.min(min, tmp);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n int N = Integer.parseInt(br.readLine());\n \n for(int loop = 0; loop < N; loop++){\n int tmp = Integer.parseInt(br.readLine());\n max = Math.max(max, tmp - min);\n min = Math.min(min, tmp);\n }\n }",
"int N = Integer.parseInt(br.readLine());",
"N",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"for(int loop = 0; loop < N; loop++){\n int tmp = Integer.parseInt(br.readLine());\n max = Math.max(max, tmp - min);\n min = Math.min(min, tmp);\n }",
"int loop = 0;",
"int loop = 0;",
"loop",
"0",
"loop < N",
"loop",
"N",
"loop++",
"loop++",
"loop",
"{\n int tmp = Integer.parseInt(br.readLine());\n max = Math.max(max, tmp - min);\n min = Math.min(min, tmp);\n }",
"{\n int tmp = Integer.parseInt(br.readLine());\n max = Math.max(max, tmp - min);\n min = Math.min(min, tmp);\n }",
"int tmp = Integer.parseInt(br.readLine());",
"tmp",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"max = Math.max(max, tmp - min)",
"max",
"Math.max(max, tmp - min)",
"Math.max",
"Math",
"max",
"tmp - min",
"tmp",
"min",
"min = Math.min(min, tmp)",
"min",
"Math.min(min, tmp)",
"Math.min",
"Math",
"min",
"tmp",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main {\n \n public static final int BIG_NUM = 2000000000;\n \n public static void main(String[] args) {\n int max = -BIG_NUM, min = BIG_NUM;\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n try {\n int N = Integer.parseInt(br.readLine());\n \n for(int loop = 0; loop < N; loop++){\n int tmp = Integer.parseInt(br.readLine());\n max = Math.max(max, tmp - min);\n min = Math.min(min, tmp);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n System.out.println(max);\n }\n}",
"public class Main {\n \n public static final int BIG_NUM = 2000000000;\n \n public static void main(String[] args) {\n int max = -BIG_NUM, min = BIG_NUM;\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n try {\n int N = Integer.parseInt(br.readLine());\n \n for(int loop = 0; loop < N; loop++){\n int tmp = Integer.parseInt(br.readLine());\n max = Math.max(max, tmp - min);\n min = Math.min(min, tmp);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n System.out.println(max);\n }\n}",
"Main"
] | import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
public class Main {
public static final int BIG_NUM = 2000000000;
public static void main(String[] args) {
int max = -BIG_NUM, min = BIG_NUM;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
int N = Integer.parseInt(br.readLine());
for(int loop = 0; loop < N; loop++){
int tmp = Integer.parseInt(br.readLine());
max = Math.max(max, tmp - min);
min = Math.min(min, tmp);
}
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(max);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
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,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
17,
14,
2,
18,
13,
13,
13,
30,
9,
0,
13,
18,
13,
13,
11,
1,
41,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
13,
30,
0,
13,
18,
13,
13,
14,
2,
2,
13,
18,
13,
13,
13,
30,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
146,
11
],
[
146,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
14,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
30,
38
],
[
38,
39
],
[
39,
40
],
[
30,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
14,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
14,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
14,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
63,
73
],
[
73,
74
],
[
74,
75
],
[
63,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
81,
87
],
[
87,
88
],
[
77,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
77,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
94,
101
],
[
101,
102
],
[
101,
103
],
[
94,
104
],
[
104,
105
],
[
105,
106
],
[
94,
107
],
[
108,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
109,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
118,
120
],
[
77,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
125,
127
],
[
122,
128
],
[
121,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
134,
136
],
[
14,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
12,
143
],
[
143,
144
],
[
0,
145
],
[
145,
146
],
[
145,
147
]
] | [
"\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t//??\\?????¨\n\t\tint n = Integer.parseInt(br.readLine());\n\n\t\tint[] price = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tprice[i] = Integer.parseInt(br.readLine());\n\t\t}\n\n\t\tint maxProfit = Integer.MIN_VALUE;\n\t\tint prevBuy = Integer.MAX_VALUE;\n\n\t\tfor(int i = 0; i < n - 1; i++){\n\t\t\tint tmpHigh = 0;\n\n\t\t\tif(price[i] >= prevBuy){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprevBuy = price[i];\n\t\t\t\n\t\t\tfor(int j = i + 1; j < n; j++){\n\t\t\t\tif(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(tmpHigh - price[i] > maxProfit){\n\t\t\t\tmaxProfit = tmpHigh - price[i];\n\t\t\t}\n\t\t}\n\n\n\t\tSystem.out.println(maxProfit);\n\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t//??\\?????¨\n\t\tint n = Integer.parseInt(br.readLine());\n\n\t\tint[] price = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tprice[i] = Integer.parseInt(br.readLine());\n\t\t}\n\n\t\tint maxProfit = Integer.MIN_VALUE;\n\t\tint prevBuy = Integer.MAX_VALUE;\n\n\t\tfor(int i = 0; i < n - 1; i++){\n\t\t\tint tmpHigh = 0;\n\n\t\t\tif(price[i] >= prevBuy){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprevBuy = price[i];\n\t\t\t\n\t\t\tfor(int j = i + 1; j < n; j++){\n\t\t\t\tif(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(tmpHigh - price[i] > maxProfit){\n\t\t\t\tmaxProfit = tmpHigh - price[i];\n\t\t\t}\n\t\t}\n\n\n\t\tSystem.out.println(maxProfit);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t//??\\?????¨\n\t\tint n = Integer.parseInt(br.readLine());\n\n\t\tint[] price = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tprice[i] = Integer.parseInt(br.readLine());\n\t\t}\n\n\t\tint maxProfit = Integer.MIN_VALUE;\n\t\tint prevBuy = Integer.MAX_VALUE;\n\n\t\tfor(int i = 0; i < n - 1; i++){\n\t\t\tint tmpHigh = 0;\n\n\t\t\tif(price[i] >= prevBuy){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprevBuy = price[i];\n\t\t\t\n\t\t\tfor(int j = i + 1; j < n; j++){\n\t\t\t\tif(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(tmpHigh - price[i] > maxProfit){\n\t\t\t\tmaxProfit = tmpHigh - price[i];\n\t\t\t}\n\t\t}\n\n\n\t\tSystem.out.println(maxProfit);\n\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t//??\\?????¨\n\t\tint n = Integer.parseInt(br.readLine());\n\n\t\tint[] price = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tprice[i] = Integer.parseInt(br.readLine());\n\t\t}\n\n\t\tint maxProfit = Integer.MIN_VALUE;\n\t\tint prevBuy = Integer.MAX_VALUE;\n\n\t\tfor(int i = 0; i < n - 1; i++){\n\t\t\tint tmpHigh = 0;\n\n\t\t\tif(price[i] >= prevBuy){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprevBuy = price[i];\n\t\t\t\n\t\t\tfor(int j = i + 1; j < n; j++){\n\t\t\t\tif(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(tmpHigh - price[i] > maxProfit){\n\t\t\t\tmaxProfit = tmpHigh - price[i];\n\t\t\t}\n\t\t}\n\n\n\t\tSystem.out.println(maxProfit);\n\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int n = Integer.parseInt(br.readLine());",
"n",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int[] price = new int[n];",
"price",
"new int[n]",
"n",
"for(int i = 0; i < n; i++){\n\t\t\tprice[i] = Integer.parseInt(br.readLine());\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tprice[i] = Integer.parseInt(br.readLine());\n\t\t}",
"{\n\t\t\tprice[i] = Integer.parseInt(br.readLine());\n\t\t}",
"price[i] = Integer.parseInt(br.readLine())",
"price[i]",
"price",
"i",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int maxProfit = Integer.MIN_VALUE;",
"maxProfit",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int prevBuy = Integer.MAX_VALUE;",
"prevBuy",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"for(int i = 0; i < n - 1; i++){\n\t\t\tint tmpHigh = 0;\n\n\t\t\tif(price[i] >= prevBuy){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprevBuy = price[i];\n\t\t\t\n\t\t\tfor(int j = i + 1; j < n; j++){\n\t\t\t\tif(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(tmpHigh - price[i] > maxProfit){\n\t\t\t\tmaxProfit = tmpHigh - price[i];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tint tmpHigh = 0;\n\n\t\t\tif(price[i] >= prevBuy){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprevBuy = price[i];\n\t\t\t\n\t\t\tfor(int j = i + 1; j < n; j++){\n\t\t\t\tif(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(tmpHigh - price[i] > maxProfit){\n\t\t\t\tmaxProfit = tmpHigh - price[i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tint tmpHigh = 0;\n\n\t\t\tif(price[i] >= prevBuy){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprevBuy = price[i];\n\t\t\t\n\t\t\tfor(int j = i + 1; j < n; j++){\n\t\t\t\tif(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(tmpHigh - price[i] > maxProfit){\n\t\t\t\tmaxProfit = tmpHigh - price[i];\n\t\t\t}\n\t\t}",
"int tmpHigh = 0;",
"tmpHigh",
"0",
"if(price[i] >= prevBuy){\n\t\t\t\tcontinue;\n\t\t\t}",
"price[i] >= prevBuy",
"price[i]",
"price",
"i",
"prevBuy",
"{\n\t\t\t\tcontinue;\n\t\t\t}",
"continue;",
"prevBuy = price[i]",
"prevBuy",
"price[i]",
"price",
"i",
"for(int j = i + 1; j < n; j++){\n\t\t\t\tif(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}\n\t\t\t}",
"int j = i + 1;",
"int j = i + 1;",
"j",
"i + 1",
"i",
"1",
"j < n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}\n\t\t\t}",
"if(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}",
"price[j] > tmpHigh",
"price[j]",
"price",
"j",
"tmpHigh",
"{\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}",
"tmpHigh = price[j]",
"tmpHigh",
"price[j]",
"price",
"j",
"if(tmpHigh - price[i] > maxProfit){\n\t\t\t\tmaxProfit = tmpHigh - price[i];\n\t\t\t}",
"tmpHigh - price[i] > maxProfit",
"tmpHigh - price[i]",
"tmpHigh",
"price[i]",
"price",
"i",
"maxProfit",
"{\n\t\t\t\tmaxProfit = tmpHigh - price[i];\n\t\t\t}",
"maxProfit = tmpHigh - price[i]",
"maxProfit",
"tmpHigh - price[i]",
"tmpHigh",
"price[i]",
"price",
"i",
"System.out.println(maxProfit)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxProfit",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t//??\\?????¨\n\t\tint n = Integer.parseInt(br.readLine());\n\n\t\tint[] price = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tprice[i] = Integer.parseInt(br.readLine());\n\t\t}\n\n\t\tint maxProfit = Integer.MIN_VALUE;\n\t\tint prevBuy = Integer.MAX_VALUE;\n\n\t\tfor(int i = 0; i < n - 1; i++){\n\t\t\tint tmpHigh = 0;\n\n\t\t\tif(price[i] >= prevBuy){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprevBuy = price[i];\n\t\t\t\n\t\t\tfor(int j = i + 1; j < n; j++){\n\t\t\t\tif(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(tmpHigh - price[i] > maxProfit){\n\t\t\t\tmaxProfit = tmpHigh - price[i];\n\t\t\t}\n\t\t}\n\n\n\t\tSystem.out.println(maxProfit);\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t//??\\?????¨\n\t\tint n = Integer.parseInt(br.readLine());\n\n\t\tint[] price = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tprice[i] = Integer.parseInt(br.readLine());\n\t\t}\n\n\t\tint maxProfit = Integer.MIN_VALUE;\n\t\tint prevBuy = Integer.MAX_VALUE;\n\n\t\tfor(int i = 0; i < n - 1; i++){\n\t\t\tint tmpHigh = 0;\n\n\t\t\tif(price[i] >= prevBuy){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprevBuy = price[i];\n\t\t\t\n\t\t\tfor(int j = i + 1; j < n; j++){\n\t\t\t\tif(price[j] > tmpHigh){\n\t\t\t\t\ttmpHigh = price[j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(tmpHigh - price[i] > maxProfit){\n\t\t\t\tmaxProfit = tmpHigh - price[i];\n\t\t\t}\n\t\t}\n\n\n\t\tSystem.out.println(maxProfit);\n\n\t}\n\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws NumberFormatException, IOException {
// TODO ?????????????????????????????????????????????
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//??\?????¨
int n = Integer.parseInt(br.readLine());
int[] price = new int[n];
for(int i = 0; i < n; i++){
price[i] = Integer.parseInt(br.readLine());
}
int maxProfit = Integer.MIN_VALUE;
int prevBuy = Integer.MAX_VALUE;
for(int i = 0; i < n - 1; i++){
int tmpHigh = 0;
if(price[i] >= prevBuy){
continue;
}
prevBuy = price[i];
for(int j = i + 1; j < n; j++){
if(price[j] > tmpHigh){
tmpHigh = price[j];
}
}
if(tmpHigh - price[i] > maxProfit){
maxProfit = tmpHigh - price[i];
}
}
System.out.println(maxProfit);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
40,
17,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
13,
41,
13,
41,
13,
40,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
13,
2,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
29,
30
],
[
30,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
8,
35
],
[
35,
36
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
41,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
60,
61
],
[
53,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
67,
68
],
[
67,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
70,
76
],
[
76,
77
],
[
76,
78
],
[
62,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
83,
89
],
[
89,
90
],
[
89,
91
],
[
83,
92
],
[
92,
93
],
[
92,
94
],
[
53,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
99,
101
],
[
8,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
6,
108
],
[
108,
109
]
] | [
"import java.util.Scanner;\n\nclass Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n\n int n = Integer.parseInt(scan.nextLine());\n double maxProfit = -1000000000;\n double maxR = Integer.parseInt(scan.nextLine());\n double minR = maxR;\n double newR;\n double tmp = -1000000000;\n\n for (int i=1; i<n; i++){\n newR = Integer.parseInt(scan.nextLine());\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\", i, newR, minR, maxR, maxProfit);\n if (newR > minR && newR > maxR){\n //System.out.println(\"aiueo\");\n tmp = newR - minR;\n maxR = newR;\n }else if (newR <= minR){\n tmp = newR - minR;\n minR = newR;\n maxR = newR;\n }\n if (tmp > maxProfit)\n maxProfit = tmp;\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\\n\", i, newR, minR, maxR, maxProfit);\n }\n System.out.println((int) maxProfit);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n\n int n = Integer.parseInt(scan.nextLine());\n double maxProfit = -1000000000;\n double maxR = Integer.parseInt(scan.nextLine());\n double minR = maxR;\n double newR;\n double tmp = -1000000000;\n\n for (int i=1; i<n; i++){\n newR = Integer.parseInt(scan.nextLine());\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\", i, newR, minR, maxR, maxProfit);\n if (newR > minR && newR > maxR){\n //System.out.println(\"aiueo\");\n tmp = newR - minR;\n maxR = newR;\n }else if (newR <= minR){\n tmp = newR - minR;\n minR = newR;\n maxR = newR;\n }\n if (tmp > maxProfit)\n maxProfit = tmp;\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\\n\", i, newR, minR, maxR, maxProfit);\n }\n System.out.println((int) maxProfit);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n\n int n = Integer.parseInt(scan.nextLine());\n double maxProfit = -1000000000;\n double maxR = Integer.parseInt(scan.nextLine());\n double minR = maxR;\n double newR;\n double tmp = -1000000000;\n\n for (int i=1; i<n; i++){\n newR = Integer.parseInt(scan.nextLine());\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\", i, newR, minR, maxR, maxProfit);\n if (newR > minR && newR > maxR){\n //System.out.println(\"aiueo\");\n tmp = newR - minR;\n maxR = newR;\n }else if (newR <= minR){\n tmp = newR - minR;\n minR = newR;\n maxR = newR;\n }\n if (tmp > maxProfit)\n maxProfit = tmp;\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\\n\", i, newR, minR, maxR, maxProfit);\n }\n System.out.println((int) maxProfit);\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n\n int n = Integer.parseInt(scan.nextLine());\n double maxProfit = -1000000000;\n double maxR = Integer.parseInt(scan.nextLine());\n double minR = maxR;\n double newR;\n double tmp = -1000000000;\n\n for (int i=1; i<n; i++){\n newR = Integer.parseInt(scan.nextLine());\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\", i, newR, minR, maxR, maxProfit);\n if (newR > minR && newR > maxR){\n //System.out.println(\"aiueo\");\n tmp = newR - minR;\n maxR = newR;\n }else if (newR <= minR){\n tmp = newR - minR;\n minR = newR;\n maxR = newR;\n }\n if (tmp > maxProfit)\n maxProfit = tmp;\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\\n\", i, newR, minR, maxR, maxProfit);\n }\n System.out.println((int) maxProfit);\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = Integer.parseInt(scan.nextLine());",
"n",
"Integer.parseInt(scan.nextLine())",
"Integer.parseInt",
"Integer",
"scan.nextLine()",
"scan.nextLine",
"scan",
"double maxProfit = -1000000000;",
"maxProfit",
"-1000000000",
"1000000000",
"double maxR = Integer.parseInt(scan.nextLine());",
"maxR",
"Integer.parseInt(scan.nextLine())",
"Integer.parseInt",
"Integer",
"scan.nextLine()",
"scan.nextLine",
"scan",
"double minR = maxR;",
"minR",
"maxR",
"double newR;",
"newR",
"double tmp = -1000000000;",
"tmp",
"-1000000000",
"1000000000",
"for (int i=1; i<n; i++){\n newR = Integer.parseInt(scan.nextLine());\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\", i, newR, minR, maxR, maxProfit);\n if (newR > minR && newR > maxR){\n //System.out.println(\"aiueo\");\n tmp = newR - minR;\n maxR = newR;\n }else if (newR <= minR){\n tmp = newR - minR;\n minR = newR;\n maxR = newR;\n }\n if (tmp > maxProfit)\n maxProfit = tmp;\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\\n\", i, newR, minR, maxR, maxProfit);\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n newR = Integer.parseInt(scan.nextLine());\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\", i, newR, minR, maxR, maxProfit);\n if (newR > minR && newR > maxR){\n //System.out.println(\"aiueo\");\n tmp = newR - minR;\n maxR = newR;\n }else if (newR <= minR){\n tmp = newR - minR;\n minR = newR;\n maxR = newR;\n }\n if (tmp > maxProfit)\n maxProfit = tmp;\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\\n\", i, newR, minR, maxR, maxProfit);\n }",
"{\n newR = Integer.parseInt(scan.nextLine());\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\", i, newR, minR, maxR, maxProfit);\n if (newR > minR && newR > maxR){\n //System.out.println(\"aiueo\");\n tmp = newR - minR;\n maxR = newR;\n }else if (newR <= minR){\n tmp = newR - minR;\n minR = newR;\n maxR = newR;\n }\n if (tmp > maxProfit)\n maxProfit = tmp;\n //System.out.printf(\"%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\\n\\n\", i, newR, minR, maxR, maxProfit);\n }",
"newR = Integer.parseInt(scan.nextLine())",
"newR",
"Integer.parseInt(scan.nextLine())",
"Integer.parseInt",
"Integer",
"scan.nextLine()",
"scan.nextLine",
"scan",
"if (newR > minR && newR > maxR){\n //System.out.println(\"aiueo\");\n tmp = newR - minR;\n maxR = newR;\n }else if (newR <= minR){\n tmp = newR - minR;\n minR = newR;\n maxR = newR;\n }",
"newR > minR && newR > maxR",
"newR > minR",
"newR",
"minR",
"newR > maxR",
"newR",
"maxR",
"{\n //System.out.println(\"aiueo\");\n tmp = newR - minR;\n maxR = newR;\n }",
"tmp = newR - minR",
"tmp",
"newR - minR",
"newR",
"minR",
"maxR = newR",
"maxR",
"newR",
"if (newR <= minR){\n tmp = newR - minR;\n minR = newR;\n maxR = newR;\n }",
"newR <= minR",
"newR",
"minR",
"{\n tmp = newR - minR;\n minR = newR;\n maxR = newR;\n }",
"tmp = newR - minR",
"tmp",
"newR - minR",
"newR",
"minR",
"minR = newR",
"minR",
"newR",
"maxR = newR",
"maxR",
"newR",
"if (tmp > maxProfit)\n maxProfit = tmp;",
"tmp > maxProfit",
"tmp",
"maxProfit",
"maxProfit = tmp",
"maxProfit",
"tmp",
"System.out.println((int) maxProfit)",
"System.out.println",
"System.out",
"System",
"System.out",
"(int) maxProfit",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = Integer.parseInt(scan.nextLine());
double maxProfit = -1000000000;
double maxR = Integer.parseInt(scan.nextLine());
double minR = maxR;
double newR;
double tmp = -1000000000;
for (int i=1; i<n; i++){
newR = Integer.parseInt(scan.nextLine());
//System.out.printf("%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\n", i, newR, minR, maxR, maxProfit);
if (newR > minR && newR > maxR){
//System.out.println("aiueo");
tmp = newR - minR;
maxR = newR;
}else if (newR <= minR){
tmp = newR - minR;
minR = newR;
maxR = newR;
}
if (tmp > maxProfit)
maxProfit = tmp;
//System.out.printf("%d??????????¨???????, newR:%f, minR:%f, maxR:%f, maxProfit:%f\n\n", i, newR, minR, maxR, maxProfit);
}
System.out.println((int) maxProfit);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
0,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
13,
13,
30,
0,
13,
13,
30,
0,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
95,
5
],
[
95,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
36,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
8,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
44,
54
],
[
54,
55
],
[
55,
56
],
[
44,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
58,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
72,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
8,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
6,
92
],
[
92,
93
],
[
0,
94
],
[
94,
95
],
[
94,
96
]
] | [
"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 min;\n int d;\n min = scan.nextInt();\n \tint tmp = scan.nextInt();\n \td = tmp - min;\n \tif(tmp < min){\n \t\tmin = tmp;\n \t}\n //max = min;\n for(int i = 1; i < n-1; i++){\n int x = scan.nextInt();\n if(x < min){\n min = x;\n }else{\n \ttmp = x - min;\n \tif(d < tmp){\n \t\td = tmp;\n \t}\n }\n }\n System.out.println(d);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int min;\n int d;\n min = scan.nextInt();\n \tint tmp = scan.nextInt();\n \td = tmp - min;\n \tif(tmp < min){\n \t\tmin = tmp;\n \t}\n //max = min;\n for(int i = 1; i < n-1; i++){\n int x = scan.nextInt();\n if(x < min){\n min = x;\n }else{\n \ttmp = x - min;\n \tif(d < tmp){\n \t\td = tmp;\n \t}\n }\n }\n System.out.println(d);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int min;\n int d;\n min = scan.nextInt();\n \tint tmp = scan.nextInt();\n \td = tmp - min;\n \tif(tmp < min){\n \t\tmin = tmp;\n \t}\n //max = min;\n for(int i = 1; i < n-1; i++){\n int x = scan.nextInt();\n if(x < min){\n min = x;\n }else{\n \ttmp = x - min;\n \tif(d < tmp){\n \t\td = tmp;\n \t}\n }\n }\n System.out.println(d);\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int min;\n int d;\n min = scan.nextInt();\n \tint tmp = scan.nextInt();\n \td = tmp - min;\n \tif(tmp < min){\n \t\tmin = tmp;\n \t}\n //max = min;\n for(int i = 1; i < n-1; i++){\n int x = scan.nextInt();\n if(x < min){\n min = x;\n }else{\n \ttmp = x - min;\n \tif(d < tmp){\n \t\td = tmp;\n \t}\n }\n }\n System.out.println(d);\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int min;",
"min",
"int d;",
"d",
"min = scan.nextInt()",
"min",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int tmp = scan.nextInt();",
"tmp",
"scan.nextInt()",
"scan.nextInt",
"scan",
"d = tmp - min",
"d",
"tmp - min",
"tmp",
"min",
"if(tmp < min){\n \t\tmin = tmp;\n \t}",
"tmp < min",
"tmp",
"min",
"{\n \t\tmin = tmp;\n \t}",
"min = tmp",
"min",
"tmp",
"for(int i = 1; i < n-1; i++){\n int x = scan.nextInt();\n if(x < min){\n min = x;\n }else{\n \ttmp = x - min;\n \tif(d < tmp){\n \t\td = tmp;\n \t}\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n int x = scan.nextInt();\n if(x < min){\n min = x;\n }else{\n \ttmp = x - min;\n \tif(d < tmp){\n \t\td = tmp;\n \t}\n }\n }",
"{\n int x = scan.nextInt();\n if(x < min){\n min = x;\n }else{\n \ttmp = x - min;\n \tif(d < tmp){\n \t\td = tmp;\n \t}\n }\n }",
"int x = scan.nextInt();",
"x",
"scan.nextInt()",
"scan.nextInt",
"scan",
"if(x < min){\n min = x;\n }else{\n \ttmp = x - min;\n \tif(d < tmp){\n \t\td = tmp;\n \t}\n }",
"x < min",
"x",
"min",
"{\n min = x;\n }",
"min = x",
"min",
"x",
"{\n \ttmp = x - min;\n \tif(d < tmp){\n \t\td = tmp;\n \t}\n }",
"tmp = x - min",
"tmp",
"x - min",
"x",
"min",
"if(d < tmp){\n \t\td = tmp;\n \t}",
"d < tmp",
"d",
"tmp",
"{\n \t\td = tmp;\n \t}",
"d = tmp",
"d",
"tmp",
"System.out.println(d)",
"System.out.println",
"System.out",
"System",
"System.out",
"d",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int min;\n int d;\n min = scan.nextInt();\n \tint tmp = scan.nextInt();\n \td = tmp - min;\n \tif(tmp < min){\n \t\tmin = tmp;\n \t}\n //max = min;\n for(int i = 1; i < n-1; i++){\n int x = scan.nextInt();\n if(x < min){\n min = x;\n }else{\n \ttmp = x - min;\n \tif(d < tmp){\n \t\td = tmp;\n \t}\n }\n }\n System.out.println(d);\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int min;\n int d;\n min = scan.nextInt();\n \tint tmp = scan.nextInt();\n \td = tmp - min;\n \tif(tmp < min){\n \t\tmin = tmp;\n \t}\n //max = min;\n for(int i = 1; i < n-1; i++){\n int x = scan.nextInt();\n if(x < min){\n min = x;\n }else{\n \ttmp = x - min;\n \tif(d < tmp){\n \t\td = tmp;\n \t}\n }\n }\n System.out.println(d);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int min;
int d;
min = scan.nextInt();
int tmp = scan.nextInt();
d = tmp - min;
if(tmp < min){
min = tmp;
}
//max = min;
for(int i = 1; i < n-1; i++){
int x = scan.nextInt();
if(x < min){
min = x;
}else{
tmp = x - min;
if(d < tmp){
d = tmp;
}
}
}
System.out.println(d);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
2,
13,
13,
30,
0,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
89,
5
],
[
89,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
32,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
8,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
40,
50
],
[
50,
51
],
[
51,
52
],
[
40,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
54,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
60,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
54,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
8,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
6,
86
],
[
86,
87
],
[
0,
88
],
[
88,
89
],
[
88,
90
]
] | [
"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\tint N = scan.nextInt();\n\t\tint min = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint maxLong = r - min;\n\t\tif (min > r){\n\t\t\tmin = r;\n\t\t}\n\t\tfor (int i = 0; i < N - 2; i++) {\n\t\t\tr = scan.nextInt();\n\t\t\tif (maxLong < r - min) {\n\t\t\t\tmaxLong = r - min;\n\t\t\t}\n\t\t\tif (r < min) {\n\t\t\t\tmin = r;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(maxLong);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public 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 min = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint maxLong = r - min;\n\t\tif (min > r){\n\t\t\tmin = r;\n\t\t}\n\t\tfor (int i = 0; i < N - 2; i++) {\n\t\t\tr = scan.nextInt();\n\t\t\tif (maxLong < r - min) {\n\t\t\t\tmaxLong = r - min;\n\t\t\t}\n\t\t\tif (r < min) {\n\t\t\t\tmin = r;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(maxLong);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint min = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint maxLong = r - min;\n\t\tif (min > r){\n\t\t\tmin = r;\n\t\t}\n\t\tfor (int i = 0; i < N - 2; i++) {\n\t\t\tr = scan.nextInt();\n\t\t\tif (maxLong < r - min) {\n\t\t\t\tmaxLong = r - min;\n\t\t\t}\n\t\t\tif (r < min) {\n\t\t\t\tmin = r;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(maxLong);\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint min = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint maxLong = r - min;\n\t\tif (min > r){\n\t\t\tmin = r;\n\t\t}\n\t\tfor (int i = 0; i < N - 2; i++) {\n\t\t\tr = scan.nextInt();\n\t\t\tif (maxLong < r - min) {\n\t\t\t\tmaxLong = r - min;\n\t\t\t}\n\t\t\tif (r < min) {\n\t\t\t\tmin = r;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(maxLong);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int min = scan.nextInt();",
"min",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int maxLong = r - min;",
"maxLong",
"r - min",
"r",
"min",
"if (min > r){\n\t\t\tmin = r;\n\t\t}",
"min > r",
"min",
"r",
"{\n\t\t\tmin = r;\n\t\t}",
"min = r",
"min",
"r",
"for (int i = 0; i < N - 2; i++) {\n\t\t\tr = scan.nextInt();\n\t\t\tif (maxLong < r - min) {\n\t\t\t\tmaxLong = r - min;\n\t\t\t}\n\t\t\tif (r < min) {\n\t\t\t\tmin = r;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N - 2",
"i",
"N - 2",
"N",
"2",
"i++",
"i++",
"i",
"{\n\t\t\tr = scan.nextInt();\n\t\t\tif (maxLong < r - min) {\n\t\t\t\tmaxLong = r - min;\n\t\t\t}\n\t\t\tif (r < min) {\n\t\t\t\tmin = r;\n\t\t\t}\n\t\t}",
"{\n\t\t\tr = scan.nextInt();\n\t\t\tif (maxLong < r - min) {\n\t\t\t\tmaxLong = r - min;\n\t\t\t}\n\t\t\tif (r < min) {\n\t\t\t\tmin = r;\n\t\t\t}\n\t\t}",
"r = scan.nextInt()",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"if (maxLong < r - min) {\n\t\t\t\tmaxLong = r - min;\n\t\t\t}",
"maxLong < r - min",
"maxLong",
"r - min",
"r",
"min",
"{\n\t\t\t\tmaxLong = r - min;\n\t\t\t}",
"maxLong = r - min",
"maxLong",
"r - min",
"r",
"min",
"if (r < min) {\n\t\t\t\tmin = r;\n\t\t\t}",
"r < min",
"r",
"min",
"{\n\t\t\t\tmin = r;\n\t\t\t}",
"min = r",
"min",
"r",
"System.out.println(maxLong)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxLong",
"String[] args",
"args",
"public 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 min = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint maxLong = r - min;\n\t\tif (min > r){\n\t\t\tmin = r;\n\t\t}\n\t\tfor (int i = 0; i < N - 2; i++) {\n\t\t\tr = scan.nextInt();\n\t\t\tif (maxLong < r - min) {\n\t\t\t\tmaxLong = r - min;\n\t\t\t}\n\t\t\tif (r < min) {\n\t\t\t\tmin = r;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(maxLong);\n\t}\n}",
"public 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 min = scan.nextInt();\n\t\tint r = scan.nextInt();\n\t\tint maxLong = r - min;\n\t\tif (min > r){\n\t\t\tmin = r;\n\t\t}\n\t\tfor (int i = 0; i < N - 2; i++) {\n\t\t\tr = scan.nextInt();\n\t\t\tif (maxLong < r - min) {\n\t\t\t\tmaxLong = r - min;\n\t\t\t}\n\t\t\tif (r < min) {\n\t\t\t\tmin = r;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(maxLong);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
int min = scan.nextInt();
int r = scan.nextInt();
int maxLong = r - min;
if (min > r){
min = r;
}
for (int i = 0; i < N - 2; i++) {
r = scan.nextInt();
if (maxLong < r - min) {
maxLong = r - min;
}
if (r < min) {
min = r;
}
}
System.out.println(maxLong);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
40,
17,
41,
13,
41,
13,
17,
41,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
13,
30,
0,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
85,
5
],
[
85,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
18,
20
],
[
8,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
28,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
40,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
54,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
54,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
8,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
6,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
] | [
"import java.util.Scanner;\n\npublic class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int max=-1000000000,res,min=0,num;\n int n=sc.nextInt();\n for(int i=0;i<n;i++){\n num=sc.nextInt();\n if(i==0){\n min=num;\n }else{\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n }\n System.out.println(max);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int max=-1000000000,res,min=0,num;\n int n=sc.nextInt();\n for(int i=0;i<n;i++){\n num=sc.nextInt();\n if(i==0){\n min=num;\n }else{\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n }\n System.out.println(max);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int max=-1000000000,res,min=0,num;\n int n=sc.nextInt();\n for(int i=0;i<n;i++){\n num=sc.nextInt();\n if(i==0){\n min=num;\n }else{\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n }\n System.out.println(max);\n }",
"main",
"{\n Scanner sc=new Scanner(System.in);\n int max=-1000000000,res,min=0,num;\n int n=sc.nextInt();\n for(int i=0;i<n;i++){\n num=sc.nextInt();\n if(i==0){\n min=num;\n }else{\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n }\n System.out.println(max);\n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int max=-1000000000",
"max",
"-1000000000",
"1000000000",
"res",
"res",
"min=0",
"min",
"0",
"num;",
"num",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=0;i<n;i++){\n num=sc.nextInt();\n if(i==0){\n min=num;\n }else{\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n num=sc.nextInt();\n if(i==0){\n min=num;\n }else{\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n }",
"{\n num=sc.nextInt();\n if(i==0){\n min=num;\n }else{\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n }",
"num=sc.nextInt()",
"num",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if(i==0){\n min=num;\n }else{\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }",
"i==0",
"i",
"0",
"{\n min=num;\n }",
"min=num",
"min",
"num",
"{\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }",
"res=num-min",
"res",
"num-min",
"num",
"min",
"if(res>max){\n max=res;\n }",
"res>max",
"res",
"max",
"{\n max=res;\n }",
"max=res",
"max",
"res",
"if(min>num){\n min=num;\n }",
"min>num",
"min",
"num",
"{\n min=num;\n }",
"min=num",
"min",
"num",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int max=-1000000000,res,min=0,num;\n int n=sc.nextInt();\n for(int i=0;i<n;i++){\n num=sc.nextInt();\n if(i==0){\n min=num;\n }else{\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n }\n System.out.println(max);\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int max=-1000000000,res,min=0,num;\n int n=sc.nextInt();\n for(int i=0;i<n;i++){\n num=sc.nextInt();\n if(i==0){\n min=num;\n }else{\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n }\n System.out.println(max);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int max=-1000000000,res,min=0,num;
int n=sc.nextInt();
for(int i=0;i<n;i++){
num=sc.nextInt();
if(i==0){
min=num;
}else{
res=num-min;
if(res>max){
max=res;
}
if(min>num){
min=num;
}
}
}
System.out.println(max);
}
}
|
[
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,
2,
4,
18,
13,
17,
17,
40,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
18,
13,
13,
13,
30,
0,
13,
2,
18,
13,
13,
13,
0,
13,
8,
2,
13,
18,
13,
13,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
106,
5
],
[
106,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
44,
48
],
[
43,
49
],
[
49,
50
],
[
8,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
8,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
69,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
68,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
87,
93
],
[
93,
94
],
[
93,
95
],
[
87,
96
],
[
8,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
6,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] | [
"import 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\n\t\tint[] t = new int[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tt[i] = sc.nextInt();\n\t\t}\n\n\t\tint max = (int) Math.pow(10, 9) * -1;\n\t\tint min = t[0];\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (max < t[i] - min) {\n\t\t\t\tmax = t[i] - min;\n\t\t\t}\n\t\t\tmin = min > t[i] ? t[i] : min;\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public 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\n\t\tint[] t = new int[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tt[i] = sc.nextInt();\n\t\t}\n\n\t\tint max = (int) Math.pow(10, 9) * -1;\n\t\tint min = t[0];\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (max < t[i] - min) {\n\t\t\t\tmax = t[i] - min;\n\t\t\t}\n\t\t\tmin = min > t[i] ? t[i] : min;\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] t = new int[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tt[i] = sc.nextInt();\n\t\t}\n\n\t\tint max = (int) Math.pow(10, 9) * -1;\n\t\tint min = t[0];\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (max < t[i] - min) {\n\t\t\t\tmax = t[i] - min;\n\t\t\t}\n\t\t\tmin = min > t[i] ? t[i] : min;\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] t = new int[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tt[i] = sc.nextInt();\n\t\t}\n\n\t\tint max = (int) Math.pow(10, 9) * -1;\n\t\tint min = t[0];\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (max < t[i] - min) {\n\t\t\t\tmax = t[i] - min;\n\t\t\t}\n\t\t\tmin = min > t[i] ? t[i] : min;\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] t = new int[n];",
"t",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n\t\t\tt[i] = sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tt[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tt[i] = sc.nextInt();\n\t\t}",
"t[i] = sc.nextInt()",
"t[i]",
"t",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int max = (int) Math.pow(10, 9) * -1;",
"max",
"(int) Math.pow(10, 9) * -1",
"(int) Math.pow(10, 9)",
"Math.pow",
"Math",
"10",
"9",
"-1",
"1",
"int min = t[0];",
"min",
"t[0]",
"t",
"0",
"for (int i = 1; i < n; i++) {\n\t\t\tif (max < t[i] - min) {\n\t\t\t\tmax = t[i] - min;\n\t\t\t}\n\t\t\tmin = min > t[i] ? t[i] : min;\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif (max < t[i] - min) {\n\t\t\t\tmax = t[i] - min;\n\t\t\t}\n\t\t\tmin = min > t[i] ? t[i] : min;\n\t\t}",
"{\n\t\t\tif (max < t[i] - min) {\n\t\t\t\tmax = t[i] - min;\n\t\t\t}\n\t\t\tmin = min > t[i] ? t[i] : min;\n\t\t}",
"if (max < t[i] - min) {\n\t\t\t\tmax = t[i] - min;\n\t\t\t}",
"max < t[i] - min",
"max",
"t[i] - min",
"t[i]",
"t",
"i",
"min",
"{\n\t\t\t\tmax = t[i] - min;\n\t\t\t}",
"max = t[i] - min",
"max",
"t[i] - min",
"t[i]",
"t",
"i",
"min",
"min = min > t[i] ? t[i] : min",
"min",
"min > t[i] ? t[i] : min",
"min > t[i]",
"min",
"t[i]",
"t",
"i",
"t[i]",
"t",
"i",
"min",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public 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\n\t\tint[] t = new int[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tt[i] = sc.nextInt();\n\t\t}\n\n\t\tint max = (int) Math.pow(10, 9) * -1;\n\t\tint min = t[0];\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (max < t[i] - min) {\n\t\t\t\tmax = t[i] - min;\n\t\t\t}\n\t\t\tmin = min > t[i] ? t[i] : min;\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n\n}",
"public 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\n\t\tint[] t = new int[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tt[i] = sc.nextInt();\n\t\t}\n\n\t\tint max = (int) Math.pow(10, 9) * -1;\n\t\tint min = t[0];\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (max < t[i] - min) {\n\t\t\t\tmax = t[i] - min;\n\t\t\t}\n\t\t\tmin = min > t[i] ? t[i] : min;\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] t = new int[n];
for (int i = 0; i < n; i++) {
t[i] = sc.nextInt();
}
int max = (int) Math.pow(10, 9) * -1;
int min = t[0];
for (int i = 1; i < n; i++) {
if (max < t[i] - min) {
max = t[i] - min;
}
min = min > t[i] ? t[i] : min;
}
System.out.println(max);
}
} |
[
7,
15,
13,
17,
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,
18,
13,
13,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
14,
2,
13,
18,
13,
13,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
99,
8
],
[
99,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
11,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
11,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
11,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
69,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
66,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
81,
83
],
[
78,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
87,
89
],
[
11,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
9,
96
],
[
96,
97
],
[
0,
98
],
[
98,
99
],
[
98,
100
]
] | [
"import java.io.FileNotFoundException;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) throws FileNotFoundException {\n\n\t\tScanner sc = new Scanner(System.in);\n//\t\tScanner sc = new Scanner(new BufferedReader(new FileReader(\"/workspace/AOJ/src/section1/in38.txt\")));\n\n\t\tint n = sc.nextInt();\n\t\tint[] r = new int[n];\n\t\tfor (int t = 0; t < n; t++) {\n\t\t\tr[t] = sc.nextInt();\n\t\t}\n\n\t\tint min = Integer.MAX_VALUE;\n\t\tint ans = Integer.MIN_VALUE;\n\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tans = Math.max(ans, r[i] - min);\n\t\t\tif (min > r[i]) {\n\t\t\t\tmin = r[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}\n",
"import java.io.FileNotFoundException;",
"FileNotFoundException",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) throws FileNotFoundException {\n\n\t\tScanner sc = new Scanner(System.in);\n//\t\tScanner sc = new Scanner(new BufferedReader(new FileReader(\"/workspace/AOJ/src/section1/in38.txt\")));\n\n\t\tint n = sc.nextInt();\n\t\tint[] r = new int[n];\n\t\tfor (int t = 0; t < n; t++) {\n\t\t\tr[t] = sc.nextInt();\n\t\t}\n\n\t\tint min = Integer.MAX_VALUE;\n\t\tint ans = Integer.MIN_VALUE;\n\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tans = Math.max(ans, r[i] - min);\n\t\t\tif (min > r[i]) {\n\t\t\t\tmin = r[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main",
"public static void main(String[] args) throws FileNotFoundException {\n\n\t\tScanner sc = new Scanner(System.in);\n//\t\tScanner sc = new Scanner(new BufferedReader(new FileReader(\"/workspace/AOJ/src/section1/in38.txt\")));\n\n\t\tint n = sc.nextInt();\n\t\tint[] r = new int[n];\n\t\tfor (int t = 0; t < n; t++) {\n\t\t\tr[t] = sc.nextInt();\n\t\t}\n\n\t\tint min = Integer.MAX_VALUE;\n\t\tint ans = Integer.MIN_VALUE;\n\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tans = Math.max(ans, r[i] - min);\n\t\t\tif (min > r[i]) {\n\t\t\t\tmin = r[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n//\t\tScanner sc = new Scanner(new BufferedReader(new FileReader(\"/workspace/AOJ/src/section1/in38.txt\")));\n\n\t\tint n = sc.nextInt();\n\t\tint[] r = new int[n];\n\t\tfor (int t = 0; t < n; t++) {\n\t\t\tr[t] = sc.nextInt();\n\t\t}\n\n\t\tint min = Integer.MAX_VALUE;\n\t\tint ans = Integer.MIN_VALUE;\n\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tans = Math.max(ans, r[i] - min);\n\t\t\tif (min > r[i]) {\n\t\t\t\tmin = r[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] r = new int[n];",
"r",
"new int[n]",
"n",
"for (int t = 0; t < n; t++) {\n\t\t\tr[t] = sc.nextInt();\n\t\t}",
"int t = 0;",
"int t = 0;",
"t",
"0",
"t < n",
"t",
"n",
"t++",
"t++",
"t",
"{\n\t\t\tr[t] = sc.nextInt();\n\t\t}",
"{\n\t\t\tr[t] = sc.nextInt();\n\t\t}",
"r[t] = sc.nextInt()",
"r[t]",
"r",
"t",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int min = Integer.MAX_VALUE;",
"min",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"int ans = Integer.MIN_VALUE;",
"ans",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"for (int i = 0; i < n; i++) {\n\t\t\tans = Math.max(ans, r[i] - min);\n\t\t\tif (min > r[i]) {\n\t\t\t\tmin = r[i];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tans = Math.max(ans, r[i] - min);\n\t\t\tif (min > r[i]) {\n\t\t\t\tmin = r[i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tans = Math.max(ans, r[i] - min);\n\t\t\tif (min > r[i]) {\n\t\t\t\tmin = r[i];\n\t\t\t}\n\t\t}",
"ans = Math.max(ans, r[i] - min)",
"ans",
"Math.max(ans, r[i] - min)",
"Math.max",
"Math",
"ans",
"r[i] - min",
"r[i]",
"r",
"i",
"min",
"if (min > r[i]) {\n\t\t\t\tmin = r[i];\n\t\t\t}",
"min > r[i]",
"min",
"r[i]",
"r",
"i",
"{\n\t\t\t\tmin = r[i];\n\t\t\t}",
"min = r[i]",
"min",
"r[i]",
"r",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws FileNotFoundException {\n\n\t\tScanner sc = new Scanner(System.in);\n//\t\tScanner sc = new Scanner(new BufferedReader(new FileReader(\"/workspace/AOJ/src/section1/in38.txt\")));\n\n\t\tint n = sc.nextInt();\n\t\tint[] r = new int[n];\n\t\tfor (int t = 0; t < n; t++) {\n\t\t\tr[t] = sc.nextInt();\n\t\t}\n\n\t\tint min = Integer.MAX_VALUE;\n\t\tint ans = Integer.MIN_VALUE;\n\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tans = Math.max(ans, r[i] - min);\n\t\t\tif (min > r[i]) {\n\t\t\t\tmin = r[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws FileNotFoundException {\n\n\t\tScanner sc = new Scanner(System.in);\n//\t\tScanner sc = new Scanner(new BufferedReader(new FileReader(\"/workspace/AOJ/src/section1/in38.txt\")));\n\n\t\tint n = sc.nextInt();\n\t\tint[] r = new int[n];\n\t\tfor (int t = 0; t < n; t++) {\n\t\t\tr[t] = sc.nextInt();\n\t\t}\n\n\t\tint min = Integer.MAX_VALUE;\n\t\tint ans = Integer.MIN_VALUE;\n\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tans = Math.max(ans, r[i] - min);\n\t\t\tif (min > r[i]) {\n\t\t\t\tmin = r[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main"
] | import java.io.FileNotFoundException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws FileNotFoundException {
Scanner sc = new Scanner(System.in);
// Scanner sc = new Scanner(new BufferedReader(new FileReader("/workspace/AOJ/src/section1/in38.txt")));
int n = sc.nextInt();
int[] r = new int[n];
for (int t = 0; t < n; t++) {
r[t] = sc.nextInt();
}
int min = Integer.MAX_VALUE;
int ans = Integer.MIN_VALUE;
for (int i = 0; i < n; i++) {
ans = Math.max(ans, r[i] - min);
if (min > r[i]) {
min = r[i];
}
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
17,
41,
13,
40,
18,
13,
13,
41,
13,
17,
42,
2,
13,
4,
18,
13,
30,
0,
13,
4,
18,
13,
13,
2,
4,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
4,
18,
13,
13,
40,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
0,
13,
4,
18,
13,
41,
13,
20,
41,
13,
17,
42,
2,
13,
17,
30,
0,
13,
4,
18,
13,
4,
18,
13,
13,
40,
13,
4,
18,
18,
13,
13,
4,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
111,
8
],
[
111,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
11,
24
],
[
24,
25
],
[
24,
26
],
[
11,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
27,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
36,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
40,
45
],
[
33,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
48,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
33,
56
],
[
56,
57
],
[
11,
58
],
[
58,
59
],
[
9,
60
],
[
60,
61
],
[
111,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
64,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
75,
76
],
[
75,
77
],
[
64,
78
],
[
78,
79
],
[
78,
80
],
[
64,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
85,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
85,
95
],
[
95,
96
],
[
64,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
102
],
[
102,
103
],
[
102,
104
],
[
64,
105
],
[
105,
106
],
[
106,
107
],
[
62,
108
],
[
108,
109
],
[
0,
110
],
[
110,
111
],
[
110,
112
]
] | [
"import java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static int max_profit(ArrayList<Integer> arr) {\n\t\tint min_val = arr.get(0);\n\t\tint max_val = -Integer.MIN_VALUE;\n\t\t\n\t\tint i = 1;\n\t\twhile(i < arr.size()) {\n\t\t\tmax_val = Math.max(max_val, arr.get(i) - min_val);\n\t\t\tmin_val = Math.min(min_val, arr.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t\n\t\treturn max_val;\n\t}\n\tpublic static void main(String [] args) {\n\t\tScanner br = new Scanner(System.in);\n\t\tint len;\n\t\t\n\t\tlen = br.nextInt();\n\t\tArrayList<Integer> arr= new ArrayList<Integer>();\n\t\tint val = 0;\n\t\twhile(len > 0) {\n\t\t\tval = br.nextInt();\n\t\t\tarr.add(val);\n\t\t\tlen --;\n\t\t}\n\t\t\n\t\t\n\t\t//invoke the computation part\n\t\tSystem.out.println(max_profit(arr));\n\t\tbr.close();\n\t\t\n\t}\n\t\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static int max_profit(ArrayList<Integer> arr) {\n\t\tint min_val = arr.get(0);\n\t\tint max_val = -Integer.MIN_VALUE;\n\t\t\n\t\tint i = 1;\n\t\twhile(i < arr.size()) {\n\t\t\tmax_val = Math.max(max_val, arr.get(i) - min_val);\n\t\t\tmin_val = Math.min(min_val, arr.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t\n\t\treturn max_val;\n\t}\n\tpublic static void main(String [] args) {\n\t\tScanner br = new Scanner(System.in);\n\t\tint len;\n\t\t\n\t\tlen = br.nextInt();\n\t\tArrayList<Integer> arr= new ArrayList<Integer>();\n\t\tint val = 0;\n\t\twhile(len > 0) {\n\t\t\tval = br.nextInt();\n\t\t\tarr.add(val);\n\t\t\tlen --;\n\t\t}\n\t\t\n\t\t\n\t\t//invoke the computation part\n\t\tSystem.out.println(max_profit(arr));\n\t\tbr.close();\n\t\t\n\t}\n\t\n}",
"Main",
"public static int max_profit(ArrayList<Integer> arr) {\n\t\tint min_val = arr.get(0);\n\t\tint max_val = -Integer.MIN_VALUE;\n\t\t\n\t\tint i = 1;\n\t\twhile(i < arr.size()) {\n\t\t\tmax_val = Math.max(max_val, arr.get(i) - min_val);\n\t\t\tmin_val = Math.min(min_val, arr.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t\n\t\treturn max_val;\n\t}",
"max_profit",
"{\n\t\tint min_val = arr.get(0);\n\t\tint max_val = -Integer.MIN_VALUE;\n\t\t\n\t\tint i = 1;\n\t\twhile(i < arr.size()) {\n\t\t\tmax_val = Math.max(max_val, arr.get(i) - min_val);\n\t\t\tmin_val = Math.min(min_val, arr.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t\n\t\treturn max_val;\n\t}",
"int min_val = arr.get(0);",
"min_val",
"arr.get(0)",
"arr.get",
"arr",
"0",
"int max_val = -Integer.MIN_VALUE;",
"max_val",
"-Integer.MIN_VALUE",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int i = 1;",
"i",
"1",
"while(i < arr.size()) {\n\t\t\tmax_val = Math.max(max_val, arr.get(i) - min_val);\n\t\t\tmin_val = Math.min(min_val, arr.get(i));\n\t\t\ti++;\n\t\t}",
"i < arr.size()",
"i",
"arr.size()",
"arr.size",
"arr",
"{\n\t\t\tmax_val = Math.max(max_val, arr.get(i) - min_val);\n\t\t\tmin_val = Math.min(min_val, arr.get(i));\n\t\t\ti++;\n\t\t}",
"max_val = Math.max(max_val, arr.get(i) - min_val)",
"max_val",
"Math.max(max_val, arr.get(i) - min_val)",
"Math.max",
"Math",
"max_val",
"arr.get(i) - min_val",
"arr.get(i)",
"arr.get",
"arr",
"i",
"min_val",
"min_val = Math.min(min_val, arr.get(i))",
"min_val",
"Math.min(min_val, arr.get(i))",
"Math.min",
"Math",
"min_val",
"arr.get(i)",
"arr.get",
"arr",
"i",
"i++",
"i",
"return max_val;",
"max_val",
"ArrayList<Integer> arr",
"arr",
"public static void main(String [] args) {\n\t\tScanner br = new Scanner(System.in);\n\t\tint len;\n\t\t\n\t\tlen = br.nextInt();\n\t\tArrayList<Integer> arr= new ArrayList<Integer>();\n\t\tint val = 0;\n\t\twhile(len > 0) {\n\t\t\tval = br.nextInt();\n\t\t\tarr.add(val);\n\t\t\tlen --;\n\t\t}\n\t\t\n\t\t\n\t\t//invoke the computation part\n\t\tSystem.out.println(max_profit(arr));\n\t\tbr.close();\n\t\t\n\t}",
"main",
"{\n\t\tScanner br = new Scanner(System.in);\n\t\tint len;\n\t\t\n\t\tlen = br.nextInt();\n\t\tArrayList<Integer> arr= new ArrayList<Integer>();\n\t\tint val = 0;\n\t\twhile(len > 0) {\n\t\t\tval = br.nextInt();\n\t\t\tarr.add(val);\n\t\t\tlen --;\n\t\t}\n\t\t\n\t\t\n\t\t//invoke the computation part\n\t\tSystem.out.println(max_profit(arr));\n\t\tbr.close();\n\t\t\n\t}",
"Scanner br = new Scanner(System.in);",
"br",
"new Scanner(System.in)",
"int len;",
"len",
"len = br.nextInt()",
"len",
"br.nextInt()",
"br.nextInt",
"br",
"ArrayList<Integer> arr= new ArrayList<Integer>();",
"arr",
"new ArrayList<Integer>()",
"int val = 0;",
"val",
"0",
"while(len > 0) {\n\t\t\tval = br.nextInt();\n\t\t\tarr.add(val);\n\t\t\tlen --;\n\t\t}",
"len > 0",
"len",
"0",
"{\n\t\t\tval = br.nextInt();\n\t\t\tarr.add(val);\n\t\t\tlen --;\n\t\t}",
"val = br.nextInt()",
"val",
"br.nextInt()",
"br.nextInt",
"br",
"arr.add(val)",
"arr.add",
"arr",
"val",
"len --",
"len",
"System.out.println(max_profit(arr))",
"System.out.println",
"System.out",
"System",
"System.out",
"max_profit(arr)",
"max_profit",
"arr",
"br.close()",
"br.close",
"br",
"String [] args",
"args",
"public class Main {\n\tpublic static int max_profit(ArrayList<Integer> arr) {\n\t\tint min_val = arr.get(0);\n\t\tint max_val = -Integer.MIN_VALUE;\n\t\t\n\t\tint i = 1;\n\t\twhile(i < arr.size()) {\n\t\t\tmax_val = Math.max(max_val, arr.get(i) - min_val);\n\t\t\tmin_val = Math.min(min_val, arr.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t\n\t\treturn max_val;\n\t}\n\tpublic static void main(String [] args) {\n\t\tScanner br = new Scanner(System.in);\n\t\tint len;\n\t\t\n\t\tlen = br.nextInt();\n\t\tArrayList<Integer> arr= new ArrayList<Integer>();\n\t\tint val = 0;\n\t\twhile(len > 0) {\n\t\t\tval = br.nextInt();\n\t\t\tarr.add(val);\n\t\t\tlen --;\n\t\t}\n\t\t\n\t\t\n\t\t//invoke the computation part\n\t\tSystem.out.println(max_profit(arr));\n\t\tbr.close();\n\t\t\n\t}\n\t\n}",
"public class Main {\n\tpublic static int max_profit(ArrayList<Integer> arr) {\n\t\tint min_val = arr.get(0);\n\t\tint max_val = -Integer.MIN_VALUE;\n\t\t\n\t\tint i = 1;\n\t\twhile(i < arr.size()) {\n\t\t\tmax_val = Math.max(max_val, arr.get(i) - min_val);\n\t\t\tmin_val = Math.min(min_val, arr.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t\n\t\treturn max_val;\n\t}\n\tpublic static void main(String [] args) {\n\t\tScanner br = new Scanner(System.in);\n\t\tint len;\n\t\t\n\t\tlen = br.nextInt();\n\t\tArrayList<Integer> arr= new ArrayList<Integer>();\n\t\tint val = 0;\n\t\twhile(len > 0) {\n\t\t\tval = br.nextInt();\n\t\t\tarr.add(val);\n\t\t\tlen --;\n\t\t}\n\t\t\n\t\t\n\t\t//invoke the computation part\n\t\tSystem.out.println(max_profit(arr));\n\t\tbr.close();\n\t\t\n\t}\n\t\n}",
"Main"
] | import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static int max_profit(ArrayList<Integer> arr) {
int min_val = arr.get(0);
int max_val = -Integer.MIN_VALUE;
int i = 1;
while(i < arr.size()) {
max_val = Math.max(max_val, arr.get(i) - min_val);
min_val = Math.min(min_val, arr.get(i));
i++;
}
return max_val;
}
public static void main(String [] args) {
Scanner br = new Scanner(System.in);
int len;
len = br.nextInt();
ArrayList<Integer> arr= new ArrayList<Integer>();
int val = 0;
while(len > 0) {
val = br.nextInt();
arr.add(val);
len --;
}
//invoke the computation part
System.out.println(max_profit(arr));
br.close();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
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,
4,
18,
13,
41,
13,
17,
41,
13,
40,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
18,
13,
13,
13,
0,
13,
2,
18,
13,
13,
13,
14,
2,
13,
18,
13,
13,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
12,
13,
30,
41,
13,
20,
4,
18,
13,
23,
13
] | [
[
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
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
20,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
11,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
11,
50
],
[
50,
51
],
[
50,
52
],
[
11,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
11,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
11,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
67,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
62,
73
],
[
74,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
75,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
74,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
90,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
11,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
7,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
114,
115
],
[
107,
116
],
[
116,
117
]
] | [
"import java.io.*;\nimport java.util.*;\n\nclass Main{\n void run() throws IOException{\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n int num = Integer.parseInt(in.readLine());\n int[] menber = new int[num];\n for(int i = 0;i < num;i++){\n menber[i] = Integer.parseInt(in.readLine());\n }\n int count = 0;\n int ans = -2000000000;\n int minv = menber[0];\n for(int i = 1;i < num;i++){\n if(ans <= menber[i] - minv)\n ans = menber[i] - minv;\n if(minv >= menber[i])\n minv = menber[i];\n }\n System.out.println(ans);\n }\n public static void main(String[] args) throws IOException{\n Main ma = new Main();\n ma.run();\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"class Main{\n void run() throws IOException{\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n int num = Integer.parseInt(in.readLine());\n int[] menber = new int[num];\n for(int i = 0;i < num;i++){\n menber[i] = Integer.parseInt(in.readLine());\n }\n int count = 0;\n int ans = -2000000000;\n int minv = menber[0];\n for(int i = 1;i < num;i++){\n if(ans <= menber[i] - minv)\n ans = menber[i] - minv;\n if(minv >= menber[i])\n minv = menber[i];\n }\n System.out.println(ans);\n }\n public static void main(String[] args) throws IOException{\n Main ma = new Main();\n ma.run();\n }\n}",
"Main",
"void run() throws IOException{\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n int num = Integer.parseInt(in.readLine());\n int[] menber = new int[num];\n for(int i = 0;i < num;i++){\n menber[i] = Integer.parseInt(in.readLine());\n }\n int count = 0;\n int ans = -2000000000;\n int minv = menber[0];\n for(int i = 1;i < num;i++){\n if(ans <= menber[i] - minv)\n ans = menber[i] - minv;\n if(minv >= menber[i])\n minv = menber[i];\n }\n System.out.println(ans);\n }",
"run",
"{\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n int num = Integer.parseInt(in.readLine());\n int[] menber = new int[num];\n for(int i = 0;i < num;i++){\n menber[i] = Integer.parseInt(in.readLine());\n }\n int count = 0;\n int ans = -2000000000;\n int minv = menber[0];\n for(int i = 1;i < num;i++){\n if(ans <= menber[i] - minv)\n ans = menber[i] - minv;\n if(minv >= menber[i])\n minv = menber[i];\n }\n System.out.println(ans);\n }",
"BufferedReader in = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"int num = Integer.parseInt(in.readLine());",
"num",
"Integer.parseInt(in.readLine())",
"Integer.parseInt",
"Integer",
"in.readLine()",
"in.readLine",
"in",
"int[] menber = new int[num];",
"menber",
"new int[num]",
"num",
"for(int i = 0;i < num;i++){\n menber[i] = Integer.parseInt(in.readLine());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < num",
"i",
"num",
"i++",
"i++",
"i",
"{\n menber[i] = Integer.parseInt(in.readLine());\n }",
"{\n menber[i] = Integer.parseInt(in.readLine());\n }",
"menber[i] = Integer.parseInt(in.readLine())",
"menber[i]",
"menber",
"i",
"Integer.parseInt(in.readLine())",
"Integer.parseInt",
"Integer",
"in.readLine()",
"in.readLine",
"in",
"int count = 0;",
"count",
"0",
"int ans = -2000000000;",
"ans",
"-2000000000",
"2000000000",
"int minv = menber[0];",
"minv",
"menber[0]",
"menber",
"0",
"for(int i = 1;i < num;i++){\n if(ans <= menber[i] - minv)\n ans = menber[i] - minv;\n if(minv >= menber[i])\n minv = menber[i];\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < num",
"i",
"num",
"i++",
"i++",
"i",
"{\n if(ans <= menber[i] - minv)\n ans = menber[i] - minv;\n if(minv >= menber[i])\n minv = menber[i];\n }",
"{\n if(ans <= menber[i] - minv)\n ans = menber[i] - minv;\n if(minv >= menber[i])\n minv = menber[i];\n }",
"if(ans <= menber[i] - minv)\n ans = menber[i] - minv;",
"ans <= menber[i] - minv",
"ans",
"menber[i] - minv",
"menber[i]",
"menber",
"i",
"minv",
"ans = menber[i] - minv",
"ans",
"menber[i] - minv",
"menber[i]",
"menber",
"i",
"minv",
"if(minv >= menber[i])\n minv = menber[i];",
"minv >= menber[i]",
"minv",
"menber[i]",
"menber",
"i",
"minv = menber[i]",
"minv",
"menber[i]",
"menber",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"public static void main(String[] args) throws IOException{\n Main ma = new Main();\n ma.run();\n }",
"main",
"{\n Main ma = new Main();\n ma.run();\n }",
"Main ma = new Main();",
"ma",
"new Main()",
"ma.run()",
"ma.run",
"ma",
"String[] args",
"args"
] | import java.io.*;
import java.util.*;
class Main{
void run() throws IOException{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int num = Integer.parseInt(in.readLine());
int[] menber = new int[num];
for(int i = 0;i < num;i++){
menber[i] = Integer.parseInt(in.readLine());
}
int count = 0;
int ans = -2000000000;
int minv = menber[0];
for(int i = 1;i < num;i++){
if(ans <= menber[i] - minv)
ans = menber[i] - minv;
if(minv >= menber[i])
minv = menber[i];
}
System.out.println(ans);
}
public static void main(String[] args) throws IOException{
Main ma = new Main();
ma.run();
}
} |
[
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,
20,
13,
41,
13,
40,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
18,
13,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
12,
13,
30,
14,
2,
13,
13,
30,
29,
17,
30,
0,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
29,
17,
29,
17,
12,
13,
30,
14,
4,
13,
29,
18,
13,
40,
13,
29,
40,
17,
12,
13,
30,
29,
2,
2,
17,
13,
2,
13,
17,
23,
13,
12,
13,
30,
42,
2,
4,
13,
40,
4,
13,
18,
13,
13,
40,
13,
29,
4,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
20,
41,
13,
4,
13,
42,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
14,
2,
2,
13,
17,
2,
17,
13,
30,
37,
20,
42,
17,
30,
14,
2,
2,
17,
13,
2,
13,
17,
30,
0,
13,
17,
0,
13,
2,
13,
17,
14,
2,
2,
13,
40,
17,
40,
4,
13,
13,
30,
29,
8,
13,
40,
13,
13,
30,
37,
20,
0,
13,
4,
13,
12,
13,
30,
41,
13,
4,
13,
14,
2,
2,
13,
18,
13,
13,
2,
13,
18,
13,
13,
37,
20,
29,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
348,
11
],
[
348,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
14,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
14,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
14,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
14,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
71,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
68,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
82,
86
],
[
86,
87
],
[
86,
88
],
[
14,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
12,
95
],
[
95,
96
],
[
348,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
97,
104
],
[
104,
105
],
[
104,
106
],
[
97,
108
],
[
108,
109
],
[
108,
110
],
[
97,
111
],
[
111,
112
],
[
111,
113
],
[
97,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
121,
122
],
[
122,
123
],
[
117,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
128,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
139,
140
],
[
138,
141
],
[
124,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
146,
147
],
[
147,
148
],
[
116,
149
],
[
149,
150
],
[
97,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
154,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
154,
162
],
[
162,
163
],
[
163,
164
],
[
97,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
170,
172
],
[
169,
173
],
[
173,
174
],
[
173,
175
],
[
165,
176
],
[
176,
177
],
[
97,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
182,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
188,
190
],
[
181,
191
],
[
191,
192
],
[
180,
193
],
[
193,
194
],
[
194,
195
],
[
97,
196
],
[
196,
197
],
[
196,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
199,
203
],
[
203,
204
],
[
198,
205
],
[
205,
206
],
[
205,
207
],
[
198,
208
],
[
208,
209
],
[
208,
210
],
[
210,
211
],
[
198,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
212,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
217,
220
],
[
216,
221
],
[
221,
222
],
[
221,
223
],
[
223,
224
],
[
198,
225
],
[
225,
226
],
[
226,
227
],
[
227,
228
],
[
97,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
234,
235
],
[
232,
236
],
[
236,
237
],
[
231,
238
],
[
238,
239
],
[
238,
240
],
[
231,
241
],
[
241,
242
],
[
241,
243
],
[
231,
244
],
[
244,
245
],
[
244,
246
],
[
246,
247
],
[
231,
248
],
[
248,
249
],
[
249,
250
],
[
249,
251
],
[
248,
252
],
[
252,
253
],
[
253,
254
],
[
253,
255
],
[
252,
256
],
[
256,
257
],
[
256,
258
],
[
258,
259
],
[
231,
260
],
[
260,
261
],
[
261,
262
],
[
262,
263
],
[
262,
264
],
[
261,
265
],
[
265,
266
],
[
265,
267
],
[
260,
268
],
[
268,
269
],
[
269,
270
],
[
231,
271
],
[
271,
272
],
[
271,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
276,
277
],
[
276,
278
],
[
275,
279
],
[
279,
280
],
[
279,
281
],
[
274,
282
],
[
282,
283
],
[
283,
284
],
[
283,
285
],
[
282,
286
],
[
286,
287
],
[
286,
288
],
[
288,
289
],
[
288,
290
],
[
274,
291
],
[
291,
292
],
[
292,
293
],
[
293,
294
],
[
293,
295
],
[
295,
296
],
[
292,
297
],
[
297,
298
],
[
298,
299
],
[
298,
300
],
[
291,
301
],
[
301,
302
],
[
302,
303
],
[
303,
304
],
[
303,
305
],
[
305,
306
],
[
303,
307
],
[
291,
308
],
[
308,
309
],
[
309,
310
],
[
273,
311
],
[
311,
312
],
[
311,
313
],
[
313,
314
],
[
97,
315
],
[
315,
316
],
[
315,
317
],
[
317,
318
],
[
318,
319
],
[
318,
320
],
[
320,
321
],
[
317,
322
],
[
322,
323
],
[
323,
324
],
[
324,
325
],
[
324,
326
],
[
326,
327
],
[
326,
328
],
[
323,
329
],
[
329,
330
],
[
329,
331
],
[
331,
332
],
[
331,
333
],
[
322,
334
],
[
334,
335
],
[
317,
336
],
[
336,
337
],
[
97,
338
],
[
338,
339
],
[
338,
340
],
[
340,
341
],
[
341,
342
],
[
342,
343
],
[
343,
344
],
[
342,
345
],
[
345,
346
],
[
0,
347
],
[
347,
348
],
[
347,
349
]
] | [
"import java.io.IOException;\nimport java.io.InputStream;\nimport java.util.*;\n\npublic class Main {\n public static void main(String[] args){\n FastScanner sc = new FastScanner();\n int n = sc.nextInt();\n int[] rates = new int[n];\n long maxv = -2000000000;\n for(int i=0; i<n; i++){\n rates[i] = sc.nextInt();\n }\n /**\n * この場合,O(n^2)で n=200000 20^10 > 10^8 \n * for(int j=1; j<n; j++){\n * for(int i=0; i<j; i++){\n * maxv = Math.max(rates[j] - rates[i], maxv);\n * }\n * }\n */\n \n // minvを保持することで O(n)\n long minv = rates[0];\n for(int j=1; j<n; j++){\n maxv = Math.max(maxv, rates[j] - minv);\n minv = Math.min(minv, rates[j]);\n }\n\n\n System.out.println(maxv);\n\n }\n\n static class FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }\n private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}\n private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}\n public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}\n public String next() {\n if (!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n public long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n public int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }\n public double nextDouble() { return Double.parseDouble(next());}\n }\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args){\n FastScanner sc = new FastScanner();\n int n = sc.nextInt();\n int[] rates = new int[n];\n long maxv = -2000000000;\n for(int i=0; i<n; i++){\n rates[i] = sc.nextInt();\n }\n /**\n * この場合,O(n^2)で n=200000 20^10 > 10^8 \n * for(int j=1; j<n; j++){\n * for(int i=0; i<j; i++){\n * maxv = Math.max(rates[j] - rates[i], maxv);\n * }\n * }\n */\n \n // minvを保持することで O(n)\n long minv = rates[0];\n for(int j=1; j<n; j++){\n maxv = Math.max(maxv, rates[j] - minv);\n minv = Math.min(minv, rates[j]);\n }\n\n\n System.out.println(maxv);\n\n }\n\n static class FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }\n private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}\n private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}\n public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}\n public String next() {\n if (!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n public long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n public int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }\n public double nextDouble() { return Double.parseDouble(next());}\n }\n}",
"Main",
"public static void main(String[] args){\n FastScanner sc = new FastScanner();\n int n = sc.nextInt();\n int[] rates = new int[n];\n long maxv = -2000000000;\n for(int i=0; i<n; i++){\n rates[i] = sc.nextInt();\n }\n /**\n * この場合,O(n^2)で n=200000 20^10 > 10^8 \n * for(int j=1; j<n; j++){\n * for(int i=0; i<j; i++){\n * maxv = Math.max(rates[j] - rates[i], maxv);\n * }\n * }\n */\n \n // minvを保持することで O(n)\n long minv = rates[0];\n for(int j=1; j<n; j++){\n maxv = Math.max(maxv, rates[j] - minv);\n minv = Math.min(minv, rates[j]);\n }\n\n\n System.out.println(maxv);\n\n }",
"main",
"{\n FastScanner sc = new FastScanner();\n int n = sc.nextInt();\n int[] rates = new int[n];\n long maxv = -2000000000;\n for(int i=0; i<n; i++){\n rates[i] = sc.nextInt();\n }\n /**\n * この場合,O(n^2)で n=200000 20^10 > 10^8 \n * for(int j=1; j<n; j++){\n * for(int i=0; i<j; i++){\n * maxv = Math.max(rates[j] - rates[i], maxv);\n * }\n * }\n */\n \n // minvを保持することで O(n)\n long minv = rates[0];\n for(int j=1; j<n; j++){\n maxv = Math.max(maxv, rates[j] - minv);\n minv = Math.min(minv, rates[j]);\n }\n\n\n System.out.println(maxv);\n\n }",
"FastScanner sc = new FastScanner();",
"sc",
"new FastScanner()",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] rates = new int[n];",
"rates",
"new int[n]",
"n",
"long maxv = -2000000000;",
"maxv",
"-2000000000",
"2000000000",
"for(int i=0; i<n; i++){\n rates[i] = sc.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n rates[i] = sc.nextInt();\n }",
"{\n rates[i] = sc.nextInt();\n }",
"rates[i] = sc.nextInt()",
"rates[i]",
"rates",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long minv = rates[0];",
"minv",
"rates[0]",
"rates",
"0",
"for(int j=1; j<n; j++){\n maxv = Math.max(maxv, rates[j] - minv);\n minv = Math.min(minv, rates[j]);\n }",
"int j=1;",
"int j=1;",
"j",
"1",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"{\n maxv = Math.max(maxv, rates[j] - minv);\n minv = Math.min(minv, rates[j]);\n }",
"{\n maxv = Math.max(maxv, rates[j] - minv);\n minv = Math.min(minv, rates[j]);\n }",
"maxv = Math.max(maxv, rates[j] - minv)",
"maxv",
"Math.max(maxv, rates[j] - minv)",
"Math.max",
"Math",
"maxv",
"rates[j] - minv",
"rates[j]",
"rates",
"j",
"minv",
"minv = Math.min(minv, rates[j])",
"minv",
"Math.min(minv, rates[j])",
"Math.min",
"Math",
"minv",
"rates[j]",
"rates",
"j",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String[] args",
"args",
"static class FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }\n private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}\n private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}\n public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}\n public String next() {\n if (!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n public long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n public int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }\n public double nextDouble() { return Double.parseDouble(next());}\n }",
"FastScanner",
"private final InputStream in = System.in;",
"in",
"System.in",
"System",
"System.in",
"private final byte[] buffer = new byte[1024];",
"buffer",
"new byte[1024]",
"1024",
"private int ptr = 0;",
"ptr",
"0",
"private int buflen = 0;",
"buflen",
"0",
"private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }",
"hasNextByte",
"{\n if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }",
"if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }",
"ptr < buflen",
"ptr",
"buflen",
"{\n return true;\n }",
"return true;",
"true",
"{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }",
"ptr = 0",
"ptr",
"0",
"try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n buflen = in.read(buffer);\n }",
"buflen = in.read(buffer)",
"buflen",
"in.read(buffer)",
"in.read",
"in",
"buffer",
"if (buflen <= 0) {\n return false;\n }",
"buflen <= 0",
"buflen",
"0",
"{\n return false;\n }",
"return false;",
"false",
"return true;",
"true",
"private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}",
"readByte",
"{ if (hasNextByte()) return buffer[ptr++]; else return -1;}",
"if (hasNextByte()) return buffer[ptr++]; else return -1;",
"hasNextByte()",
"hasNextByte",
"return buffer[ptr++];",
"buffer[ptr++]",
"buffer",
"ptr++",
"ptr",
"return -1;",
"-1",
"1",
"private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}",
"isPrintableChar",
"{ return 33 <= c && c <= 126;}",
"return 33 <= c && c <= 126;",
"33 <= c && c <= 126",
"33 <= c",
"33",
"c",
"c <= 126",
"c",
"126",
"int c",
"c",
"public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}",
"hasNext",
"{ while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}",
"while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;",
"hasNextByte() && !isPrintableChar(buffer[ptr])",
"hasNextByte()",
"hasNextByte",
"!isPrintableChar(buffer[ptr])",
"isPrintableChar(buffer[ptr])",
"isPrintableChar",
"buffer[ptr]",
"buffer",
"ptr",
"ptr++",
"ptr",
"return hasNextByte();",
"hasNextByte()",
"hasNextByte",
"public String next() {\n if (!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }",
"next",
"{\n if (!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }",
"if (!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }",
"isPrintableChar(b)",
"isPrintableChar",
"b",
"{\n sb.appendCodePoint(b);\n b = readByte();\n }",
"sb.appendCodePoint(b)",
"sb.appendCodePoint",
"sb",
"b",
"b = readByte()",
"b",
"readByte()",
"readByte",
"return sb.toString();",
"sb.toString()",
"sb.toString",
"sb",
"public long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }",
"nextLong",
"{\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }",
"if (!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"long n = 0;",
"n",
"0",
"boolean minus = false;",
"minus",
"false",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"if (b == '-') {\n minus = true;\n b = readByte();\n }",
"b == '-'",
"b",
"'-'",
"{\n minus = true;\n b = readByte();\n }",
"minus = true",
"minus",
"true",
"b = readByte()",
"b",
"readByte()",
"readByte",
"if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }",
"b < '0' || '9' < b",
"b < '0'",
"b",
"'0'",
"'9' < b",
"'9'",
"b",
"{\n throw new NumberFormatException();\n }",
"throw new NumberFormatException();",
"new NumberFormatException()",
"while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }",
"true",
"{\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }",
"if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }",
"'0' <= b && b <= '9'",
"'0' <= b",
"'0'",
"b",
"b <= '9'",
"b",
"'9'",
"{\n n *= 10;\n n += b - '0';\n }",
"n *= 10",
"n",
"10",
"n += b - '0'",
"n",
"b - '0'",
"b",
"'0'",
"if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }",
"b == -1 || !isPrintableChar(b)",
"b == -1",
"b",
"-1",
"1",
"!isPrintableChar(b)",
"isPrintableChar(b)",
"isPrintableChar",
"b",
"{\n return minus ? -n : n;\n }",
"return minus ? -n : n;",
"minus ? -n : n",
"minus",
"-n",
"n",
"n",
"{\n throw new NumberFormatException();\n }",
"throw new NumberFormatException();",
"new NumberFormatException()",
"b = readByte()",
"b",
"readByte()",
"readByte",
"public int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }",
"nextInt",
"{\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }",
"long nl = nextLong();",
"nl",
"nextLong()",
"nextLong",
"if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();",
"nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE",
"nl < Integer.MIN_VALUE",
"nl",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"nl > Integer.MAX_VALUE",
"nl",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"throw new NumberFormatException();",
"new NumberFormatException()",
"return (int) nl;",
"(int) nl",
"public double nextDouble() { return Double.parseDouble(next());}",
"nextDouble",
"{ return Double.parseDouble(next());}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public class Main {\n public static void main(String[] args){\n FastScanner sc = new FastScanner();\n int n = sc.nextInt();\n int[] rates = new int[n];\n long maxv = -2000000000;\n for(int i=0; i<n; i++){\n rates[i] = sc.nextInt();\n }\n /**\n * この場合,O(n^2)で n=200000 20^10 > 10^8 \n * for(int j=1; j<n; j++){\n * for(int i=0; i<j; i++){\n * maxv = Math.max(rates[j] - rates[i], maxv);\n * }\n * }\n */\n \n // minvを保持することで O(n)\n long minv = rates[0];\n for(int j=1; j<n; j++){\n maxv = Math.max(maxv, rates[j] - minv);\n minv = Math.min(minv, rates[j]);\n }\n\n\n System.out.println(maxv);\n\n }\n\n static class FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }\n private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}\n private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}\n public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}\n public String next() {\n if (!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n public long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n public int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }\n public double nextDouble() { return Double.parseDouble(next());}\n }\n}",
"public class Main {\n public static void main(String[] args){\n FastScanner sc = new FastScanner();\n int n = sc.nextInt();\n int[] rates = new int[n];\n long maxv = -2000000000;\n for(int i=0; i<n; i++){\n rates[i] = sc.nextInt();\n }\n /**\n * この場合,O(n^2)で n=200000 20^10 > 10^8 \n * for(int j=1; j<n; j++){\n * for(int i=0; i<j; i++){\n * maxv = Math.max(rates[j] - rates[i], maxv);\n * }\n * }\n */\n \n // minvを保持することで O(n)\n long minv = rates[0];\n for(int j=1; j<n; j++){\n maxv = Math.max(maxv, rates[j] - minv);\n minv = Math.min(minv, rates[j]);\n }\n\n\n System.out.println(maxv);\n\n }\n\n static class FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n }else{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }\n private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}\n private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}\n public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}\n public String next() {\n if (!hasNext()) throw new NoSuchElementException();\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while(isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n public long nextLong() {\n if (!hasNext()) throw new NoSuchElementException();\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while(true){\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n }else if(b == -1 || !isPrintableChar(b)){\n return minus ? -n : n;\n }else{\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n public int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n return (int) nl;\n }\n public double nextDouble() { return Double.parseDouble(next());}\n }\n}",
"Main"
] | import java.io.IOException;
import java.io.InputStream;
import java.util.*;
public class Main {
public static void main(String[] args){
FastScanner sc = new FastScanner();
int n = sc.nextInt();
int[] rates = new int[n];
long maxv = -2000000000;
for(int i=0; i<n; i++){
rates[i] = sc.nextInt();
}
/**
* この場合,O(n^2)で n=200000 20^10 > 10^8
* for(int j=1; j<n; j++){
* for(int i=0; i<j; i++){
* maxv = Math.max(rates[j] - rates[i], maxv);
* }
* }
*/
// minvを保持することで O(n)
long minv = rates[0];
for(int j=1; j<n; j++){
maxv = Math.max(maxv, rates[j] - minv);
minv = Math.min(minv, rates[j]);
}
System.out.println(maxv);
}
static class FastScanner {
private final InputStream in = System.in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
private boolean hasNextByte() {
if (ptr < buflen) {
return true;
}else{
ptr = 0;
try {
buflen = in.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
if (buflen <= 0) {
return false;
}
}
return true;
}
private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
public String next() {
if (!hasNext()) throw new NoSuchElementException();
StringBuilder sb = new StringBuilder();
int b = readByte();
while(isPrintableChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public long nextLong() {
if (!hasNext()) throw new NoSuchElementException();
long n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
if (b < '0' || '9' < b) {
throw new NumberFormatException();
}
while(true){
if ('0' <= b && b <= '9') {
n *= 10;
n += b - '0';
}else if(b == -1 || !isPrintableChar(b)){
return minus ? -n : n;
}else{
throw new NumberFormatException();
}
b = readByte();
}
}
public int nextInt() {
long nl = nextLong();
if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
return (int) nl;
}
public double nextDouble() { return Double.parseDouble(next());}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
41,
13,
4,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
82,
5
],
[
82,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
34,
38
],
[
8,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
51,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
59,
63
],
[
63,
64
],
[
63,
65
],
[
51,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
68,
72
],
[
8,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
6,
79
],
[
79,
80
],
[
0,
81
],
[
81,
82
],
[
81,
83
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int r0 = sc.nextInt();\n int r = sc.nextInt();\n int max = r - r0;\n int min = Math.min(r, r0);\n for(int i = 2; i < n; i++) {\n r = sc.nextInt();\n max = Math.max(max, r - min);\n min = Math.min(min, r);\n }\n System.out.println(max);\n }\n}\n",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int r0 = sc.nextInt();\n int r = sc.nextInt();\n int max = r - r0;\n int min = Math.min(r, r0);\n for(int i = 2; i < n; i++) {\n r = sc.nextInt();\n max = Math.max(max, r - min);\n min = Math.min(min, r);\n }\n System.out.println(max);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int r0 = sc.nextInt();\n int r = sc.nextInt();\n int max = r - r0;\n int min = Math.min(r, r0);\n for(int i = 2; i < n; i++) {\n r = sc.nextInt();\n max = Math.max(max, r - min);\n min = Math.min(min, r);\n }\n System.out.println(max);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int r0 = sc.nextInt();\n int r = sc.nextInt();\n int max = r - r0;\n int min = Math.min(r, r0);\n for(int i = 2; i < n; i++) {\n r = sc.nextInt();\n max = Math.max(max, r - min);\n min = Math.min(min, r);\n }\n System.out.println(max);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int r0 = sc.nextInt();",
"r0",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int max = r - r0;",
"max",
"r - r0",
"r",
"r0",
"int min = Math.min(r, r0);",
"min",
"Math.min(r, r0)",
"Math.min",
"Math",
"r",
"r0",
"for(int i = 2; i < n; i++) {\n r = sc.nextInt();\n max = Math.max(max, r - min);\n min = Math.min(min, r);\n }",
"int i = 2;",
"int i = 2;",
"i",
"2",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n r = sc.nextInt();\n max = Math.max(max, r - min);\n min = Math.min(min, r);\n }",
"{\n r = sc.nextInt();\n max = Math.max(max, r - min);\n min = Math.min(min, r);\n }",
"r = sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"max = Math.max(max, r - min)",
"max",
"Math.max(max, r - min)",
"Math.max",
"Math",
"max",
"r - min",
"r",
"min",
"min = Math.min(min, r)",
"min",
"Math.min(min, r)",
"Math.min",
"Math",
"min",
"r",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int r0 = sc.nextInt();\n int r = sc.nextInt();\n int max = r - r0;\n int min = Math.min(r, r0);\n for(int i = 2; i < n; i++) {\n r = sc.nextInt();\n max = Math.max(max, r - min);\n min = Math.min(min, r);\n }\n System.out.println(max);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int r0 = sc.nextInt();\n int r = sc.nextInt();\n int max = r - r0;\n int min = Math.min(r, r0);\n for(int i = 2; i < n; i++) {\n r = sc.nextInt();\n max = Math.max(max, r - min);\n min = Math.min(min, r);\n }\n System.out.println(max);\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int r0 = sc.nextInt();
int r = sc.nextInt();
int max = r - r0;
int min = Math.min(r, r0);
for(int i = 2; i < n; i++) {
r = sc.nextInt();
max = Math.max(max, r - min);
min = Math.min(min, r);
}
System.out.println(max);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
41,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
18,
13,
13,
9,
0,
13,
18,
13,
13,
11,
1,
0,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
18,
13,
13,
18,
13,
13,
0,
13,
2,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
8,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
32,
34
],
[
8,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
35,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
53,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
55,
65
],
[
65,
66
],
[
66,
67
],
[
55,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
70,
76
],
[
69,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
69,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
82,
89
],
[
89,
90
],
[
89,
91
],
[
82,
92
],
[
92,
93
],
[
93,
94
],
[
82,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
104,
106
],
[
97,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
113,
115
],
[
8,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
6,
122
],
[
122,
123
]
] | [
"import java.util.Scanner;\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 R[] = new int[N];\n\t\tint i, j;\n\t\tint min=Integer.MAX_VALUE;\n\t\tint max=Integer.MIN_VALUE;\n\t\tfor(i=0; i<N; i++){\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n\t\tfor(i=0; i<N-1; i++){\n\t\t\tif(min<=R[i]) continue;\n\t\t\tmin=R[i];\n\t\t\tfor(j=i+1; j<N; j++){\n\t\t\t\tif(max<R[j]-R[i]) max=R[j]-R[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"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 R[] = new int[N];\n\t\tint i, j;\n\t\tint min=Integer.MAX_VALUE;\n\t\tint max=Integer.MIN_VALUE;\n\t\tfor(i=0; i<N; i++){\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n\t\tfor(i=0; i<N-1; i++){\n\t\t\tif(min<=R[i]) continue;\n\t\t\tmin=R[i];\n\t\t\tfor(j=i+1; j<N; j++){\n\t\t\t\tif(max<R[j]-R[i]) max=R[j]-R[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint R[] = new int[N];\n\t\tint i, j;\n\t\tint min=Integer.MAX_VALUE;\n\t\tint max=Integer.MIN_VALUE;\n\t\tfor(i=0; i<N; i++){\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n\t\tfor(i=0; i<N-1; i++){\n\t\t\tif(min<=R[i]) continue;\n\t\t\tmin=R[i];\n\t\t\tfor(j=i+1; j<N; j++){\n\t\t\t\tif(max<R[j]-R[i]) max=R[j]-R[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint R[] = new int[N];\n\t\tint i, j;\n\t\tint min=Integer.MAX_VALUE;\n\t\tint max=Integer.MIN_VALUE;\n\t\tfor(i=0; i<N; i++){\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n\t\tfor(i=0; i<N-1; i++){\n\t\t\tif(min<=R[i]) continue;\n\t\t\tmin=R[i];\n\t\t\tfor(j=i+1; j<N; j++){\n\t\t\t\tif(max<R[j]-R[i]) max=R[j]-R[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int R[] = new int[N];",
"R",
"new int[N]",
"N",
"int i",
"i",
"j;",
"j",
"int min=Integer.MAX_VALUE;",
"min",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"int max=Integer.MIN_VALUE;",
"max",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"for(i=0; i<N; i++){\n\t\t\tR[i] = sc.nextInt();\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tR[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tR[i] = sc.nextInt();\n\t\t}",
"R[i] = sc.nextInt()",
"R[i]",
"R",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(i=0; i<N-1; i++){\n\t\t\tif(min<=R[i]) continue;\n\t\t\tmin=R[i];\n\t\t\tfor(j=i+1; j<N; j++){\n\t\t\t\tif(max<R[j]-R[i]) max=R[j]-R[i];\n\t\t\t}\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<N-1",
"i",
"N-1",
"N",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tif(min<=R[i]) continue;\n\t\t\tmin=R[i];\n\t\t\tfor(j=i+1; j<N; j++){\n\t\t\t\tif(max<R[j]-R[i]) max=R[j]-R[i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(min<=R[i]) continue;\n\t\t\tmin=R[i];\n\t\t\tfor(j=i+1; j<N; j++){\n\t\t\t\tif(max<R[j]-R[i]) max=R[j]-R[i];\n\t\t\t}\n\t\t}",
"if(min<=R[i]) continue;",
"min<=R[i]",
"min",
"R[i]",
"R",
"i",
"continue;",
"min=R[i]",
"min",
"R[i]",
"R",
"i",
"for(j=i+1; j<N; j++){\n\t\t\t\tif(max<R[j]-R[i]) max=R[j]-R[i];\n\t\t\t}",
"j=i+1;",
"j=i+1",
"j",
"i+1",
"i",
"1",
"j<N",
"j",
"N",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(max<R[j]-R[i]) max=R[j]-R[i];\n\t\t\t}",
"{\n\t\t\t\tif(max<R[j]-R[i]) max=R[j]-R[i];\n\t\t\t}",
"if(max<R[j]-R[i]) max=R[j]-R[i];",
"max<R[j]-R[i]",
"max",
"R[j]-R[i]",
"R[j]",
"R",
"j",
"R[i]",
"R",
"i",
"max=R[j]-R[i]",
"max",
"R[j]-R[i]",
"R[j]",
"R",
"j",
"R[i]",
"R",
"i",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int R[] = new int[N];
int i, j;
int min=Integer.MAX_VALUE;
int max=Integer.MIN_VALUE;
for(i=0; i<N; i++){
R[i] = sc.nextInt();
}
for(i=0; i<N-1; i++){
if(min<=R[i]) continue;
min=R[i];
for(j=i+1; j<N; j++){
if(max<R[j]-R[i]) max=R[j]-R[i];
}
}
System.out.println(max);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
4,
13,
23,
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,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
101,
5
],
[
101,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
6,
11
],
[
11,
12
],
[
101,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
15,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
15,
24
],
[
24,
25
],
[
24,
26
],
[
15,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
28,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
15,
48
],
[
48,
49
],
[
49,
50
],
[
15,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
15,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
58,
60
],
[
15,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
76,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
73,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
87,
91
],
[
91,
92
],
[
91,
93
],
[
15,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
0,
100
],
[
100,
101
],
[
100,
102
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tsolve();\n\t}\n\n\tprivate static void solve() {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint[] nums = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tnums[i] = sc.nextInt();\n\t\t}\n\t\tsc.close();\n\t\tint tmpMax = Integer.MIN_VALUE;\n\t\tint tmpMin = nums[0];\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ttmpMax = Math.max(tmpMax, nums[i] - tmpMin);\n\t\t\ttmpMin = Math.min(tmpMin, nums[i]);\n\t\t}\n\n\t\tSystem.out.println(tmpMax);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tsolve();\n\t}\n\n\tprivate static void solve() {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint[] nums = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tnums[i] = sc.nextInt();\n\t\t}\n\t\tsc.close();\n\t\tint tmpMax = Integer.MIN_VALUE;\n\t\tint tmpMin = nums[0];\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ttmpMax = Math.max(tmpMax, nums[i] - tmpMin);\n\t\t\ttmpMin = Math.min(tmpMin, nums[i]);\n\t\t}\n\n\t\tSystem.out.println(tmpMax);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tsolve();\n\t}",
"main",
"{\n\t\tsolve();\n\t}",
"solve()",
"solve",
"String[] args",
"args",
"private static void solve() {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint[] nums = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tnums[i] = sc.nextInt();\n\t\t}\n\t\tsc.close();\n\t\tint tmpMax = Integer.MIN_VALUE;\n\t\tint tmpMin = nums[0];\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ttmpMax = Math.max(tmpMax, nums[i] - tmpMin);\n\t\t\ttmpMin = Math.min(tmpMin, nums[i]);\n\t\t}\n\n\t\tSystem.out.println(tmpMax);\n\t}",
"solve",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint[] nums = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tnums[i] = sc.nextInt();\n\t\t}\n\t\tsc.close();\n\t\tint tmpMax = Integer.MIN_VALUE;\n\t\tint tmpMin = nums[0];\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ttmpMax = Math.max(tmpMax, nums[i] - tmpMin);\n\t\t\ttmpMin = Math.min(tmpMin, nums[i]);\n\t\t}\n\n\t\tSystem.out.println(tmpMax);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] nums = new int[n];",
"nums",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n\t\t\tnums[i] = sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tnums[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tnums[i] = sc.nextInt();\n\t\t}",
"nums[i] = sc.nextInt()",
"nums[i]",
"nums",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.close()",
"sc.close",
"sc",
"int tmpMax = Integer.MIN_VALUE;",
"tmpMax",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int tmpMin = nums[0];",
"tmpMin",
"nums[0]",
"nums",
"0",
"for (int i = 1; i < n; i++) {\n\t\t\ttmpMax = Math.max(tmpMax, nums[i] - tmpMin);\n\t\t\ttmpMin = Math.min(tmpMin, nums[i]);\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ttmpMax = Math.max(tmpMax, nums[i] - tmpMin);\n\t\t\ttmpMin = Math.min(tmpMin, nums[i]);\n\t\t}",
"{\n\t\t\ttmpMax = Math.max(tmpMax, nums[i] - tmpMin);\n\t\t\ttmpMin = Math.min(tmpMin, nums[i]);\n\t\t}",
"tmpMax = Math.max(tmpMax, nums[i] - tmpMin)",
"tmpMax",
"Math.max(tmpMax, nums[i] - tmpMin)",
"Math.max",
"Math",
"tmpMax",
"nums[i] - tmpMin",
"nums[i]",
"nums",
"i",
"tmpMin",
"tmpMin = Math.min(tmpMin, nums[i])",
"tmpMin",
"Math.min(tmpMin, nums[i])",
"Math.min",
"Math",
"tmpMin",
"nums[i]",
"nums",
"i",
"System.out.println(tmpMax)",
"System.out.println",
"System.out",
"System",
"System.out",
"tmpMax",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tsolve();\n\t}\n\n\tprivate static void solve() {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint[] nums = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tnums[i] = sc.nextInt();\n\t\t}\n\t\tsc.close();\n\t\tint tmpMax = Integer.MIN_VALUE;\n\t\tint tmpMin = nums[0];\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ttmpMax = Math.max(tmpMax, nums[i] - tmpMin);\n\t\t\ttmpMin = Math.min(tmpMin, nums[i]);\n\t\t}\n\n\t\tSystem.out.println(tmpMax);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tsolve();\n\t}\n\n\tprivate static void solve() {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\t\tint[] nums = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tnums[i] = sc.nextInt();\n\t\t}\n\t\tsc.close();\n\t\tint tmpMax = Integer.MIN_VALUE;\n\t\tint tmpMin = nums[0];\n\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ttmpMax = Math.max(tmpMax, nums[i] - tmpMin);\n\t\t\ttmpMin = Math.min(tmpMin, nums[i]);\n\t\t}\n\n\t\tSystem.out.println(tmpMax);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
solve();
}
private static void solve() {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] nums = new int[n];
for (int i = 0; i < n; i++) {
nums[i] = sc.nextInt();
}
sc.close();
int tmpMax = Integer.MIN_VALUE;
int tmpMin = nums[0];
for (int i = 1; i < n; i++) {
tmpMax = Math.max(tmpMax, nums[i] - tmpMin);
tmpMin = Math.min(tmpMin, nums[i]);
}
System.out.println(tmpMax);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
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,
4,
18,
13,
41,
13,
18,
13,
17,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
29,
13,
30,
29,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
29,
13,
30,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
137,
11
],
[
137,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
14,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
30,
38
],
[
38,
39
],
[
39,
40
],
[
30,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
14,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
14,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
14,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
63,
71
],
[
71,
72
],
[
72,
73
],
[
63,
74
],
[
75,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
78,
80
],
[
78,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
75,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
88,
91
],
[
91,
92
],
[
91,
93
],
[
14,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
12,
100
],
[
100,
101
],
[
137,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
109,
110
],
[
110,
111
],
[
105,
112
],
[
112,
113
],
[
113,
114
],
[
102,
115
],
[
115,
116
],
[
102,
117
],
[
117,
118
],
[
137,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
126,
127
],
[
127,
128
],
[
122,
129
],
[
129,
130
],
[
130,
131
],
[
119,
132
],
[
132,
133
],
[
119,
134
],
[
134,
135
],
[
0,
136
],
[
136,
137
],
[
136,
138
]
] | [
"import java.io.IOException;\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int[] array= new int[n];\n for (int i = 0; i < n; i++){\n array[i] = Integer.parseInt(br.readLine());\n }\n int minv = array[0];\n int maxv = Integer.MIN_VALUE;\n for (int j = 1; j < n; j++){\n maxv = max(maxv, array[j] - minv);\n minv = min(minv, array[j]);\n }\n System.out.println(maxv);\n }\n static int max(int a, int b){\n if (a > b){\n return a;\n }else{\n return b;\n }\n }\n static int min(int a, int b){\n if (a > b){\n return b;\n }else{\n return a;\n }\n }\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int[] array= new int[n];\n for (int i = 0; i < n; i++){\n array[i] = Integer.parseInt(br.readLine());\n }\n int minv = array[0];\n int maxv = Integer.MIN_VALUE;\n for (int j = 1; j < n; j++){\n maxv = max(maxv, array[j] - minv);\n minv = min(minv, array[j]);\n }\n System.out.println(maxv);\n }\n static int max(int a, int b){\n if (a > b){\n return a;\n }else{\n return b;\n }\n }\n static int min(int a, int b){\n if (a > b){\n return b;\n }else{\n return a;\n }\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int[] array= new int[n];\n for (int i = 0; i < n; i++){\n array[i] = Integer.parseInt(br.readLine());\n }\n int minv = array[0];\n int maxv = Integer.MIN_VALUE;\n for (int j = 1; j < n; j++){\n maxv = max(maxv, array[j] - minv);\n minv = min(minv, array[j]);\n }\n System.out.println(maxv);\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int[] array= new int[n];\n for (int i = 0; i < n; i++){\n array[i] = Integer.parseInt(br.readLine());\n }\n int minv = array[0];\n int maxv = Integer.MIN_VALUE;\n for (int j = 1; j < n; j++){\n maxv = max(maxv, array[j] - minv);\n minv = min(minv, array[j]);\n }\n System.out.println(maxv);\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int n = Integer.parseInt(br.readLine());",
"n",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int[] array= new int[n];",
"array",
"new int[n]",
"n",
"for (int i = 0; i < n; i++){\n array[i] = Integer.parseInt(br.readLine());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n array[i] = Integer.parseInt(br.readLine());\n }",
"{\n array[i] = Integer.parseInt(br.readLine());\n }",
"array[i] = Integer.parseInt(br.readLine())",
"array[i]",
"array",
"i",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int minv = array[0];",
"minv",
"array[0]",
"array",
"0",
"int maxv = Integer.MIN_VALUE;",
"maxv",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"for (int j = 1; j < n; j++){\n maxv = max(maxv, array[j] - minv);\n minv = min(minv, array[j]);\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j < n",
"j",
"n",
"j++",
"j++",
"j",
"{\n maxv = max(maxv, array[j] - minv);\n minv = min(minv, array[j]);\n }",
"{\n maxv = max(maxv, array[j] - minv);\n minv = min(minv, array[j]);\n }",
"maxv = max(maxv, array[j] - minv)",
"maxv",
"max(maxv, array[j] - minv)",
"max",
"maxv",
"array[j] - minv",
"array[j]",
"array",
"j",
"minv",
"minv = min(minv, array[j])",
"minv",
"min(minv, array[j])",
"min",
"minv",
"array[j]",
"array",
"j",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String[] args",
"args",
"static int max(int a, int b){\n if (a > b){\n return a;\n }else{\n return b;\n }\n }",
"max",
"{\n if (a > b){\n return a;\n }else{\n return b;\n }\n }",
"if (a > b){\n return a;\n }else{\n return b;\n }",
"a > b",
"a",
"b",
"{\n return a;\n }",
"return a;",
"a",
"{\n return b;\n }",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"static int min(int a, int b){\n if (a > b){\n return b;\n }else{\n return a;\n }\n }",
"min",
"{\n if (a > b){\n return b;\n }else{\n return a;\n }\n }",
"if (a > b){\n return b;\n }else{\n return a;\n }",
"a > b",
"a",
"b",
"{\n return b;\n }",
"return b;",
"b",
"{\n return a;\n }",
"return a;",
"a",
"int a",
"a",
"int b",
"b",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int[] array= new int[n];\n for (int i = 0; i < n; i++){\n array[i] = Integer.parseInt(br.readLine());\n }\n int minv = array[0];\n int maxv = Integer.MIN_VALUE;\n for (int j = 1; j < n; j++){\n maxv = max(maxv, array[j] - minv);\n minv = min(minv, array[j]);\n }\n System.out.println(maxv);\n }\n static int max(int a, int b){\n if (a > b){\n return a;\n }else{\n return b;\n }\n }\n static int min(int a, int b){\n if (a > b){\n return b;\n }else{\n return a;\n }\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int[] array= new int[n];\n for (int i = 0; i < n; i++){\n array[i] = Integer.parseInt(br.readLine());\n }\n int minv = array[0];\n int maxv = Integer.MIN_VALUE;\n for (int j = 1; j < n; j++){\n maxv = max(maxv, array[j] - minv);\n minv = min(minv, array[j]);\n }\n System.out.println(maxv);\n }\n static int max(int a, int b){\n if (a > b){\n return a;\n }else{\n return b;\n }\n }\n static int min(int a, int b){\n if (a > b){\n return b;\n }else{\n return a;\n }\n }\n}",
"Main"
] | import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int[] array= new int[n];
for (int i = 0; i < n; i++){
array[i] = Integer.parseInt(br.readLine());
}
int minv = array[0];
int maxv = Integer.MIN_VALUE;
for (int j = 1; j < n; j++){
maxv = max(maxv, array[j] - minv);
minv = min(minv, array[j]);
}
System.out.println(maxv);
}
static int max(int a, int b){
if (a > b){
return a;
}else{
return b;
}
}
static int min(int a, int b){
if (a > b){
return b;
}else{
return a;
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
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,
4,
18,
13,
41,
13,
18,
13,
17,
41,
13,
2,
18,
13,
17,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
2,
13,
17,
30,
0,
13,
4,
13,
13,
18,
13,
2,
13,
17,
0,
13,
4,
13,
13,
2,
18,
13,
13,
13,
30,
0,
13,
4,
13,
13,
18,
13,
13,
0,
13,
4,
13,
13,
2,
18,
13,
2,
13,
17,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
29,
13,
30,
29,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
13,
29,
13,
23,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
14,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
30,
38
],
[
38,
39
],
[
39,
40
],
[
30,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
14,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
14,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
64,
66
],
[
14,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
67,
77
],
[
77,
78
],
[
78,
79
],
[
67,
80
],
[
81,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
82,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
91,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
88,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
101,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
82,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
112,
114
],
[
112,
115
],
[
115,
116
],
[
115,
117
],
[
109,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
120,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
128
],
[
123,
129
],
[
14,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
12,
136
],
[
136,
137
],
[
10,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
145,
146
],
[
146,
147
],
[
141,
148
],
[
148,
149
],
[
149,
150
],
[
138,
151
],
[
151,
152
],
[
138,
153
],
[
153,
154
],
[
10,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
162,
163
],
[
158,
164
],
[
164,
165
],
[
155,
166
],
[
166,
167
],
[
155,
168
],
[
168,
169
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\n\nclass Main{\n\n public static void main(String[] args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int N = Integer.parseInt(br.readLine());\n int[] a = new int[N];\n\n for(int i = 0; i < N; i++){\n a[i] = Integer.parseInt(br.readLine());\n }\n\n int min = a[0];\n int max = a[1]-a[0];\n\n for(int i = 0; i < N-1; i++){\n if(i == N - 1){\n min = minv(min, a[i-1]);\n max = maxv(max, a[i] - min);\n }else{\n min = minv(min, a[i]);\n max = maxv(max, a[i+1] - min);\n }\n }\n\n\n System.out.println(max);\n }\n\n public static int minv(int min, int a){\n if(min >= a){\n return a;\n }else{\n return min;\n }\n }\n\n public static int maxv(int max, int a){\n if(max <= a)return a;\n else return max;\n }\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"class Main{\n\n public static void main(String[] args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int N = Integer.parseInt(br.readLine());\n int[] a = new int[N];\n\n for(int i = 0; i < N; i++){\n a[i] = Integer.parseInt(br.readLine());\n }\n\n int min = a[0];\n int max = a[1]-a[0];\n\n for(int i = 0; i < N-1; i++){\n if(i == N - 1){\n min = minv(min, a[i-1]);\n max = maxv(max, a[i] - min);\n }else{\n min = minv(min, a[i]);\n max = maxv(max, a[i+1] - min);\n }\n }\n\n\n System.out.println(max);\n }\n\n public static int minv(int min, int a){\n if(min >= a){\n return a;\n }else{\n return min;\n }\n }\n\n public static int maxv(int max, int a){\n if(max <= a)return a;\n else return max;\n }\n\n}",
"Main",
"public static void main(String[] args)throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int N = Integer.parseInt(br.readLine());\n int[] a = new int[N];\n\n for(int i = 0; i < N; i++){\n a[i] = Integer.parseInt(br.readLine());\n }\n\n int min = a[0];\n int max = a[1]-a[0];\n\n for(int i = 0; i < N-1; i++){\n if(i == N - 1){\n min = minv(min, a[i-1]);\n max = maxv(max, a[i] - min);\n }else{\n min = minv(min, a[i]);\n max = maxv(max, a[i+1] - min);\n }\n }\n\n\n System.out.println(max);\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int N = Integer.parseInt(br.readLine());\n int[] a = new int[N];\n\n for(int i = 0; i < N; i++){\n a[i] = Integer.parseInt(br.readLine());\n }\n\n int min = a[0];\n int max = a[1]-a[0];\n\n for(int i = 0; i < N-1; i++){\n if(i == N - 1){\n min = minv(min, a[i-1]);\n max = maxv(max, a[i] - min);\n }else{\n min = minv(min, a[i]);\n max = maxv(max, a[i+1] - min);\n }\n }\n\n\n System.out.println(max);\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int N = Integer.parseInt(br.readLine());",
"N",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int[] a = new int[N];",
"a",
"new int[N]",
"N",
"for(int i = 0; i < N; i++){\n a[i] = Integer.parseInt(br.readLine());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n a[i] = Integer.parseInt(br.readLine());\n }",
"{\n a[i] = Integer.parseInt(br.readLine());\n }",
"a[i] = Integer.parseInt(br.readLine())",
"a[i]",
"a",
"i",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int min = a[0];",
"min",
"a[0]",
"a",
"0",
"int max = a[1]-a[0];",
"max",
"a[1]-a[0]",
"a[1]",
"a",
"1",
"a[0]",
"a",
"0",
"for(int i = 0; i < N-1; i++){\n if(i == N - 1){\n min = minv(min, a[i-1]);\n max = maxv(max, a[i] - min);\n }else{\n min = minv(min, a[i]);\n max = maxv(max, a[i+1] - min);\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N-1",
"i",
"N-1",
"N",
"1",
"i++",
"i++",
"i",
"{\n if(i == N - 1){\n min = minv(min, a[i-1]);\n max = maxv(max, a[i] - min);\n }else{\n min = minv(min, a[i]);\n max = maxv(max, a[i+1] - min);\n }\n }",
"{\n if(i == N - 1){\n min = minv(min, a[i-1]);\n max = maxv(max, a[i] - min);\n }else{\n min = minv(min, a[i]);\n max = maxv(max, a[i+1] - min);\n }\n }",
"if(i == N - 1){\n min = minv(min, a[i-1]);\n max = maxv(max, a[i] - min);\n }else{\n min = minv(min, a[i]);\n max = maxv(max, a[i+1] - min);\n }",
"i == N - 1",
"i",
"N - 1",
"N",
"1",
"{\n min = minv(min, a[i-1]);\n max = maxv(max, a[i] - min);\n }",
"min = minv(min, a[i-1])",
"min",
"minv(min, a[i-1])",
"minv",
"min",
"a[i-1]",
"a",
"i-1",
"i",
"1",
"max = maxv(max, a[i] - min)",
"max",
"maxv(max, a[i] - min)",
"maxv",
"max",
"a[i] - min",
"a[i]",
"a",
"i",
"min",
"{\n min = minv(min, a[i]);\n max = maxv(max, a[i+1] - min);\n }",
"min = minv(min, a[i])",
"min",
"minv(min, a[i])",
"minv",
"min",
"a[i]",
"a",
"i",
"max = maxv(max, a[i+1] - min)",
"max",
"maxv(max, a[i+1] - min)",
"maxv",
"max",
"a[i+1] - min",
"a[i+1]",
"a",
"i+1",
"i",
"1",
"min",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public static int minv(int min, int a){\n if(min >= a){\n return a;\n }else{\n return min;\n }\n }",
"minv",
"{\n if(min >= a){\n return a;\n }else{\n return min;\n }\n }",
"if(min >= a){\n return a;\n }else{\n return min;\n }",
"min >= a",
"min",
"a",
"{\n return a;\n }",
"return a;",
"a",
"{\n return min;\n }",
"return min;",
"min",
"int min",
"min",
"int a",
"a",
"public static int maxv(int max, int a){\n if(max <= a)return a;\n else return max;\n }",
"maxv",
"{\n if(max <= a)return a;\n else return max;\n }",
"if(max <= a)return a;\n else return max;",
"max <= a",
"max",
"a",
"return a;",
"a",
"return max;",
"max",
"int max",
"max",
"int a",
"a"
] | 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));
int N = Integer.parseInt(br.readLine());
int[] a = new int[N];
for(int i = 0; i < N; i++){
a[i] = Integer.parseInt(br.readLine());
}
int min = a[0];
int max = a[1]-a[0];
for(int i = 0; i < N-1; i++){
if(i == N - 1){
min = minv(min, a[i-1]);
max = maxv(max, a[i] - min);
}else{
min = minv(min, a[i]);
max = maxv(max, a[i+1] - min);
}
}
System.out.println(max);
}
public static int minv(int min, int a){
if(min >= a){
return a;
}else{
return min;
}
}
public static int maxv(int max, int a){
if(max <= a)return a;
else return max;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
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,
4,
18,
13,
41,
13,
40,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
8,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
8,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
8,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
71,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
68,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
82,
85
],
[
82,
86
],
[
86,
87
],
[
86,
88
],
[
8,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
6,
95
],
[
95,
96
]
] | [
"import java.util.*;\n\nclass Main{\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.nextLine());\n int[] r = new int[n];\n for(int x=0; x < n; x++){\n r[x] = Integer.parseInt(sc.nextLine());\n }\n int maxv = -2000000000;\n int minv = r[0];\n\n for(int i = 1; i < n; i++){\n maxv = Math.max(maxv, r[i] - minv);\n minv = Math.min(minv, r[i]);\n }\n System.out.println(maxv);\n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.nextLine());\n int[] r = new int[n];\n for(int x=0; x < n; x++){\n r[x] = Integer.parseInt(sc.nextLine());\n }\n int maxv = -2000000000;\n int minv = r[0];\n\n for(int i = 1; i < n; i++){\n maxv = Math.max(maxv, r[i] - minv);\n minv = Math.min(minv, r[i]);\n }\n System.out.println(maxv);\n\n }\n}",
"Main",
"public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.nextLine());\n int[] r = new int[n];\n for(int x=0; x < n; x++){\n r[x] = Integer.parseInt(sc.nextLine());\n }\n int maxv = -2000000000;\n int minv = r[0];\n\n for(int i = 1; i < n; i++){\n maxv = Math.max(maxv, r[i] - minv);\n minv = Math.min(minv, r[i]);\n }\n System.out.println(maxv);\n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.nextLine());\n int[] r = new int[n];\n for(int x=0; x < n; x++){\n r[x] = Integer.parseInt(sc.nextLine());\n }\n int maxv = -2000000000;\n int minv = r[0];\n\n for(int i = 1; i < n; i++){\n maxv = Math.max(maxv, r[i] - minv);\n minv = Math.min(minv, r[i]);\n }\n System.out.println(maxv);\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = Integer.parseInt(sc.nextLine());",
"n",
"Integer.parseInt(sc.nextLine())",
"Integer.parseInt",
"Integer",
"sc.nextLine()",
"sc.nextLine",
"sc",
"int[] r = new int[n];",
"r",
"new int[n]",
"n",
"for(int x=0; x < n; x++){\n r[x] = Integer.parseInt(sc.nextLine());\n }",
"int x=0;",
"int x=0;",
"x",
"0",
"x < n",
"x",
"n",
"x++",
"x++",
"x",
"{\n r[x] = Integer.parseInt(sc.nextLine());\n }",
"{\n r[x] = Integer.parseInt(sc.nextLine());\n }",
"r[x] = Integer.parseInt(sc.nextLine())",
"r[x]",
"r",
"x",
"Integer.parseInt(sc.nextLine())",
"Integer.parseInt",
"Integer",
"sc.nextLine()",
"sc.nextLine",
"sc",
"int maxv = -2000000000;",
"maxv",
"-2000000000",
"2000000000",
"int minv = r[0];",
"minv",
"r[0]",
"r",
"0",
"for(int i = 1; i < n; i++){\n maxv = Math.max(maxv, r[i] - minv);\n minv = Math.min(minv, r[i]);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n maxv = Math.max(maxv, r[i] - minv);\n minv = Math.min(minv, r[i]);\n }",
"{\n maxv = Math.max(maxv, r[i] - minv);\n minv = Math.min(minv, r[i]);\n }",
"maxv = Math.max(maxv, r[i] - minv)",
"maxv",
"Math.max(maxv, r[i] - minv)",
"Math.max",
"Math",
"maxv",
"r[i] - minv",
"r[i]",
"r",
"i",
"minv",
"minv = Math.min(minv, r[i])",
"minv",
"Math.min(minv, r[i])",
"Math.min",
"Math",
"minv",
"r[i]",
"r",
"i",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String args[]",
"args"
] | import java.util.*;
class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.nextLine());
int[] r = new int[n];
for(int x=0; x < n; x++){
r[x] = Integer.parseInt(sc.nextLine());
}
int maxv = -2000000000;
int minv = r[0];
for(int i = 1; i < n; i++){
maxv = Math.max(maxv, r[i] - minv);
minv = Math.min(minv, r[i]);
}
System.out.println(maxv);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
72,
5
],
[
72,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
19,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
27,
37
],
[
37,
38
],
[
38,
39
],
[
27,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
41,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
49,
53
],
[
53,
54
],
[
53,
55
],
[
41,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
58,
62
],
[
8,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
6,
69
],
[
69,
70
],
[
0,
71
],
[
71,
72
],
[
71,
73
]
] | [
"import java.util.*;\npublic class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int answer = Integer.MIN_VALUE;\n int min = scan.nextInt();\n for(int x = 0; x < n - 1; x++){\n int r = scan.nextInt();\n answer = Math.max(answer, r - min);\n min = Math.min(min, r);\n }\n System.out.println(answer);\n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int answer = Integer.MIN_VALUE;\n int min = scan.nextInt();\n for(int x = 0; x < n - 1; x++){\n int r = scan.nextInt();\n answer = Math.max(answer, r - min);\n min = Math.min(min, r);\n }\n System.out.println(answer);\n\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int answer = Integer.MIN_VALUE;\n int min = scan.nextInt();\n for(int x = 0; x < n - 1; x++){\n int r = scan.nextInt();\n answer = Math.max(answer, r - min);\n min = Math.min(min, r);\n }\n System.out.println(answer);\n\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int answer = Integer.MIN_VALUE;\n int min = scan.nextInt();\n for(int x = 0; x < n - 1; x++){\n int r = scan.nextInt();\n answer = Math.max(answer, r - min);\n min = Math.min(min, r);\n }\n System.out.println(answer);\n\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int answer = Integer.MIN_VALUE;",
"answer",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int min = scan.nextInt();",
"min",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int x = 0; x < n - 1; x++){\n int r = scan.nextInt();\n answer = Math.max(answer, r - min);\n min = Math.min(min, r);\n }",
"int x = 0;",
"int x = 0;",
"x",
"0",
"x < n - 1",
"x",
"n - 1",
"n",
"1",
"x++",
"x++",
"x",
"{\n int r = scan.nextInt();\n answer = Math.max(answer, r - min);\n min = Math.min(min, r);\n }",
"{\n int r = scan.nextInt();\n answer = Math.max(answer, r - min);\n min = Math.min(min, r);\n }",
"int r = scan.nextInt();",
"r",
"scan.nextInt()",
"scan.nextInt",
"scan",
"answer = Math.max(answer, r - min)",
"answer",
"Math.max(answer, r - min)",
"Math.max",
"Math",
"answer",
"r - min",
"r",
"min",
"min = Math.min(min, r)",
"min",
"Math.min(min, r)",
"Math.min",
"Math",
"min",
"r",
"System.out.println(answer)",
"System.out.println",
"System.out",
"System",
"System.out",
"answer",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int answer = Integer.MIN_VALUE;\n int min = scan.nextInt();\n for(int x = 0; x < n - 1; x++){\n int r = scan.nextInt();\n answer = Math.max(answer, r - min);\n min = Math.min(min, r);\n }\n System.out.println(answer);\n\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int answer = Integer.MIN_VALUE;\n int min = scan.nextInt();\n for(int x = 0; x < n - 1; x++){\n int r = scan.nextInt();\n answer = Math.max(answer, r - min);\n min = Math.min(min, r);\n }\n System.out.println(answer);\n\n }\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int answer = Integer.MIN_VALUE;
int min = scan.nextInt();
for(int x = 0; x < n - 1; x++){
int r = scan.nextInt();
answer = Math.max(answer, r - min);
min = Math.min(min, r);
}
System.out.println(answer);
}
}
|
[
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,
4,
18,
13,
4,
18,
13,
41,
13,
2,
13,
13,
41,
13,
4,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
34,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
43,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
66,
67
],
[
67,
68
],
[
60,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
71,
75
],
[
75,
76
],
[
75,
77
],
[
60,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
80,
84
],
[
8,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
6,
91
],
[
91,
92
]
] | [
"import java.util.Scanner;\n\nclass Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = Integer.parseInt(sc.next());\n\n int r0 = Integer.parseInt(sc.next());\n int r1 = Integer.parseInt(sc.next());\n\n int max = r1-r0;\n int min = Math.min(r0,r1);\n\n for(int i = 2; i < n; i++){\n int r = Integer.parseInt(sc.next());\n max = Math.max(max, r - min);\n min = Math.min(min,r);\n }\n \n System.out.println(max);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = Integer.parseInt(sc.next());\n\n int r0 = Integer.parseInt(sc.next());\n int r1 = Integer.parseInt(sc.next());\n\n int max = r1-r0;\n int min = Math.min(r0,r1);\n\n for(int i = 2; i < n; i++){\n int r = Integer.parseInt(sc.next());\n max = Math.max(max, r - min);\n min = Math.min(min,r);\n }\n \n System.out.println(max);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = Integer.parseInt(sc.next());\n\n int r0 = Integer.parseInt(sc.next());\n int r1 = Integer.parseInt(sc.next());\n\n int max = r1-r0;\n int min = Math.min(r0,r1);\n\n for(int i = 2; i < n; i++){\n int r = Integer.parseInt(sc.next());\n max = Math.max(max, r - min);\n min = Math.min(min,r);\n }\n \n System.out.println(max);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int n = Integer.parseInt(sc.next());\n\n int r0 = Integer.parseInt(sc.next());\n int r1 = Integer.parseInt(sc.next());\n\n int max = r1-r0;\n int min = Math.min(r0,r1);\n\n for(int i = 2; i < n; i++){\n int r = Integer.parseInt(sc.next());\n max = Math.max(max, r - min);\n min = Math.min(min,r);\n }\n \n System.out.println(max);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = Integer.parseInt(sc.next());",
"n",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int r0 = Integer.parseInt(sc.next());",
"r0",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int r1 = Integer.parseInt(sc.next());",
"r1",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int max = r1-r0;",
"max",
"r1-r0",
"r1",
"r0",
"int min = Math.min(r0,r1);",
"min",
"Math.min(r0,r1)",
"Math.min",
"Math",
"r0",
"r1",
"for(int i = 2; i < n; i++){\n int r = Integer.parseInt(sc.next());\n max = Math.max(max, r - min);\n min = Math.min(min,r);\n }",
"int i = 2;",
"int i = 2;",
"i",
"2",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n int r = Integer.parseInt(sc.next());\n max = Math.max(max, r - min);\n min = Math.min(min,r);\n }",
"{\n int r = Integer.parseInt(sc.next());\n max = Math.max(max, r - min);\n min = Math.min(min,r);\n }",
"int r = Integer.parseInt(sc.next());",
"r",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"max = Math.max(max, r - min)",
"max",
"Math.max(max, r - min)",
"Math.max",
"Math",
"max",
"r - min",
"r",
"min",
"min = Math.min(min,r)",
"min",
"Math.min(min,r)",
"Math.min",
"Math",
"min",
"r",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int r0 = Integer.parseInt(sc.next());
int r1 = Integer.parseInt(sc.next());
int max = r1-r0;
int min = Math.min(r0,r1);
for(int i = 2; i < n; i++){
int r = Integer.parseInt(sc.next());
max = Math.max(max, r - min);
min = Math.min(min,r);
}
System.out.println(max);
}
}
|
[
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,
2,
18,
13,
17,
18,
13,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
18,
13,
13,
13,
30,
0,
13,
2,
18,
13,
13,
13,
14,
2,
13,
18,
13,
13,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
105,
5
],
[
105,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
67,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
87,
89
],
[
84,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
8,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
6,
102
],
[
102,
103
],
[
0,
104
],
[
104,
105
],
[
104,
106
]
] | [
"/**\n * ?????§?????????\n * FX????????§????????°?????????????????¨????????????????????¨??§????????????????????????????????¨?????§????????????????????°????????????100???????????? 1000???????????????????????????????????? 1?????? 108???????????£??????????£??????¨???(108??? ?????? 100???) ???? 1000?????? == 8000??????????????????????????¨?????§????????????\n * <p>\n * ???????????¨?????????????????????t?????????????????? Rt(t=0,1,2,,,n???1)?????\\?????¨??????????????????????????§??????????????? Rj???Ri (?????????,j>i??¨??????) ????????§???????±??????????????????????\n * <p>\n * ??\\???\n * ?????????????????´??°n?????????????????????????¶????n????????´??° Rt(t=0,1,2,,,n???1) ?????????????????????????????????\n * <p>\n * ??????\n * ?????§??????????????????????????????????????????\n * <p>\n * ??¶?´?\n * 2???n???200,000\n * 1???Rt???10e9\n */\n\nimport java.util.*;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tint t = stdIn.nextInt();\n\t\tint[] profitT = new int[t];\n\n\t\tfor (int i = 0; i < t; i++) {\n\t\t\tprofitT[i] = stdIn.nextInt();\n\t\t}\n\n\t\tint maxProfit = profitT[1] - profitT[0];\n\n\t\tint min = profitT[0];\n\t\tfor (int i = 1; i < t; i++) {\n\t\t\tif (maxProfit < profitT[i] - min) {\n\t\t\t\tmaxProfit = profitT[i] - min;\n\t\t\t}\n\t\t\tif (min > profitT[i]) {\n\t\t\t\tmin = profitT[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(maxProfit);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tint t = stdIn.nextInt();\n\t\tint[] profitT = new int[t];\n\n\t\tfor (int i = 0; i < t; i++) {\n\t\t\tprofitT[i] = stdIn.nextInt();\n\t\t}\n\n\t\tint maxProfit = profitT[1] - profitT[0];\n\n\t\tint min = profitT[0];\n\t\tfor (int i = 1; i < t; i++) {\n\t\t\tif (maxProfit < profitT[i] - min) {\n\t\t\t\tmaxProfit = profitT[i] - min;\n\t\t\t}\n\t\t\tif (min > profitT[i]) {\n\t\t\t\tmin = profitT[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(maxProfit);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tint t = stdIn.nextInt();\n\t\tint[] profitT = new int[t];\n\n\t\tfor (int i = 0; i < t; i++) {\n\t\t\tprofitT[i] = stdIn.nextInt();\n\t\t}\n\n\t\tint maxProfit = profitT[1] - profitT[0];\n\n\t\tint min = profitT[0];\n\t\tfor (int i = 1; i < t; i++) {\n\t\t\tif (maxProfit < profitT[i] - min) {\n\t\t\t\tmaxProfit = profitT[i] - min;\n\t\t\t}\n\t\t\tif (min > profitT[i]) {\n\t\t\t\tmin = profitT[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(maxProfit);\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tint t = stdIn.nextInt();\n\t\tint[] profitT = new int[t];\n\n\t\tfor (int i = 0; i < t; i++) {\n\t\t\tprofitT[i] = stdIn.nextInt();\n\t\t}\n\n\t\tint maxProfit = profitT[1] - profitT[0];\n\n\t\tint min = profitT[0];\n\t\tfor (int i = 1; i < t; i++) {\n\t\t\tif (maxProfit < profitT[i] - min) {\n\t\t\t\tmaxProfit = profitT[i] - min;\n\t\t\t}\n\t\t\tif (min > profitT[i]) {\n\t\t\t\tmin = profitT[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(maxProfit);\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int t = stdIn.nextInt();",
"t",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int[] profitT = new int[t];",
"profitT",
"new int[t]",
"t",
"for (int i = 0; i < t; i++) {\n\t\t\tprofitT[i] = stdIn.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < t",
"i",
"t",
"i++",
"i++",
"i",
"{\n\t\t\tprofitT[i] = stdIn.nextInt();\n\t\t}",
"{\n\t\t\tprofitT[i] = stdIn.nextInt();\n\t\t}",
"profitT[i] = stdIn.nextInt()",
"profitT[i]",
"profitT",
"i",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int maxProfit = profitT[1] - profitT[0];",
"maxProfit",
"profitT[1] - profitT[0]",
"profitT[1]",
"profitT",
"1",
"profitT[0]",
"profitT",
"0",
"int min = profitT[0];",
"min",
"profitT[0]",
"profitT",
"0",
"for (int i = 1; i < t; i++) {\n\t\t\tif (maxProfit < profitT[i] - min) {\n\t\t\t\tmaxProfit = profitT[i] - min;\n\t\t\t}\n\t\t\tif (min > profitT[i]) {\n\t\t\t\tmin = profitT[i];\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < t",
"i",
"t",
"i++",
"i++",
"i",
"{\n\t\t\tif (maxProfit < profitT[i] - min) {\n\t\t\t\tmaxProfit = profitT[i] - min;\n\t\t\t}\n\t\t\tif (min > profitT[i]) {\n\t\t\t\tmin = profitT[i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (maxProfit < profitT[i] - min) {\n\t\t\t\tmaxProfit = profitT[i] - min;\n\t\t\t}\n\t\t\tif (min > profitT[i]) {\n\t\t\t\tmin = profitT[i];\n\t\t\t}\n\t\t}",
"if (maxProfit < profitT[i] - min) {\n\t\t\t\tmaxProfit = profitT[i] - min;\n\t\t\t}",
"maxProfit < profitT[i] - min",
"maxProfit",
"profitT[i] - min",
"profitT[i]",
"profitT",
"i",
"min",
"{\n\t\t\t\tmaxProfit = profitT[i] - min;\n\t\t\t}",
"maxProfit = profitT[i] - min",
"maxProfit",
"profitT[i] - min",
"profitT[i]",
"profitT",
"i",
"min",
"if (min > profitT[i]) {\n\t\t\t\tmin = profitT[i];\n\t\t\t}",
"min > profitT[i]",
"min",
"profitT[i]",
"profitT",
"i",
"{\n\t\t\t\tmin = profitT[i];\n\t\t\t}",
"min = profitT[i]",
"min",
"profitT[i]",
"profitT",
"i",
"System.out.println(maxProfit)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxProfit",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tint t = stdIn.nextInt();\n\t\tint[] profitT = new int[t];\n\n\t\tfor (int i = 0; i < t; i++) {\n\t\t\tprofitT[i] = stdIn.nextInt();\n\t\t}\n\n\t\tint maxProfit = profitT[1] - profitT[0];\n\n\t\tint min = profitT[0];\n\t\tfor (int i = 1; i < t; i++) {\n\t\t\tif (maxProfit < profitT[i] - min) {\n\t\t\t\tmaxProfit = profitT[i] - min;\n\t\t\t}\n\t\t\tif (min > profitT[i]) {\n\t\t\t\tmin = profitT[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(maxProfit);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\n\t\tint t = stdIn.nextInt();\n\t\tint[] profitT = new int[t];\n\n\t\tfor (int i = 0; i < t; i++) {\n\t\t\tprofitT[i] = stdIn.nextInt();\n\t\t}\n\n\t\tint maxProfit = profitT[1] - profitT[0];\n\n\t\tint min = profitT[0];\n\t\tfor (int i = 1; i < t; i++) {\n\t\t\tif (maxProfit < profitT[i] - min) {\n\t\t\t\tmaxProfit = profitT[i] - min;\n\t\t\t}\n\t\t\tif (min > profitT[i]) {\n\t\t\t\tmin = profitT[i];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(maxProfit);\n\t}\n}",
"Main"
] | /**
* ?????§?????????
* FX????????§????????°?????????????????¨????????????????????¨??§????????????????????????????????¨?????§????????????????????°????????????100???????????? 1000???????????????????????????????????? 1?????? 108???????????£??????????£??????¨???(108??? ?????? 100???) ???? 1000?????? == 8000??????????????????????????¨?????§????????????
* <p>
* ???????????¨?????????????????????t?????????????????? Rt(t=0,1,2,,,n???1)?????\?????¨??????????????????????????§??????????????? Rj???Ri (?????????,j>i??¨??????) ????????§???????±??????????????????????
* <p>
* ??\???
* ?????????????????´??°n?????????????????????????¶????n????????´??° Rt(t=0,1,2,,,n???1) ?????????????????????????????????
* <p>
* ??????
* ?????§??????????????????????????????????????????
* <p>
* ??¶?´?
* 2???n???200,000
* 1???Rt???10e9
*/
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int t = stdIn.nextInt();
int[] profitT = new int[t];
for (int i = 0; i < t; i++) {
profitT[i] = stdIn.nextInt();
}
int maxProfit = profitT[1] - profitT[0];
int min = profitT[0];
for (int i = 1; i < t; i++) {
if (maxProfit < profitT[i] - min) {
maxProfit = profitT[i] - min;
}
if (min > profitT[i]) {
min = profitT[i];
}
}
System.out.println(maxProfit);
}
} |
[
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,
2,
18,
13,
17,
18,
13,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
18,
13,
13,
13,
13,
30,
0,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
104,
5
],
[
104,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
55,
65
],
[
65,
66
],
[
66,
67
],
[
55,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
71,
77
],
[
70,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
69,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
88,
92
],
[
92,
93
],
[
92,
94
],
[
8,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
6,
101
],
[
101,
102
],
[
0,
103
],
[
103,
104
],
[
103,
105
]
] | [
"import java.util.Scanner;\n\npublic class Main{\n\n public static void main(String[] args) {\n\n // ?????\\??°???\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = scan.nextInt();\n }\n\n int answer = arr[1] - arr[0];\n int min = arr[0];\n for (int i = 1; i < arr.length; i++) {\n if (arr[i] - min > answer) {\n answer = arr[i] - min;\n }\n min = Math.min(min, arr[i]);\n }\n System.out.println(answer);\n\n }\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\n public static void main(String[] args) {\n\n // ?????\\??°???\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = scan.nextInt();\n }\n\n int answer = arr[1] - arr[0];\n int min = arr[0];\n for (int i = 1; i < arr.length; i++) {\n if (arr[i] - min > answer) {\n answer = arr[i] - min;\n }\n min = Math.min(min, arr[i]);\n }\n System.out.println(answer);\n\n }\n\n}",
"Main",
"public static void main(String[] args) {\n\n // ?????\\??°???\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = scan.nextInt();\n }\n\n int answer = arr[1] - arr[0];\n int min = arr[0];\n for (int i = 1; i < arr.length; i++) {\n if (arr[i] - min > answer) {\n answer = arr[i] - min;\n }\n min = Math.min(min, arr[i]);\n }\n System.out.println(answer);\n\n }",
"main",
"{\n\n // ?????\\??°???\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = scan.nextInt();\n }\n\n int answer = arr[1] - arr[0];\n int min = arr[0];\n for (int i = 1; i < arr.length; i++) {\n if (arr[i] - min > answer) {\n answer = arr[i] - min;\n }\n min = Math.min(min, arr[i]);\n }\n System.out.println(answer);\n\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] arr = new int[n];",
"arr",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n arr[i] = scan.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = scan.nextInt();\n }",
"{\n arr[i] = scan.nextInt();\n }",
"arr[i] = scan.nextInt()",
"arr[i]",
"arr",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int answer = arr[1] - arr[0];",
"answer",
"arr[1] - arr[0]",
"arr[1]",
"arr",
"1",
"arr[0]",
"arr",
"0",
"int min = arr[0];",
"min",
"arr[0]",
"arr",
"0",
"for (int i = 1; i < arr.length; i++) {\n if (arr[i] - min > answer) {\n answer = arr[i] - min;\n }\n min = Math.min(min, arr[i]);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n if (arr[i] - min > answer) {\n answer = arr[i] - min;\n }\n min = Math.min(min, arr[i]);\n }",
"{\n if (arr[i] - min > answer) {\n answer = arr[i] - min;\n }\n min = Math.min(min, arr[i]);\n }",
"if (arr[i] - min > answer) {\n answer = arr[i] - min;\n }",
"arr[i] - min > answer",
"arr[i] - min",
"arr[i]",
"arr",
"i",
"min",
"answer",
"{\n answer = arr[i] - min;\n }",
"answer = arr[i] - min",
"answer",
"arr[i] - min",
"arr[i]",
"arr",
"i",
"min",
"min = Math.min(min, arr[i])",
"min",
"Math.min(min, arr[i])",
"Math.min",
"Math",
"min",
"arr[i]",
"arr",
"i",
"System.out.println(answer)",
"System.out.println",
"System.out",
"System",
"System.out",
"answer",
"String[] args",
"args",
"public class Main{\n\n public static void main(String[] args) {\n\n // ?????\\??°???\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = scan.nextInt();\n }\n\n int answer = arr[1] - arr[0];\n int min = arr[0];\n for (int i = 1; i < arr.length; i++) {\n if (arr[i] - min > answer) {\n answer = arr[i] - min;\n }\n min = Math.min(min, arr[i]);\n }\n System.out.println(answer);\n\n }\n\n}",
"public class Main{\n\n public static void main(String[] args) {\n\n // ?????\\??°???\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = scan.nextInt();\n }\n\n int answer = arr[1] - arr[0];\n int min = arr[0];\n for (int i = 1; i < arr.length; i++) {\n if (arr[i] - min > answer) {\n answer = arr[i] - min;\n }\n min = Math.min(min, arr[i]);\n }\n System.out.println(answer);\n\n }\n\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
// ?????\??°???
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = scan.nextInt();
}
int answer = arr[1] - arr[0];
int min = arr[0];
for (int i = 1; i < arr.length; i++) {
if (arr[i] - min > answer) {
answer = arr[i] - min;
}
min = Math.min(min, arr[i]);
}
System.out.println(answer);
}
} |
[
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,
2,
18,
13,
17,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
18,
13,
13,
18,
13,
13,
13,
30,
0,
13,
2,
18,
13,
13,
18,
13,
13,
14,
2,
18,
13,
13,
18,
13,
13,
30,
0,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
111,
5
],
[
111,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
72,
74
],
[
67,
75
],
[
66,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
83,
85
],
[
65,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
91,
93
],
[
86,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
99,
101
],
[
8,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
6,
108
],
[
108,
109
],
[
0,
110
],
[
110,
111
],
[
110,
112
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] R = new int[n];\n\t\tfor (int i=0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n//\n//\t\tint max = R[1] - R[0];\n//\t\tfor (int i =0; i < n-1; i++) {\n//\t\t\tfor (int j=i+1; j < n; j++) {\n//\t\t\t\tif (max < R[j] - R[i])\n//\t\t\t\tmax = R[j] - R[i];\n//\t\t\t}\n//\t\t}\n//\n//\t\tSystem.out.println(max);\n\n\t\tint max = R[1] - R[0];\n\t\tint i = 0;\n\t\tfor ( int j=1; j < n; j++) {\n\t\t\tif ( R[j] - R[i] > max ) {\n\t\t\t\tmax = R[j] - R[i];\n\t\t\t}\n\t\t\tif ( R[i] > R[j] ) {\n\t\t\t\tR[i] = R[j];\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] R = new int[n];\n\t\tfor (int i=0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n//\n//\t\tint max = R[1] - R[0];\n//\t\tfor (int i =0; i < n-1; i++) {\n//\t\t\tfor (int j=i+1; j < n; j++) {\n//\t\t\t\tif (max < R[j] - R[i])\n//\t\t\t\tmax = R[j] - R[i];\n//\t\t\t}\n//\t\t}\n//\n//\t\tSystem.out.println(max);\n\n\t\tint max = R[1] - R[0];\n\t\tint i = 0;\n\t\tfor ( int j=1; j < n; j++) {\n\t\t\tif ( R[j] - R[i] > max ) {\n\t\t\t\tmax = R[j] - R[i];\n\t\t\t}\n\t\t\tif ( R[i] > R[j] ) {\n\t\t\t\tR[i] = R[j];\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] R = new int[n];\n\t\tfor (int i=0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n//\n//\t\tint max = R[1] - R[0];\n//\t\tfor (int i =0; i < n-1; i++) {\n//\t\t\tfor (int j=i+1; j < n; j++) {\n//\t\t\t\tif (max < R[j] - R[i])\n//\t\t\t\tmax = R[j] - R[i];\n//\t\t\t}\n//\t\t}\n//\n//\t\tSystem.out.println(max);\n\n\t\tint max = R[1] - R[0];\n\t\tint i = 0;\n\t\tfor ( int j=1; j < n; j++) {\n\t\t\tif ( R[j] - R[i] > max ) {\n\t\t\t\tmax = R[j] - R[i];\n\t\t\t}\n\t\t\tif ( R[i] > R[j] ) {\n\t\t\t\tR[i] = R[j];\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] R = new int[n];\n\t\tfor (int i=0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n//\n//\t\tint max = R[1] - R[0];\n//\t\tfor (int i =0; i < n-1; i++) {\n//\t\t\tfor (int j=i+1; j < n; j++) {\n//\t\t\t\tif (max < R[j] - R[i])\n//\t\t\t\tmax = R[j] - R[i];\n//\t\t\t}\n//\t\t}\n//\n//\t\tSystem.out.println(max);\n\n\t\tint max = R[1] - R[0];\n\t\tint i = 0;\n\t\tfor ( int j=1; j < n; j++) {\n\t\t\tif ( R[j] - R[i] > max ) {\n\t\t\t\tmax = R[j] - R[i];\n\t\t\t}\n\t\t\tif ( R[i] > R[j] ) {\n\t\t\t\tR[i] = R[j];\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] R = new int[n];",
"R",
"new int[n]",
"n",
"for (int i=0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tR[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tR[i] = sc.nextInt();\n\t\t}",
"R[i] = sc.nextInt()",
"R[i]",
"R",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int max = R[1] - R[0];",
"max",
"R[1] - R[0]",
"R[1]",
"R",
"1",
"R[0]",
"R",
"0",
"int i = 0;",
"i",
"0",
"for ( int j=1; j < n; j++) {\n\t\t\tif ( R[j] - R[i] > max ) {\n\t\t\t\tmax = R[j] - R[i];\n\t\t\t}\n\t\t\tif ( R[i] > R[j] ) {\n\t\t\t\tR[i] = R[j];\n\t\t\t}\n\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j < n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\tif ( R[j] - R[i] > max ) {\n\t\t\t\tmax = R[j] - R[i];\n\t\t\t}\n\t\t\tif ( R[i] > R[j] ) {\n\t\t\t\tR[i] = R[j];\n\t\t\t}\n\t\t}",
"{\n\t\t\tif ( R[j] - R[i] > max ) {\n\t\t\t\tmax = R[j] - R[i];\n\t\t\t}\n\t\t\tif ( R[i] > R[j] ) {\n\t\t\t\tR[i] = R[j];\n\t\t\t}\n\t\t}",
"if ( R[j] - R[i] > max ) {\n\t\t\t\tmax = R[j] - R[i];\n\t\t\t}",
"R[j] - R[i] > max",
"R[j] - R[i]",
"R[j]",
"R",
"j",
"R[i]",
"R",
"i",
"max",
"{\n\t\t\t\tmax = R[j] - R[i];\n\t\t\t}",
"max = R[j] - R[i]",
"max",
"R[j] - R[i]",
"R[j]",
"R",
"j",
"R[i]",
"R",
"i",
"if ( R[i] > R[j] ) {\n\t\t\t\tR[i] = R[j];\n\t\t\t}",
"R[i] > R[j]",
"R[i]",
"R",
"i",
"R[j]",
"R",
"j",
"{\n\t\t\t\tR[i] = R[j];\n\t\t\t}",
"R[i] = R[j]",
"R[i]",
"R",
"i",
"R[j]",
"R",
"j",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] R = new int[n];\n\t\tfor (int i=0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n//\n//\t\tint max = R[1] - R[0];\n//\t\tfor (int i =0; i < n-1; i++) {\n//\t\t\tfor (int j=i+1; j < n; j++) {\n//\t\t\t\tif (max < R[j] - R[i])\n//\t\t\t\tmax = R[j] - R[i];\n//\t\t\t}\n//\t\t}\n//\n//\t\tSystem.out.println(max);\n\n\t\tint max = R[1] - R[0];\n\t\tint i = 0;\n\t\tfor ( int j=1; j < n; j++) {\n\t\t\tif ( R[j] - R[i] > max ) {\n\t\t\t\tmax = R[j] - R[i];\n\t\t\t}\n\t\t\tif ( R[i] > R[j] ) {\n\t\t\t\tR[i] = R[j];\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] R = new int[n];\n\t\tfor (int i=0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n//\n//\t\tint max = R[1] - R[0];\n//\t\tfor (int i =0; i < n-1; i++) {\n//\t\t\tfor (int j=i+1; j < n; j++) {\n//\t\t\t\tif (max < R[j] - R[i])\n//\t\t\t\tmax = R[j] - R[i];\n//\t\t\t}\n//\t\t}\n//\n//\t\tSystem.out.println(max);\n\n\t\tint max = R[1] - R[0];\n\t\tint i = 0;\n\t\tfor ( int j=1; j < n; j++) {\n\t\t\tif ( R[j] - R[i] > max ) {\n\t\t\t\tmax = R[j] - R[i];\n\t\t\t}\n\t\t\tif ( R[i] > R[j] ) {\n\t\t\t\tR[i] = R[j];\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] R = new int[n];
for (int i=0; i < n; i++) {
R[i] = sc.nextInt();
}
//
// int max = R[1] - R[0];
// for (int i =0; i < n-1; i++) {
// for (int j=i+1; j < n; j++) {
// if (max < R[j] - R[i])
// max = R[j] - R[i];
// }
// }
//
// System.out.println(max);
int max = R[1] - R[0];
int i = 0;
for ( int j=1; j < n; j++) {
if ( R[j] - R[i] > max ) {
max = R[j] - R[i];
}
if ( R[i] > R[j] ) {
R[i] = R[j];
}
}
System.out.println(max);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
20,
0,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
0,
13,
18,
13,
17,
0,
13,
2,
18,
13,
17,
18,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
121,
5
],
[
121,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
8,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
34,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
39,
40
],
[
39,
41
],
[
8,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
63,
64
],
[
8,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
8,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
76,
78
],
[
8,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
91,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
105,
109
],
[
109,
110
],
[
109,
111
],
[
8,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
6,
118
],
[
118,
119
],
[
0,
120
],
[
120,
121
],
[
120,
122
]
] | [
"import java.util.Scanner;\n\npublic class Main{\n\n\tpublic static void main(String args[]){\n\t\tint i,j,k,t,min,minv,maxv,l;\n\t\tScanner sc=new Scanner(System.in);\n\t\tt=Integer.parseInt(sc.next());\n\t\tint n[]=new int[t+1];\n\t\tfor(i=0;i<t;i++){\n\t\t\tn[i]=Integer.parseInt(sc.next());\n\t\t}\n\t\t\n\t\tminv=n[0];\n\t\tmaxv=n[1]-n[0];\n\t\tfor(i=1;i<t;i++){\n\t\t\tmaxv=Math.max(maxv, n[i]-minv);\n\t\t\tminv=Math.min(minv, n[i]);\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\n\tpublic static void main(String args[]){\n\t\tint i,j,k,t,min,minv,maxv,l;\n\t\tScanner sc=new Scanner(System.in);\n\t\tt=Integer.parseInt(sc.next());\n\t\tint n[]=new int[t+1];\n\t\tfor(i=0;i<t;i++){\n\t\t\tn[i]=Integer.parseInt(sc.next());\n\t\t}\n\t\t\n\t\tminv=n[0];\n\t\tmaxv=n[1]-n[0];\n\t\tfor(i=1;i<t;i++){\n\t\t\tmaxv=Math.max(maxv, n[i]-minv);\n\t\t\tminv=Math.min(minv, n[i]);\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}\n}",
"Main",
"public static void main(String args[]){\n\t\tint i,j,k,t,min,minv,maxv,l;\n\t\tScanner sc=new Scanner(System.in);\n\t\tt=Integer.parseInt(sc.next());\n\t\tint n[]=new int[t+1];\n\t\tfor(i=0;i<t;i++){\n\t\t\tn[i]=Integer.parseInt(sc.next());\n\t\t}\n\t\t\n\t\tminv=n[0];\n\t\tmaxv=n[1]-n[0];\n\t\tfor(i=1;i<t;i++){\n\t\t\tmaxv=Math.max(maxv, n[i]-minv);\n\t\t\tminv=Math.min(minv, n[i]);\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}",
"main",
"{\n\t\tint i,j,k,t,min,minv,maxv,l;\n\t\tScanner sc=new Scanner(System.in);\n\t\tt=Integer.parseInt(sc.next());\n\t\tint n[]=new int[t+1];\n\t\tfor(i=0;i<t;i++){\n\t\t\tn[i]=Integer.parseInt(sc.next());\n\t\t}\n\t\t\n\t\tminv=n[0];\n\t\tmaxv=n[1]-n[0];\n\t\tfor(i=1;i<t;i++){\n\t\t\tmaxv=Math.max(maxv, n[i]-minv);\n\t\t\tminv=Math.min(minv, n[i]);\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}",
"int i",
"i",
"j",
"j",
"k",
"k",
"t",
"t",
"min",
"min",
"minv",
"minv",
"maxv",
"maxv",
"l;",
"l",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"t=Integer.parseInt(sc.next())",
"t",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int n[]=new int[t+1];",
"n",
"new int[t+1]",
"t+1",
"t",
"1",
"for(i=0;i<t;i++){\n\t\t\tn[i]=Integer.parseInt(sc.next());\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<t",
"i",
"t",
"i++",
"i++",
"i",
"{\n\t\t\tn[i]=Integer.parseInt(sc.next());\n\t\t}",
"{\n\t\t\tn[i]=Integer.parseInt(sc.next());\n\t\t}",
"n[i]=Integer.parseInt(sc.next())",
"n[i]",
"n",
"i",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"minv=n[0]",
"minv",
"n[0]",
"n",
"0",
"maxv=n[1]-n[0]",
"maxv",
"n[1]-n[0]",
"n[1]",
"n",
"1",
"n[0]",
"n",
"0",
"for(i=1;i<t;i++){\n\t\t\tmaxv=Math.max(maxv, n[i]-minv);\n\t\t\tminv=Math.min(minv, n[i]);\n\t\t}",
"i=1;",
"i=1",
"i",
"1",
"i<t",
"i",
"t",
"i++",
"i++",
"i",
"{\n\t\t\tmaxv=Math.max(maxv, n[i]-minv);\n\t\t\tminv=Math.min(minv, n[i]);\n\t\t}",
"{\n\t\t\tmaxv=Math.max(maxv, n[i]-minv);\n\t\t\tminv=Math.min(minv, n[i]);\n\t\t}",
"maxv=Math.max(maxv, n[i]-minv)",
"maxv",
"Math.max(maxv, n[i]-minv)",
"Math.max",
"Math",
"maxv",
"n[i]-minv",
"n[i]",
"n",
"i",
"minv",
"minv=Math.min(minv, n[i])",
"minv",
"Math.min(minv, n[i])",
"Math.min",
"Math",
"minv",
"n[i]",
"n",
"i",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String args[]",
"args",
"public class Main{\n\n\tpublic static void main(String args[]){\n\t\tint i,j,k,t,min,minv,maxv,l;\n\t\tScanner sc=new Scanner(System.in);\n\t\tt=Integer.parseInt(sc.next());\n\t\tint n[]=new int[t+1];\n\t\tfor(i=0;i<t;i++){\n\t\t\tn[i]=Integer.parseInt(sc.next());\n\t\t}\n\t\t\n\t\tminv=n[0];\n\t\tmaxv=n[1]-n[0];\n\t\tfor(i=1;i<t;i++){\n\t\t\tmaxv=Math.max(maxv, n[i]-minv);\n\t\t\tminv=Math.min(minv, n[i]);\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}\n}",
"public class Main{\n\n\tpublic static void main(String args[]){\n\t\tint i,j,k,t,min,minv,maxv,l;\n\t\tScanner sc=new Scanner(System.in);\n\t\tt=Integer.parseInt(sc.next());\n\t\tint n[]=new int[t+1];\n\t\tfor(i=0;i<t;i++){\n\t\t\tn[i]=Integer.parseInt(sc.next());\n\t\t}\n\t\t\n\t\tminv=n[0];\n\t\tmaxv=n[1]-n[0];\n\t\tfor(i=1;i<t;i++){\n\t\t\tmaxv=Math.max(maxv, n[i]-minv);\n\t\t\tminv=Math.min(minv, n[i]);\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String args[]){
int i,j,k,t,min,minv,maxv,l;
Scanner sc=new Scanner(System.in);
t=Integer.parseInt(sc.next());
int n[]=new int[t+1];
for(i=0;i<t;i++){
n[i]=Integer.parseInt(sc.next());
}
minv=n[0];
maxv=n[1]-n[0];
for(i=1;i<t;i++){
maxv=Math.max(maxv, n[i]-minv);
minv=Math.min(minv, n[i]);
}
System.out.println(maxv);
}
} |
[
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,
18,
13,
17,
41,
13,
2,
18,
13,
17,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
18,
13,
2,
13,
17,
0,
13,
18,
13,
2,
13,
17,
14,
2,
13,
2,
18,
13,
13,
13,
0,
13,
2,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
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
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
53,
63
],
[
63,
64
],
[
64,
65
],
[
53,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
68,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
67,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
83,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
8,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
6,
104
],
[
104,
105
],
[
0,
106
],
[
106,
107
],
[
106,
108
]
] | [
"\n\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\t\n\t\tScanner s=new Scanner(System.in);\n\t\tint n=s.nextInt();\n\t\tint R[]=new int[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tR[i]=s.nextInt();\n\t\t}\n\t\t//ri ?????????\n\t\tint ri=R[0];\n\t\t//rj ???????????????\n\t\tint max=R[1]-ri;\n\t\tfor(int i=2;i<R.length;i++){\n\t\t\tif(ri>R[i-1])ri=R[i-1];\n\t\t\tif(max<R[i]-ri)max=R[i]-ri;\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\t\n\t\tScanner s=new Scanner(System.in);\n\t\tint n=s.nextInt();\n\t\tint R[]=new int[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tR[i]=s.nextInt();\n\t\t}\n\t\t//ri ?????????\n\t\tint ri=R[0];\n\t\t//rj ???????????????\n\t\tint max=R[1]-ri;\n\t\tfor(int i=2;i<R.length;i++){\n\t\t\tif(ri>R[i-1])ri=R[i-1];\n\t\t\tif(max<R[i]-ri)max=R[i]-ri;\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\t\n\t\tScanner s=new Scanner(System.in);\n\t\tint n=s.nextInt();\n\t\tint R[]=new int[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tR[i]=s.nextInt();\n\t\t}\n\t\t//ri ?????????\n\t\tint ri=R[0];\n\t\t//rj ???????????????\n\t\tint max=R[1]-ri;\n\t\tfor(int i=2;i<R.length;i++){\n\t\t\tif(ri>R[i-1])ri=R[i-1];\n\t\t\tif(max<R[i]-ri)max=R[i]-ri;\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"main",
"{\n\t\t\n\t\tScanner s=new Scanner(System.in);\n\t\tint n=s.nextInt();\n\t\tint R[]=new int[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tR[i]=s.nextInt();\n\t\t}\n\t\t//ri ?????????\n\t\tint ri=R[0];\n\t\t//rj ???????????????\n\t\tint max=R[1]-ri;\n\t\tfor(int i=2;i<R.length;i++){\n\t\t\tif(ri>R[i-1])ri=R[i-1];\n\t\t\tif(max<R[i]-ri)max=R[i]-ri;\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"Scanner s=new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int n=s.nextInt();",
"n",
"s.nextInt()",
"s.nextInt",
"s",
"int R[]=new int[n];",
"R",
"new int[n]",
"n",
"for(int i=0;i<n;i++){\n\t\t\tR[i]=s.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tR[i]=s.nextInt();\n\t\t}",
"{\n\t\t\tR[i]=s.nextInt();\n\t\t}",
"R[i]=s.nextInt()",
"R[i]",
"R",
"i",
"s.nextInt()",
"s.nextInt",
"s",
"int ri=R[0];",
"ri",
"R[0]",
"R",
"0",
"int max=R[1]-ri;",
"max",
"R[1]-ri",
"R[1]",
"R",
"1",
"ri",
"for(int i=2;i<R.length;i++){\n\t\t\tif(ri>R[i-1])ri=R[i-1];\n\t\t\tif(max<R[i]-ri)max=R[i]-ri;\n\t\t}",
"int i=2;",
"int i=2;",
"i",
"2",
"i<R.length",
"i",
"R.length",
"R",
"R.length",
"i++",
"i++",
"i",
"{\n\t\t\tif(ri>R[i-1])ri=R[i-1];\n\t\t\tif(max<R[i]-ri)max=R[i]-ri;\n\t\t}",
"{\n\t\t\tif(ri>R[i-1])ri=R[i-1];\n\t\t\tif(max<R[i]-ri)max=R[i]-ri;\n\t\t}",
"if(ri>R[i-1])ri=R[i-1];",
"ri>R[i-1]",
"ri",
"R[i-1]",
"R",
"i-1",
"i",
"1",
"ri=R[i-1]",
"ri",
"R[i-1]",
"R",
"i-1",
"i",
"1",
"if(max<R[i]-ri)max=R[i]-ri;",
"max<R[i]-ri",
"max",
"R[i]-ri",
"R[i]",
"R",
"i",
"ri",
"max=R[i]-ri",
"max",
"R[i]-ri",
"R[i]",
"R",
"i",
"ri",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\t\n\t\tScanner s=new Scanner(System.in);\n\t\tint n=s.nextInt();\n\t\tint R[]=new int[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tR[i]=s.nextInt();\n\t\t}\n\t\t//ri ?????????\n\t\tint ri=R[0];\n\t\t//rj ???????????????\n\t\tint max=R[1]-ri;\n\t\tfor(int i=2;i<R.length;i++){\n\t\t\tif(ri>R[i-1])ri=R[i-1];\n\t\t\tif(max<R[i]-ri)max=R[i]-ri;\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\t\n\t\tScanner s=new Scanner(System.in);\n\t\tint n=s.nextInt();\n\t\tint R[]=new int[n];\n\t\tfor(int i=0;i<n;i++){\n\t\t\tR[i]=s.nextInt();\n\t\t}\n\t\t//ri ?????????\n\t\tint ri=R[0];\n\t\t//rj ???????????????\n\t\tint max=R[1]-ri;\n\t\tfor(int i=2;i<R.length;i++){\n\t\t\tif(ri>R[i-1])ri=R[i-1];\n\t\t\tif(max<R[i]-ri)max=R[i]-ri;\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner s=new Scanner(System.in);
int n=s.nextInt();
int R[]=new int[n];
for(int i=0;i<n;i++){
R[i]=s.nextInt();
}
//ri ?????????
int ri=R[0];
//rj ???????????????
int max=R[1]-ri;
for(int i=2;i<R.length;i++){
if(ri>R[i-1])ri=R[i-1];
if(max<R[i]-ri)max=R[i]-ri;
}
System.out.println(max);
}
} |
[
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,
4,
18,
13,
41,
13,
20,
13,
41,
13,
18,
13,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
18,
13,
13,
9,
11,
1,
41,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
2,
13,
17,
13,
2,
13,
13,
30,
0,
13,
13,
0,
13,
2,
18,
13,
13,
18,
13,
13,
3,
14,
2,
2,
13,
18,
13,
13,
18,
13,
13,
30,
0,
13,
2,
18,
13,
13,
18,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
17,
0,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
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
],
[
13,
15
],
[
0,
16
],
[
176,
17
],
[
176,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
29,
30
],
[
30,
31
],
[
20,
32
],
[
32,
33
],
[
32,
34
],
[
20,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
20,
41
],
[
41,
42
],
[
41,
43
],
[
20,
44
],
[
44,
45
],
[
44,
46
],
[
20,
47
],
[
47,
48
],
[
47,
49
],
[
20,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
69,
70
],
[
70,
71
],
[
20,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
72,
82
],
[
82,
83
],
[
83,
84
],
[
72,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
92,
94
],
[
87,
95
],
[
86,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
100,
102
],
[
96,
103
],
[
103,
104
],
[
103,
105
],
[
96,
106
],
[
106,
107
],
[
107,
108
],
[
96,
109
],
[
110,
110
],
[
110,
111
],
[
111,
112
],
[
113,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
113,
118
],
[
118,
119
],
[
118,
120
],
[
111,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
131,
132
],
[
131,
133
],
[
121,
134
],
[
111,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
139,
141
],
[
136,
142
],
[
142,
143
],
[
142,
144
],
[
135,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
152,
153
],
[
152,
154
],
[
145,
155
],
[
155,
156
],
[
155,
157
],
[
145,
158
],
[
158,
159
],
[
158,
160
],
[
145,
161
],
[
161,
162
],
[
161,
163
],
[
86,
164
],
[
164,
165
],
[
164,
166
],
[
20,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
18,
173
],
[
173,
174
],
[
0,
175
],
[
175,
176
],
[
175,
177
]
] | [
"import java.io.BufferedReader;\nimport java.io.FileNotFoundException;\nimport java.io.FileReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main{\n\n\tpublic static void main(String[] args) throws NumberFormatException,\n\t\t\tIOException {\n\t\t BufferedReader br = new BufferedReader(new\n\t\t InputStreamReader(System.in));\n\t\t//BufferedReader br = new BufferedReader(new FileReader(\"sample.txt\"));\n\n\t\tint n = Integer.parseInt(br.readLine());\n\t\tint[] in = new int[n];\n\t\tint max = Integer.MIN_VALUE;\n\t\tint mini = 0;\n\t\tint maxj=0;\n\t\tboolean con=false;\n\t\t\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tin[i] = Integer.parseInt(br.readLine());\n\t\t\n\n\t\tfor (int i = 0; i < n - 1; i++) {\n\t\t\tif (in[i] > in[mini])continue;\n\t\t\tfor (int j = i + 1; j < n; j++){\n\t\t\t\tif(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}\n\t\t\t}con=true;\n\t\t}\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.FileNotFoundException;",
"FileNotFoundException",
"java.io",
"import java.io.FileReader;",
"FileReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main{\n\n\tpublic static void main(String[] args) throws NumberFormatException,\n\t\t\tIOException {\n\t\t BufferedReader br = new BufferedReader(new\n\t\t InputStreamReader(System.in));\n\t\t//BufferedReader br = new BufferedReader(new FileReader(\"sample.txt\"));\n\n\t\tint n = Integer.parseInt(br.readLine());\n\t\tint[] in = new int[n];\n\t\tint max = Integer.MIN_VALUE;\n\t\tint mini = 0;\n\t\tint maxj=0;\n\t\tboolean con=false;\n\t\t\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tin[i] = Integer.parseInt(br.readLine());\n\t\t\n\n\t\tfor (int i = 0; i < n - 1; i++) {\n\t\t\tif (in[i] > in[mini])continue;\n\t\t\tfor (int j = i + 1; j < n; j++){\n\t\t\t\tif(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}\n\t\t\t}con=true;\n\t\t}\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws NumberFormatException,\n\t\t\tIOException {\n\t\t BufferedReader br = new BufferedReader(new\n\t\t InputStreamReader(System.in));\n\t\t//BufferedReader br = new BufferedReader(new FileReader(\"sample.txt\"));\n\n\t\tint n = Integer.parseInt(br.readLine());\n\t\tint[] in = new int[n];\n\t\tint max = Integer.MIN_VALUE;\n\t\tint mini = 0;\n\t\tint maxj=0;\n\t\tboolean con=false;\n\t\t\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tin[i] = Integer.parseInt(br.readLine());\n\t\t\n\n\t\tfor (int i = 0; i < n - 1; i++) {\n\t\t\tif (in[i] > in[mini])continue;\n\t\t\tfor (int j = i + 1; j < n; j++){\n\t\t\t\tif(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}\n\t\t\t}con=true;\n\t\t}\n\t\tSystem.out.println(max);\n\n\t}",
"main",
"{\n\t\t BufferedReader br = new BufferedReader(new\n\t\t InputStreamReader(System.in));\n\t\t//BufferedReader br = new BufferedReader(new FileReader(\"sample.txt\"));\n\n\t\tint n = Integer.parseInt(br.readLine());\n\t\tint[] in = new int[n];\n\t\tint max = Integer.MIN_VALUE;\n\t\tint mini = 0;\n\t\tint maxj=0;\n\t\tboolean con=false;\n\t\t\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tin[i] = Integer.parseInt(br.readLine());\n\t\t\n\n\t\tfor (int i = 0; i < n - 1; i++) {\n\t\t\tif (in[i] > in[mini])continue;\n\t\t\tfor (int j = i + 1; j < n; j++){\n\t\t\t\tif(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}\n\t\t\t}con=true;\n\t\t}\n\t\tSystem.out.println(max);\n\n\t}",
"BufferedReader br = new BufferedReader(new\n\t\t InputStreamReader(System.in));",
"br",
"new BufferedReader(new\n\t\t InputStreamReader(System.in))",
"int n = Integer.parseInt(br.readLine());",
"n",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int[] in = new int[n];",
"in",
"new int[n]",
"n",
"int max = Integer.MIN_VALUE;",
"max",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int mini = 0;",
"mini",
"0",
"int maxj=0;",
"maxj",
"0",
"boolean con=false;",
"con",
"false",
"for (int i = 0; i < n; i++)\n\t\t\tin[i] = Integer.parseInt(br.readLine());",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"in[i] = Integer.parseInt(br.readLine());",
"in[i] = Integer.parseInt(br.readLine())",
"in[i]",
"in",
"i",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"for (int i = 0; i < n - 1; i++) {\n\t\t\tif (in[i] > in[mini])continue;\n\t\t\tfor (int j = i + 1; j < n; j++){\n\t\t\t\tif(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}\n\t\t\t}con=true;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tif (in[i] > in[mini])continue;\n\t\t\tfor (int j = i + 1; j < n; j++){\n\t\t\t\tif(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}\n\t\t\t}con=true;\n\t\t}",
"{\n\t\t\tif (in[i] > in[mini])continue;\n\t\t\tfor (int j = i + 1; j < n; j++){\n\t\t\t\tif(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}\n\t\t\t}con=true;\n\t\t}",
"if (in[i] > in[mini])continue;",
"in[i] > in[mini]",
"in[i]",
"in",
"i",
"in[mini]",
"in",
"mini",
"continue;",
"for (int j = i + 1; j < n; j++){\n\t\t\t\tif(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}\n\t\t\t}",
"int j = i + 1;",
"int j = i + 1;",
"j",
"i + 1",
"i",
"1",
"j < n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}\n\t\t\t}",
"if(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}",
"i!=0&&con&&i<maxj",
"i!=0&&con&&i<maxj",
"i!=0",
"i",
"0",
"con",
"i<maxj",
"i",
"maxj",
"{\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}",
"mini=i",
"mini",
"i",
"max=in[maxj]-in[i]",
"max",
"in[maxj]-in[i]",
"in[maxj]",
"in",
"maxj",
"in[i]",
"in",
"i",
"break;",
"if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}",
"max+in[i]<in[j]",
"max+in[i]",
"max",
"in[i]",
"in",
"i",
"in[j]",
"in",
"j",
"{\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}",
"max=in[j]-in[i]",
"max",
"in[j]-in[i]",
"in[j]",
"in",
"j",
"in[i]",
"in",
"i",
"mini=i",
"mini",
"i",
"maxj=j",
"maxj",
"j",
"con=false",
"con",
"false",
"con=true",
"con",
"true",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main{\n\n\tpublic static void main(String[] args) throws NumberFormatException,\n\t\t\tIOException {\n\t\t BufferedReader br = new BufferedReader(new\n\t\t InputStreamReader(System.in));\n\t\t//BufferedReader br = new BufferedReader(new FileReader(\"sample.txt\"));\n\n\t\tint n = Integer.parseInt(br.readLine());\n\t\tint[] in = new int[n];\n\t\tint max = Integer.MIN_VALUE;\n\t\tint mini = 0;\n\t\tint maxj=0;\n\t\tboolean con=false;\n\t\t\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tin[i] = Integer.parseInt(br.readLine());\n\t\t\n\n\t\tfor (int i = 0; i < n - 1; i++) {\n\t\t\tif (in[i] > in[mini])continue;\n\t\t\tfor (int j = i + 1; j < n; j++){\n\t\t\t\tif(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}\n\t\t\t}con=true;\n\t\t}\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"public class Main{\n\n\tpublic static void main(String[] args) throws NumberFormatException,\n\t\t\tIOException {\n\t\t BufferedReader br = new BufferedReader(new\n\t\t InputStreamReader(System.in));\n\t\t//BufferedReader br = new BufferedReader(new FileReader(\"sample.txt\"));\n\n\t\tint n = Integer.parseInt(br.readLine());\n\t\tint[] in = new int[n];\n\t\tint max = Integer.MIN_VALUE;\n\t\tint mini = 0;\n\t\tint maxj=0;\n\t\tboolean con=false;\n\t\t\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tin[i] = Integer.parseInt(br.readLine());\n\t\t\n\n\t\tfor (int i = 0; i < n - 1; i++) {\n\t\t\tif (in[i] > in[mini])continue;\n\t\t\tfor (int j = i + 1; j < n; j++){\n\t\t\t\tif(i!=0&&con&&i<maxj){\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmax=in[maxj]-in[i];\n\t\t\t\t\tbreak;}\n\t\t\t\telse if(max+in[i]<in[j]){\n\t\t\t\t\tmax=in[j]-in[i];\n\t\t\t\t\tmini=i;\n\t\t\t\t\tmaxj=j;\n\t\t\t\t\tcon=false;\n\t\t\t\t}\n\t\t\t}con=true;\n\t\t}\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
//BufferedReader br = new BufferedReader(new FileReader("sample.txt"));
int n = Integer.parseInt(br.readLine());
int[] in = new int[n];
int max = Integer.MIN_VALUE;
int mini = 0;
int maxj=0;
boolean con=false;
for (int i = 0; i < n; i++)
in[i] = Integer.parseInt(br.readLine());
for (int i = 0; i < n - 1; i++) {
if (in[i] > in[mini])continue;
for (int j = i + 1; j < n; j++){
if(i!=0&&con&&i<maxj){
mini=i;
max=in[maxj]-in[i];
break;}
else if(max+in[i]<in[j]){
max=in[j]-in[i];
mini=i;
maxj=j;
con=false;
}
}con=true;
}
System.out.println(max);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
82,
11
],
[
82,
12
],
[
12,
13
],
[
12,
14
],
[
82,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
28,
30
],
[
17,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
17,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
54,
55
],
[
55,
56
],
[
48,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
59,
63
],
[
63,
64
],
[
63,
65
],
[
48,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
68,
72
],
[
17,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
15,
79
],
[
79,
80
],
[
0,
81
],
[
81,
82
],
[
81,
83
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\t\n\tprivate static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\n\t\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tint n = Integer.parseInt(br.readLine());\n\t\t\n\t\tint maxv = Integer.MIN_VALUE;\n\t\tint min = Integer.MAX_VALUE;\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint r = Integer.parseInt(br.readLine());\n\t\t\tmaxv = Math.max(maxv, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}\n\t\t\n\t\tSystem.out.println(maxv);\n\t\t\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\t\n\tprivate static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\n\t\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tint n = Integer.parseInt(br.readLine());\n\t\t\n\t\tint maxv = Integer.MIN_VALUE;\n\t\tint min = Integer.MAX_VALUE;\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint r = Integer.parseInt(br.readLine());\n\t\t\tmaxv = Math.max(maxv, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}\n\t\t\n\t\tSystem.out.println(maxv);\n\t\t\n\t}\n}",
"Main",
"private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tint n = Integer.parseInt(br.readLine());\n\t\t\n\t\tint maxv = Integer.MIN_VALUE;\n\t\tint min = Integer.MAX_VALUE;\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint r = Integer.parseInt(br.readLine());\n\t\t\tmaxv = Math.max(maxv, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}\n\t\t\n\t\tSystem.out.println(maxv);\n\t\t\n\t}",
"main",
"{\n\t\tint n = Integer.parseInt(br.readLine());\n\t\t\n\t\tint maxv = Integer.MIN_VALUE;\n\t\tint min = Integer.MAX_VALUE;\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint r = Integer.parseInt(br.readLine());\n\t\t\tmaxv = Math.max(maxv, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}\n\t\t\n\t\tSystem.out.println(maxv);\n\t\t\n\t}",
"int n = Integer.parseInt(br.readLine());",
"n",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int maxv = Integer.MIN_VALUE;",
"maxv",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int min = Integer.MAX_VALUE;",
"min",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"for(int i = 0; i < n; i++){\n\t\t\tint r = Integer.parseInt(br.readLine());\n\t\t\tmaxv = Math.max(maxv, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tint r = Integer.parseInt(br.readLine());\n\t\t\tmaxv = Math.max(maxv, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}",
"{\n\t\t\tint r = Integer.parseInt(br.readLine());\n\t\t\tmaxv = Math.max(maxv, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}",
"int r = Integer.parseInt(br.readLine());",
"r",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"maxv = Math.max(maxv, r - min)",
"maxv",
"Math.max(maxv, r - min)",
"Math.max",
"Math",
"maxv",
"r - min",
"r",
"min",
"min = Math.min(min, r)",
"min",
"Math.min(min, r)",
"Math.min",
"Math",
"min",
"r",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String[] args",
"args",
"public class Main {\n\t\n\tprivate static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\n\t\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tint n = Integer.parseInt(br.readLine());\n\t\t\n\t\tint maxv = Integer.MIN_VALUE;\n\t\tint min = Integer.MAX_VALUE;\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint r = Integer.parseInt(br.readLine());\n\t\t\tmaxv = Math.max(maxv, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}\n\t\t\n\t\tSystem.out.println(maxv);\n\t\t\n\t}\n}",
"public class Main {\n\t\n\tprivate static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\n\t\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tint n = Integer.parseInt(br.readLine());\n\t\t\n\t\tint maxv = Integer.MIN_VALUE;\n\t\tint min = Integer.MAX_VALUE;\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint r = Integer.parseInt(br.readLine());\n\t\t\tmaxv = Math.max(maxv, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}\n\t\t\n\t\tSystem.out.println(maxv);\n\t\t\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) throws NumberFormatException, IOException {
int n = Integer.parseInt(br.readLine());
int maxv = Integer.MIN_VALUE;
int min = Integer.MAX_VALUE;
for(int i = 0; i < n; i++){
int r = Integer.parseInt(br.readLine());
maxv = Math.max(maxv, r - min);
min = Math.min(min, r);
}
System.out.println(maxv);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
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,
4,
18,
13,
41,
13,
18,
13,
17,
41,
13,
2,
18,
13,
17,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
103,
5
],
[
103,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
8,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
8,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
58,
60
],
[
8,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
76,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
73,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
87,
91
],
[
91,
92
],
[
91,
93
],
[
8,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
6,
100
],
[
100,
101
],
[
0,
102
],
[
102,
103
],
[
102,
104
]
] | [
"import java.util.Scanner;\n\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int count = Integer.parseInt(sc.nextLine());\n\n int[] rates = new int[count];\n for (int i = 0; i < count; i++) {\n \trates[i] = Integer.parseInt(sc.nextLine());\n }\n\n int min = rates[0];\n int max = rates[1] - rates[0];\n for (int i = 1; i < count; i++) {\n \tmax = Math.max(max, rates[i] - min);\n \tmin = Math.min(min, rates[i]);\n }\n\n System.out.println(max);\n }\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int count = Integer.parseInt(sc.nextLine());\n\n int[] rates = new int[count];\n for (int i = 0; i < count; i++) {\n \trates[i] = Integer.parseInt(sc.nextLine());\n }\n\n int min = rates[0];\n int max = rates[1] - rates[0];\n for (int i = 1; i < count; i++) {\n \tmax = Math.max(max, rates[i] - min);\n \tmin = Math.min(min, rates[i]);\n }\n\n System.out.println(max);\n }\n\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int count = Integer.parseInt(sc.nextLine());\n\n int[] rates = new int[count];\n for (int i = 0; i < count; i++) {\n \trates[i] = Integer.parseInt(sc.nextLine());\n }\n\n int min = rates[0];\n int max = rates[1] - rates[0];\n for (int i = 1; i < count; i++) {\n \tmax = Math.max(max, rates[i] - min);\n \tmin = Math.min(min, rates[i]);\n }\n\n System.out.println(max);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int count = Integer.parseInt(sc.nextLine());\n\n int[] rates = new int[count];\n for (int i = 0; i < count; i++) {\n \trates[i] = Integer.parseInt(sc.nextLine());\n }\n\n int min = rates[0];\n int max = rates[1] - rates[0];\n for (int i = 1; i < count; i++) {\n \tmax = Math.max(max, rates[i] - min);\n \tmin = Math.min(min, rates[i]);\n }\n\n System.out.println(max);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int count = Integer.parseInt(sc.nextLine());",
"count",
"Integer.parseInt(sc.nextLine())",
"Integer.parseInt",
"Integer",
"sc.nextLine()",
"sc.nextLine",
"sc",
"int[] rates = new int[count];",
"rates",
"new int[count]",
"count",
"for (int i = 0; i < count; i++) {\n \trates[i] = Integer.parseInt(sc.nextLine());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < count",
"i",
"count",
"i++",
"i++",
"i",
"{\n \trates[i] = Integer.parseInt(sc.nextLine());\n }",
"{\n \trates[i] = Integer.parseInt(sc.nextLine());\n }",
"rates[i] = Integer.parseInt(sc.nextLine())",
"rates[i]",
"rates",
"i",
"Integer.parseInt(sc.nextLine())",
"Integer.parseInt",
"Integer",
"sc.nextLine()",
"sc.nextLine",
"sc",
"int min = rates[0];",
"min",
"rates[0]",
"rates",
"0",
"int max = rates[1] - rates[0];",
"max",
"rates[1] - rates[0]",
"rates[1]",
"rates",
"1",
"rates[0]",
"rates",
"0",
"for (int i = 1; i < count; i++) {\n \tmax = Math.max(max, rates[i] - min);\n \tmin = Math.min(min, rates[i]);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < count",
"i",
"count",
"i++",
"i++",
"i",
"{\n \tmax = Math.max(max, rates[i] - min);\n \tmin = Math.min(min, rates[i]);\n }",
"{\n \tmax = Math.max(max, rates[i] - min);\n \tmin = Math.min(min, rates[i]);\n }",
"max = Math.max(max, rates[i] - min)",
"max",
"Math.max(max, rates[i] - min)",
"Math.max",
"Math",
"max",
"rates[i] - min",
"rates[i]",
"rates",
"i",
"min",
"min = Math.min(min, rates[i])",
"min",
"Math.min(min, rates[i])",
"Math.min",
"Math",
"min",
"rates[i]",
"rates",
"i",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int count = Integer.parseInt(sc.nextLine());\n\n int[] rates = new int[count];\n for (int i = 0; i < count; i++) {\n \trates[i] = Integer.parseInt(sc.nextLine());\n }\n\n int min = rates[0];\n int max = rates[1] - rates[0];\n for (int i = 1; i < count; i++) {\n \tmax = Math.max(max, rates[i] - min);\n \tmin = Math.min(min, rates[i]);\n }\n\n System.out.println(max);\n }\n\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int count = Integer.parseInt(sc.nextLine());\n\n int[] rates = new int[count];\n for (int i = 0; i < count; i++) {\n \trates[i] = Integer.parseInt(sc.nextLine());\n }\n\n int min = rates[0];\n int max = rates[1] - rates[0];\n for (int i = 1; i < count; i++) {\n \tmax = Math.max(max, rates[i] - min);\n \tmin = Math.min(min, rates[i]);\n }\n\n System.out.println(max);\n }\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int count = Integer.parseInt(sc.nextLine());
int[] rates = new int[count];
for (int i = 0; i < count; i++) {
rates[i] = Integer.parseInt(sc.nextLine());
}
int min = rates[0];
int max = rates[1] - rates[0];
for (int i = 1; i < count; i++) {
max = Math.max(max, rates[i] - min);
min = Math.min(min, rates[i]);
}
System.out.println(max);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
0,
13,
4,
18,
13,
41,
13,
17,
41,
13,
40,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
8,
2,
13,
17,
40,
17,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
77,
5
],
[
77,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
28,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
40,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
48,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
54,
58
],
[
58,
59
],
[
58,
60
],
[
40,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
63,
67
],
[
8,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
6,
74
],
[
74,
75
],
[
0,
76
],
[
76,
77
],
[
76,
78
]
] | [
"import java.util.*;\npublic class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int iniNum, RiNum;\n iniNum = scan.nextInt();\n int buyPrice=1000000001, maxProfit=-1000000001;\n \n for(int i=0; i<iniNum; i++){\n RiNum = scan.nextInt();\n\n maxProfit= i==0? -1000000000: Math.max(maxProfit,RiNum-buyPrice);\n buyPrice=Math.min(buyPrice,RiNum);\n\n }\n System.out.println(maxProfit); \n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int iniNum, RiNum;\n iniNum = scan.nextInt();\n int buyPrice=1000000001, maxProfit=-1000000001;\n \n for(int i=0; i<iniNum; i++){\n RiNum = scan.nextInt();\n\n maxProfit= i==0? -1000000000: Math.max(maxProfit,RiNum-buyPrice);\n buyPrice=Math.min(buyPrice,RiNum);\n\n }\n System.out.println(maxProfit); \n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int iniNum, RiNum;\n iniNum = scan.nextInt();\n int buyPrice=1000000001, maxProfit=-1000000001;\n \n for(int i=0; i<iniNum; i++){\n RiNum = scan.nextInt();\n\n maxProfit= i==0? -1000000000: Math.max(maxProfit,RiNum-buyPrice);\n buyPrice=Math.min(buyPrice,RiNum);\n\n }\n System.out.println(maxProfit); \n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int iniNum, RiNum;\n iniNum = scan.nextInt();\n int buyPrice=1000000001, maxProfit=-1000000001;\n \n for(int i=0; i<iniNum; i++){\n RiNum = scan.nextInt();\n\n maxProfit= i==0? -1000000000: Math.max(maxProfit,RiNum-buyPrice);\n buyPrice=Math.min(buyPrice,RiNum);\n\n }\n System.out.println(maxProfit); \n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int iniNum",
"iniNum",
"RiNum;",
"RiNum",
"iniNum = scan.nextInt()",
"iniNum",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int buyPrice=1000000001",
"buyPrice",
"1000000001",
"maxProfit=-1000000001;",
"maxProfit",
"-1000000001",
"1000000001",
"for(int i=0; i<iniNum; i++){\n RiNum = scan.nextInt();\n\n maxProfit= i==0? -1000000000: Math.max(maxProfit,RiNum-buyPrice);\n buyPrice=Math.min(buyPrice,RiNum);\n\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<iniNum",
"i",
"iniNum",
"i++",
"i++",
"i",
"{\n RiNum = scan.nextInt();\n\n maxProfit= i==0? -1000000000: Math.max(maxProfit,RiNum-buyPrice);\n buyPrice=Math.min(buyPrice,RiNum);\n\n }",
"{\n RiNum = scan.nextInt();\n\n maxProfit= i==0? -1000000000: Math.max(maxProfit,RiNum-buyPrice);\n buyPrice=Math.min(buyPrice,RiNum);\n\n }",
"RiNum = scan.nextInt()",
"RiNum",
"scan.nextInt()",
"scan.nextInt",
"scan",
"maxProfit= i==0? -1000000000: Math.max(maxProfit,RiNum-buyPrice)",
"maxProfit",
"i==0? -1000000000: Math.max(maxProfit,RiNum-buyPrice)",
"i==0",
"i",
"0",
"-1000000000",
"1000000000",
"Math.max(maxProfit,RiNum-buyPrice)",
"Math.max",
"Math",
"maxProfit",
"RiNum-buyPrice",
"RiNum",
"buyPrice",
"buyPrice=Math.min(buyPrice,RiNum)",
"buyPrice",
"Math.min(buyPrice,RiNum)",
"Math.min",
"Math",
"buyPrice",
"RiNum",
"System.out.println(maxProfit)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxProfit",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int iniNum, RiNum;\n iniNum = scan.nextInt();\n int buyPrice=1000000001, maxProfit=-1000000001;\n \n for(int i=0; i<iniNum; i++){\n RiNum = scan.nextInt();\n\n maxProfit= i==0? -1000000000: Math.max(maxProfit,RiNum-buyPrice);\n buyPrice=Math.min(buyPrice,RiNum);\n\n }\n System.out.println(maxProfit); \n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int iniNum, RiNum;\n iniNum = scan.nextInt();\n int buyPrice=1000000001, maxProfit=-1000000001;\n \n for(int i=0; i<iniNum; i++){\n RiNum = scan.nextInt();\n\n maxProfit= i==0? -1000000000: Math.max(maxProfit,RiNum-buyPrice);\n buyPrice=Math.min(buyPrice,RiNum);\n\n }\n System.out.println(maxProfit); \n }\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int iniNum, RiNum;
iniNum = scan.nextInt();
int buyPrice=1000000001, maxProfit=-1000000001;
for(int i=0; i<iniNum; i++){
RiNum = scan.nextInt();
maxProfit= i==0? -1000000000: Math.max(maxProfit,RiNum-buyPrice);
buyPrice=Math.min(buyPrice,RiNum);
}
System.out.println(maxProfit);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
13,
9,
41,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
94,
11
],
[
94,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
28,
30
],
[
14,
31
],
[
31,
32
],
[
31,
33
],
[
14,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
52,
53
],
[
53,
54
],
[
46,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
46,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
46,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
46,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
14,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
12,
91
],
[
91,
92
],
[
0,
93
],
[
93,
94
],
[
93,
95
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int max = Integer.MIN_VALUE;\n int prospectMin = 0;\n for (int i = 0; i < n; i++) {\n int a = Integer.parseInt(br.readLine());\n if (i == 0) {\n prospectMin = a;\n continue;\n }\n int profit = a - prospectMin;\n if (profit > max) {\n max = profit;\n }\n if (a < prospectMin) {\n prospectMin = a;\n }\n }\n System.out.println(max);\n\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int max = Integer.MIN_VALUE;\n int prospectMin = 0;\n for (int i = 0; i < n; i++) {\n int a = Integer.parseInt(br.readLine());\n if (i == 0) {\n prospectMin = a;\n continue;\n }\n int profit = a - prospectMin;\n if (profit > max) {\n max = profit;\n }\n if (a < prospectMin) {\n prospectMin = a;\n }\n }\n System.out.println(max);\n\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int max = Integer.MIN_VALUE;\n int prospectMin = 0;\n for (int i = 0; i < n; i++) {\n int a = Integer.parseInt(br.readLine());\n if (i == 0) {\n prospectMin = a;\n continue;\n }\n int profit = a - prospectMin;\n if (profit > max) {\n max = profit;\n }\n if (a < prospectMin) {\n prospectMin = a;\n }\n }\n System.out.println(max);\n\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int max = Integer.MIN_VALUE;\n int prospectMin = 0;\n for (int i = 0; i < n; i++) {\n int a = Integer.parseInt(br.readLine());\n if (i == 0) {\n prospectMin = a;\n continue;\n }\n int profit = a - prospectMin;\n if (profit > max) {\n max = profit;\n }\n if (a < prospectMin) {\n prospectMin = a;\n }\n }\n System.out.println(max);\n\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int n = Integer.parseInt(br.readLine());",
"n",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int max = Integer.MIN_VALUE;",
"max",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int prospectMin = 0;",
"prospectMin",
"0",
"for (int i = 0; i < n; i++) {\n int a = Integer.parseInt(br.readLine());\n if (i == 0) {\n prospectMin = a;\n continue;\n }\n int profit = a - prospectMin;\n if (profit > max) {\n max = profit;\n }\n if (a < prospectMin) {\n prospectMin = a;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n int a = Integer.parseInt(br.readLine());\n if (i == 0) {\n prospectMin = a;\n continue;\n }\n int profit = a - prospectMin;\n if (profit > max) {\n max = profit;\n }\n if (a < prospectMin) {\n prospectMin = a;\n }\n }",
"{\n int a = Integer.parseInt(br.readLine());\n if (i == 0) {\n prospectMin = a;\n continue;\n }\n int profit = a - prospectMin;\n if (profit > max) {\n max = profit;\n }\n if (a < prospectMin) {\n prospectMin = a;\n }\n }",
"int a = Integer.parseInt(br.readLine());",
"a",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"if (i == 0) {\n prospectMin = a;\n continue;\n }",
"i == 0",
"i",
"0",
"{\n prospectMin = a;\n continue;\n }",
"prospectMin = a",
"prospectMin",
"a",
"continue;",
"int profit = a - prospectMin;",
"profit",
"a - prospectMin",
"a",
"prospectMin",
"if (profit > max) {\n max = profit;\n }",
"profit > max",
"profit",
"max",
"{\n max = profit;\n }",
"max = profit",
"max",
"profit",
"if (a < prospectMin) {\n prospectMin = a;\n }",
"a < prospectMin",
"a",
"prospectMin",
"{\n prospectMin = a;\n }",
"prospectMin = a",
"prospectMin",
"a",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int max = Integer.MIN_VALUE;\n int prospectMin = 0;\n for (int i = 0; i < n; i++) {\n int a = Integer.parseInt(br.readLine());\n if (i == 0) {\n prospectMin = a;\n continue;\n }\n int profit = a - prospectMin;\n if (profit > max) {\n max = profit;\n }\n if (a < prospectMin) {\n prospectMin = a;\n }\n }\n System.out.println(max);\n\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int n = Integer.parseInt(br.readLine());\n int max = Integer.MIN_VALUE;\n int prospectMin = 0;\n for (int i = 0; i < n; i++) {\n int a = Integer.parseInt(br.readLine());\n if (i == 0) {\n prospectMin = a;\n continue;\n }\n int profit = a - prospectMin;\n if (profit > max) {\n max = profit;\n }\n if (a < prospectMin) {\n prospectMin = a;\n }\n }\n System.out.println(max);\n\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int max = Integer.MIN_VALUE;
int prospectMin = 0;
for (int i = 0; i < n; i++) {
int a = Integer.parseInt(br.readLine());
if (i == 0) {
prospectMin = a;
continue;
}
int profit = a - prospectMin;
if (profit > max) {
max = profit;
}
if (a < prospectMin) {
prospectMin = a;
}
}
System.out.println(max);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
12,
13,
30,
41,
13,
18,
13,
17,
41,
13,
2,
18,
13,
17,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
0,
13,
13,
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,
20,
0,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
13,
13,
13,
18,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
4,
8
],
[
8,
9
],
[
8,
10
],
[
4,
12
],
[
12,
13
],
[
4,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
19,
21
],
[
16,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
24,
28
],
[
28,
29
],
[
28,
30
],
[
16,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
43,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
57,
61
],
[
61,
62
],
[
61,
63
],
[
16,
64
],
[
64,
65
],
[
64,
66
],
[
0,
67
],
[
151,
68
],
[
151,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
71,
80
],
[
80,
81
],
[
80,
82
],
[
71,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
84,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
102,
103
],
[
71,
104
],
[
104,
105
],
[
104,
106
],
[
71,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
71,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
117,
118
],
[
117,
119
],
[
112,
120
],
[
120,
121
],
[
121,
122
],
[
112,
123
],
[
124,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
125,
131
],
[
131,
132
],
[
131,
133
],
[
71,
134
],
[
134,
135
],
[
135,
136
],
[
71,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
142,
143
],
[
142,
144
],
[
71,
145
],
[
145,
146
],
[
146,
147
],
[
69,
148
],
[
148,
149
],
[
0,
150
],
[
150,
151
],
[
150,
152
]
] | [
"import java.util.Scanner;\nclass Fx{\n\tint a;\n\tint [] p=new int[200000];\n\tint ans;\n\tvoid rieki() {\n\t\tint minv=p[0];\n\t\tint maxv=p[1]-p[0];\n\t\tfor(int j=1;j<a;j++) {\n\t\t\tmaxv=Math.max(maxv, p[j]-minv);\n\t\t\tminv=Math.min(minv,p[j]);\n\t\t}\n\t\tans=maxv;\n\t}\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 [] s=new int [n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ts[i]=sc.nextInt();\n\t\t}\n\t\tFx f=new Fx();\n\t\tf.a=n;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tf.p[i]=s[i];\n\n\t\t}\n\t\tf.rieki();\n\t\tSystem.out.println(f.ans);\n\t\tsc.close();\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Fx{\n\tint a;\n\tint [] p=new int[200000];\n\tint ans;\n\tvoid rieki() {\n\t\tint minv=p[0];\n\t\tint maxv=p[1]-p[0];\n\t\tfor(int j=1;j<a;j++) {\n\t\t\tmaxv=Math.max(maxv, p[j]-minv);\n\t\t\tminv=Math.min(minv,p[j]);\n\t\t}\n\t\tans=maxv;\n\t}\n}",
"Fx",
"int a;",
"a",
"int [] p=new int[200000];",
"p",
"new int[200000]",
"200000",
"int ans;",
"ans",
"void rieki() {\n\t\tint minv=p[0];\n\t\tint maxv=p[1]-p[0];\n\t\tfor(int j=1;j<a;j++) {\n\t\t\tmaxv=Math.max(maxv, p[j]-minv);\n\t\t\tminv=Math.min(minv,p[j]);\n\t\t}\n\t\tans=maxv;\n\t}",
"rieki",
"{\n\t\tint minv=p[0];\n\t\tint maxv=p[1]-p[0];\n\t\tfor(int j=1;j<a;j++) {\n\t\t\tmaxv=Math.max(maxv, p[j]-minv);\n\t\t\tminv=Math.min(minv,p[j]);\n\t\t}\n\t\tans=maxv;\n\t}",
"int minv=p[0];",
"minv",
"p[0]",
"p",
"0",
"int maxv=p[1]-p[0];",
"maxv",
"p[1]-p[0]",
"p[1]",
"p",
"1",
"p[0]",
"p",
"0",
"for(int j=1;j<a;j++) {\n\t\t\tmaxv=Math.max(maxv, p[j]-minv);\n\t\t\tminv=Math.min(minv,p[j]);\n\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<a",
"j",
"a",
"j++",
"j++",
"j",
"{\n\t\t\tmaxv=Math.max(maxv, p[j]-minv);\n\t\t\tminv=Math.min(minv,p[j]);\n\t\t}",
"{\n\t\t\tmaxv=Math.max(maxv, p[j]-minv);\n\t\t\tminv=Math.min(minv,p[j]);\n\t\t}",
"maxv=Math.max(maxv, p[j]-minv)",
"maxv",
"Math.max(maxv, p[j]-minv)",
"Math.max",
"Math",
"maxv",
"p[j]-minv",
"p[j]",
"p",
"j",
"minv",
"minv=Math.min(minv,p[j])",
"minv",
"Math.min(minv,p[j])",
"Math.min",
"Math",
"minv",
"p[j]",
"p",
"j",
"ans=maxv",
"ans",
"maxv",
"public 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 [] s=new int [n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ts[i]=sc.nextInt();\n\t\t}\n\t\tFx f=new Fx();\n\t\tf.a=n;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tf.p[i]=s[i];\n\n\t\t}\n\t\tf.rieki();\n\t\tSystem.out.println(f.ans);\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint [] s=new int [n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ts[i]=sc.nextInt();\n\t\t}\n\t\tFx f=new Fx();\n\t\tf.a=n;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tf.p[i]=s[i];\n\n\t\t}\n\t\tf.rieki();\n\t\tSystem.out.println(f.ans);\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint [] s=new int [n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ts[i]=sc.nextInt();\n\t\t}\n\t\tFx f=new Fx();\n\t\tf.a=n;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tf.p[i]=s[i];\n\n\t\t}\n\t\tf.rieki();\n\t\tSystem.out.println(f.ans);\n\t\tsc.close();\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int [] s=new int [n];",
"s",
"new int [n]",
"n",
"for(int i=0;i<n;i++) {\n\t\t\ts[i]=sc.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ts[i]=sc.nextInt();\n\t\t}",
"{\n\t\t\ts[i]=sc.nextInt();\n\t\t}",
"s[i]=sc.nextInt()",
"s[i]",
"s",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Fx f=new Fx();",
"f",
"new Fx()",
"f.a=n",
"f.a",
"f",
"f.a",
"n",
"for(int i=0;i<n;i++) {\n\t\t\tf.p[i]=s[i];\n\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tf.p[i]=s[i];\n\n\t\t}",
"{\n\t\t\tf.p[i]=s[i];\n\n\t\t}",
"f.p[i]=s[i]",
"f.p[i]",
"f.p",
"f",
"f.p",
"i",
"s[i]",
"s",
"i",
"f.rieki()",
"f.rieki",
"f",
"System.out.println(f.ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"f.ans",
"f",
"f.ans",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public 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 [] s=new int [n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ts[i]=sc.nextInt();\n\t\t}\n\t\tFx f=new Fx();\n\t\tf.a=n;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tf.p[i]=s[i];\n\n\t\t}\n\t\tf.rieki();\n\t\tSystem.out.println(f.ans);\n\t\tsc.close();\n\t}\n}",
"public 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 [] s=new int [n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ts[i]=sc.nextInt();\n\t\t}\n\t\tFx f=new Fx();\n\t\tf.a=n;\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tf.p[i]=s[i];\n\n\t\t}\n\t\tf.rieki();\n\t\tSystem.out.println(f.ans);\n\t\tsc.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
class Fx{
int a;
int [] p=new int[200000];
int ans;
void rieki() {
int minv=p[0];
int maxv=p[1]-p[0];
for(int j=1;j<a;j++) {
maxv=Math.max(maxv, p[j]-minv);
minv=Math.min(minv,p[j]);
}
ans=maxv;
}
}
public class Main{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int [] s=new int [n];
for(int i=0;i<n;i++) {
s[i]=sc.nextInt();
}
Fx f=new Fx();
f.a=n;
for(int i=0;i<n;i++) {
f.p[i]=s[i];
}
f.rieki();
System.out.println(f.ans);
sc.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
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,
18,
13,
17,
41,
13,
40,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
12,
13,
30,
4,
18,
20,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
100,
5
],
[
100,
6
],
[
6,
7
],
[
6,
8
],
[
100,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
11,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
11,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
11,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
11,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
67,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
64,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
78,
82
],
[
82,
83
],
[
82,
84
],
[
11,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
100,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
91,
97
],
[
97,
98
],
[
0,
99
],
[
99,
100
],
[
99,
101
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tScanner sc = new Scanner(System.in);\n\n\tvoid run() {\n\t\tint n = sc.nextInt();\n\t\tint[] R = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n\t\tint min = R[0];\n\t\tint ans = -Integer.MAX_VALUE;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tans = Math.max(ans, R[i] - min);\n\t\t\tmin = Math.min(min, R[i]);\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tScanner sc = new Scanner(System.in);\n\n\tvoid run() {\n\t\tint n = sc.nextInt();\n\t\tint[] R = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n\t\tint min = R[0];\n\t\tint ans = -Integer.MAX_VALUE;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tans = Math.max(ans, R[i] - min);\n\t\t\tmin = Math.min(min, R[i]);\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"Main",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"void run() {\n\t\tint n = sc.nextInt();\n\t\tint[] R = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n\t\tint min = R[0];\n\t\tint ans = -Integer.MAX_VALUE;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tans = Math.max(ans, R[i] - min);\n\t\t\tmin = Math.min(min, R[i]);\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"run",
"{\n\t\tint n = sc.nextInt();\n\t\tint[] R = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n\t\tint min = R[0];\n\t\tint ans = -Integer.MAX_VALUE;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tans = Math.max(ans, R[i] - min);\n\t\t\tmin = Math.min(min, R[i]);\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] R = new int[n];",
"R",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tR[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tR[i] = sc.nextInt();\n\t\t}",
"R[i] = sc.nextInt()",
"R[i]",
"R",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int min = R[0];",
"min",
"R[0]",
"R",
"0",
"int ans = -Integer.MAX_VALUE;",
"ans",
"-Integer.MAX_VALUE",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"for (int i = 1; i < n; i++) {\n\t\t\tans = Math.max(ans, R[i] - min);\n\t\t\tmin = Math.min(min, R[i]);\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tans = Math.max(ans, R[i] - min);\n\t\t\tmin = Math.min(min, R[i]);\n\t\t}",
"{\n\t\t\tans = Math.max(ans, R[i] - min);\n\t\t\tmin = Math.min(min, R[i]);\n\t\t}",
"ans = Math.max(ans, R[i] - min)",
"ans",
"Math.max(ans, R[i] - min)",
"Math.max",
"Math",
"ans",
"R[i] - min",
"R[i]",
"R",
"i",
"min",
"min = Math.min(min, R[i])",
"min",
"Math.min(min, R[i])",
"Math.min",
"Math",
"min",
"R[i]",
"R",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"public static void main(String[] args) {\n\t\tnew Main().run();\n\t}",
"main",
"{\n\t\tnew Main().run();\n\t}",
"new Main().run()",
"new Main().run",
"new Main()",
"String[] args",
"args",
"public class Main {\n\tScanner sc = new Scanner(System.in);\n\n\tvoid run() {\n\t\tint n = sc.nextInt();\n\t\tint[] R = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n\t\tint min = R[0];\n\t\tint ans = -Integer.MAX_VALUE;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tans = Math.max(ans, R[i] - min);\n\t\t\tmin = Math.min(min, R[i]);\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"public class Main {\n\tScanner sc = new Scanner(System.in);\n\n\tvoid run() {\n\t\tint n = sc.nextInt();\n\t\tint[] R = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tR[i] = sc.nextInt();\n\t\t}\n\t\tint min = R[0];\n\t\tint ans = -Integer.MAX_VALUE;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tans = Math.max(ans, R[i] - min);\n\t\t\tmin = Math.min(min, R[i]);\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
Scanner sc = new Scanner(System.in);
void run() {
int n = sc.nextInt();
int[] R = new int[n];
for (int i = 0; i < n; i++) {
R[i] = sc.nextInt();
}
int min = R[0];
int ans = -Integer.MAX_VALUE;
for (int i = 1; i < n; i++) {
ans = Math.max(ans, R[i] - min);
min = Math.min(min, R[i]);
}
System.out.println(ans);
}
public static void main(String[] args) {
new Main().run();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
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,
4,
18,
13,
41,
13,
20,
2,
13,
17,
41,
13,
20,
2,
13,
17,
41,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
17,
30,
0,
18,
13,
17,
18,
13,
17,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
2,
13,
17,
18,
13,
13,
11,
1,
41,
13,
2,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
2,
13,
17,
30,
0,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
2,
18,
13,
13,
18,
13,
13,
41,
13,
40,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
8,
47
],
[
47,
48
],
[
47,
49
],
[
50,
51
],
[
50,
52
],
[
8,
53
],
[
53,
54
],
[
53,
55
],
[
56,
57
],
[
56,
58
],
[
8,
59
],
[
59,
60
],
[
59,
61
],
[
62,
63
],
[
62,
64
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
65,
75
],
[
75,
76
],
[
76,
77
],
[
65,
78
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
89,
91
],
[
80,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
97,
105
],
[
105,
106
],
[
105,
107
],
[
8,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
112,
114
],
[
108,
115
],
[
115,
116
],
[
115,
117
],
[
108,
118
],
[
118,
119
],
[
119,
120
],
[
108,
121
],
[
122,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
128
],
[
123,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
133,
135
],
[
130,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
138,
140
],
[
123,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
151,
153
],
[
146,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
156,
158
],
[
8,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
159,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
166,
168
],
[
159,
169
],
[
169,
170
],
[
170,
171
],
[
159,
172
],
[
173,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
174,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
178,
182
],
[
182,
183
],
[
182,
184
],
[
8,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
8,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
189,
194
],
[
194,
195
],
[
194,
196
],
[
196,
197
],
[
196,
198
],
[
189,
199
],
[
199,
200
],
[
200,
201
],
[
189,
202
],
[
203,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
207,
208
],
[
206,
209
],
[
206,
210
],
[
210,
211
],
[
210,
212
],
[
8,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
213,
218
],
[
6,
219
],
[
219,
220
]
] | [
"import java.util.Scanner;\n\nclass Main {\n\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n int n = Integer.parseInt(scan.nextLine());\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = Integer.parseInt(scan.nextLine());\n }\n \n int[] max = new int[n-1];\n int[] min = new int[n-1];\n int[] dif = new int[n-1];\n\n for(int i=0; i<n-1; i++){\n if(i==0){min[0]=a[0];}\n else{min[i] = Math.min(min[i-1], a[i]);}\n } \n \n for(int i=n-2; i>=0; i--){\n if(i==n-2){max[n-2]=a[n-1];}\n else{max[i] = Math.max(max[i+1], a[i+1]);} \n } \n \n for(int i=0; i<n-1; i++){\n dif[i] = max[i]-min[i]; \n }\n \n int maximum = -1000000000;\n \n for(int i=0; i<n-1; i++){\n maximum = Math.max(maximum, dif[i]);\n }\n \n System.out.println(maximum);\n }\n \n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\n public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n int n = Integer.parseInt(scan.nextLine());\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = Integer.parseInt(scan.nextLine());\n }\n \n int[] max = new int[n-1];\n int[] min = new int[n-1];\n int[] dif = new int[n-1];\n\n for(int i=0; i<n-1; i++){\n if(i==0){min[0]=a[0];}\n else{min[i] = Math.min(min[i-1], a[i]);}\n } \n \n for(int i=n-2; i>=0; i--){\n if(i==n-2){max[n-2]=a[n-1];}\n else{max[i] = Math.max(max[i+1], a[i+1]);} \n } \n \n for(int i=0; i<n-1; i++){\n dif[i] = max[i]-min[i]; \n }\n \n int maximum = -1000000000;\n \n for(int i=0; i<n-1; i++){\n maximum = Math.max(maximum, dif[i]);\n }\n \n System.out.println(maximum);\n }\n \n}",
"Main",
"public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n int n = Integer.parseInt(scan.nextLine());\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = Integer.parseInt(scan.nextLine());\n }\n \n int[] max = new int[n-1];\n int[] min = new int[n-1];\n int[] dif = new int[n-1];\n\n for(int i=0; i<n-1; i++){\n if(i==0){min[0]=a[0];}\n else{min[i] = Math.min(min[i-1], a[i]);}\n } \n \n for(int i=n-2; i>=0; i--){\n if(i==n-2){max[n-2]=a[n-1];}\n else{max[i] = Math.max(max[i+1], a[i+1]);} \n } \n \n for(int i=0; i<n-1; i++){\n dif[i] = max[i]-min[i]; \n }\n \n int maximum = -1000000000;\n \n for(int i=0; i<n-1; i++){\n maximum = Math.max(maximum, dif[i]);\n }\n \n System.out.println(maximum);\n }",
"main",
"{\n\n Scanner scan = new Scanner(System.in);\n int n = Integer.parseInt(scan.nextLine());\n int[] a = new int[n];\n for(int i=0; i<n; i++){\n a[i] = Integer.parseInt(scan.nextLine());\n }\n \n int[] max = new int[n-1];\n int[] min = new int[n-1];\n int[] dif = new int[n-1];\n\n for(int i=0; i<n-1; i++){\n if(i==0){min[0]=a[0];}\n else{min[i] = Math.min(min[i-1], a[i]);}\n } \n \n for(int i=n-2; i>=0; i--){\n if(i==n-2){max[n-2]=a[n-1];}\n else{max[i] = Math.max(max[i+1], a[i+1]);} \n } \n \n for(int i=0; i<n-1; i++){\n dif[i] = max[i]-min[i]; \n }\n \n int maximum = -1000000000;\n \n for(int i=0; i<n-1; i++){\n maximum = Math.max(maximum, dif[i]);\n }\n \n System.out.println(maximum);\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = Integer.parseInt(scan.nextLine());",
"n",
"Integer.parseInt(scan.nextLine())",
"Integer.parseInt",
"Integer",
"scan.nextLine()",
"scan.nextLine",
"scan",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for(int i=0; i<n; i++){\n a[i] = Integer.parseInt(scan.nextLine());\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = Integer.parseInt(scan.nextLine());\n }",
"{\n a[i] = Integer.parseInt(scan.nextLine());\n }",
"a[i] = Integer.parseInt(scan.nextLine())",
"a[i]",
"a",
"i",
"Integer.parseInt(scan.nextLine())",
"Integer.parseInt",
"Integer",
"scan.nextLine()",
"scan.nextLine",
"scan",
"int[] max = new int[n-1];",
"max",
"new int[n-1]",
"n-1",
"n",
"1",
"int[] min = new int[n-1];",
"min",
"new int[n-1]",
"n-1",
"n",
"1",
"int[] dif = new int[n-1];",
"dif",
"new int[n-1]",
"n-1",
"n",
"1",
"for(int i=0; i<n-1; i++){\n if(i==0){min[0]=a[0];}\n else{min[i] = Math.min(min[i-1], a[i]);}\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n if(i==0){min[0]=a[0];}\n else{min[i] = Math.min(min[i-1], a[i]);}\n }",
"{\n if(i==0){min[0]=a[0];}\n else{min[i] = Math.min(min[i-1], a[i]);}\n }",
"if(i==0){min[0]=a[0];}\n else{min[i] = Math.min(min[i-1], a[i]);}",
"i==0",
"i",
"0",
"{min[0]=a[0];}",
"min[0]=a[0]",
"min[0]",
"min",
"0",
"a[0]",
"a",
"0",
"{min[i] = Math.min(min[i-1], a[i]);}",
"min[i] = Math.min(min[i-1], a[i])",
"min[i]",
"min",
"i",
"Math.min(min[i-1], a[i])",
"Math.min",
"Math",
"min[i-1]",
"min",
"i-1",
"i",
"1",
"a[i]",
"a",
"i",
"for(int i=n-2; i>=0; i--){\n if(i==n-2){max[n-2]=a[n-1];}\n else{max[i] = Math.max(max[i+1], a[i+1]);} \n }",
"int i=n-2;",
"int i=n-2;",
"i",
"n-2",
"n",
"2",
"i>=0",
"i",
"0",
"i--",
"i--",
"i",
"{\n if(i==n-2){max[n-2]=a[n-1];}\n else{max[i] = Math.max(max[i+1], a[i+1]);} \n }",
"{\n if(i==n-2){max[n-2]=a[n-1];}\n else{max[i] = Math.max(max[i+1], a[i+1]);} \n }",
"if(i==n-2){max[n-2]=a[n-1];}\n else{max[i] = Math.max(max[i+1], a[i+1]);}",
"i==n-2",
"i",
"n-2",
"n",
"2",
"{max[n-2]=a[n-1];}",
"max[n-2]=a[n-1]",
"max[n-2]",
"max",
"n-2",
"n",
"2",
"a[n-1]",
"a",
"n-1",
"n",
"1",
"{max[i] = Math.max(max[i+1], a[i+1]);}",
"max[i] = Math.max(max[i+1], a[i+1])",
"max[i]",
"max",
"i",
"Math.max(max[i+1], a[i+1])",
"Math.max",
"Math",
"max[i+1]",
"max",
"i+1",
"i",
"1",
"a[i+1]",
"a",
"i+1",
"i",
"1",
"for(int i=0; i<n-1; i++){\n dif[i] = max[i]-min[i]; \n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n dif[i] = max[i]-min[i]; \n }",
"{\n dif[i] = max[i]-min[i]; \n }",
"dif[i] = max[i]-min[i]",
"dif[i]",
"dif",
"i",
"max[i]-min[i]",
"max[i]",
"max",
"i",
"min[i]",
"min",
"i",
"int maximum = -1000000000;",
"maximum",
"-1000000000",
"1000000000",
"for(int i=0; i<n-1; i++){\n maximum = Math.max(maximum, dif[i]);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n maximum = Math.max(maximum, dif[i]);\n }",
"{\n maximum = Math.max(maximum, dif[i]);\n }",
"maximum = Math.max(maximum, dif[i])",
"maximum",
"Math.max(maximum, dif[i])",
"Math.max",
"Math",
"maximum",
"dif[i]",
"dif",
"i",
"System.out.println(maximum)",
"System.out.println",
"System.out",
"System",
"System.out",
"maximum",
"String[] args",
"args"
] | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = Integer.parseInt(scan.nextLine());
int[] a = new int[n];
for(int i=0; i<n; i++){
a[i] = Integer.parseInt(scan.nextLine());
}
int[] max = new int[n-1];
int[] min = new int[n-1];
int[] dif = new int[n-1];
for(int i=0; i<n-1; i++){
if(i==0){min[0]=a[0];}
else{min[i] = Math.min(min[i-1], a[i]);}
}
for(int i=n-2; i>=0; i--){
if(i==n-2){max[n-2]=a[n-1];}
else{max[i] = Math.max(max[i+1], a[i+1]);}
}
for(int i=0; i<n-1; i++){
dif[i] = max[i]-min[i];
}
int maximum = -1000000000;
for(int i=0; i<n-1; i++){
maximum = Math.max(maximum, dif[i]);
}
System.out.println(maximum);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
18,
13,
17,
41,
13,
40,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
13,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
17,
29,
17,
29,
17,
23,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
13,
13,
17,
4,
13,
18,
13,
2,
18,
13,
13,
17,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
4,
13,
17,
30,
4,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
220,
5
],
[
220,
6
],
[
6,
7
],
[
6,
8
],
[
220,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
11,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
38,
39
],
[
11,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
11,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
61,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
75,
79
],
[
79,
80
],
[
79,
81
],
[
11,
82
],
[
82,
83
],
[
82,
84
],
[
9,
85
],
[
85,
86
],
[
220,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
90,
100
],
[
100,
101
],
[
101,
102
],
[
90,
103
],
[
104,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
105,
111
],
[
111,
112
],
[
89,
113
],
[
113,
114
],
[
87,
115
],
[
115,
116
],
[
220,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
120,
126
],
[
126,
127
],
[
120,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
129,
132
],
[
132,
133
],
[
132,
134
],
[
117,
135
],
[
135,
136
],
[
117,
137
],
[
137,
138
],
[
220,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
142,
154
],
[
154,
155
],
[
155,
156
],
[
142,
157
],
[
158,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
159,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
141,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
173,
177
],
[
139,
178
],
[
178,
179
],
[
220,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
183,
188
],
[
180,
189
],
[
189,
190
],
[
220,
191
],
[
191,
192
],
[
191,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
194,
199
],
[
191,
200
],
[
200,
201
],
[
220,
202
],
[
202,
203
],
[
202,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
205,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
202,
217
],
[
217,
218
],
[
0,
219
],
[
219,
220
],
[
219,
221
]
] | [
"import java.util.*;\n \npublic class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\t\n\tpublic static void main(String[] args) {\n\t\tint m = sc.nextInt();\n\t\tint[] R = new int[m];\n\t\t\n\t\tfor(int i=0;i<m;i++) R[i] = sc.nextInt();\n\t\t\n\t\tint mn = R[0];\n\t\tint ret = -1000000001;\n\t\tfor(int i=1;i<m;i++){\n\t\t\tret = Math.max(ret, R[i]-mn);\n\t\t\tmn = Math.min(mn, R[i]);\n\t\t}\n\t\tcout(ret);\n\t}\n\t\n\t\n\t\n\tpublic static boolean isPrime(int n){\n\t\tfor(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}\n\t\treturn false;\n\t}\n\tpublic static int gcd(int a,int b){\n\t\tif(a%b==0) return b;\n\t\telse return gcd(b,a%b);\n\t}\n\tpublic static void showary(int[] ary){\n\t\tfor(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}\n\t\tcout(ary[ary.length-1]);\n\t}\n\tpublic static void cout(String n){\n\t\tSystem.out.println(n);\n\t}\n\t\n\tpublic static void cout(int n){\n\t\tSystem.out.println(n);\n\t}\n\tpublic static void cout(boolean n){\n\t\tif(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\t\n\tpublic static void main(String[] args) {\n\t\tint m = sc.nextInt();\n\t\tint[] R = new int[m];\n\t\t\n\t\tfor(int i=0;i<m;i++) R[i] = sc.nextInt();\n\t\t\n\t\tint mn = R[0];\n\t\tint ret = -1000000001;\n\t\tfor(int i=1;i<m;i++){\n\t\t\tret = Math.max(ret, R[i]-mn);\n\t\t\tmn = Math.min(mn, R[i]);\n\t\t}\n\t\tcout(ret);\n\t}\n\t\n\t\n\t\n\tpublic static boolean isPrime(int n){\n\t\tfor(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}\n\t\treturn false;\n\t}\n\tpublic static int gcd(int a,int b){\n\t\tif(a%b==0) return b;\n\t\telse return gcd(b,a%b);\n\t}\n\tpublic static void showary(int[] ary){\n\t\tfor(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}\n\t\tcout(ary[ary.length-1]);\n\t}\n\tpublic static void cout(String n){\n\t\tSystem.out.println(n);\n\t}\n\t\n\tpublic static void cout(int n){\n\t\tSystem.out.println(n);\n\t}\n\tpublic static void cout(boolean n){\n\t\tif(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}\n\t}\n}",
"Main",
"static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main(String[] args) {\n\t\tint m = sc.nextInt();\n\t\tint[] R = new int[m];\n\t\t\n\t\tfor(int i=0;i<m;i++) R[i] = sc.nextInt();\n\t\t\n\t\tint mn = R[0];\n\t\tint ret = -1000000001;\n\t\tfor(int i=1;i<m;i++){\n\t\t\tret = Math.max(ret, R[i]-mn);\n\t\t\tmn = Math.min(mn, R[i]);\n\t\t}\n\t\tcout(ret);\n\t}",
"main",
"{\n\t\tint m = sc.nextInt();\n\t\tint[] R = new int[m];\n\t\t\n\t\tfor(int i=0;i<m;i++) R[i] = sc.nextInt();\n\t\t\n\t\tint mn = R[0];\n\t\tint ret = -1000000001;\n\t\tfor(int i=1;i<m;i++){\n\t\t\tret = Math.max(ret, R[i]-mn);\n\t\t\tmn = Math.min(mn, R[i]);\n\t\t}\n\t\tcout(ret);\n\t}",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] R = new int[m];",
"R",
"new int[m]",
"m",
"for(int i=0;i<m;i++) R[i] = sc.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"R[i] = sc.nextInt();",
"R[i] = sc.nextInt()",
"R[i]",
"R",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int mn = R[0];",
"mn",
"R[0]",
"R",
"0",
"int ret = -1000000001;",
"ret",
"-1000000001",
"1000000001",
"for(int i=1;i<m;i++){\n\t\t\tret = Math.max(ret, R[i]-mn);\n\t\t\tmn = Math.min(mn, R[i]);\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tret = Math.max(ret, R[i]-mn);\n\t\t\tmn = Math.min(mn, R[i]);\n\t\t}",
"{\n\t\t\tret = Math.max(ret, R[i]-mn);\n\t\t\tmn = Math.min(mn, R[i]);\n\t\t}",
"ret = Math.max(ret, R[i]-mn)",
"ret",
"Math.max(ret, R[i]-mn)",
"Math.max",
"Math",
"ret",
"R[i]-mn",
"R[i]",
"R",
"i",
"mn",
"mn = Math.min(mn, R[i])",
"mn",
"Math.min(mn, R[i])",
"Math.min",
"Math",
"mn",
"R[i]",
"R",
"i",
"cout(ret)",
"cout",
"ret",
"String[] args",
"args",
"public static boolean isPrime(int n){\n\t\tfor(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}\n\t\treturn false;\n\t}",
"isPrime",
"{\n\t\tfor(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}\n\t\treturn false;\n\t}",
"for(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}",
"int i=2;",
"int i=2;",
"i",
"2",
"i<=n*n",
"i",
"n*n",
"n",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif(n%i==0) return true;\n\t\t}",
"{\n\t\t\tif(n%i==0) return true;\n\t\t}",
"if(n%i==0) return true;",
"n%i==0",
"n%i",
"n",
"i",
"0",
"return true;",
"true",
"return false;",
"false",
"int n",
"n",
"public static int gcd(int a,int b){\n\t\tif(a%b==0) return b;\n\t\telse return gcd(b,a%b);\n\t}",
"gcd",
"{\n\t\tif(a%b==0) return b;\n\t\telse return gcd(b,a%b);\n\t}",
"if(a%b==0) return b;\n\t\telse return gcd(b,a%b);",
"a%b==0",
"a%b",
"a",
"b",
"0",
"return b;",
"b",
"return gcd(b,a%b);",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"public static void showary(int[] ary){\n\t\tfor(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}\n\t\tcout(ary[ary.length-1]);\n\t}",
"showary",
"{\n\t\tfor(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}\n\t\tcout(ary[ary.length-1]);\n\t}",
"for(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<ary.length-1",
"i",
"ary.length-1",
"ary.length",
"ary",
"ary.length",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}",
"System.out.print(ary[i]+\" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"ary[i]+\" \"",
"ary[i]",
"ary",
"i",
"\" \"",
"cout(ary[ary.length-1])",
"cout",
"ary[ary.length-1]",
"ary",
"ary.length-1",
"ary.length",
"ary",
"ary.length",
"1",
"int[] ary",
"ary",
"public static void cout(String n){\n\t\tSystem.out.println(n);\n\t}",
"cout",
"{\n\t\tSystem.out.println(n);\n\t}",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"String n",
"n",
"public static void cout(int n){\n\t\tSystem.out.println(n);\n\t}",
"cout",
"{\n\t\tSystem.out.println(n);\n\t}",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"int n",
"n",
"public static void cout(boolean n){\n\t\tif(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}\n\t}",
"cout",
"{\n\t\tif(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}\n\t}",
"if(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}",
"n==true",
"n",
"true",
"{\n\t\t\tcout(\"true\");\n\t\t}",
"cout(\"true\")",
"cout",
"\"true\"",
"{\n\t\t\tcout(\"false\");\n\t\t}",
"cout(\"false\")",
"cout",
"\"false\"",
"boolean n",
"n",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\t\n\tpublic static void main(String[] args) {\n\t\tint m = sc.nextInt();\n\t\tint[] R = new int[m];\n\t\t\n\t\tfor(int i=0;i<m;i++) R[i] = sc.nextInt();\n\t\t\n\t\tint mn = R[0];\n\t\tint ret = -1000000001;\n\t\tfor(int i=1;i<m;i++){\n\t\t\tret = Math.max(ret, R[i]-mn);\n\t\t\tmn = Math.min(mn, R[i]);\n\t\t}\n\t\tcout(ret);\n\t}\n\t\n\t\n\t\n\tpublic static boolean isPrime(int n){\n\t\tfor(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}\n\t\treturn false;\n\t}\n\tpublic static int gcd(int a,int b){\n\t\tif(a%b==0) return b;\n\t\telse return gcd(b,a%b);\n\t}\n\tpublic static void showary(int[] ary){\n\t\tfor(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}\n\t\tcout(ary[ary.length-1]);\n\t}\n\tpublic static void cout(String n){\n\t\tSystem.out.println(n);\n\t}\n\t\n\tpublic static void cout(int n){\n\t\tSystem.out.println(n);\n\t}\n\tpublic static void cout(boolean n){\n\t\tif(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}\n\t}\n}",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\t\n\tpublic static void main(String[] args) {\n\t\tint m = sc.nextInt();\n\t\tint[] R = new int[m];\n\t\t\n\t\tfor(int i=0;i<m;i++) R[i] = sc.nextInt();\n\t\t\n\t\tint mn = R[0];\n\t\tint ret = -1000000001;\n\t\tfor(int i=1;i<m;i++){\n\t\t\tret = Math.max(ret, R[i]-mn);\n\t\t\tmn = Math.min(mn, R[i]);\n\t\t}\n\t\tcout(ret);\n\t}\n\t\n\t\n\t\n\tpublic static boolean isPrime(int n){\n\t\tfor(int i=2;i<=n*n;i++){\n\t\t\tif(n%i==0) return true;\n\t\t}\n\t\treturn false;\n\t}\n\tpublic static int gcd(int a,int b){\n\t\tif(a%b==0) return b;\n\t\telse return gcd(b,a%b);\n\t}\n\tpublic static void showary(int[] ary){\n\t\tfor(int i=0;i<ary.length-1;i++){\n\t\t\tSystem.out.print(ary[i]+\" \");\n\t\t}\n\t\tcout(ary[ary.length-1]);\n\t}\n\tpublic static void cout(String n){\n\t\tSystem.out.println(n);\n\t}\n\t\n\tpublic static void cout(int n){\n\t\tSystem.out.println(n);\n\t}\n\tpublic static void cout(boolean n){\n\t\tif(n==true){\n\t\t\tcout(\"true\");\n\t\t}else{\n\t\t\tcout(\"false\");\n\t\t}\n\t}\n}",
"Main"
] | import java.util.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int m = sc.nextInt();
int[] R = new int[m];
for(int i=0;i<m;i++) R[i] = sc.nextInt();
int mn = R[0];
int ret = -1000000001;
for(int i=1;i<m;i++){
ret = Math.max(ret, R[i]-mn);
mn = Math.min(mn, R[i]);
}
cout(ret);
}
public static boolean isPrime(int n){
for(int i=2;i<=n*n;i++){
if(n%i==0) return true;
}
return false;
}
public static int gcd(int a,int b){
if(a%b==0) return b;
else return gcd(b,a%b);
}
public static void showary(int[] ary){
for(int i=0;i<ary.length-1;i++){
System.out.print(ary[i]+" ");
}
cout(ary[ary.length-1]);
}
public static void cout(String n){
System.out.println(n);
}
public static void cout(int n){
System.out.println(n);
}
public static void cout(boolean n){
if(n==true){
cout("true");
}else{
cout("false");
}
}
} |
[
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,
20,
2,
13,
17,
41,
13,
20,
2,
13,
17,
41,
13,
20,
2,
13,
17,
41,
13,
20,
2,
13,
17,
0,
18,
13,
17,
18,
13,
13,
0,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
18,
13,
13,
4,
18,
13,
18,
13,
2,
13,
17,
18,
13,
13,
0,
18,
13,
13,
4,
18,
13,
18,
13,
2,
13,
17,
18,
13,
13,
0,
18,
13,
2,
13,
17,
18,
13,
13,
0,
18,
13,
2,
13,
17,
17,
11,
1,
41,
13,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
2,
13,
17,
18,
13,
13,
0,
18,
13,
13,
4,
18,
13,
18,
13,
2,
13,
17,
18,
13,
13,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
2,
13,
17,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
32,
33
],
[
32,
34
],
[
8,
35
],
[
35,
36
],
[
35,
37
],
[
38,
39
],
[
38,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
44,
45
],
[
44,
46
],
[
8,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
8,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
59,
67
],
[
67,
68
],
[
68,
69
],
[
59,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
77,
78
],
[
71,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
83,
91
],
[
91,
92
],
[
91,
93
],
[
71,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
98,
106
],
[
106,
107
],
[
106,
108
],
[
8,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
112,
114
],
[
109,
115
],
[
115,
116
],
[
115,
117
],
[
8,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
121,
123
],
[
118,
124
],
[
8,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
125,
133
],
[
133,
134
],
[
134,
135
],
[
125,
136
],
[
137,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
147,
149
],
[
142,
150
],
[
150,
151
],
[
150,
152
],
[
137,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
157,
158
],
[
158,
159
],
[
157,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
162,
164
],
[
157,
165
],
[
165,
166
],
[
165,
167
],
[
8,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
170,
172
],
[
8,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
173,
178
],
[
178,
179
],
[
178,
180
],
[
173,
181
],
[
181,
182
],
[
182,
183
],
[
173,
184
],
[
185,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
189,
190
],
[
188,
191
],
[
188,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
195,
196
],
[
195,
197
],
[
192,
198
],
[
198,
199
],
[
198,
200
],
[
8,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
201,
206
],
[
6,
207
],
[
207,
208
]
] | [
"import java.util.Scanner;\n\nclass Main {\n\tpublic static void main(String args[]) {\n\t\tScanner in = new Scanner(System.in);\n\n\t\tint n = in.nextInt();\n\t\tint[] minsL = new int[n+2];\n\t\tint[] maxsL = new int[n+2];\n\t\tint[] maxsR = new int[n+2];\n\t\tint[] minsR = new int[n+2];\n\t\tint[] kawase = new int[n+2];\n\n\t\tminsL[0] = Integer.MAX_VALUE;\n\t\tmaxsL[0] = 0;\n\t\tfor(int i=1;i<=n;i++) {\n\t\t\tkawase[i] = in.nextInt();\n\t\t\tminsL[i] = Math.min(minsL[i-1], kawase[i]);\n\t\t\tmaxsL[i] = Math.max(maxsL[i-1], kawase[i]);\n\t\t}\n\t\tminsR[n+1] = Integer.MAX_VALUE;\n\t\tmaxsR[n+1] = 0;\n\t\tfor(int i=n;i>=1;i--) {\n\t\t\tminsR[i] = Math.min(minsR[i+1], kawase[i]);\n\t\t\tmaxsR[i] = Math.max(maxsR[i+1], kawase[i]);\n\t\t}\n\n\t\tint ans = Integer.MIN_VALUE;\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tans = Math.max(ans, maxsR[i+1] - minsL[i]);\n//\t\t\tans = Math.max(ans, Math.abs(maxsL[i] - minsR[i+1]));\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n\tpublic static void main(String args[]) {\n\t\tScanner in = new Scanner(System.in);\n\n\t\tint n = in.nextInt();\n\t\tint[] minsL = new int[n+2];\n\t\tint[] maxsL = new int[n+2];\n\t\tint[] maxsR = new int[n+2];\n\t\tint[] minsR = new int[n+2];\n\t\tint[] kawase = new int[n+2];\n\n\t\tminsL[0] = Integer.MAX_VALUE;\n\t\tmaxsL[0] = 0;\n\t\tfor(int i=1;i<=n;i++) {\n\t\t\tkawase[i] = in.nextInt();\n\t\t\tminsL[i] = Math.min(minsL[i-1], kawase[i]);\n\t\t\tmaxsL[i] = Math.max(maxsL[i-1], kawase[i]);\n\t\t}\n\t\tminsR[n+1] = Integer.MAX_VALUE;\n\t\tmaxsR[n+1] = 0;\n\t\tfor(int i=n;i>=1;i--) {\n\t\t\tminsR[i] = Math.min(minsR[i+1], kawase[i]);\n\t\t\tmaxsR[i] = Math.max(maxsR[i+1], kawase[i]);\n\t\t}\n\n\t\tint ans = Integer.MIN_VALUE;\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tans = Math.max(ans, maxsR[i+1] - minsL[i]);\n//\t\t\tans = Math.max(ans, Math.abs(maxsL[i] - minsR[i+1]));\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n}",
"Main",
"public static void main(String args[]) {\n\t\tScanner in = new Scanner(System.in);\n\n\t\tint n = in.nextInt();\n\t\tint[] minsL = new int[n+2];\n\t\tint[] maxsL = new int[n+2];\n\t\tint[] maxsR = new int[n+2];\n\t\tint[] minsR = new int[n+2];\n\t\tint[] kawase = new int[n+2];\n\n\t\tminsL[0] = Integer.MAX_VALUE;\n\t\tmaxsL[0] = 0;\n\t\tfor(int i=1;i<=n;i++) {\n\t\t\tkawase[i] = in.nextInt();\n\t\t\tminsL[i] = Math.min(minsL[i-1], kawase[i]);\n\t\t\tmaxsL[i] = Math.max(maxsL[i-1], kawase[i]);\n\t\t}\n\t\tminsR[n+1] = Integer.MAX_VALUE;\n\t\tmaxsR[n+1] = 0;\n\t\tfor(int i=n;i>=1;i--) {\n\t\t\tminsR[i] = Math.min(minsR[i+1], kawase[i]);\n\t\t\tmaxsR[i] = Math.max(maxsR[i+1], kawase[i]);\n\t\t}\n\n\t\tint ans = Integer.MIN_VALUE;\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tans = Math.max(ans, maxsR[i+1] - minsL[i]);\n//\t\t\tans = Math.max(ans, Math.abs(maxsL[i] - minsR[i+1]));\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner in = new Scanner(System.in);\n\n\t\tint n = in.nextInt();\n\t\tint[] minsL = new int[n+2];\n\t\tint[] maxsL = new int[n+2];\n\t\tint[] maxsR = new int[n+2];\n\t\tint[] minsR = new int[n+2];\n\t\tint[] kawase = new int[n+2];\n\n\t\tminsL[0] = Integer.MAX_VALUE;\n\t\tmaxsL[0] = 0;\n\t\tfor(int i=1;i<=n;i++) {\n\t\t\tkawase[i] = in.nextInt();\n\t\t\tminsL[i] = Math.min(minsL[i-1], kawase[i]);\n\t\t\tmaxsL[i] = Math.max(maxsL[i-1], kawase[i]);\n\t\t}\n\t\tminsR[n+1] = Integer.MAX_VALUE;\n\t\tmaxsR[n+1] = 0;\n\t\tfor(int i=n;i>=1;i--) {\n\t\t\tminsR[i] = Math.min(minsR[i+1], kawase[i]);\n\t\t\tmaxsR[i] = Math.max(maxsR[i+1], kawase[i]);\n\t\t}\n\n\t\tint ans = Integer.MIN_VALUE;\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tans = Math.max(ans, maxsR[i+1] - minsL[i]);\n//\t\t\tans = Math.max(ans, Math.abs(maxsL[i] - minsR[i+1]));\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int[] minsL = new int[n+2];",
"minsL",
"new int[n+2]",
"n+2",
"n",
"2",
"int[] maxsL = new int[n+2];",
"maxsL",
"new int[n+2]",
"n+2",
"n",
"2",
"int[] maxsR = new int[n+2];",
"maxsR",
"new int[n+2]",
"n+2",
"n",
"2",
"int[] minsR = new int[n+2];",
"minsR",
"new int[n+2]",
"n+2",
"n",
"2",
"int[] kawase = new int[n+2];",
"kawase",
"new int[n+2]",
"n+2",
"n",
"2",
"minsL[0] = Integer.MAX_VALUE",
"minsL[0]",
"minsL",
"0",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"maxsL[0] = 0",
"maxsL[0]",
"maxsL",
"0",
"0",
"for(int i=1;i<=n;i++) {\n\t\t\tkawase[i] = in.nextInt();\n\t\t\tminsL[i] = Math.min(minsL[i-1], kawase[i]);\n\t\t\tmaxsL[i] = Math.max(maxsL[i-1], kawase[i]);\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tkawase[i] = in.nextInt();\n\t\t\tminsL[i] = Math.min(minsL[i-1], kawase[i]);\n\t\t\tmaxsL[i] = Math.max(maxsL[i-1], kawase[i]);\n\t\t}",
"{\n\t\t\tkawase[i] = in.nextInt();\n\t\t\tminsL[i] = Math.min(minsL[i-1], kawase[i]);\n\t\t\tmaxsL[i] = Math.max(maxsL[i-1], kawase[i]);\n\t\t}",
"kawase[i] = in.nextInt()",
"kawase[i]",
"kawase",
"i",
"in.nextInt()",
"in.nextInt",
"in",
"minsL[i] = Math.min(minsL[i-1], kawase[i])",
"minsL[i]",
"minsL",
"i",
"Math.min(minsL[i-1], kawase[i])",
"Math.min",
"Math",
"minsL[i-1]",
"minsL",
"i-1",
"i",
"1",
"kawase[i]",
"kawase",
"i",
"maxsL[i] = Math.max(maxsL[i-1], kawase[i])",
"maxsL[i]",
"maxsL",
"i",
"Math.max(maxsL[i-1], kawase[i])",
"Math.max",
"Math",
"maxsL[i-1]",
"maxsL",
"i-1",
"i",
"1",
"kawase[i]",
"kawase",
"i",
"minsR[n+1] = Integer.MAX_VALUE",
"minsR[n+1]",
"minsR",
"n+1",
"n",
"1",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"maxsR[n+1] = 0",
"maxsR[n+1]",
"maxsR",
"n+1",
"n",
"1",
"0",
"for(int i=n;i>=1;i--) {\n\t\t\tminsR[i] = Math.min(minsR[i+1], kawase[i]);\n\t\t\tmaxsR[i] = Math.max(maxsR[i+1], kawase[i]);\n\t\t}",
"int i=n;",
"int i=n;",
"i",
"n",
"i>=1",
"i",
"1",
"i--",
"i--",
"i",
"{\n\t\t\tminsR[i] = Math.min(minsR[i+1], kawase[i]);\n\t\t\tmaxsR[i] = Math.max(maxsR[i+1], kawase[i]);\n\t\t}",
"{\n\t\t\tminsR[i] = Math.min(minsR[i+1], kawase[i]);\n\t\t\tmaxsR[i] = Math.max(maxsR[i+1], kawase[i]);\n\t\t}",
"minsR[i] = Math.min(minsR[i+1], kawase[i])",
"minsR[i]",
"minsR",
"i",
"Math.min(minsR[i+1], kawase[i])",
"Math.min",
"Math",
"minsR[i+1]",
"minsR",
"i+1",
"i",
"1",
"kawase[i]",
"kawase",
"i",
"maxsR[i] = Math.max(maxsR[i+1], kawase[i])",
"maxsR[i]",
"maxsR",
"i",
"Math.max(maxsR[i+1], kawase[i])",
"Math.max",
"Math",
"maxsR[i+1]",
"maxsR",
"i+1",
"i",
"1",
"kawase[i]",
"kawase",
"i",
"int ans = Integer.MIN_VALUE;",
"ans",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"for(int i=1;i<n;i++) {\n\t\t\tans = Math.max(ans, maxsR[i+1] - minsL[i]);\n//\t\t\tans = Math.max(ans, Math.abs(maxsL[i] - minsR[i+1]));\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tans = Math.max(ans, maxsR[i+1] - minsL[i]);\n//\t\t\tans = Math.max(ans, Math.abs(maxsL[i] - minsR[i+1]));\n\t\t}",
"{\n\t\t\tans = Math.max(ans, maxsR[i+1] - minsL[i]);\n//\t\t\tans = Math.max(ans, Math.abs(maxsL[i] - minsR[i+1]));\n\t\t}",
"ans = Math.max(ans, maxsR[i+1] - minsL[i])",
"ans",
"Math.max(ans, maxsR[i+1] - minsL[i])",
"Math.max",
"Math",
"ans",
"maxsR[i+1] - minsL[i]",
"maxsR[i+1]",
"maxsR",
"i+1",
"i",
"1",
"minsL[i]",
"minsL",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String args[]",
"args"
] | import java.util.Scanner;
class Main {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] minsL = new int[n+2];
int[] maxsL = new int[n+2];
int[] maxsR = new int[n+2];
int[] minsR = new int[n+2];
int[] kawase = new int[n+2];
minsL[0] = Integer.MAX_VALUE;
maxsL[0] = 0;
for(int i=1;i<=n;i++) {
kawase[i] = in.nextInt();
minsL[i] = Math.min(minsL[i-1], kawase[i]);
maxsL[i] = Math.max(maxsL[i-1], kawase[i]);
}
minsR[n+1] = Integer.MAX_VALUE;
maxsR[n+1] = 0;
for(int i=n;i>=1;i--) {
minsR[i] = Math.min(minsR[i+1], kawase[i]);
maxsR[i] = Math.max(maxsR[i+1], kawase[i]);
}
int ans = Integer.MIN_VALUE;
for(int i=1;i<n;i++) {
ans = Math.max(ans, maxsR[i+1] - minsL[i]);
// ans = Math.max(ans, Math.abs(maxsL[i] - minsR[i+1]));
}
System.out.println(ans);
}
} |
[
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,
41,
13,
41,
13,
18,
13,
2,
13,
17,
41,
13,
2,
13,
18,
13,
17,
11,
1,
41,
13,
13,
2,
13,
17,
30,
30,
14,
2,
13,
17,
30,
14,
2,
13,
2,
18,
13,
17,
18,
13,
17,
30,
0,
13,
2,
18,
13,
17,
18,
13,
17,
40,
13,
0,
13,
17,
0,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
13,
30,
0,
13,
13,
0,
13,
18,
13,
13,
14,
2,
13,
2,
13,
17,
30,
14,
2,
13,
2,
13,
18,
13,
2,
13,
17,
30,
0,
13,
2,
13,
18,
13,
2,
13,
17,
40,
13,
30,
0,
13,
18,
13,
2,
13,
17,
11,
1,
41,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
13,
30,
0,
13,
18,
13,
13,
14,
2,
13,
2,
13,
13,
30,
0,
13,
2,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
220,
5
],
[
220,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
8,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
8,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
8,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
59,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
81,
83
],
[
74,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
91,
93
],
[
73,
94
],
[
94,
95
],
[
68,
96
],
[
96,
97
],
[
96,
98
],
[
68,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
68,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
104,
109
],
[
109,
110
],
[
109,
111
],
[
104,
112
],
[
112,
113
],
[
113,
114
],
[
104,
115
],
[
116,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
117,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
129,
131
],
[
68,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
135,
137
],
[
132,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
146,
148
],
[
139,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
156,
158
],
[
138,
159
],
[
159,
160
],
[
132,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
166,
168
],
[
161,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
173,
175
],
[
169,
176
],
[
176,
177
],
[
176,
178
],
[
169,
179
],
[
179,
180
],
[
180,
181
],
[
169,
182
],
[
183,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
184,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
193,
194
],
[
193,
195
],
[
161,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
199,
201
],
[
196,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
205,
206
],
[
205,
207
],
[
161,
208
],
[
208,
209
],
[
208,
210
],
[
8,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
211,
216
],
[
6,
217
],
[
217,
218
],
[
0,
219
],
[
219,
220
],
[
219,
221
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int[] list = new int[n];\n for(int i=0; i<n; i++){\n list[i] = scan.nextInt();\n }\n\n int minindex;\n int min;\n int max = list[n-1];\n int diff = max-list[0];\n for(int m=n; m>0; ){\n if(m==1){\n if(diff<list[1]-list[0]){\n diff = list[1]-list[0];\n }\n m--;\n }\n minindex = 0;\n min = list[0];\n for (int i = 0; i < m; i++) {\n if (list[i] < min) {\n minindex = i;\n min = list[i];\n }\n }\n if (minindex == m-1) {\n if(diff<min-list[m-2]){\n diff = min-list[m-2];\n }\n m--;\n } else {\n max = list[minindex+1];\n for (int i = minindex + 1; i < n; i++) {\n if (list[i] > max) {\n max = list[i];\n }\n }\n if(diff<max-min){\n diff = max-min;\n }\n m = minindex;\n }\n }\n System.out.println(diff);\n }\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int[] list = new int[n];\n for(int i=0; i<n; i++){\n list[i] = scan.nextInt();\n }\n\n int minindex;\n int min;\n int max = list[n-1];\n int diff = max-list[0];\n for(int m=n; m>0; ){\n if(m==1){\n if(diff<list[1]-list[0]){\n diff = list[1]-list[0];\n }\n m--;\n }\n minindex = 0;\n min = list[0];\n for (int i = 0; i < m; i++) {\n if (list[i] < min) {\n minindex = i;\n min = list[i];\n }\n }\n if (minindex == m-1) {\n if(diff<min-list[m-2]){\n diff = min-list[m-2];\n }\n m--;\n } else {\n max = list[minindex+1];\n for (int i = minindex + 1; i < n; i++) {\n if (list[i] > max) {\n max = list[i];\n }\n }\n if(diff<max-min){\n diff = max-min;\n }\n m = minindex;\n }\n }\n System.out.println(diff);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int[] list = new int[n];\n for(int i=0; i<n; i++){\n list[i] = scan.nextInt();\n }\n\n int minindex;\n int min;\n int max = list[n-1];\n int diff = max-list[0];\n for(int m=n; m>0; ){\n if(m==1){\n if(diff<list[1]-list[0]){\n diff = list[1]-list[0];\n }\n m--;\n }\n minindex = 0;\n min = list[0];\n for (int i = 0; i < m; i++) {\n if (list[i] < min) {\n minindex = i;\n min = list[i];\n }\n }\n if (minindex == m-1) {\n if(diff<min-list[m-2]){\n diff = min-list[m-2];\n }\n m--;\n } else {\n max = list[minindex+1];\n for (int i = minindex + 1; i < n; i++) {\n if (list[i] > max) {\n max = list[i];\n }\n }\n if(diff<max-min){\n diff = max-min;\n }\n m = minindex;\n }\n }\n System.out.println(diff);\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int[] list = new int[n];\n for(int i=0; i<n; i++){\n list[i] = scan.nextInt();\n }\n\n int minindex;\n int min;\n int max = list[n-1];\n int diff = max-list[0];\n for(int m=n; m>0; ){\n if(m==1){\n if(diff<list[1]-list[0]){\n diff = list[1]-list[0];\n }\n m--;\n }\n minindex = 0;\n min = list[0];\n for (int i = 0; i < m; i++) {\n if (list[i] < min) {\n minindex = i;\n min = list[i];\n }\n }\n if (minindex == m-1) {\n if(diff<min-list[m-2]){\n diff = min-list[m-2];\n }\n m--;\n } else {\n max = list[minindex+1];\n for (int i = minindex + 1; i < n; i++) {\n if (list[i] > max) {\n max = list[i];\n }\n }\n if(diff<max-min){\n diff = max-min;\n }\n m = minindex;\n }\n }\n System.out.println(diff);\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] list = new int[n];",
"list",
"new int[n]",
"n",
"for(int i=0; i<n; i++){\n list[i] = scan.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n list[i] = scan.nextInt();\n }",
"{\n list[i] = scan.nextInt();\n }",
"list[i] = scan.nextInt()",
"list[i]",
"list",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int minindex;",
"minindex",
"int min;",
"min",
"int max = list[n-1];",
"max",
"list[n-1]",
"list",
"n-1",
"n",
"1",
"int diff = max-list[0];",
"diff",
"max-list[0]",
"max",
"list[0]",
"list",
"0",
"for(int m=n; m>0; ){\n if(m==1){\n if(diff<list[1]-list[0]){\n diff = list[1]-list[0];\n }\n m--;\n }\n minindex = 0;\n min = list[0];\n for (int i = 0; i < m; i++) {\n if (list[i] < min) {\n minindex = i;\n min = list[i];\n }\n }\n if (minindex == m-1) {\n if(diff<min-list[m-2]){\n diff = min-list[m-2];\n }\n m--;\n } else {\n max = list[minindex+1];\n for (int i = minindex + 1; i < n; i++) {\n if (list[i] > max) {\n max = list[i];\n }\n }\n if(diff<max-min){\n diff = max-min;\n }\n m = minindex;\n }\n }",
"int m=n;",
"int m=n;",
"m",
"n",
"m>0",
"m",
"0",
"{\n if(m==1){\n if(diff<list[1]-list[0]){\n diff = list[1]-list[0];\n }\n m--;\n }\n minindex = 0;\n min = list[0];\n for (int i = 0; i < m; i++) {\n if (list[i] < min) {\n minindex = i;\n min = list[i];\n }\n }\n if (minindex == m-1) {\n if(diff<min-list[m-2]){\n diff = min-list[m-2];\n }\n m--;\n } else {\n max = list[minindex+1];\n for (int i = minindex + 1; i < n; i++) {\n if (list[i] > max) {\n max = list[i];\n }\n }\n if(diff<max-min){\n diff = max-min;\n }\n m = minindex;\n }\n }",
"{\n if(m==1){\n if(diff<list[1]-list[0]){\n diff = list[1]-list[0];\n }\n m--;\n }\n minindex = 0;\n min = list[0];\n for (int i = 0; i < m; i++) {\n if (list[i] < min) {\n minindex = i;\n min = list[i];\n }\n }\n if (minindex == m-1) {\n if(diff<min-list[m-2]){\n diff = min-list[m-2];\n }\n m--;\n } else {\n max = list[minindex+1];\n for (int i = minindex + 1; i < n; i++) {\n if (list[i] > max) {\n max = list[i];\n }\n }\n if(diff<max-min){\n diff = max-min;\n }\n m = minindex;\n }\n }",
"if(m==1){\n if(diff<list[1]-list[0]){\n diff = list[1]-list[0];\n }\n m--;\n }",
"m==1",
"m",
"1",
"{\n if(diff<list[1]-list[0]){\n diff = list[1]-list[0];\n }\n m--;\n }",
"if(diff<list[1]-list[0]){\n diff = list[1]-list[0];\n }",
"diff<list[1]-list[0]",
"diff",
"list[1]-list[0]",
"list[1]",
"list",
"1",
"list[0]",
"list",
"0",
"{\n diff = list[1]-list[0];\n }",
"diff = list[1]-list[0]",
"diff",
"list[1]-list[0]",
"list[1]",
"list",
"1",
"list[0]",
"list",
"0",
"m--",
"m",
"minindex = 0",
"minindex",
"0",
"min = list[0]",
"min",
"list[0]",
"list",
"0",
"for (int i = 0; i < m; i++) {\n if (list[i] < min) {\n minindex = i;\n min = list[i];\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n if (list[i] < min) {\n minindex = i;\n min = list[i];\n }\n }",
"{\n if (list[i] < min) {\n minindex = i;\n min = list[i];\n }\n }",
"if (list[i] < min) {\n minindex = i;\n min = list[i];\n }",
"list[i] < min",
"list[i]",
"list",
"i",
"min",
"{\n minindex = i;\n min = list[i];\n }",
"minindex = i",
"minindex",
"i",
"min = list[i]",
"min",
"list[i]",
"list",
"i",
"if (minindex == m-1) {\n if(diff<min-list[m-2]){\n diff = min-list[m-2];\n }\n m--;\n } else {\n max = list[minindex+1];\n for (int i = minindex + 1; i < n; i++) {\n if (list[i] > max) {\n max = list[i];\n }\n }\n if(diff<max-min){\n diff = max-min;\n }\n m = minindex;\n }",
"minindex == m-1",
"minindex",
"m-1",
"m",
"1",
"{\n if(diff<min-list[m-2]){\n diff = min-list[m-2];\n }\n m--;\n }",
"if(diff<min-list[m-2]){\n diff = min-list[m-2];\n }",
"diff<min-list[m-2]",
"diff",
"min-list[m-2]",
"min",
"list[m-2]",
"list",
"m-2",
"m",
"2",
"{\n diff = min-list[m-2];\n }",
"diff = min-list[m-2]",
"diff",
"min-list[m-2]",
"min",
"list[m-2]",
"list",
"m-2",
"m",
"2",
"m--",
"m",
"{\n max = list[minindex+1];\n for (int i = minindex + 1; i < n; i++) {\n if (list[i] > max) {\n max = list[i];\n }\n }\n if(diff<max-min){\n diff = max-min;\n }\n m = minindex;\n }",
"max = list[minindex+1]",
"max",
"list[minindex+1]",
"list",
"minindex+1",
"minindex",
"1",
"for (int i = minindex + 1; i < n; i++) {\n if (list[i] > max) {\n max = list[i];\n }\n }",
"int i = minindex + 1;",
"int i = minindex + 1;",
"i",
"minindex + 1",
"minindex",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n if (list[i] > max) {\n max = list[i];\n }\n }",
"{\n if (list[i] > max) {\n max = list[i];\n }\n }",
"if (list[i] > max) {\n max = list[i];\n }",
"list[i] > max",
"list[i]",
"list",
"i",
"max",
"{\n max = list[i];\n }",
"max = list[i]",
"max",
"list[i]",
"list",
"i",
"if(diff<max-min){\n diff = max-min;\n }",
"diff<max-min",
"diff",
"max-min",
"max",
"min",
"{\n diff = max-min;\n }",
"diff = max-min",
"diff",
"max-min",
"max",
"min",
"m = minindex",
"m",
"minindex",
"System.out.println(diff)",
"System.out.println",
"System.out",
"System",
"System.out",
"diff",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int[] list = new int[n];\n for(int i=0; i<n; i++){\n list[i] = scan.nextInt();\n }\n\n int minindex;\n int min;\n int max = list[n-1];\n int diff = max-list[0];\n for(int m=n; m>0; ){\n if(m==1){\n if(diff<list[1]-list[0]){\n diff = list[1]-list[0];\n }\n m--;\n }\n minindex = 0;\n min = list[0];\n for (int i = 0; i < m; i++) {\n if (list[i] < min) {\n minindex = i;\n min = list[i];\n }\n }\n if (minindex == m-1) {\n if(diff<min-list[m-2]){\n diff = min-list[m-2];\n }\n m--;\n } else {\n max = list[minindex+1];\n for (int i = minindex + 1; i < n; i++) {\n if (list[i] > max) {\n max = list[i];\n }\n }\n if(diff<max-min){\n diff = max-min;\n }\n m = minindex;\n }\n }\n System.out.println(diff);\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n int[] list = new int[n];\n for(int i=0; i<n; i++){\n list[i] = scan.nextInt();\n }\n\n int minindex;\n int min;\n int max = list[n-1];\n int diff = max-list[0];\n for(int m=n; m>0; ){\n if(m==1){\n if(diff<list[1]-list[0]){\n diff = list[1]-list[0];\n }\n m--;\n }\n minindex = 0;\n min = list[0];\n for (int i = 0; i < m; i++) {\n if (list[i] < min) {\n minindex = i;\n min = list[i];\n }\n }\n if (minindex == m-1) {\n if(diff<min-list[m-2]){\n diff = min-list[m-2];\n }\n m--;\n } else {\n max = list[minindex+1];\n for (int i = minindex + 1; i < n; i++) {\n if (list[i] > max) {\n max = list[i];\n }\n }\n if(diff<max-min){\n diff = max-min;\n }\n m = minindex;\n }\n }\n System.out.println(diff);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int[] list = new int[n];
for(int i=0; i<n; i++){
list[i] = scan.nextInt();
}
int minindex;
int min;
int max = list[n-1];
int diff = max-list[0];
for(int m=n; m>0; ){
if(m==1){
if(diff<list[1]-list[0]){
diff = list[1]-list[0];
}
m--;
}
minindex = 0;
min = list[0];
for (int i = 0; i < m; i++) {
if (list[i] < min) {
minindex = i;
min = list[i];
}
}
if (minindex == m-1) {
if(diff<min-list[m-2]){
diff = min-list[m-2];
}
m--;
} else {
max = list[minindex+1];
for (int i = minindex + 1; i < n; i++) {
if (list[i] > max) {
max = list[i];
}
}
if(diff<max-min){
diff = max-min;
}
m = minindex;
}
}
System.out.println(diff);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
93,
5
],
[
93,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
8,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
66,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
63,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
77,
81
],
[
81,
82
],
[
81,
83
],
[
8,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
6,
90
],
[
90,
91
],
[
0,
92
],
[
92,
93
],
[
92,
94
]
] | [
"import java.util.Scanner;\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[] arr = new int[200000];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = arr[0];\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tmax = Math.max(max, arr[i] - min);\n\t\t\tmin = Math.min(min, arr[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public 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[] arr = new int[200000];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = arr[0];\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tmax = Math.max(max, arr[i] - min);\n\t\t\tmin = Math.min(min, arr[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[200000];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = arr[0];\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tmax = Math.max(max, arr[i] - min);\n\t\t\tmin = Math.min(min, arr[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[200000];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = arr[0];\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tmax = Math.max(max, arr[i] - min);\n\t\t\tmin = Math.min(min, arr[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] arr = new int[200000];",
"arr",
"new int[200000]",
"200000",
"for (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}",
"arr[i] = sc.nextInt()",
"arr[i]",
"arr",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int max = Integer.MIN_VALUE;",
"max",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int min = arr[0];",
"min",
"arr[0]",
"arr",
"0",
"for (int i = 1; i < n; i++) {\n\t\t\tmax = Math.max(max, arr[i] - min);\n\t\t\tmin = Math.min(min, arr[i]);\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tmax = Math.max(max, arr[i] - min);\n\t\t\tmin = Math.min(min, arr[i]);\n\t\t}",
"{\n\t\t\tmax = Math.max(max, arr[i] - min);\n\t\t\tmin = Math.min(min, arr[i]);\n\t\t}",
"max = Math.max(max, arr[i] - min)",
"max",
"Math.max(max, arr[i] - min)",
"Math.max",
"Math",
"max",
"arr[i] - min",
"arr[i]",
"arr",
"i",
"min",
"min = Math.min(min, arr[i])",
"min",
"Math.min(min, arr[i])",
"Math.min",
"Math",
"min",
"arr[i]",
"arr",
"i",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public 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[] arr = new int[200000];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = arr[0];\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tmax = Math.max(max, arr[i] - min);\n\t\t\tmin = Math.min(min, arr[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"public 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[] arr = new int[200000];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = arr[0];\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tmax = Math.max(max, arr[i] - min);\n\t\t\tmin = Math.min(min, arr[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] arr = new int[200000];
for (int i = 0; i < n; i++) {
arr[i] = sc.nextInt();
}
int max = Integer.MIN_VALUE;
int min = arr[0];
for (int i = 1; i < n; i++) {
max = Math.max(max, arr[i] - min);
min = Math.min(min, arr[i]);
}
System.out.println(max);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
18,
13,
17,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
2,
18,
13,
13,
13,
14,
2,
18,
13,
13,
13,
0,
13,
18,
13,
13,
14,
2,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
108,
5
],
[
108,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
6,
12
],
[
12,
13
],
[
108,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
16,
25
],
[
25,
26
],
[
25,
27
],
[
16,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
16,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
16,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
58,
60
],
[
16,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
61,
71
],
[
71,
72
],
[
72,
73
],
[
61,
74
],
[
75,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
75,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
83,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
75,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
98,
100
],
[
16,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
0,
107
],
[
107,
108
],
[
107,
109
]
] | [
"\n\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n new Main().start();\n }\n void start(){\n Scanner in = new Scanner(System.in);\n int t = in.nextInt();\n int[]a = new int[t];\n for(int i = 0; i < a.length;i++){\n \ta[i] = in.nextInt();\n }\n\n int min = a[0];\n int maxRieki = Integer.MIN_VALUE;\n for(int i = 1; i < a.length; i++){\n int rieki = a[i] - min;\n if(a[i] < min) min = a[i];\n if(rieki > maxRieki) maxRieki = rieki;\n }\n System.out.println(maxRieki);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n new Main().start();\n }\n void start(){\n Scanner in = new Scanner(System.in);\n int t = in.nextInt();\n int[]a = new int[t];\n for(int i = 0; i < a.length;i++){\n \ta[i] = in.nextInt();\n }\n\n int min = a[0];\n int maxRieki = Integer.MIN_VALUE;\n for(int i = 1; i < a.length; i++){\n int rieki = a[i] - min;\n if(a[i] < min) min = a[i];\n if(rieki > maxRieki) maxRieki = rieki;\n }\n System.out.println(maxRieki);\n }\n}",
"Main",
"public static void main(String[] args) {\n new Main().start();\n }",
"main",
"{\n new Main().start();\n }",
"new Main().start()",
"new Main().start",
"new Main()",
"String[] args",
"args",
"void start(){\n Scanner in = new Scanner(System.in);\n int t = in.nextInt();\n int[]a = new int[t];\n for(int i = 0; i < a.length;i++){\n \ta[i] = in.nextInt();\n }\n\n int min = a[0];\n int maxRieki = Integer.MIN_VALUE;\n for(int i = 1; i < a.length; i++){\n int rieki = a[i] - min;\n if(a[i] < min) min = a[i];\n if(rieki > maxRieki) maxRieki = rieki;\n }\n System.out.println(maxRieki);\n }",
"start",
"{\n Scanner in = new Scanner(System.in);\n int t = in.nextInt();\n int[]a = new int[t];\n for(int i = 0; i < a.length;i++){\n \ta[i] = in.nextInt();\n }\n\n int min = a[0];\n int maxRieki = Integer.MIN_VALUE;\n for(int i = 1; i < a.length; i++){\n int rieki = a[i] - min;\n if(a[i] < min) min = a[i];\n if(rieki > maxRieki) maxRieki = rieki;\n }\n System.out.println(maxRieki);\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int t = in.nextInt();",
"t",
"in.nextInt()",
"in.nextInt",
"in",
"int[]a = new int[t];",
"a",
"new int[t]",
"t",
"for(int i = 0; i < a.length;i++){\n \ta[i] = in.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n \ta[i] = in.nextInt();\n }",
"{\n \ta[i] = in.nextInt();\n }",
"a[i] = in.nextInt()",
"a[i]",
"a",
"i",
"in.nextInt()",
"in.nextInt",
"in",
"int min = a[0];",
"min",
"a[0]",
"a",
"0",
"int maxRieki = Integer.MIN_VALUE;",
"maxRieki",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"for(int i = 1; i < a.length; i++){\n int rieki = a[i] - min;\n if(a[i] < min) min = a[i];\n if(rieki > maxRieki) maxRieki = rieki;\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n int rieki = a[i] - min;\n if(a[i] < min) min = a[i];\n if(rieki > maxRieki) maxRieki = rieki;\n }",
"{\n int rieki = a[i] - min;\n if(a[i] < min) min = a[i];\n if(rieki > maxRieki) maxRieki = rieki;\n }",
"int rieki = a[i] - min;",
"rieki",
"a[i] - min",
"a[i]",
"a",
"i",
"min",
"if(a[i] < min) min = a[i];",
"a[i] < min",
"a[i]",
"a",
"i",
"min",
"min = a[i]",
"min",
"a[i]",
"a",
"i",
"if(rieki > maxRieki) maxRieki = rieki;",
"rieki > maxRieki",
"rieki",
"maxRieki",
"maxRieki = rieki",
"maxRieki",
"rieki",
"System.out.println(maxRieki)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxRieki",
"public class Main {\n public static void main(String[] args) {\n new Main().start();\n }\n void start(){\n Scanner in = new Scanner(System.in);\n int t = in.nextInt();\n int[]a = new int[t];\n for(int i = 0; i < a.length;i++){\n \ta[i] = in.nextInt();\n }\n\n int min = a[0];\n int maxRieki = Integer.MIN_VALUE;\n for(int i = 1; i < a.length; i++){\n int rieki = a[i] - min;\n if(a[i] < min) min = a[i];\n if(rieki > maxRieki) maxRieki = rieki;\n }\n System.out.println(maxRieki);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n new Main().start();\n }\n void start(){\n Scanner in = new Scanner(System.in);\n int t = in.nextInt();\n int[]a = new int[t];\n for(int i = 0; i < a.length;i++){\n \ta[i] = in.nextInt();\n }\n\n int min = a[0];\n int maxRieki = Integer.MIN_VALUE;\n for(int i = 1; i < a.length; i++){\n int rieki = a[i] - min;\n if(a[i] < min) min = a[i];\n if(rieki > maxRieki) maxRieki = rieki;\n }\n System.out.println(maxRieki);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
new Main().start();
}
void start(){
Scanner in = new Scanner(System.in);
int t = in.nextInt();
int[]a = new int[t];
for(int i = 0; i < a.length;i++){
a[i] = in.nextInt();
}
int min = a[0];
int maxRieki = Integer.MIN_VALUE;
for(int i = 1; i < a.length; i++){
int rieki = a[i] - min;
if(a[i] < min) min = a[i];
if(rieki > maxRieki) maxRieki = rieki;
}
System.out.println(maxRieki);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
0,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
2,
18,
13,
17,
18,
13,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
13,
0,
13,
18,
13,
13,
11,
1,
41,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
14,
2,
13,
18,
13,
13,
3,
14,
2,
2,
18,
13,
13,
18,
13,
13,
13,
0,
13,
2,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
39,
40
],
[
40,
41
],
[
8,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
48,
50
],
[
8,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
8,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
69,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
68,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
80,
87
],
[
87,
88
],
[
87,
89
],
[
80,
90
],
[
90,
91
],
[
91,
92
],
[
80,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
94,
100
],
[
94,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
107,
108
],
[
107,
109
],
[
102,
110
],
[
101,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
117,
118
],
[
117,
119
],
[
8,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
6,
126
],
[
126,
127
]
] | [
"import java.util.Scanner;\n\nclass Main{\n\n\tpublic static void main(String[] args){\n\n\t\tScanner sc =new Scanner(System.in);\n\n\t\tint n=sc.nextInt();\n\t\tint R[];\n\t\tR=new int[n];\n\n\t\tfor(int i=0;i<n;i++) \n\t\t\tR[i]=sc.nextInt();\n\n\t\tint max=R[1]-R[0];\n\t\tint min=R[0];\n\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tif(R[i]<min) min=R[i];\n\t\t\tfor(int j=i+1;j<n;j++)\n\t\t\t\tif (min<R[i]) break;\n\t\t\t\telse if(R[j]-R[i]>max)\n\t\t\t\t\tmax=R[j]-R[i];\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n\n\tpublic static void main(String[] args){\n\n\t\tScanner sc =new Scanner(System.in);\n\n\t\tint n=sc.nextInt();\n\t\tint R[];\n\t\tR=new int[n];\n\n\t\tfor(int i=0;i<n;i++) \n\t\t\tR[i]=sc.nextInt();\n\n\t\tint max=R[1]-R[0];\n\t\tint min=R[0];\n\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tif(R[i]<min) min=R[i];\n\t\t\tfor(int j=i+1;j<n;j++)\n\t\t\t\tif (min<R[i]) break;\n\t\t\t\telse if(R[j]-R[i]>max)\n\t\t\t\t\tmax=R[j]-R[i];\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args){\n\n\t\tScanner sc =new Scanner(System.in);\n\n\t\tint n=sc.nextInt();\n\t\tint R[];\n\t\tR=new int[n];\n\n\t\tfor(int i=0;i<n;i++) \n\t\t\tR[i]=sc.nextInt();\n\n\t\tint max=R[1]-R[0];\n\t\tint min=R[0];\n\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tif(R[i]<min) min=R[i];\n\t\t\tfor(int j=i+1;j<n;j++)\n\t\t\t\tif (min<R[i]) break;\n\t\t\t\telse if(R[j]-R[i]>max)\n\t\t\t\t\tmax=R[j]-R[i];\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}",
"main",
"{\n\n\t\tScanner sc =new Scanner(System.in);\n\n\t\tint n=sc.nextInt();\n\t\tint R[];\n\t\tR=new int[n];\n\n\t\tfor(int i=0;i<n;i++) \n\t\t\tR[i]=sc.nextInt();\n\n\t\tint max=R[1]-R[0];\n\t\tint min=R[0];\n\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tif(R[i]<min) min=R[i];\n\t\t\tfor(int j=i+1;j<n;j++)\n\t\t\t\tif (min<R[i]) break;\n\t\t\t\telse if(R[j]-R[i]>max)\n\t\t\t\t\tmax=R[j]-R[i];\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}",
"Scanner sc =new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int R[];",
"R",
"R=new int[n]",
"R",
"new int[n]",
"n",
"for(int i=0;i<n;i++) \n\t\t\tR[i]=sc.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"R[i]=sc.nextInt();",
"R[i]=sc.nextInt()",
"R[i]",
"R",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int max=R[1]-R[0];",
"max",
"R[1]-R[0]",
"R[1]",
"R",
"1",
"R[0]",
"R",
"0",
"int min=R[0];",
"min",
"R[0]",
"R",
"0",
"for(int i=0;i<n;i++) {\n\t\t\tif(R[i]<min) min=R[i];\n\t\t\tfor(int j=i+1;j<n;j++)\n\t\t\t\tif (min<R[i]) break;\n\t\t\t\telse if(R[j]-R[i]>max)\n\t\t\t\t\tmax=R[j]-R[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif(R[i]<min) min=R[i];\n\t\t\tfor(int j=i+1;j<n;j++)\n\t\t\t\tif (min<R[i]) break;\n\t\t\t\telse if(R[j]-R[i]>max)\n\t\t\t\t\tmax=R[j]-R[i];\n\t\t}",
"{\n\t\t\tif(R[i]<min) min=R[i];\n\t\t\tfor(int j=i+1;j<n;j++)\n\t\t\t\tif (min<R[i]) break;\n\t\t\t\telse if(R[j]-R[i]>max)\n\t\t\t\t\tmax=R[j]-R[i];\n\t\t}",
"if(R[i]<min) min=R[i];",
"R[i]<min",
"R[i]",
"R",
"i",
"min",
"min=R[i]",
"min",
"R[i]",
"R",
"i",
"for(int j=i+1;j<n;j++)\n\t\t\t\tif (min<R[i]) break;\n\t\t\t\telse if(R[j]-R[i]>max)\n\t\t\t\t\tmax=R[j]-R[i];",
"int j=i+1;",
"int j=i+1;",
"j",
"i+1",
"i",
"1",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"if (min<R[i]) break;\n\t\t\t\telse if(R[j]-R[i]>max)\n\t\t\t\t\tmax=R[j]-R[i];",
"if (min<R[i]) break;\n\t\t\t\telse if(R[j]-R[i]>max)\n\t\t\t\t\tmax=R[j]-R[i];",
"min<R[i]",
"min",
"R[i]",
"R",
"i",
"break;",
"if(R[j]-R[i]>max)\n\t\t\t\t\tmax=R[j]-R[i];",
"R[j]-R[i]>max",
"R[j]-R[i]",
"R[j]",
"R",
"j",
"R[i]",
"R",
"i",
"max",
"max=R[j]-R[i]",
"max",
"R[j]-R[i]",
"R[j]",
"R",
"j",
"R[i]",
"R",
"i",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner sc =new Scanner(System.in);
int n=sc.nextInt();
int R[];
R=new int[n];
for(int i=0;i<n;i++)
R[i]=sc.nextInt();
int max=R[1]-R[0];
int min=R[0];
for(int i=0;i<n;i++) {
if(R[i]<min) min=R[i];
for(int j=i+1;j<n;j++)
if (min<R[i]) break;
else if(R[j]-R[i]>max)
max=R[j]-R[i];
}
System.out.println(max);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
40,
17,
41,
13,
41,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
80,
5
],
[
80,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
8,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
37,
39
],
[
30,
40
],
[
40,
41
],
[
41,
42
],
[
30,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
44,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
44,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
44,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
6,
77
],
[
77,
78
],
[
0,
79
],
[
79,
80
],
[
79,
81
]
] | [
"import java.util.Scanner;\n\npublic class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int max=-1000000000,res,num;\n int n=sc.nextInt();\n int min=sc.nextInt();\n for(int i=0;i<n-1;i++){\n num=sc.nextInt();\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n System.out.println(max);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int max=-1000000000,res,num;\n int n=sc.nextInt();\n int min=sc.nextInt();\n for(int i=0;i<n-1;i++){\n num=sc.nextInt();\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n System.out.println(max);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int max=-1000000000,res,num;\n int n=sc.nextInt();\n int min=sc.nextInt();\n for(int i=0;i<n-1;i++){\n num=sc.nextInt();\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n System.out.println(max);\n }",
"main",
"{\n Scanner sc=new Scanner(System.in);\n int max=-1000000000,res,num;\n int n=sc.nextInt();\n int min=sc.nextInt();\n for(int i=0;i<n-1;i++){\n num=sc.nextInt();\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n System.out.println(max);\n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int max=-1000000000",
"max",
"-1000000000",
"1000000000",
"res",
"res",
"num;",
"num",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int min=sc.nextInt();",
"min",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=0;i<n-1;i++){\n num=sc.nextInt();\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n num=sc.nextInt();\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }",
"{\n num=sc.nextInt();\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }",
"num=sc.nextInt()",
"num",
"sc.nextInt()",
"sc.nextInt",
"sc",
"res=num-min",
"res",
"num-min",
"num",
"min",
"if(res>max){\n max=res;\n }",
"res>max",
"res",
"max",
"{\n max=res;\n }",
"max=res",
"max",
"res",
"if(min>num){\n min=num;\n }",
"min>num",
"min",
"num",
"{\n min=num;\n }",
"min=num",
"min",
"num",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int max=-1000000000,res,num;\n int n=sc.nextInt();\n int min=sc.nextInt();\n for(int i=0;i<n-1;i++){\n num=sc.nextInt();\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n System.out.println(max);\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner sc=new Scanner(System.in);\n int max=-1000000000,res,num;\n int n=sc.nextInt();\n int min=sc.nextInt();\n for(int i=0;i<n-1;i++){\n num=sc.nextInt();\n res=num-min;\n if(res>max){\n max=res;\n }\n if(min>num){\n min=num;\n }\n }\n System.out.println(max);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int max=-1000000000,res,num;
int n=sc.nextInt();
int min=sc.nextInt();
for(int i=0;i<n-1;i++){
num=sc.nextInt();
res=num-min;
if(res>max){
max=res;
}
if(min>num){
min=num;
}
}
System.out.println(max);
}
}
|
[
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,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
97,
5
],
[
97,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
28,
30
],
[
21,
31
],
[
31,
32
],
[
32,
33
],
[
21,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
36,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
53,
63
],
[
63,
64
],
[
64,
65
],
[
53,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
70,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
67,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
81,
85
],
[
85,
86
],
[
85,
87
],
[
8,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
6,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
]
] | [
"import java.util.*;\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[] nums = new int[n];\n\t\tfor(int i=0;i<nums.length;i++){\n\t\t\tnums[i] = sc.nextInt();\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = nums[0];\n\t\tfor(int i=1;i<nums.length;i++){\n\t\t\tmax = Math.max(max, nums[i]-min);\n\t\t\tmin = Math.min(min, nums[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public 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[] nums = new int[n];\n\t\tfor(int i=0;i<nums.length;i++){\n\t\t\tnums[i] = sc.nextInt();\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = nums[0];\n\t\tfor(int i=1;i<nums.length;i++){\n\t\t\tmax = Math.max(max, nums[i]-min);\n\t\t\tmin = Math.min(min, nums[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"Main",
"public static void main(String args[]){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] nums = new int[n];\n\t\tfor(int i=0;i<nums.length;i++){\n\t\t\tnums[i] = sc.nextInt();\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = nums[0];\n\t\tfor(int i=1;i<nums.length;i++){\n\t\t\tmax = Math.max(max, nums[i]-min);\n\t\t\tmin = Math.min(min, nums[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] nums = new int[n];\n\t\tfor(int i=0;i<nums.length;i++){\n\t\t\tnums[i] = sc.nextInt();\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = nums[0];\n\t\tfor(int i=1;i<nums.length;i++){\n\t\t\tmax = Math.max(max, nums[i]-min);\n\t\t\tmin = Math.min(min, nums[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] nums = new int[n];",
"nums",
"new int[n]",
"n",
"for(int i=0;i<nums.length;i++){\n\t\t\tnums[i] = sc.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<nums.length",
"i",
"nums.length",
"nums",
"nums.length",
"i++",
"i++",
"i",
"{\n\t\t\tnums[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tnums[i] = sc.nextInt();\n\t\t}",
"nums[i] = sc.nextInt()",
"nums[i]",
"nums",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int max = Integer.MIN_VALUE;",
"max",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int min = nums[0];",
"min",
"nums[0]",
"nums",
"0",
"for(int i=1;i<nums.length;i++){\n\t\t\tmax = Math.max(max, nums[i]-min);\n\t\t\tmin = Math.min(min, nums[i]);\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<nums.length",
"i",
"nums.length",
"nums",
"nums.length",
"i++",
"i++",
"i",
"{\n\t\t\tmax = Math.max(max, nums[i]-min);\n\t\t\tmin = Math.min(min, nums[i]);\n\t\t}",
"{\n\t\t\tmax = Math.max(max, nums[i]-min);\n\t\t\tmin = Math.min(min, nums[i]);\n\t\t}",
"max = Math.max(max, nums[i]-min)",
"max",
"Math.max(max, nums[i]-min)",
"Math.max",
"Math",
"max",
"nums[i]-min",
"nums[i]",
"nums",
"i",
"min",
"min = Math.min(min, nums[i])",
"min",
"Math.min(min, nums[i])",
"Math.min",
"Math",
"min",
"nums[i]",
"nums",
"i",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String args[]",
"args",
"public 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[] nums = new int[n];\n\t\tfor(int i=0;i<nums.length;i++){\n\t\t\tnums[i] = sc.nextInt();\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = nums[0];\n\t\tfor(int i=1;i<nums.length;i++){\n\t\t\tmax = Math.max(max, nums[i]-min);\n\t\t\tmin = Math.min(min, nums[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"public 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[] nums = new int[n];\n\t\tfor(int i=0;i<nums.length;i++){\n\t\t\tnums[i] = sc.nextInt();\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = nums[0];\n\t\tfor(int i=1;i<nums.length;i++){\n\t\t\tmax = Math.max(max, nums[i]-min);\n\t\t\tmin = Math.min(min, nums[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] nums = new int[n];
for(int i=0;i<nums.length;i++){
nums[i] = sc.nextInt();
}
int max = Integer.MIN_VALUE;
int min = nums[0];
for(int i=1;i<nums.length;i++){
max = Math.max(max, nums[i]-min);
min = Math.min(min, nums[i]);
}
System.out.println(max);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
40,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
13,
30,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
76,
5
],
[
76,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
36,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
53,
57
],
[
57,
58
],
[
57,
59
],
[
50,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
62,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
6,
73
],
[
73,
74
],
[
0,
75
],
[
75,
76
],
[
75,
77
]
] | [
"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\tint min = 1000000000;\n\t\tint max = -1000000000;\n\n\t\tfor(int i = 0; i < n; i++) {\n\n\t\t\tint r = sc.nextInt();\n\n\t\t\tif(i == 0) {\n\n\t\t\t\tmin = r;\n\n\t\t\t} else {\n\n\t\t\t\tmax = Math.max(max, r - min);\n\t\t\t\tmin = Math.min(min, r);\n\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public 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\tint min = 1000000000;\n\t\tint max = -1000000000;\n\n\t\tfor(int i = 0; i < n; i++) {\n\n\t\t\tint r = sc.nextInt();\n\n\t\t\tif(i == 0) {\n\n\t\t\t\tmin = r;\n\n\t\t\t} else {\n\n\t\t\t\tmax = Math.max(max, r - min);\n\t\t\t\tmin = Math.min(min, r);\n\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint min = 1000000000;\n\t\tint max = -1000000000;\n\n\t\tfor(int i = 0; i < n; i++) {\n\n\t\t\tint r = sc.nextInt();\n\n\t\t\tif(i == 0) {\n\n\t\t\t\tmin = r;\n\n\t\t\t} else {\n\n\t\t\t\tmax = Math.max(max, r - min);\n\t\t\t\tmin = Math.min(min, r);\n\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint min = 1000000000;\n\t\tint max = -1000000000;\n\n\t\tfor(int i = 0; i < n; i++) {\n\n\t\t\tint r = sc.nextInt();\n\n\t\t\tif(i == 0) {\n\n\t\t\t\tmin = r;\n\n\t\t\t} else {\n\n\t\t\t\tmax = Math.max(max, r - min);\n\t\t\t\tmin = Math.min(min, r);\n\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int min = 1000000000;",
"min",
"1000000000",
"int max = -1000000000;",
"max",
"-1000000000",
"1000000000",
"for(int i = 0; i < n; i++) {\n\n\t\t\tint r = sc.nextInt();\n\n\t\t\tif(i == 0) {\n\n\t\t\t\tmin = r;\n\n\t\t\t} else {\n\n\t\t\t\tmax = Math.max(max, r - min);\n\t\t\t\tmin = Math.min(min, r);\n\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\n\t\t\tint r = sc.nextInt();\n\n\t\t\tif(i == 0) {\n\n\t\t\t\tmin = r;\n\n\t\t\t} else {\n\n\t\t\t\tmax = Math.max(max, r - min);\n\t\t\t\tmin = Math.min(min, r);\n\n\t\t\t}\n\t\t}",
"{\n\n\t\t\tint r = sc.nextInt();\n\n\t\t\tif(i == 0) {\n\n\t\t\t\tmin = r;\n\n\t\t\t} else {\n\n\t\t\t\tmax = Math.max(max, r - min);\n\t\t\t\tmin = Math.min(min, r);\n\n\t\t\t}\n\t\t}",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if(i == 0) {\n\n\t\t\t\tmin = r;\n\n\t\t\t} else {\n\n\t\t\t\tmax = Math.max(max, r - min);\n\t\t\t\tmin = Math.min(min, r);\n\n\t\t\t}",
"i == 0",
"i",
"0",
"{\n\n\t\t\t\tmin = r;\n\n\t\t\t}",
"min = r",
"min",
"r",
"{\n\n\t\t\t\tmax = Math.max(max, r - min);\n\t\t\t\tmin = Math.min(min, r);\n\n\t\t\t}",
"max = Math.max(max, r - min)",
"max",
"Math.max(max, r - min)",
"Math.max",
"Math",
"max",
"r - min",
"r",
"min",
"min = Math.min(min, r)",
"min",
"Math.min(min, r)",
"Math.min",
"Math",
"min",
"r",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public 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\tint min = 1000000000;\n\t\tint max = -1000000000;\n\n\t\tfor(int i = 0; i < n; i++) {\n\n\t\t\tint r = sc.nextInt();\n\n\t\t\tif(i == 0) {\n\n\t\t\t\tmin = r;\n\n\t\t\t} else {\n\n\t\t\t\tmax = Math.max(max, r - min);\n\t\t\t\tmin = Math.min(min, r);\n\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"public 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\tint min = 1000000000;\n\t\tint max = -1000000000;\n\n\t\tfor(int i = 0; i < n; i++) {\n\n\t\t\tint r = sc.nextInt();\n\n\t\t\tif(i == 0) {\n\n\t\t\t\tmin = r;\n\n\t\t\t} else {\n\n\t\t\t\tmax = Math.max(max, r - min);\n\t\t\t\tmin = Math.min(min, r);\n\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(max);\n\n\t}\n\n}",
"Main"
] | 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();
int min = 1000000000;
int max = -1000000000;
for(int i = 0; i < n; i++) {
int r = sc.nextInt();
if(i == 0) {
min = r;
} else {
max = Math.max(max, r - min);
min = Math.min(min, r);
}
}
System.out.println(max);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
14,
2,
2,
13,
17,
2,
13,
2,
18,
13,
13,
13,
0,
13,
2,
18,
13,
13,
13,
14,
2,
2,
13,
17,
2,
18,
13,
13,
13,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
95,
5
],
[
95,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
30
],
[
30,
31
],
[
8,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
52,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
44,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
71,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
8,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
6,
92
],
[
92,
93
],
[
0,
94
],
[
94,
95
],
[
94,
96
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner number = new Scanner(System.in);\n\t\tint a = number.nextInt();\n\t\tint[] b = new int[a];\n\t\tint c = 0,max = 0,min = 0;\n\t\tdouble d;\n\n\t\tfor(int i = 0;i < a;i++) {\n\t\t\tb[i] = number.nextInt();\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\tif(i == 1 || max < b[i] - min) max = b[i] - min;\n\t\t\tif(i == 0 || b[i] < min) min = b[i];\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner number = new Scanner(System.in);\n\t\tint a = number.nextInt();\n\t\tint[] b = new int[a];\n\t\tint c = 0,max = 0,min = 0;\n\t\tdouble d;\n\n\t\tfor(int i = 0;i < a;i++) {\n\t\t\tb[i] = number.nextInt();\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\tif(i == 1 || max < b[i] - min) max = b[i] - min;\n\t\t\tif(i == 0 || b[i] < min) min = b[i];\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner number = new Scanner(System.in);\n\t\tint a = number.nextInt();\n\t\tint[] b = new int[a];\n\t\tint c = 0,max = 0,min = 0;\n\t\tdouble d;\n\n\t\tfor(int i = 0;i < a;i++) {\n\t\t\tb[i] = number.nextInt();\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\tif(i == 1 || max < b[i] - min) max = b[i] - min;\n\t\t\tif(i == 0 || b[i] < min) min = b[i];\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"main",
"{\n\t\tScanner number = new Scanner(System.in);\n\t\tint a = number.nextInt();\n\t\tint[] b = new int[a];\n\t\tint c = 0,max = 0,min = 0;\n\t\tdouble d;\n\n\t\tfor(int i = 0;i < a;i++) {\n\t\t\tb[i] = number.nextInt();\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\tif(i == 1 || max < b[i] - min) max = b[i] - min;\n\t\t\tif(i == 0 || b[i] < min) min = b[i];\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"Scanner number = new Scanner(System.in);",
"number",
"new Scanner(System.in)",
"int a = number.nextInt();",
"a",
"number.nextInt()",
"number.nextInt",
"number",
"int[] b = new int[a];",
"b",
"new int[a]",
"a",
"int c = 0",
"c",
"0",
"max = 0",
"max",
"0",
"min = 0;",
"min",
"0",
"double d;",
"d",
"for(int i = 0;i < a;i++) {\n\t\t\tb[i] = number.nextInt();\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\tif(i == 1 || max < b[i] - min) max = b[i] - min;\n\t\t\tif(i == 0 || b[i] < min) min = b[i];\n\t\t\t\n\t\t\t\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tb[i] = number.nextInt();\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\tif(i == 1 || max < b[i] - min) max = b[i] - min;\n\t\t\tif(i == 0 || b[i] < min) min = b[i];\n\t\t\t\n\t\t\t\n\t\t}",
"{\n\t\t\tb[i] = number.nextInt();\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\tif(i == 1 || max < b[i] - min) max = b[i] - min;\n\t\t\tif(i == 0 || b[i] < min) min = b[i];\n\t\t\t\n\t\t\t\n\t\t}",
"b[i] = number.nextInt()",
"b[i]",
"b",
"i",
"number.nextInt()",
"number.nextInt",
"number",
"if(i == 1 || max < b[i] - min) max = b[i] - min;",
"i == 1 || max < b[i] - min",
"i == 1",
"i",
"1",
"max < b[i] - min",
"max",
"b[i] - min",
"b[i]",
"b",
"i",
"min",
"max = b[i] - min",
"max",
"b[i] - min",
"b[i]",
"b",
"i",
"min",
"if(i == 0 || b[i] < min) min = b[i];",
"i == 0 || b[i] < min",
"i == 0",
"i",
"0",
"b[i] < min",
"b[i]",
"b",
"i",
"min",
"min = b[i]",
"min",
"b[i]",
"b",
"i",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner number = new Scanner(System.in);\n\t\tint a = number.nextInt();\n\t\tint[] b = new int[a];\n\t\tint c = 0,max = 0,min = 0;\n\t\tdouble d;\n\n\t\tfor(int i = 0;i < a;i++) {\n\t\t\tb[i] = number.nextInt();\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\tif(i == 1 || max < b[i] - min) max = b[i] - min;\n\t\t\tif(i == 0 || b[i] < min) min = b[i];\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner number = new Scanner(System.in);\n\t\tint a = number.nextInt();\n\t\tint[] b = new int[a];\n\t\tint c = 0,max = 0,min = 0;\n\t\tdouble d;\n\n\t\tfor(int i = 0;i < a;i++) {\n\t\t\tb[i] = number.nextInt();\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\tif(i == 1 || max < b[i] - min) max = b[i] - min;\n\t\t\tif(i == 0 || b[i] < min) min = b[i];\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner number = new Scanner(System.in);
int a = number.nextInt();
int[] b = new int[a];
int c = 0,max = 0,min = 0;
double d;
for(int i = 0;i < a;i++) {
b[i] = number.nextInt();
if(i == 1 || max < b[i] - min) max = b[i] - min;
if(i == 0 || b[i] < min) min = b[i];
}
System.out.println(max);
}
}
|
[
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,
40,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
8,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
65,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
62,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
76,
80
],
[
80,
81
],
[
80,
82
],
[
8,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
6,
89
],
[
89,
90
]
] | [
"import java.util.*;\n\nclass Main{\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] r = new int[n];\n for(int i = 0; i < n; i++){\n r[i] = sc.nextInt();\n }\n\n int max = -2000000000;\n int min = r[0];\n for(int i = 1; i < n; i++){\n max = Math.max(max,r[i]-min);\n min = Math.min(min,r[i]);\n }\n System.out.println(max);\n }\n}\n",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] r = new int[n];\n for(int i = 0; i < n; i++){\n r[i] = sc.nextInt();\n }\n\n int max = -2000000000;\n int min = r[0];\n for(int i = 1; i < n; i++){\n max = Math.max(max,r[i]-min);\n min = Math.min(min,r[i]);\n }\n System.out.println(max);\n }\n}",
"Main",
"public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] r = new int[n];\n for(int i = 0; i < n; i++){\n r[i] = sc.nextInt();\n }\n\n int max = -2000000000;\n int min = r[0];\n for(int i = 1; i < n; i++){\n max = Math.max(max,r[i]-min);\n min = Math.min(min,r[i]);\n }\n System.out.println(max);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] r = new int[n];\n for(int i = 0; i < n; i++){\n r[i] = sc.nextInt();\n }\n\n int max = -2000000000;\n int min = r[0];\n for(int i = 1; i < n; i++){\n max = Math.max(max,r[i]-min);\n min = Math.min(min,r[i]);\n }\n System.out.println(max);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] r = new int[n];",
"r",
"new int[n]",
"n",
"for(int i = 0; i < n; i++){\n r[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n r[i] = sc.nextInt();\n }",
"{\n r[i] = sc.nextInt();\n }",
"r[i] = sc.nextInt()",
"r[i]",
"r",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int max = -2000000000;",
"max",
"-2000000000",
"2000000000",
"int min = r[0];",
"min",
"r[0]",
"r",
"0",
"for(int i = 1; i < n; i++){\n max = Math.max(max,r[i]-min);\n min = Math.min(min,r[i]);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n max = Math.max(max,r[i]-min);\n min = Math.min(min,r[i]);\n }",
"{\n max = Math.max(max,r[i]-min);\n min = Math.min(min,r[i]);\n }",
"max = Math.max(max,r[i]-min)",
"max",
"Math.max(max,r[i]-min)",
"Math.max",
"Math",
"max",
"r[i]-min",
"r[i]",
"r",
"i",
"min",
"min = Math.min(min,r[i])",
"min",
"Math.min(min,r[i])",
"Math.min",
"Math",
"min",
"r[i]",
"r",
"i",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String args[]",
"args"
] | import java.util.*;
class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] r = new int[n];
for(int i = 0; i < n; i++){
r[i] = sc.nextInt();
}
int max = -2000000000;
int min = r[0];
for(int i = 1; i < n; i++){
max = Math.max(max,r[i]-min);
min = Math.min(min,r[i]);
}
System.out.println(max);
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
20,
41,
13,
17,
42,
2,
2,
0,
13,
4,
18,
13,
17,
40,
4,
18,
13,
30,
41,
13,
4,
18,
13,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
13,
13,
4,
18,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
4,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
20,
26
],
[
19,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
18,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
31,
38
],
[
38,
39
],
[
38,
40
],
[
31,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
62,
63
],
[
31,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
31,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
31,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
79,
81
],
[
74,
82
],
[
82,
83
],
[
83,
84
],
[
74,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
89,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
86,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
100,
104
],
[
104,
105
],
[
104,
106
],
[
31,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
31,
111
],
[
111,
112
],
[
112,
113
],
[
9,
114
],
[
114,
115
]
] | [
"import java.io.*;\n \nclass Main{\n \nstatic final PrintWriter out=new PrintWriter(System.out);\n \npublic static void main(String[] args) throws IOException{\nBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\nString line=\"\";\nwhile((line=br.readLine())!=null&&!line.isEmpty()){\nint n=Integer.parseInt(line);\nint[] r=new int[n];\nfor(int i=0;i<n;i++) r[i]=Integer.parseInt(br.readLine());\nint ans=Integer.MIN_VALUE;\nint min=r[0];\nfor(int i=1;i<n;i++){\nans=Math.max(ans,r[i]-min);\nmin=Math.min(min,r[i]);\n}\nout.println(ans);\nout.flush();\n}\n}\n}",
"import java.io.*;",
"io.*",
"java",
"class Main{\n \nstatic final PrintWriter out=new PrintWriter(System.out);\n \npublic static void main(String[] args) throws IOException{\nBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\nString line=\"\";\nwhile((line=br.readLine())!=null&&!line.isEmpty()){\nint n=Integer.parseInt(line);\nint[] r=new int[n];\nfor(int i=0;i<n;i++) r[i]=Integer.parseInt(br.readLine());\nint ans=Integer.MIN_VALUE;\nint min=r[0];\nfor(int i=1;i<n;i++){\nans=Math.max(ans,r[i]-min);\nmin=Math.min(min,r[i]);\n}\nout.println(ans);\nout.flush();\n}\n}\n}",
"Main",
"static final PrintWriter out=new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"public static void main(String[] args) throws IOException{\nBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\nString line=\"\";\nwhile((line=br.readLine())!=null&&!line.isEmpty()){\nint n=Integer.parseInt(line);\nint[] r=new int[n];\nfor(int i=0;i<n;i++) r[i]=Integer.parseInt(br.readLine());\nint ans=Integer.MIN_VALUE;\nint min=r[0];\nfor(int i=1;i<n;i++){\nans=Math.max(ans,r[i]-min);\nmin=Math.min(min,r[i]);\n}\nout.println(ans);\nout.flush();\n}\n}",
"main",
"{\nBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\nString line=\"\";\nwhile((line=br.readLine())!=null&&!line.isEmpty()){\nint n=Integer.parseInt(line);\nint[] r=new int[n];\nfor(int i=0;i<n;i++) r[i]=Integer.parseInt(br.readLine());\nint ans=Integer.MIN_VALUE;\nint min=r[0];\nfor(int i=1;i<n;i++){\nans=Math.max(ans,r[i]-min);\nmin=Math.min(min,r[i]);\n}\nout.println(ans);\nout.flush();\n}\n}",
"BufferedReader br=new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line=\"\";",
"line",
"\"\"",
"while((line=br.readLine())!=null&&!line.isEmpty()){\nint n=Integer.parseInt(line);\nint[] r=new int[n];\nfor(int i=0;i<n;i++) r[i]=Integer.parseInt(br.readLine());\nint ans=Integer.MIN_VALUE;\nint min=r[0];\nfor(int i=1;i<n;i++){\nans=Math.max(ans,r[i]-min);\nmin=Math.min(min,r[i]);\n}\nout.println(ans);\nout.flush();\n}",
"(line=br.readLine())!=null&&!line.isEmpty()",
"(line=br.readLine())!=null",
"(line=br.readLine())",
"line",
"br.readLine()",
"br.readLine",
"br",
"null",
"!line.isEmpty()",
"line.isEmpty()",
"line.isEmpty",
"line",
"{\nint n=Integer.parseInt(line);\nint[] r=new int[n];\nfor(int i=0;i<n;i++) r[i]=Integer.parseInt(br.readLine());\nint ans=Integer.MIN_VALUE;\nint min=r[0];\nfor(int i=1;i<n;i++){\nans=Math.max(ans,r[i]-min);\nmin=Math.min(min,r[i]);\n}\nout.println(ans);\nout.flush();\n}",
"int n=Integer.parseInt(line);",
"n",
"Integer.parseInt(line)",
"Integer.parseInt",
"Integer",
"line",
"int[] r=new int[n];",
"r",
"new int[n]",
"n",
"for(int i=0;i<n;i++) r[i]=Integer.parseInt(br.readLine());",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"r[i]=Integer.parseInt(br.readLine());",
"r[i]=Integer.parseInt(br.readLine())",
"r[i]",
"r",
"i",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int ans=Integer.MIN_VALUE;",
"ans",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int min=r[0];",
"min",
"r[0]",
"r",
"0",
"for(int i=1;i<n;i++){\nans=Math.max(ans,r[i]-min);\nmin=Math.min(min,r[i]);\n}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\nans=Math.max(ans,r[i]-min);\nmin=Math.min(min,r[i]);\n}",
"{\nans=Math.max(ans,r[i]-min);\nmin=Math.min(min,r[i]);\n}",
"ans=Math.max(ans,r[i]-min)",
"ans",
"Math.max(ans,r[i]-min)",
"Math.max",
"Math",
"ans",
"r[i]-min",
"r[i]",
"r",
"i",
"min",
"min=Math.min(min,r[i])",
"min",
"Math.min(min,r[i])",
"Math.min",
"Math",
"min",
"r[i]",
"r",
"i",
"out.println(ans)",
"out.println",
"out",
"ans",
"out.flush()",
"out.flush",
"out",
"String[] args",
"args"
] | import java.io.*;
class Main{
static final PrintWriter out=new PrintWriter(System.out);
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
int[] r=new int[n];
for(int i=0;i<n;i++) r[i]=Integer.parseInt(br.readLine());
int ans=Integer.MIN_VALUE;
int min=r[0];
for(int i=1;i<n;i++){
ans=Math.max(ans,r[i]-min);
min=Math.min(min,r[i]);
}
out.println(ans);
out.flush();
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
13,
41,
13,
13,
41,
13,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
4,
18,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
17,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
17,
41,
13,
2,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
30,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
30,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
13,
14,
2,
2,
13,
13,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
14,
2,
13,
2,
13,
13,
30,
0,
13,
2,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
186,
5
],
[
186,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
8,
34
],
[
34,
35
],
[
34,
36
],
[
8,
37
],
[
37,
38
],
[
37,
39
],
[
8,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
53,
55
],
[
8,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
64,
65
],
[
64,
66
],
[
8,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
8,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
84,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
103,
105
],
[
94,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
114,
115
],
[
114,
116
],
[
110,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
119,
121
],
[
90,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
127,
131
],
[
131,
132
],
[
131,
133
],
[
123,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
142,
143
],
[
142,
144
],
[
138,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
147,
149
],
[
134,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
155,
156
],
[
155,
157
],
[
150,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
158,
162
],
[
162,
163
],
[
162,
164
],
[
158,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
168,
170
],
[
165,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
174,
176
],
[
8,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
177,
182
],
[
6,
183
],
[
183,
184
],
[
0,
185
],
[
185,
186
],
[
185,
187
]
] | [
"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 R0=sc.nextInt();\n\t\tint M=R0;\n\t\tint m=R0;\n\t\tint M2=R0;\n\t\tint Mn=0;\n\t\tint mn=0;\n\t\tint M2n=0;\n\t\tint R=sc.nextInt();\n\t\tif(m>R){\n\t\t\tm=R;\n\t\t\tmn=1;\n\t\t}\n\t\tif(M<=R){\n\t\t\tM=R;\n\t\t\tMn=1;\n\t\t}\n\t\tint d=R-R0;\n\t\tfor(int i=2;i<n;i++){\n\t\t\tR=sc.nextInt();\n\t\t\tif(mn<=Mn){\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}\n\t\t\t\tif(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}else if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(d);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public 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 R0=sc.nextInt();\n\t\tint M=R0;\n\t\tint m=R0;\n\t\tint M2=R0;\n\t\tint Mn=0;\n\t\tint mn=0;\n\t\tint M2n=0;\n\t\tint R=sc.nextInt();\n\t\tif(m>R){\n\t\t\tm=R;\n\t\t\tmn=1;\n\t\t}\n\t\tif(M<=R){\n\t\t\tM=R;\n\t\t\tMn=1;\n\t\t}\n\t\tint d=R-R0;\n\t\tfor(int i=2;i<n;i++){\n\t\t\tR=sc.nextInt();\n\t\t\tif(mn<=Mn){\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}\n\t\t\t\tif(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}else if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(d);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint R0=sc.nextInt();\n\t\tint M=R0;\n\t\tint m=R0;\n\t\tint M2=R0;\n\t\tint Mn=0;\n\t\tint mn=0;\n\t\tint M2n=0;\n\t\tint R=sc.nextInt();\n\t\tif(m>R){\n\t\t\tm=R;\n\t\t\tmn=1;\n\t\t}\n\t\tif(M<=R){\n\t\t\tM=R;\n\t\t\tMn=1;\n\t\t}\n\t\tint d=R-R0;\n\t\tfor(int i=2;i<n;i++){\n\t\t\tR=sc.nextInt();\n\t\t\tif(mn<=Mn){\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}\n\t\t\t\tif(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}else if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(d);\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint R0=sc.nextInt();\n\t\tint M=R0;\n\t\tint m=R0;\n\t\tint M2=R0;\n\t\tint Mn=0;\n\t\tint mn=0;\n\t\tint M2n=0;\n\t\tint R=sc.nextInt();\n\t\tif(m>R){\n\t\t\tm=R;\n\t\t\tmn=1;\n\t\t}\n\t\tif(M<=R){\n\t\t\tM=R;\n\t\t\tMn=1;\n\t\t}\n\t\tint d=R-R0;\n\t\tfor(int i=2;i<n;i++){\n\t\t\tR=sc.nextInt();\n\t\t\tif(mn<=Mn){\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}\n\t\t\t\tif(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}else if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(d);\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int R0=sc.nextInt();",
"R0",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M=R0;",
"M",
"R0",
"int m=R0;",
"m",
"R0",
"int M2=R0;",
"M2",
"R0",
"int Mn=0;",
"Mn",
"0",
"int mn=0;",
"mn",
"0",
"int M2n=0;",
"M2n",
"0",
"int R=sc.nextInt();",
"R",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if(m>R){\n\t\t\tm=R;\n\t\t\tmn=1;\n\t\t}",
"m>R",
"m",
"R",
"{\n\t\t\tm=R;\n\t\t\tmn=1;\n\t\t}",
"m=R",
"m",
"R",
"mn=1",
"mn",
"1",
"if(M<=R){\n\t\t\tM=R;\n\t\t\tMn=1;\n\t\t}",
"M<=R",
"M",
"R",
"{\n\t\t\tM=R;\n\t\t\tMn=1;\n\t\t}",
"M=R",
"M",
"R",
"Mn=1",
"Mn",
"1",
"int d=R-R0;",
"d",
"R-R0",
"R",
"R0",
"for(int i=2;i<n;i++){\n\t\t\tR=sc.nextInt();\n\t\t\tif(mn<=Mn){\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}\n\t\t\t\tif(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}else if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=2;",
"int i=2;",
"i",
"2",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tR=sc.nextInt();\n\t\t\tif(mn<=Mn){\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}\n\t\t\t\tif(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}else if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tR=sc.nextInt();\n\t\t\tif(mn<=Mn){\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}\n\t\t\t\tif(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}else if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"R=sc.nextInt()",
"R",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if(mn<=Mn){\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}\n\t\t\t\tif(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}else if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"mn<=Mn",
"mn",
"Mn",
"{\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}\n\t\t\t\tif(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}\n\t\t\t}",
"if(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}",
"m>R",
"m",
"R",
"{\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}",
"m=R",
"m",
"R",
"mn=i",
"mn",
"i",
"if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}",
"M<=R",
"M",
"R",
"{\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}",
"M=R",
"M",
"R",
"Mn=i",
"Mn",
"i",
"d=M-m",
"d",
"M-m",
"M",
"m",
"{\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}else if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"if(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}else if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}",
"m>R",
"m",
"R",
"{\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}",
"m=R",
"m",
"R",
"mn=i",
"mn",
"i",
"if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}",
"M<=R",
"M",
"R",
"{\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}",
"M=R",
"M",
"R",
"Mn=i",
"Mn",
"i",
"d=M-m",
"d",
"M-m",
"M",
"m",
"if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}",
"M2<R||M2n<mn",
"M2<R",
"M2",
"R",
"M2n<mn",
"M2n",
"mn",
"{\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}",
"M2=R",
"M2",
"R",
"M2n=i",
"M2n",
"i",
"if(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}",
"d<R-m",
"d",
"R-m",
"R",
"m",
"{\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}",
"d=R-m",
"d",
"R-m",
"R",
"m",
"System.out.println(d)",
"System.out.println",
"System.out",
"System",
"System.out",
"d",
"String[] args",
"args",
"public 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 R0=sc.nextInt();\n\t\tint M=R0;\n\t\tint m=R0;\n\t\tint M2=R0;\n\t\tint Mn=0;\n\t\tint mn=0;\n\t\tint M2n=0;\n\t\tint R=sc.nextInt();\n\t\tif(m>R){\n\t\t\tm=R;\n\t\t\tmn=1;\n\t\t}\n\t\tif(M<=R){\n\t\t\tM=R;\n\t\t\tMn=1;\n\t\t}\n\t\tint d=R-R0;\n\t\tfor(int i=2;i<n;i++){\n\t\t\tR=sc.nextInt();\n\t\t\tif(mn<=Mn){\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}\n\t\t\t\tif(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}else if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(d);\n\t}\n}",
"public 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 R0=sc.nextInt();\n\t\tint M=R0;\n\t\tint m=R0;\n\t\tint M2=R0;\n\t\tint Mn=0;\n\t\tint mn=0;\n\t\tint M2n=0;\n\t\tint R=sc.nextInt();\n\t\tif(m>R){\n\t\t\tm=R;\n\t\t\tmn=1;\n\t\t}\n\t\tif(M<=R){\n\t\t\tM=R;\n\t\t\tMn=1;\n\t\t}\n\t\tint d=R-R0;\n\t\tfor(int i=2;i<n;i++){\n\t\t\tR=sc.nextInt();\n\t\t\tif(mn<=Mn){\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}\n\t\t\t\tif(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(m>R){\n\t\t\t\t\tm=R;\n\t\t\t\t\tmn=i;\n\t\t\t\t}else if(M<=R){\n\t\t\t\t\tM=R;\n\t\t\t\t\tMn=i;\n\t\t\t\t\td=M-m;\n\t\t\t\t}else if(M2<R||M2n<mn){\n\t\t\t\t\tM2=R;\n\t\t\t\t\tM2n=i;\n\t\t\t\t\tif(d<R-m){\n\t\t\t\t\t\td=R-m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(d);\n\t}\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int R0=sc.nextInt();
int M=R0;
int m=R0;
int M2=R0;
int Mn=0;
int mn=0;
int M2n=0;
int R=sc.nextInt();
if(m>R){
m=R;
mn=1;
}
if(M<=R){
M=R;
Mn=1;
}
int d=R-R0;
for(int i=2;i<n;i++){
R=sc.nextInt();
if(mn<=Mn){
if(m>R){
m=R;
mn=i;
}
if(M<=R){
M=R;
Mn=i;
d=M-m;
}
}else{
if(m>R){
m=R;
mn=i;
}else if(M<=R){
M=R;
Mn=i;
d=M-m;
}else if(M2<R||M2n<mn){
M2=R;
M2n=i;
if(d<R-m){
d=R-m;
}
}
}
}
System.out.println(d);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
40,
17,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
13,
41,
13,
13,
11,
1,
41,
13,
2,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
4,
18,
13,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
96,
5
],
[
96,
6
],
[
6,
7
],
[
6,
8
],
[
96,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
96,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
15,
21
],
[
21,
22
],
[
21,
23
],
[
15,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
15,
44
],
[
44,
45
],
[
44,
46
],
[
15,
47
],
[
47,
48
],
[
47,
49
],
[
15,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
50,
57
],
[
57,
58
],
[
57,
59
],
[
50,
60
],
[
60,
61
],
[
61,
62
],
[
50,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
67,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
64,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
78,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
15,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
87,
92
],
[
13,
93
],
[
93,
94
],
[
0,
95
],
[
95,
96
],
[
95,
97
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n private static Scanner sc=new Scanner(System.in);\n private static final int MINF=-1000000000;\n public static void main(String[] args){\n int n=sc.nextInt();\n int[] r=new int[n];\n for(int i=0;i<n;i++) r[i]=sc.nextInt();\n int max=MINF;\n int maxp=MINF;\n for(int i=n-2;i>=0;i--){\n max=Math.max(max,r[i+1]);\n maxp=Math.max(maxp,max-r[i]);\n }\n System.out.println(maxp);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n private static Scanner sc=new Scanner(System.in);\n private static final int MINF=-1000000000;\n public static void main(String[] args){\n int n=sc.nextInt();\n int[] r=new int[n];\n for(int i=0;i<n;i++) r[i]=sc.nextInt();\n int max=MINF;\n int maxp=MINF;\n for(int i=n-2;i>=0;i--){\n max=Math.max(max,r[i+1]);\n maxp=Math.max(maxp,max-r[i]);\n }\n System.out.println(maxp);\n }\n}",
"Main",
"private static Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"private static final int MINF=-1000000000;",
"MINF",
"-1000000000",
"1000000000",
"public static void main(String[] args){\n int n=sc.nextInt();\n int[] r=new int[n];\n for(int i=0;i<n;i++) r[i]=sc.nextInt();\n int max=MINF;\n int maxp=MINF;\n for(int i=n-2;i>=0;i--){\n max=Math.max(max,r[i+1]);\n maxp=Math.max(maxp,max-r[i]);\n }\n System.out.println(maxp);\n }",
"main",
"{\n int n=sc.nextInt();\n int[] r=new int[n];\n for(int i=0;i<n;i++) r[i]=sc.nextInt();\n int max=MINF;\n int maxp=MINF;\n for(int i=n-2;i>=0;i--){\n max=Math.max(max,r[i+1]);\n maxp=Math.max(maxp,max-r[i]);\n }\n System.out.println(maxp);\n }",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] r=new int[n];",
"r",
"new int[n]",
"n",
"for(int i=0;i<n;i++) r[i]=sc.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"r[i]=sc.nextInt();",
"r[i]=sc.nextInt()",
"r[i]",
"r",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int max=MINF;",
"max",
"MINF",
"int maxp=MINF;",
"maxp",
"MINF",
"for(int i=n-2;i>=0;i--){\n max=Math.max(max,r[i+1]);\n maxp=Math.max(maxp,max-r[i]);\n }",
"int i=n-2;",
"int i=n-2;",
"i",
"n-2",
"n",
"2",
"i>=0",
"i",
"0",
"i--",
"i--",
"i",
"{\n max=Math.max(max,r[i+1]);\n maxp=Math.max(maxp,max-r[i]);\n }",
"{\n max=Math.max(max,r[i+1]);\n maxp=Math.max(maxp,max-r[i]);\n }",
"max=Math.max(max,r[i+1])",
"max",
"Math.max(max,r[i+1])",
"Math.max",
"Math",
"max",
"r[i+1]",
"r",
"i+1",
"i",
"1",
"maxp=Math.max(maxp,max-r[i])",
"maxp",
"Math.max(maxp,max-r[i])",
"Math.max",
"Math",
"maxp",
"max-r[i]",
"max",
"r[i]",
"r",
"i",
"System.out.println(maxp)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxp",
"String[] args",
"args",
"public class Main {\n private static Scanner sc=new Scanner(System.in);\n private static final int MINF=-1000000000;\n public static void main(String[] args){\n int n=sc.nextInt();\n int[] r=new int[n];\n for(int i=0;i<n;i++) r[i]=sc.nextInt();\n int max=MINF;\n int maxp=MINF;\n for(int i=n-2;i>=0;i--){\n max=Math.max(max,r[i+1]);\n maxp=Math.max(maxp,max-r[i]);\n }\n System.out.println(maxp);\n }\n}",
"public class Main {\n private static Scanner sc=new Scanner(System.in);\n private static final int MINF=-1000000000;\n public static void main(String[] args){\n int n=sc.nextInt();\n int[] r=new int[n];\n for(int i=0;i<n;i++) r[i]=sc.nextInt();\n int max=MINF;\n int maxp=MINF;\n for(int i=n-2;i>=0;i--){\n max=Math.max(max,r[i+1]);\n maxp=Math.max(maxp,max-r[i]);\n }\n System.out.println(maxp);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
private static Scanner sc=new Scanner(System.in);
private static final int MINF=-1000000000;
public static void main(String[] args){
int n=sc.nextInt();
int[] r=new int[n];
for(int i=0;i<n;i++) r[i]=sc.nextInt();
int max=MINF;
int maxp=MINF;
for(int i=n-2;i>=0;i--){
max=Math.max(max,r[i+1]);
maxp=Math.max(maxp,max-r[i]);
}
System.out.println(maxp);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
18,
13,
13,
17,
29,
17,
41,
13,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
2,
18,
13,
13,
13,
13,
0,
13,
4,
18,
13,
18,
13,
13,
13,
29,
13,
23,
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,
4,
18,
18,
13,
13,
4,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
112,
5
],
[
112,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
9,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
19,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
27,
37
],
[
37,
38
],
[
38,
39
],
[
27,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
44,
52
],
[
41,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
58,
59
],
[
58,
60
],
[
55,
61
],
[
8,
62
],
[
62,
63
],
[
6,
64
],
[
64,
65
],
[
112,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
68,
77
],
[
77,
78
],
[
77,
79
],
[
68,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
68,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
106,
107
],
[
106,
108
],
[
66,
109
],
[
109,
110
],
[
0,
111
],
[
111,
112
],
[
111,
113
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static int get_max_profit(int[] a) {\n\t\tif (a.length == 0)\n\t\t\treturn 0;\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = a[0];\n\t\tfor (int i = 1; i < a.length; i++) {\n\t\t\tmax = Math.max(a[i] - min, max);\n\t\t\tmin = Math.min(a[i], min);\n\t\t}\n\t\treturn max;\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint n = s.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = s.nextInt();\n\t\t}\n\t\tSystem.out.println(get_max_profit(a));\n\t}\n\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static int get_max_profit(int[] a) {\n\t\tif (a.length == 0)\n\t\t\treturn 0;\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = a[0];\n\t\tfor (int i = 1; i < a.length; i++) {\n\t\t\tmax = Math.max(a[i] - min, max);\n\t\t\tmin = Math.min(a[i], min);\n\t\t}\n\t\treturn max;\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint n = s.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = s.nextInt();\n\t\t}\n\t\tSystem.out.println(get_max_profit(a));\n\t}\n\n}",
"Main",
"public static int get_max_profit(int[] a) {\n\t\tif (a.length == 0)\n\t\t\treturn 0;\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = a[0];\n\t\tfor (int i = 1; i < a.length; i++) {\n\t\t\tmax = Math.max(a[i] - min, max);\n\t\t\tmin = Math.min(a[i], min);\n\t\t}\n\t\treturn max;\n\t}",
"get_max_profit",
"{\n\t\tif (a.length == 0)\n\t\t\treturn 0;\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = a[0];\n\t\tfor (int i = 1; i < a.length; i++) {\n\t\t\tmax = Math.max(a[i] - min, max);\n\t\t\tmin = Math.min(a[i], min);\n\t\t}\n\t\treturn max;\n\t}",
"if (a.length == 0)\n\t\t\treturn 0;",
"a.length == 0",
"a.length",
"a",
"a.length",
"0",
"return 0;",
"0",
"int max = Integer.MIN_VALUE;",
"max",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int min = a[0];",
"min",
"a[0]",
"a",
"0",
"for (int i = 1; i < a.length; i++) {\n\t\t\tmax = Math.max(a[i] - min, max);\n\t\t\tmin = Math.min(a[i], min);\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n\t\t\tmax = Math.max(a[i] - min, max);\n\t\t\tmin = Math.min(a[i], min);\n\t\t}",
"{\n\t\t\tmax = Math.max(a[i] - min, max);\n\t\t\tmin = Math.min(a[i], min);\n\t\t}",
"max = Math.max(a[i] - min, max)",
"max",
"Math.max(a[i] - min, max)",
"Math.max",
"Math",
"a[i] - min",
"a[i]",
"a",
"i",
"min",
"max",
"min = Math.min(a[i], min)",
"min",
"Math.min(a[i], min)",
"Math.min",
"Math",
"a[i]",
"a",
"i",
"min",
"return max;",
"max",
"int[] a",
"a",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint n = s.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = s.nextInt();\n\t\t}\n\t\tSystem.out.println(get_max_profit(a));\n\t}",
"main",
"{\n\t\tScanner s = new Scanner(System.in);\n\t\tint n = s.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = s.nextInt();\n\t\t}\n\t\tSystem.out.println(get_max_profit(a));\n\t}",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int n = s.nextInt();",
"n",
"s.nextInt()",
"s.nextInt",
"s",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n\t\t\ta[i] = s.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ta[i] = s.nextInt();\n\t\t}",
"{\n\t\t\ta[i] = s.nextInt();\n\t\t}",
"a[i] = s.nextInt()",
"a[i]",
"a",
"i",
"s.nextInt()",
"s.nextInt",
"s",
"System.out.println(get_max_profit(a))",
"System.out.println",
"System.out",
"System",
"System.out",
"get_max_profit(a)",
"get_max_profit",
"a",
"String[] args",
"args",
"public class Main {\n\n\tpublic static int get_max_profit(int[] a) {\n\t\tif (a.length == 0)\n\t\t\treturn 0;\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = a[0];\n\t\tfor (int i = 1; i < a.length; i++) {\n\t\t\tmax = Math.max(a[i] - min, max);\n\t\t\tmin = Math.min(a[i], min);\n\t\t}\n\t\treturn max;\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint n = s.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = s.nextInt();\n\t\t}\n\t\tSystem.out.println(get_max_profit(a));\n\t}\n\n}",
"public class Main {\n\n\tpublic static int get_max_profit(int[] a) {\n\t\tif (a.length == 0)\n\t\t\treturn 0;\n\t\tint max = Integer.MIN_VALUE;\n\t\tint min = a[0];\n\t\tfor (int i = 1; i < a.length; i++) {\n\t\t\tmax = Math.max(a[i] - min, max);\n\t\t\tmin = Math.min(a[i], min);\n\t\t}\n\t\treturn max;\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint n = s.nextInt();\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ta[i] = s.nextInt();\n\t\t}\n\t\tSystem.out.println(get_max_profit(a));\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static int get_max_profit(int[] a) {
if (a.length == 0)
return 0;
int max = Integer.MIN_VALUE;
int min = a[0];
for (int i = 1; i < a.length; i++) {
max = Math.max(a[i] - min, max);
min = Math.min(a[i], min);
}
return max;
}
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = s.nextInt();
}
System.out.println(get_max_profit(a));
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
12,
13,
30,
4,
18,
20,
23,
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
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
19,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
47,
51
],
[
51,
52
],
[
51,
53
],
[
39,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
56,
60
],
[
8,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
4,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
67,
73
],
[
73,
74
]
] | [
"import java.util.*;\n\nclass Main {\n\n void solve() {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tint max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint r = in.nextInt();\n\t\t\tmax = Math.max(max, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n\n public static void main(String[] args) {\n new Main().solve();\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n\n void solve() {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tint max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint r = in.nextInt();\n\t\t\tmax = Math.max(max, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n\n public static void main(String[] args) {\n new Main().solve();\n }\n}",
"Main",
"void solve() {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tint max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint r = in.nextInt();\n\t\t\tmax = Math.max(max, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"solve",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tint max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint r = in.nextInt();\n\t\t\tmax = Math.max(max, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int max = Integer.MIN_VALUE",
"max",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"min = Integer.MAX_VALUE;",
"min",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"for(int i = 0; i < n; i++){\n\t\t\tint r = in.nextInt();\n\t\t\tmax = Math.max(max, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tint r = in.nextInt();\n\t\t\tmax = Math.max(max, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}",
"{\n\t\t\tint r = in.nextInt();\n\t\t\tmax = Math.max(max, r - min);\n\t\t\tmin = Math.min(min, r);\n\t\t}",
"int r = in.nextInt();",
"r",
"in.nextInt()",
"in.nextInt",
"in",
"max = Math.max(max, r - min)",
"max",
"Math.max(max, r - min)",
"Math.max",
"Math",
"max",
"r - min",
"r",
"min",
"min = Math.min(min, r)",
"min",
"Math.min(min, r)",
"Math.min",
"Math",
"min",
"r",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"public static void main(String[] args) {\n new Main().solve();\n }",
"main",
"{\n new Main().solve();\n }",
"new Main().solve()",
"new Main().solve",
"new Main()",
"String[] args",
"args"
] | import java.util.*;
class Main {
void solve() {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;
for(int i = 0; i < n; i++){
int r = in.nextInt();
max = Math.max(max, r - min);
min = Math.min(min, r);
}
System.out.println(max);
}
public static void main(String[] args) {
new Main().solve();
}
} |
[
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,
20,
4,
18,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
14,
2,
13,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
23,
13,
23,
13,
12,
13,
30,
0,
18,
36,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
36,
13,
13,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
18,
18,
36,
13,
17,
41,
13,
41,
13,
2,
18,
18,
36,
13,
17,
18,
18,
36,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
18,
36,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
18,
18,
36,
13,
13,
13,
14,
2,
13,
18,
18,
36,
13,
13,
30,
0,
13,
18,
18,
36,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
29,
13,
12,
13,
30,
41,
13,
17,
28,
13,
18,
36,
13,
30,
30,
0,
13,
4,
13,
13,
4,
18,
18,
13,
13,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
4,
18,
13,
13,
17,
1,
40,
13,
30,
30,
14,
2,
2,
2,
13,
13,
17,
2,
13,
17,
30,
29,
17,
29,
17,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
4,
13,
18,
36,
13,
18,
36,
13,
12,
13,
30,
14,
2,
2,
13,
13,
17,
30,
29,
13,
30,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
18,
36,
13,
13,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
41,
13,
11,
1,
41,
13,
17,
2,
13,
18,
18,
36,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
18,
36,
13,
13,
0,
13,
2,
13,
17,
42,
2,
2,
13,
17,
2,
18,
18,
36,
13,
13,
13,
30,
0,
18,
18,
36,
13,
2,
13,
17,
18,
18,
36,
13,
13,
40,
13,
0,
18,
18,
36,
13,
2,
13,
17,
13,
4,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
18,
18,
36,
13,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
2,
18,
18,
36,
13,
13,
17,
4,
18,
18,
13,
13,
18,
18,
36,
13,
2,
18,
18,
36,
13,
13,
17,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
478,
5
],
[
478,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
8,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
50,
51
],
[
6,
52
],
[
52,
53
],
[
0,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
54,
58
],
[
58,
59
],
[
54,
60
],
[
60,
61
],
[
54,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
69,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
65,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
80,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
62,
91
],
[
91,
92
],
[
62,
93
],
[
93,
94
],
[
54,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
103,
104
],
[
103,
105
],
[
97,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
113,
115
],
[
106,
116
],
[
116,
117
],
[
117,
118
],
[
106,
119
],
[
120,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
121,
127
],
[
127,
128
],
[
127,
129
],
[
95,
130
],
[
130,
131
],
[
54,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
134,
142
],
[
142,
143
],
[
134,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
146,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
134,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
157,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
157,
169
],
[
169,
170
],
[
170,
171
],
[
157,
172
],
[
173,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
181
],
[
176,
182
],
[
173,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
186,
190
],
[
183,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
194,
198
],
[
173,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
199,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
134,
207
],
[
207,
208
],
[
54,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
217,
219
],
[
215,
220
],
[
221,
221
],
[
221,
222
],
[
222,
223
],
[
222,
224
],
[
224,
225
],
[
224,
226
],
[
211,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
229,
231
],
[
227,
232
],
[
54,
233
],
[
233,
234
],
[
233,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
236,
241
],
[
241,
242
],
[
241,
243
],
[
243,
244
],
[
244,
245
],
[
245,
246
],
[
244,
247
],
[
243,
248
],
[
236,
249
],
[
249,
250
],
[
250,
251
],
[
236,
252
],
[
253,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
256,
257
],
[
257,
258
],
[
257,
259
],
[
256,
260
],
[
255,
261
],
[
261,
262
],
[
261,
263
],
[
254,
264
],
[
264,
265
],
[
265,
266
],
[
235,
267
],
[
267,
268
],
[
233,
269
],
[
269,
270
],
[
54,
271
],
[
271,
272
],
[
271,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
276,
277
],
[
276,
278
],
[
274,
279
],
[
279,
280
],
[
279,
281
],
[
281,
282
],
[
281,
283
],
[
279,
284
],
[
284,
285
],
[
284,
286
],
[
54,
287
],
[
287,
288
],
[
287,
289
],
[
289,
290
],
[
290,
291
],
[
291,
292
],
[
292,
293
],
[
292,
294
],
[
291,
295
],
[
290,
296
],
[
296,
297
],
[
297,
298
],
[
290,
299
],
[
299,
300
],
[
300,
301
],
[
301,
302
],
[
301,
303
],
[
301,
304
],
[
304,
305
],
[
304,
306
],
[
287,
307
],
[
307,
308
],
[
287,
309
],
[
309,
310
],
[
0,
311
],
[
311,
312
],
[
311,
313
],
[
313,
314
],
[
311,
315
],
[
315,
316
],
[
315,
317
],
[
317,
318
],
[
318,
319
],
[
319,
320
],
[
319,
321
],
[
318,
322
],
[
323,
324
],
[
323,
325
],
[
317,
326
],
[
326,
327
],
[
327,
328
],
[
328,
329
],
[
328,
330
],
[
326,
331
],
[
331,
332
],
[
331,
333
],
[
333,
334
],
[
333,
335
],
[
326,
336
],
[
336,
337
],
[
337,
338
],
[
326,
339
],
[
340,
340
],
[
340,
341
],
[
341,
342
],
[
342,
343
],
[
343,
344
],
[
343,
345
],
[
342,
346
],
[
341,
347
],
[
347,
348
],
[
347,
349
],
[
315,
350
],
[
350,
351
],
[
311,
352
],
[
352,
353
],
[
352,
354
],
[
354,
355
],
[
355,
356
],
[
354,
357
],
[
357,
358
],
[
354,
359
],
[
359,
360
],
[
360,
361
],
[
361,
362
],
[
361,
363
],
[
359,
364
],
[
364,
365
],
[
364,
366
],
[
366,
367
],
[
367,
368
],
[
367,
369
],
[
366,
370
],
[
359,
371
],
[
371,
372
],
[
372,
373
],
[
359,
374
],
[
375,
375
],
[
375,
376
],
[
376,
377
],
[
376,
378
],
[
378,
379
],
[
379,
380
],
[
379,
381
],
[
378,
382
],
[
375,
383
],
[
383,
384
],
[
383,
385
],
[
385,
386
],
[
385,
387
],
[
375,
388
],
[
388,
389
],
[
389,
390
],
[
390,
391
],
[
390,
392
],
[
389,
393
],
[
393,
394
],
[
394,
395
],
[
395,
396
],
[
395,
397
],
[
394,
398
],
[
393,
399
],
[
388,
400
],
[
400,
401
],
[
401,
402
],
[
402,
403
],
[
403,
404
],
[
403,
405
],
[
402,
406
],
[
406,
407
],
[
406,
408
],
[
401,
409
],
[
409,
410
],
[
410,
411
],
[
410,
412
],
[
409,
413
],
[
400,
414
],
[
414,
415
],
[
375,
416
],
[
416,
417
],
[
417,
418
],
[
418,
419
],
[
418,
420
],
[
417,
421
],
[
421,
422
],
[
421,
423
],
[
416,
424
],
[
375,
425
],
[
425,
426
],
[
311,
427
],
[
427,
428
],
[
427,
429
],
[
429,
430
],
[
430,
431
],
[
431,
432
],
[
432,
433
],
[
432,
434
],
[
430,
435
],
[
435,
436
],
[
435,
437
],
[
437,
438
],
[
438,
439
],
[
439,
440
],
[
439,
441
],
[
438,
442
],
[
437,
443
],
[
430,
444
],
[
444,
445
],
[
445,
446
],
[
430,
447
],
[
448,
448
],
[
448,
449
],
[
449,
450
],
[
450,
451
],
[
451,
452
],
[
451,
453
],
[
449,
454
],
[
454,
455
],
[
455,
456
],
[
456,
457
],
[
456,
458
],
[
455,
459
],
[
454,
460
],
[
429,
461
],
[
461,
462
],
[
462,
463
],
[
463,
464
],
[
463,
465
],
[
461,
466
],
[
466,
467
],
[
467,
468
],
[
467,
469
],
[
466,
470
],
[
470,
471
],
[
471,
472
],
[
472,
473
],
[
472,
474
],
[
471,
475
],
[
470,
476
],
[
0,
477
],
[
477,
478
],
[
477,
479
]
] | [
"import java.util.Scanner;\n/**\n * @author saiyo\n *\n */\npublic class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\t//int x = scan.nextInt();\n\t\t//int y = scan.nextInt();\n\t\t\n\t\t//Seisu s = new Seisu(x, y);\n\t\t//s.kouyaku();\n\n\t\tint con = scan.nextInt();\n\t\t\n\t\tint[] num = new int[con];\n\t\tfor(int i = 0; i < con; i++){\n\t\t\tnum[i] = scan.nextInt();\n\t\t}\n\t\tSeisu s = new Seisu(num);\n\t\tSystem.out.println(s.getProfit());\n\t\t\n\t\t//s.countSosu();\n\t\t/*\n\t\tSort s = new Sort(num);\n\t\ts.printSort();\n\t\ts.insertionSort();\n\t\t*/\n\t}\n\n}\n\nclass Seisu{\n\tprivate int x, y;\n\tprivate int snum[];\n\t\n\tSeisu(int x, int y){\n\t\tif(x >= y){\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}else{\n\t\t\tthis.x = y;\n\t\t\tthis.y = x;\n\t\t}\n\t\t\n\t}\n\t\n\tSeisu(int snum[]){\n\t\tthis.snum = new int[snum.length];\n\t\tfor(int i = 0; i < snum.length; i++){\n\t\t\tthis.snum[i] = snum[i];\n\t\t}\n\t}\n\t\n\tpublic int getProfit(){\n\t\tint fstM = this.snum[0], sa, maxProfit = this.snum[1] - this.snum[0];\n\t\tfor(int i = 1; i < this.snum.length; i++){\n\t\t\tsa = this.snum[i] - fstM;\n\t\t\tif(fstM > this.snum[i]){\n\t\t\t\tfstM = this.snum[i];\n\t\t\t}\n\t\t\tif(sa > maxProfit){\n\t\t\t\tmaxProfit = sa;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn maxProfit;\n\t}\n\t\n\tpublic void countSosu(){\n\t\tint con = 0;\n\t\tfor(int nu: this.snum){\n\t\t\tcon += isSosu(nu);\n\t\t}\n\t\tSystem.out.println(con);\n\t}\n\t\n\tpublic int isSosu(int num){\n\t\tfor(int i = 2; i < Math.sqrt(num) + 1; i++){\n\n\t\t\tif(num % i == 0 && num != 2){\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn 1;\n\t}\n\t\n\tpublic void kouyaku(){\n\t\tSystem.out.println(modSeisu(this.x, this.y));\n\t}\n\t\n\t\n\tpublic int modSeisu(int x, int y){\n\t\tif(x % y == 0){\n\t\t\treturn y;\n\t\t}else{\n\t\t\treturn modSeisu(y , x % y);\n\t\t}\n\t}\n}\n\nclass Sort{\n\tprivate int[] sorted;\n\t\n\tSort(int[] sorted){\n\t\tthis.sorted = new int[sorted.length];\n\t\tfor(int i = 0; i < sorted.length; i++){\n\t\t\tthis.sorted[i] = sorted[i];\n\t\t}\n\t}\n\t\n\tpublic void insertionSort(){\n\t\tint v, j;\n\t\tfor(int i = 1; i < this.sorted.length; i++){\n\t\t\tv = this.sorted[i];\n\t\t\tj = i - 1;\n\t\t\twhile(j >= 0 && this.sorted[j] > v){\n\t\t\t\tthis.sorted[j + 1] = this.sorted[j];\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tthis.sorted[j + 1] = v;\n\t\t\tprintSort();\n\t\t}\n\t}\n\t\n\tpublic void printSort(){\n\t\tfor(int i = 0; i < this.sorted.length - 1; i++){\n\t\t\tSystem.out.print(this.sorted[i] + \" \");\n\t\t}\n\t\tSystem.out.println(this.sorted[this.sorted.length - 1]);\n\t}\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\t//int x = scan.nextInt();\n\t\t//int y = scan.nextInt();\n\t\t\n\t\t//Seisu s = new Seisu(x, y);\n\t\t//s.kouyaku();\n\n\t\tint con = scan.nextInt();\n\t\t\n\t\tint[] num = new int[con];\n\t\tfor(int i = 0; i < con; i++){\n\t\t\tnum[i] = scan.nextInt();\n\t\t}\n\t\tSeisu s = new Seisu(num);\n\t\tSystem.out.println(s.getProfit());\n\t\t\n\t\t//s.countSosu();\n\t\t/*\n\t\tSort s = new Sort(num);\n\t\ts.printSort();\n\t\ts.insertionSort();\n\t\t*/\n\t}\n\n}",
"Main",
"/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\t//int x = scan.nextInt();\n\t\t//int y = scan.nextInt();\n\t\t\n\t\t//Seisu s = new Seisu(x, y);\n\t\t//s.kouyaku();\n\n\t\tint con = scan.nextInt();\n\t\t\n\t\tint[] num = new int[con];\n\t\tfor(int i = 0; i < con; i++){\n\t\t\tnum[i] = scan.nextInt();\n\t\t}\n\t\tSeisu s = new Seisu(num);\n\t\tSystem.out.println(s.getProfit());\n\t\t\n\t\t//s.countSosu();\n\t\t/*\n\t\tSort s = new Sort(num);\n\t\ts.printSort();\n\t\ts.insertionSort();\n\t\t*/\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\t//int x = scan.nextInt();\n\t\t//int y = scan.nextInt();\n\t\t\n\t\t//Seisu s = new Seisu(x, y);\n\t\t//s.kouyaku();\n\n\t\tint con = scan.nextInt();\n\t\t\n\t\tint[] num = new int[con];\n\t\tfor(int i = 0; i < con; i++){\n\t\t\tnum[i] = scan.nextInt();\n\t\t}\n\t\tSeisu s = new Seisu(num);\n\t\tSystem.out.println(s.getProfit());\n\t\t\n\t\t//s.countSosu();\n\t\t/*\n\t\tSort s = new Sort(num);\n\t\ts.printSort();\n\t\ts.insertionSort();\n\t\t*/\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int con = scan.nextInt();",
"con",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] num = new int[con];",
"num",
"new int[con]",
"con",
"for(int i = 0; i < con; i++){\n\t\t\tnum[i] = scan.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < con",
"i",
"con",
"i++",
"i++",
"i",
"{\n\t\t\tnum[i] = scan.nextInt();\n\t\t}",
"{\n\t\t\tnum[i] = scan.nextInt();\n\t\t}",
"num[i] = scan.nextInt()",
"num[i]",
"num",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"Seisu s = new Seisu(num);",
"s",
"new Seisu(num)",
"System.out.println(s.getProfit())",
"System.out.println",
"System.out",
"System",
"System.out",
"s.getProfit()",
"s.getProfit",
"s",
"String[] args",
"args",
"class Seisu{\n\tprivate int x, y;\n\tprivate int snum[];\n\t\n\tSeisu(int x, int y){\n\t\tif(x >= y){\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}else{\n\t\t\tthis.x = y;\n\t\t\tthis.y = x;\n\t\t}\n\t\t\n\t}\n\t\n\tSeisu(int snum[]){\n\t\tthis.snum = new int[snum.length];\n\t\tfor(int i = 0; i < snum.length; i++){\n\t\t\tthis.snum[i] = snum[i];\n\t\t}\n\t}\n\t\n\tpublic int getProfit(){\n\t\tint fstM = this.snum[0], sa, maxProfit = this.snum[1] - this.snum[0];\n\t\tfor(int i = 1; i < this.snum.length; i++){\n\t\t\tsa = this.snum[i] - fstM;\n\t\t\tif(fstM > this.snum[i]){\n\t\t\t\tfstM = this.snum[i];\n\t\t\t}\n\t\t\tif(sa > maxProfit){\n\t\t\t\tmaxProfit = sa;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn maxProfit;\n\t}\n\t\n\tpublic void countSosu(){\n\t\tint con = 0;\n\t\tfor(int nu: this.snum){\n\t\t\tcon += isSosu(nu);\n\t\t}\n\t\tSystem.out.println(con);\n\t}\n\t\n\tpublic int isSosu(int num){\n\t\tfor(int i = 2; i < Math.sqrt(num) + 1; i++){\n\n\t\t\tif(num % i == 0 && num != 2){\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn 1;\n\t}\n\t\n\tpublic void kouyaku(){\n\t\tSystem.out.println(modSeisu(this.x, this.y));\n\t}\n\t\n\t\n\tpublic int modSeisu(int x, int y){\n\t\tif(x % y == 0){\n\t\t\treturn y;\n\t\t}else{\n\t\t\treturn modSeisu(y , x % y);\n\t\t}\n\t}\n}",
"Seisu",
"private int x",
"x",
"y;",
"y",
"private int snum[];",
"snum",
"Seisu(int x, int y){\n\t\tif(x >= y){\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}else{\n\t\t\tthis.x = y;\n\t\t\tthis.y = x;\n\t\t}\n\t\t\n\t}",
"Seisu",
"{\n\t\tif(x >= y){\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}else{\n\t\t\tthis.x = y;\n\t\t\tthis.y = x;\n\t\t}\n\t\t\n\t}",
"if(x >= y){\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}else{\n\t\t\tthis.x = y;\n\t\t\tthis.y = x;\n\t\t}",
"x >= y",
"x",
"y",
"{\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}",
"this.x = x",
"this.x",
"this",
"this.x",
"x",
"this.y = y",
"this.y",
"this",
"this.y",
"y",
"{\n\t\t\tthis.x = y;\n\t\t\tthis.y = x;\n\t\t}",
"this.x = y",
"this.x",
"this",
"this.x",
"y",
"this.y = x",
"this.y",
"this",
"this.y",
"x",
"int x",
"x",
"int y",
"y",
"Seisu(int snum[]){\n\t\tthis.snum = new int[snum.length];\n\t\tfor(int i = 0; i < snum.length; i++){\n\t\t\tthis.snum[i] = snum[i];\n\t\t}\n\t}",
"Seisu",
"{\n\t\tthis.snum = new int[snum.length];\n\t\tfor(int i = 0; i < snum.length; i++){\n\t\t\tthis.snum[i] = snum[i];\n\t\t}\n\t}",
"this.snum = new int[snum.length]",
"this.snum",
"this",
"this.snum",
"new int[snum.length]",
"snum.length",
"snum",
"snum.length",
"for(int i = 0; i < snum.length; i++){\n\t\t\tthis.snum[i] = snum[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < snum.length",
"i",
"snum.length",
"snum",
"snum.length",
"i++",
"i++",
"i",
"{\n\t\t\tthis.snum[i] = snum[i];\n\t\t}",
"{\n\t\t\tthis.snum[i] = snum[i];\n\t\t}",
"this.snum[i] = snum[i]",
"this.snum[i]",
"this.snum",
"this",
"this.snum",
"i",
"snum[i]",
"snum",
"i",
"int snum[]",
"snum",
"public int getProfit(){\n\t\tint fstM = this.snum[0], sa, maxProfit = this.snum[1] - this.snum[0];\n\t\tfor(int i = 1; i < this.snum.length; i++){\n\t\t\tsa = this.snum[i] - fstM;\n\t\t\tif(fstM > this.snum[i]){\n\t\t\t\tfstM = this.snum[i];\n\t\t\t}\n\t\t\tif(sa > maxProfit){\n\t\t\t\tmaxProfit = sa;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn maxProfit;\n\t}",
"getProfit",
"{\n\t\tint fstM = this.snum[0], sa, maxProfit = this.snum[1] - this.snum[0];\n\t\tfor(int i = 1; i < this.snum.length; i++){\n\t\t\tsa = this.snum[i] - fstM;\n\t\t\tif(fstM > this.snum[i]){\n\t\t\t\tfstM = this.snum[i];\n\t\t\t}\n\t\t\tif(sa > maxProfit){\n\t\t\t\tmaxProfit = sa;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn maxProfit;\n\t}",
"int fstM = this.snum[0]",
"fstM",
"this.snum[0]",
"this.snum",
"this",
"this.snum",
"0",
"sa",
"sa",
"maxProfit = this.snum[1] - this.snum[0];",
"maxProfit",
"this.snum[1] - this.snum[0]",
"this.snum[1]",
"this.snum",
"this",
"this.snum",
"1",
"this.snum[0]",
"this.snum",
"this",
"this.snum",
"0",
"for(int i = 1; i < this.snum.length; i++){\n\t\t\tsa = this.snum[i] - fstM;\n\t\t\tif(fstM > this.snum[i]){\n\t\t\t\tfstM = this.snum[i];\n\t\t\t}\n\t\t\tif(sa > maxProfit){\n\t\t\t\tmaxProfit = sa;\n\t\t\t}\n\t\t\t\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < this.snum.length",
"i",
"this.snum.length",
"this.snum",
"this",
"this.snum",
"this.snum.length",
"i++",
"i++",
"i",
"{\n\t\t\tsa = this.snum[i] - fstM;\n\t\t\tif(fstM > this.snum[i]){\n\t\t\t\tfstM = this.snum[i];\n\t\t\t}\n\t\t\tif(sa > maxProfit){\n\t\t\t\tmaxProfit = sa;\n\t\t\t}\n\t\t\t\n\t\t}",
"{\n\t\t\tsa = this.snum[i] - fstM;\n\t\t\tif(fstM > this.snum[i]){\n\t\t\t\tfstM = this.snum[i];\n\t\t\t}\n\t\t\tif(sa > maxProfit){\n\t\t\t\tmaxProfit = sa;\n\t\t\t}\n\t\t\t\n\t\t}",
"sa = this.snum[i] - fstM",
"sa",
"this.snum[i] - fstM",
"this.snum[i]",
"this.snum",
"this",
"this.snum",
"i",
"fstM",
"if(fstM > this.snum[i]){\n\t\t\t\tfstM = this.snum[i];\n\t\t\t}",
"fstM > this.snum[i]",
"fstM",
"this.snum[i]",
"this.snum",
"this",
"this.snum",
"i",
"{\n\t\t\t\tfstM = this.snum[i];\n\t\t\t}",
"fstM = this.snum[i]",
"fstM",
"this.snum[i]",
"this.snum",
"this",
"this.snum",
"i",
"if(sa > maxProfit){\n\t\t\t\tmaxProfit = sa;\n\t\t\t}",
"sa > maxProfit",
"sa",
"maxProfit",
"{\n\t\t\t\tmaxProfit = sa;\n\t\t\t}",
"maxProfit = sa",
"maxProfit",
"sa",
"return maxProfit;",
"maxProfit",
"public void countSosu(){\n\t\tint con = 0;\n\t\tfor(int nu: this.snum){\n\t\t\tcon += isSosu(nu);\n\t\t}\n\t\tSystem.out.println(con);\n\t}",
"countSosu",
"{\n\t\tint con = 0;\n\t\tfor(int nu: this.snum){\n\t\t\tcon += isSosu(nu);\n\t\t}\n\t\tSystem.out.println(con);\n\t}",
"int con = 0;",
"con",
"0",
"for(int nu: this.snum){\n\t\t\tcon += isSosu(nu);\n\t\t}",
"int nu",
"this.snum",
"this",
"this.snum",
"{\n\t\t\tcon += isSosu(nu);\n\t\t}",
"{\n\t\t\tcon += isSosu(nu);\n\t\t}",
"con += isSosu(nu)",
"con",
"isSosu(nu)",
"isSosu",
"nu",
"System.out.println(con)",
"System.out.println",
"System.out",
"System",
"System.out",
"con",
"public int isSosu(int num){\n\t\tfor(int i = 2; i < Math.sqrt(num) + 1; i++){\n\n\t\t\tif(num % i == 0 && num != 2){\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn 1;\n\t}",
"isSosu",
"{\n\t\tfor(int i = 2; i < Math.sqrt(num) + 1; i++){\n\n\t\t\tif(num % i == 0 && num != 2){\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn 1;\n\t}",
"for(int i = 2; i < Math.sqrt(num) + 1; i++){\n\n\t\t\tif(num % i == 0 && num != 2){\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t}",
"int i = 2;",
"int i = 2;",
"i",
"2",
"i < Math.sqrt(num) + 1",
"i",
"Math.sqrt(num) + 1",
"Math.sqrt(num)",
"Math.sqrt",
"Math",
"num",
"1",
"i++",
"i++",
"i",
"{\n\n\t\t\tif(num % i == 0 && num != 2){\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t}",
"{\n\n\t\t\tif(num % i == 0 && num != 2){\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t}",
"if(num % i == 0 && num != 2){\n\t\t\t\treturn 0;\n\t\t\t}",
"num % i == 0 && num != 2",
"num % i == 0",
"num % i",
"num",
"i",
"0",
"num != 2",
"num",
"2",
"{\n\t\t\t\treturn 0;\n\t\t\t}",
"return 0;",
"0",
"return 1;",
"1",
"int num",
"num",
"public void kouyaku(){\n\t\tSystem.out.println(modSeisu(this.x, this.y));\n\t}",
"kouyaku",
"{\n\t\tSystem.out.println(modSeisu(this.x, this.y));\n\t}",
"System.out.println(modSeisu(this.x, this.y))",
"System.out.println",
"System.out",
"System",
"System.out",
"modSeisu(this.x, this.y)",
"modSeisu",
"this.x",
"this",
"this.x",
"this.y",
"this",
"this.y",
"public int modSeisu(int x, int y){\n\t\tif(x % y == 0){\n\t\t\treturn y;\n\t\t}else{\n\t\t\treturn modSeisu(y , x % y);\n\t\t}\n\t}",
"modSeisu",
"{\n\t\tif(x % y == 0){\n\t\t\treturn y;\n\t\t}else{\n\t\t\treturn modSeisu(y , x % y);\n\t\t}\n\t}",
"if(x % y == 0){\n\t\t\treturn y;\n\t\t}else{\n\t\t\treturn modSeisu(y , x % y);\n\t\t}",
"x % y == 0",
"x % y",
"x",
"y",
"0",
"{\n\t\t\treturn y;\n\t\t}",
"return y;",
"y",
"{\n\t\t\treturn modSeisu(y , x % y);\n\t\t}",
"return modSeisu(y , x % y);",
"modSeisu(y , x % y)",
"modSeisu",
"y",
"x % y",
"x",
"y",
"int x",
"x",
"int y",
"y",
"class Sort{\n\tprivate int[] sorted;\n\t\n\tSort(int[] sorted){\n\t\tthis.sorted = new int[sorted.length];\n\t\tfor(int i = 0; i < sorted.length; i++){\n\t\t\tthis.sorted[i] = sorted[i];\n\t\t}\n\t}\n\t\n\tpublic void insertionSort(){\n\t\tint v, j;\n\t\tfor(int i = 1; i < this.sorted.length; i++){\n\t\t\tv = this.sorted[i];\n\t\t\tj = i - 1;\n\t\t\twhile(j >= 0 && this.sorted[j] > v){\n\t\t\t\tthis.sorted[j + 1] = this.sorted[j];\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tthis.sorted[j + 1] = v;\n\t\t\tprintSort();\n\t\t}\n\t}\n\t\n\tpublic void printSort(){\n\t\tfor(int i = 0; i < this.sorted.length - 1; i++){\n\t\t\tSystem.out.print(this.sorted[i] + \" \");\n\t\t}\n\t\tSystem.out.println(this.sorted[this.sorted.length - 1]);\n\t}\n}",
"Sort",
"private int[] sorted;",
"sorted",
"Sort(int[] sorted){\n\t\tthis.sorted = new int[sorted.length];\n\t\tfor(int i = 0; i < sorted.length; i++){\n\t\t\tthis.sorted[i] = sorted[i];\n\t\t}\n\t}",
"Sort",
"{\n\t\tthis.sorted = new int[sorted.length];\n\t\tfor(int i = 0; i < sorted.length; i++){\n\t\t\tthis.sorted[i] = sorted[i];\n\t\t}\n\t}",
"this.sorted = new int[sorted.length]",
"this.sorted",
"this",
"this.sorted",
"new int[sorted.length]",
"sorted.length",
"sorted",
"sorted.length",
"for(int i = 0; i < sorted.length; i++){\n\t\t\tthis.sorted[i] = sorted[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < sorted.length",
"i",
"sorted.length",
"sorted",
"sorted.length",
"i++",
"i++",
"i",
"{\n\t\t\tthis.sorted[i] = sorted[i];\n\t\t}",
"{\n\t\t\tthis.sorted[i] = sorted[i];\n\t\t}",
"this.sorted[i] = sorted[i]",
"this.sorted[i]",
"this.sorted",
"this",
"this.sorted",
"i",
"sorted[i]",
"sorted",
"i",
"int[] sorted",
"sorted",
"public void insertionSort(){\n\t\tint v, j;\n\t\tfor(int i = 1; i < this.sorted.length; i++){\n\t\t\tv = this.sorted[i];\n\t\t\tj = i - 1;\n\t\t\twhile(j >= 0 && this.sorted[j] > v){\n\t\t\t\tthis.sorted[j + 1] = this.sorted[j];\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tthis.sorted[j + 1] = v;\n\t\t\tprintSort();\n\t\t}\n\t}",
"insertionSort",
"{\n\t\tint v, j;\n\t\tfor(int i = 1; i < this.sorted.length; i++){\n\t\t\tv = this.sorted[i];\n\t\t\tj = i - 1;\n\t\t\twhile(j >= 0 && this.sorted[j] > v){\n\t\t\t\tthis.sorted[j + 1] = this.sorted[j];\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tthis.sorted[j + 1] = v;\n\t\t\tprintSort();\n\t\t}\n\t}",
"int v",
"v",
"j;",
"j",
"for(int i = 1; i < this.sorted.length; i++){\n\t\t\tv = this.sorted[i];\n\t\t\tj = i - 1;\n\t\t\twhile(j >= 0 && this.sorted[j] > v){\n\t\t\t\tthis.sorted[j + 1] = this.sorted[j];\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tthis.sorted[j + 1] = v;\n\t\t\tprintSort();\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < this.sorted.length",
"i",
"this.sorted.length",
"this.sorted",
"this",
"this.sorted",
"this.sorted.length",
"i++",
"i++",
"i",
"{\n\t\t\tv = this.sorted[i];\n\t\t\tj = i - 1;\n\t\t\twhile(j >= 0 && this.sorted[j] > v){\n\t\t\t\tthis.sorted[j + 1] = this.sorted[j];\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tthis.sorted[j + 1] = v;\n\t\t\tprintSort();\n\t\t}",
"{\n\t\t\tv = this.sorted[i];\n\t\t\tj = i - 1;\n\t\t\twhile(j >= 0 && this.sorted[j] > v){\n\t\t\t\tthis.sorted[j + 1] = this.sorted[j];\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tthis.sorted[j + 1] = v;\n\t\t\tprintSort();\n\t\t}",
"v = this.sorted[i]",
"v",
"this.sorted[i]",
"this.sorted",
"this",
"this.sorted",
"i",
"j = i - 1",
"j",
"i - 1",
"i",
"1",
"while(j >= 0 && this.sorted[j] > v){\n\t\t\t\tthis.sorted[j + 1] = this.sorted[j];\n\t\t\t\tj--;\n\t\t\t}",
"j >= 0 && this.sorted[j] > v",
"j >= 0",
"j",
"0",
"this.sorted[j] > v",
"this.sorted[j]",
"this.sorted",
"this",
"this.sorted",
"j",
"v",
"{\n\t\t\t\tthis.sorted[j + 1] = this.sorted[j];\n\t\t\t\tj--;\n\t\t\t}",
"this.sorted[j + 1] = this.sorted[j]",
"this.sorted[j + 1]",
"this.sorted",
"this",
"this.sorted",
"j + 1",
"j",
"1",
"this.sorted[j]",
"this.sorted",
"this",
"this.sorted",
"j",
"j--",
"j",
"this.sorted[j + 1] = v",
"this.sorted[j + 1]",
"this.sorted",
"this",
"this.sorted",
"j + 1",
"j",
"1",
"v",
"printSort()",
"printSort",
"public void printSort(){\n\t\tfor(int i = 0; i < this.sorted.length - 1; i++){\n\t\t\tSystem.out.print(this.sorted[i] + \" \");\n\t\t}\n\t\tSystem.out.println(this.sorted[this.sorted.length - 1]);\n\t}",
"printSort",
"{\n\t\tfor(int i = 0; i < this.sorted.length - 1; i++){\n\t\t\tSystem.out.print(this.sorted[i] + \" \");\n\t\t}\n\t\tSystem.out.println(this.sorted[this.sorted.length - 1]);\n\t}",
"for(int i = 0; i < this.sorted.length - 1; i++){\n\t\t\tSystem.out.print(this.sorted[i] + \" \");\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < this.sorted.length - 1",
"i",
"this.sorted.length - 1",
"this.sorted.length",
"this.sorted",
"this",
"this.sorted",
"this.sorted.length",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.print(this.sorted[i] + \" \");\n\t\t}",
"{\n\t\t\tSystem.out.print(this.sorted[i] + \" \");\n\t\t}",
"System.out.print(this.sorted[i] + \" \")",
"System.out.print",
"System.out",
"System",
"System.out",
"this.sorted[i] + \" \"",
"this.sorted[i]",
"this.sorted",
"this",
"this.sorted",
"i",
"\" \"",
"System.out.println(this.sorted[this.sorted.length - 1])",
"System.out.println",
"System.out",
"System",
"System.out",
"this.sorted[this.sorted.length - 1]",
"this.sorted",
"this",
"this.sorted",
"this.sorted.length - 1",
"this.sorted.length",
"this.sorted",
"this",
"this.sorted",
"this.sorted.length",
"1",
"public class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\t//int x = scan.nextInt();\n\t\t//int y = scan.nextInt();\n\t\t\n\t\t//Seisu s = new Seisu(x, y);\n\t\t//s.kouyaku();\n\n\t\tint con = scan.nextInt();\n\t\t\n\t\tint[] num = new int[con];\n\t\tfor(int i = 0; i < con; i++){\n\t\t\tnum[i] = scan.nextInt();\n\t\t}\n\t\tSeisu s = new Seisu(num);\n\t\tSystem.out.println(s.getProfit());\n\t\t\n\t\t//s.countSosu();\n\t\t/*\n\t\tSort s = new Sort(num);\n\t\ts.printSort();\n\t\ts.insertionSort();\n\t\t*/\n\t}\n\n}",
"public class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\t//int x = scan.nextInt();\n\t\t//int y = scan.nextInt();\n\t\t\n\t\t//Seisu s = new Seisu(x, y);\n\t\t//s.kouyaku();\n\n\t\tint con = scan.nextInt();\n\t\t\n\t\tint[] num = new int[con];\n\t\tfor(int i = 0; i < con; i++){\n\t\t\tnum[i] = scan.nextInt();\n\t\t}\n\t\tSeisu s = new Seisu(num);\n\t\tSystem.out.println(s.getProfit());\n\t\t\n\t\t//s.countSosu();\n\t\t/*\n\t\tSort s = new Sort(num);\n\t\ts.printSort();\n\t\ts.insertionSort();\n\t\t*/\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
/**
* @author saiyo
*
*/
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scan = new Scanner(System.in);
//int x = scan.nextInt();
//int y = scan.nextInt();
//Seisu s = new Seisu(x, y);
//s.kouyaku();
int con = scan.nextInt();
int[] num = new int[con];
for(int i = 0; i < con; i++){
num[i] = scan.nextInt();
}
Seisu s = new Seisu(num);
System.out.println(s.getProfit());
//s.countSosu();
/*
Sort s = new Sort(num);
s.printSort();
s.insertionSort();
*/
}
}
class Seisu{
private int x, y;
private int snum[];
Seisu(int x, int y){
if(x >= y){
this.x = x;
this.y = y;
}else{
this.x = y;
this.y = x;
}
}
Seisu(int snum[]){
this.snum = new int[snum.length];
for(int i = 0; i < snum.length; i++){
this.snum[i] = snum[i];
}
}
public int getProfit(){
int fstM = this.snum[0], sa, maxProfit = this.snum[1] - this.snum[0];
for(int i = 1; i < this.snum.length; i++){
sa = this.snum[i] - fstM;
if(fstM > this.snum[i]){
fstM = this.snum[i];
}
if(sa > maxProfit){
maxProfit = sa;
}
}
return maxProfit;
}
public void countSosu(){
int con = 0;
for(int nu: this.snum){
con += isSosu(nu);
}
System.out.println(con);
}
public int isSosu(int num){
for(int i = 2; i < Math.sqrt(num) + 1; i++){
if(num % i == 0 && num != 2){
return 0;
}
}
return 1;
}
public void kouyaku(){
System.out.println(modSeisu(this.x, this.y));
}
public int modSeisu(int x, int y){
if(x % y == 0){
return y;
}else{
return modSeisu(y , x % y);
}
}
}
class Sort{
private int[] sorted;
Sort(int[] sorted){
this.sorted = new int[sorted.length];
for(int i = 0; i < sorted.length; i++){
this.sorted[i] = sorted[i];
}
}
public void insertionSort(){
int v, j;
for(int i = 1; i < this.sorted.length; i++){
v = this.sorted[i];
j = i - 1;
while(j >= 0 && this.sorted[j] > v){
this.sorted[j + 1] = this.sorted[j];
j--;
}
this.sorted[j + 1] = v;
printSort();
}
}
public void printSort(){
for(int i = 0; i < this.sorted.length - 1; i++){
System.out.print(this.sorted[i] + " ");
}
System.out.println(this.sorted[this.sorted.length - 1]);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
2,
17,
17,
41,
13,
40,
2,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
10,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
21,
23
],
[
10,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
10,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
30,
38
],
[
38,
39
],
[
39,
40
],
[
30,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
42,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
50,
54
],
[
54,
55
],
[
54,
56
],
[
42,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
59,
63
],
[
10,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
6,
70
],
[
70,
71
]
] | [
"import java.util.*;\n\nclass Main {\n public static void main(String args[]) {\n try(Scanner sc = new Scanner(System.in)) {\n long N = sc.nextLong();\n long min = 1L << 60;\n long ans = - (1L << 60);\n for (long i = 0; i < N; i++) {\n long now = sc.nextLong();\n ans = Math.max(ans, now - min);\n min = Math.min(min, now);\n }\n System.out.println(ans);\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n public static void main(String args[]) {\n try(Scanner sc = new Scanner(System.in)) {\n long N = sc.nextLong();\n long min = 1L << 60;\n long ans = - (1L << 60);\n for (long i = 0; i < N; i++) {\n long now = sc.nextLong();\n ans = Math.max(ans, now - min);\n min = Math.min(min, now);\n }\n System.out.println(ans);\n }\n }\n}",
"Main",
"public static void main(String args[]) {\n try(Scanner sc = new Scanner(System.in)) {\n long N = sc.nextLong();\n long min = 1L << 60;\n long ans = - (1L << 60);\n for (long i = 0; i < N; i++) {\n long now = sc.nextLong();\n ans = Math.max(ans, now - min);\n min = Math.min(min, now);\n }\n System.out.println(ans);\n }\n }",
"main",
"{\n try(Scanner sc = new Scanner(System.in)) {\n long N = sc.nextLong();\n long min = 1L << 60;\n long ans = - (1L << 60);\n for (long i = 0; i < N; i++) {\n long now = sc.nextLong();\n ans = Math.max(ans, now - min);\n min = Math.min(min, now);\n }\n System.out.println(ans);\n }\n }",
"try(Scanner sc = new Scanner(System.in)) {\n long N = sc.nextLong();\n long min = 1L << 60;\n long ans = - (1L << 60);\n for (long i = 0; i < N; i++) {\n long now = sc.nextLong();\n ans = Math.max(ans, now - min);\n min = Math.min(min, now);\n }\n System.out.println(ans);\n }",
"{\n long N = sc.nextLong();\n long min = 1L << 60;\n long ans = - (1L << 60);\n for (long i = 0; i < N; i++) {\n long now = sc.nextLong();\n ans = Math.max(ans, now - min);\n min = Math.min(min, now);\n }\n System.out.println(ans);\n }",
"Scanner sc = new Scanner(System.in)",
"Scanner sc = new Scanner(System.in)",
"new Scanner(System.in)",
"long N = sc.nextLong();",
"N",
"sc.nextLong()",
"sc.nextLong",
"sc",
"long min = 1L << 60;",
"min",
"1L << 60",
"1L",
"60",
"long ans = - (1L << 60);",
"ans",
"- (1L << 60)",
"(1L << 60)",
"1L",
"60",
"for (long i = 0; i < N; i++) {\n long now = sc.nextLong();\n ans = Math.max(ans, now - min);\n min = Math.min(min, now);\n }",
"long i = 0;",
"long i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n long now = sc.nextLong();\n ans = Math.max(ans, now - min);\n min = Math.min(min, now);\n }",
"{\n long now = sc.nextLong();\n ans = Math.max(ans, now - min);\n min = Math.min(min, now);\n }",
"long now = sc.nextLong();",
"now",
"sc.nextLong()",
"sc.nextLong",
"sc",
"ans = Math.max(ans, now - min)",
"ans",
"Math.max(ans, now - min)",
"Math.max",
"Math",
"ans",
"now - min",
"now",
"min",
"min = Math.min(min, now)",
"min",
"Math.min(min, now)",
"Math.min",
"Math",
"min",
"now",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String args[]",
"args"
] | import java.util.*;
class Main {
public static void main(String args[]) {
try(Scanner sc = new Scanner(System.in)) {
long N = sc.nextLong();
long min = 1L << 60;
long ans = - (1L << 60);
for (long i = 0; i < N; i++) {
long now = sc.nextLong();
ans = Math.max(ans, now - min);
min = Math.min(min, now);
}
System.out.println(ans);
}
}
} |
[
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,
18,
13,
13,
41,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
13,
30,
11,
1,
41,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
18,
13,
13,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
115,
5
],
[
115,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
8,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
73,
80
],
[
80,
81
],
[
80,
82
],
[
73,
83
],
[
83,
84
],
[
84,
85
],
[
73,
86
],
[
87,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
90,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
98,
100
],
[
72,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
103,
105
],
[
8,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
6,
112
],
[
112,
113
],
[
0,
114
],
[
114,
115
],
[
114,
116
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num = sc.nextInt();\n\t\t\n\t\tint[] arr = new int[num];\n\t\tfor(int i = 0; i < num; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tint maxDif = Integer.MIN_VALUE;\n\t\tint maxNum;\n\t\tint smallerNum = arr[0];\n\t\t\n\t\tfor(int i = 0; i < num; i++) {\n\t\t\tif (arr[i] <= smallerNum) {\n\t\t\t\tfor(int j = i + 1; j < num; j++) {\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}\n\t\t\tsmallerNum = arr[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(maxDif);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num = sc.nextInt();\n\t\t\n\t\tint[] arr = new int[num];\n\t\tfor(int i = 0; i < num; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tint maxDif = Integer.MIN_VALUE;\n\t\tint maxNum;\n\t\tint smallerNum = arr[0];\n\t\t\n\t\tfor(int i = 0; i < num; i++) {\n\t\t\tif (arr[i] <= smallerNum) {\n\t\t\t\tfor(int j = i + 1; j < num; j++) {\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}\n\t\t\tsmallerNum = arr[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(maxDif);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num = sc.nextInt();\n\t\t\n\t\tint[] arr = new int[num];\n\t\tfor(int i = 0; i < num; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tint maxDif = Integer.MIN_VALUE;\n\t\tint maxNum;\n\t\tint smallerNum = arr[0];\n\t\t\n\t\tfor(int i = 0; i < num; i++) {\n\t\t\tif (arr[i] <= smallerNum) {\n\t\t\t\tfor(int j = i + 1; j < num; j++) {\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}\n\t\t\tsmallerNum = arr[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(maxDif);\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num = sc.nextInt();\n\t\t\n\t\tint[] arr = new int[num];\n\t\tfor(int i = 0; i < num; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tint maxDif = Integer.MIN_VALUE;\n\t\tint maxNum;\n\t\tint smallerNum = arr[0];\n\t\t\n\t\tfor(int i = 0; i < num; i++) {\n\t\t\tif (arr[i] <= smallerNum) {\n\t\t\t\tfor(int j = i + 1; j < num; j++) {\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}\n\t\t\tsmallerNum = arr[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(maxDif);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int num = sc.nextInt();",
"num",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] arr = new int[num];",
"arr",
"new int[num]",
"num",
"for(int i = 0; i < num; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < num",
"i",
"num",
"i++",
"i++",
"i",
"{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}",
"arr[i] = sc.nextInt()",
"arr[i]",
"arr",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int maxDif = Integer.MIN_VALUE;",
"maxDif",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int maxNum;",
"maxNum",
"int smallerNum = arr[0];",
"smallerNum",
"arr[0]",
"arr",
"0",
"for(int i = 0; i < num; i++) {\n\t\t\tif (arr[i] <= smallerNum) {\n\t\t\t\tfor(int j = i + 1; j < num; j++) {\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}\n\t\t\tsmallerNum = arr[i];\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < num",
"i",
"num",
"i++",
"i++",
"i",
"{\n\t\t\tif (arr[i] <= smallerNum) {\n\t\t\t\tfor(int j = i + 1; j < num; j++) {\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}\n\t\t\tsmallerNum = arr[i];\n\t\t\t}\n\t\t}",
"{\n\t\t\tif (arr[i] <= smallerNum) {\n\t\t\t\tfor(int j = i + 1; j < num; j++) {\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}\n\t\t\tsmallerNum = arr[i];\n\t\t\t}\n\t\t}",
"if (arr[i] <= smallerNum) {\n\t\t\t\tfor(int j = i + 1; j < num; j++) {\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}\n\t\t\tsmallerNum = arr[i];\n\t\t\t}",
"arr[i] <= smallerNum",
"arr[i]",
"arr",
"i",
"smallerNum",
"{\n\t\t\t\tfor(int j = i + 1; j < num; j++) {\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}\n\t\t\tsmallerNum = arr[i];\n\t\t\t}",
"for(int j = i + 1; j < num; j++) {\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}",
"int j = i + 1;",
"int j = i + 1;",
"j",
"i + 1",
"i",
"1",
"j < num",
"j",
"num",
"j++",
"j++",
"j",
"{\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}",
"{\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}",
"maxDif = Math.max(maxDif, arr[j] - arr[i])",
"maxDif",
"Math.max(maxDif, arr[j] - arr[i])",
"Math.max",
"Math",
"maxDif",
"arr[j] - arr[i]",
"arr[j]",
"arr",
"j",
"arr[i]",
"arr",
"i",
"smallerNum = arr[i]",
"smallerNum",
"arr[i]",
"arr",
"i",
"System.out.println(maxDif)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxDif",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num = sc.nextInt();\n\t\t\n\t\tint[] arr = new int[num];\n\t\tfor(int i = 0; i < num; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tint maxDif = Integer.MIN_VALUE;\n\t\tint maxNum;\n\t\tint smallerNum = arr[0];\n\t\t\n\t\tfor(int i = 0; i < num; i++) {\n\t\t\tif (arr[i] <= smallerNum) {\n\t\t\t\tfor(int j = i + 1; j < num; j++) {\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}\n\t\t\tsmallerNum = arr[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(maxDif);\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\t\tScanner sc = new Scanner(System.in);\n\t\tint num = sc.nextInt();\n\t\t\n\t\tint[] arr = new int[num];\n\t\tfor(int i = 0; i < num; i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tint maxDif = Integer.MIN_VALUE;\n\t\tint maxNum;\n\t\tint smallerNum = arr[0];\n\t\t\n\t\tfor(int i = 0; i < num; i++) {\n\t\t\tif (arr[i] <= smallerNum) {\n\t\t\t\tfor(int j = i + 1; j < num; j++) {\n\t\t\t\t\tmaxDif = Math.max(maxDif, arr[j] - arr[i]);\n\t\t\t\t}\n\t\t\tsmallerNum = arr[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(maxDif);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
int[] arr = new int[num];
for(int i = 0; i < num; i++) {
arr[i] = sc.nextInt();
}
int maxDif = Integer.MIN_VALUE;
int maxNum;
int smallerNum = arr[0];
for(int i = 0; i < num; i++) {
if (arr[i] <= smallerNum) {
for(int j = i + 1; j < num; j++) {
maxDif = Math.max(maxDif, arr[j] - arr[i]);
}
smallerNum = arr[i];
}
}
System.out.println(maxDif);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
41,
13,
20,
0,
13,
4,
18,
13,
41,
13,
40,
17,
41,
13,
0,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
4,
13,
13,
2,
13,
13,
0,
13,
4,
13,
13,
13,
4,
18,
18,
13,
13,
13,
12,
13,
30,
14,
2,
13,
13,
29,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
29,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
20,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
4,
8
],
[
8,
9
],
[
8,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
10,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
10,
23
],
[
23,
24
],
[
10,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
10,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
37,
39
],
[
30,
40
],
[
40,
41
],
[
41,
42
],
[
30,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
44,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
52,
55
],
[
55,
56
],
[
55,
57
],
[
44,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
60,
63
],
[
10,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
4,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
73,
79
],
[
79,
80
],
[
70,
81
],
[
81,
82
],
[
70,
83
],
[
83,
84
],
[
4,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
88,
94
],
[
94,
95
],
[
85,
96
],
[
96,
97
],
[
85,
98
],
[
98,
99
],
[
4,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
100,
104
],
[
104,
105
]
] | [
"import java.util.*;\nclass Main{\n int n;\n \n Main(){\n\tScanner sc = new Scanner(System.in);\n\tn=sc.nextInt();\n\tint ans=-1000000000;\n\tint mini;\n\tmini=sc.nextInt();\n\n\tfor(int i=0; i<n-1; i++){\n\t int num=sc.nextInt();\n\t \n\t ans=max(ans,num-mini);\n\n\t mini=min(mini,num);\n\t}\n \n\tSystem.out.println(ans);\n }\n\n int max(int a,int b){\n\tif(a>b)return a;\n\telse return b;\n }\n\n int min(int a,int b){\n\tif(a<b)return a;\n\telse return b;\n }\n\n\n\n\n\n public static void main(String[] args){\n\tnew Main();\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n int n;\n \n Main(){\n\tScanner sc = new Scanner(System.in);\n\tn=sc.nextInt();\n\tint ans=-1000000000;\n\tint mini;\n\tmini=sc.nextInt();\n\n\tfor(int i=0; i<n-1; i++){\n\t int num=sc.nextInt();\n\t \n\t ans=max(ans,num-mini);\n\n\t mini=min(mini,num);\n\t}\n \n\tSystem.out.println(ans);\n }\n\n int max(int a,int b){\n\tif(a>b)return a;\n\telse return b;\n }\n\n int min(int a,int b){\n\tif(a<b)return a;\n\telse return b;\n }\n\n\n\n\n\n public static void main(String[] args){\n\tnew Main();\n }\n}",
"Main",
"int n;",
"n",
"Main(){\n\tScanner sc = new Scanner(System.in);\n\tn=sc.nextInt();\n\tint ans=-1000000000;\n\tint mini;\n\tmini=sc.nextInt();\n\n\tfor(int i=0; i<n-1; i++){\n\t int num=sc.nextInt();\n\t \n\t ans=max(ans,num-mini);\n\n\t mini=min(mini,num);\n\t}\n \n\tSystem.out.println(ans);\n }",
"Main",
"{\n\tScanner sc = new Scanner(System.in);\n\tn=sc.nextInt();\n\tint ans=-1000000000;\n\tint mini;\n\tmini=sc.nextInt();\n\n\tfor(int i=0; i<n-1; i++){\n\t int num=sc.nextInt();\n\t \n\t ans=max(ans,num-mini);\n\n\t mini=min(mini,num);\n\t}\n \n\tSystem.out.println(ans);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"n=sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int ans=-1000000000;",
"ans",
"-1000000000",
"1000000000",
"int mini;",
"mini",
"mini=sc.nextInt()",
"mini",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=0; i<n-1; i++){\n\t int num=sc.nextInt();\n\t \n\t ans=max(ans,num-mini);\n\n\t mini=min(mini,num);\n\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n\t int num=sc.nextInt();\n\t \n\t ans=max(ans,num-mini);\n\n\t mini=min(mini,num);\n\t}",
"{\n\t int num=sc.nextInt();\n\t \n\t ans=max(ans,num-mini);\n\n\t mini=min(mini,num);\n\t}",
"int num=sc.nextInt();",
"num",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ans=max(ans,num-mini)",
"ans",
"max(ans,num-mini)",
"max",
"ans",
"num-mini",
"num",
"mini",
"mini=min(mini,num)",
"mini",
"min(mini,num)",
"min",
"mini",
"num",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"int max(int a,int b){\n\tif(a>b)return a;\n\telse return b;\n }",
"max",
"{\n\tif(a>b)return a;\n\telse return b;\n }",
"if(a>b)return a;\n\telse return b;",
"a>b",
"a",
"b",
"return a;",
"a",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"int min(int a,int b){\n\tif(a<b)return a;\n\telse return b;\n }",
"min",
"{\n\tif(a<b)return a;\n\telse return b;\n }",
"if(a<b)return a;\n\telse return b;",
"a<b",
"a",
"b",
"return a;",
"a",
"return b;",
"b",
"int a",
"a",
"int b",
"b",
"public static void main(String[] args){\n\tnew Main();\n }",
"main",
"{\n\tnew Main();\n }",
"new Main()",
"String[] args",
"args"
] | import java.util.*;
class Main{
int n;
Main(){
Scanner sc = new Scanner(System.in);
n=sc.nextInt();
int ans=-1000000000;
int mini;
mini=sc.nextInt();
for(int i=0; i<n-1; i++){
int num=sc.nextInt();
ans=max(ans,num-mini);
mini=min(mini,num);
}
System.out.println(ans);
}
int max(int a,int b){
if(a>b)return a;
else return b;
}
int min(int a,int b){
if(a<b)return a;
else return b;
}
public static void main(String[] args){
new Main();
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
42,
17,
30,
41,
13,
4,
18,
13,
0,
18,
13,
13,
4,
18,
13,
13,
14,
2,
40,
13,
13,
3,
4,
18,
18,
13,
13,
4,
18,
13,
4,
13,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
2,
18,
13,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
14,
2,
13,
18,
13,
13,
30,
0,
13,
18,
13,
13,
29,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
13,
18
],
[
9,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
28,
29
],
[
29,
30
],
[
19,
31
],
[
31,
32
],
[
31,
33
],
[
19,
35
],
[
35,
36
],
[
35,
37
],
[
19,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
40,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
40,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
54,
59
],
[
19,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
68,
70
],
[
6,
71
],
[
71,
72
],
[
4,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
78,
80
],
[
75,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
75,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
86,
96
],
[
96,
97
],
[
97,
98
],
[
86,
99
],
[
100,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
100,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
100,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
119,
121
],
[
116,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
125,
127
],
[
75,
128
],
[
128,
129
],
[
73,
130
],
[
130,
131
]
] | [
"import java.io.*;\n\nclass Main\n{\n \n public static void main(String[] args)\n {\n try{\n \t// ??\\???????????????\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n // ????????°???????????????\n int n = Integer.parseInt(br.readLine());\n int[] array = new int[n];\n int putnum = 0;\n while(true){\n \t String str = br.readLine();\n \t array[putnum] = Integer.parseInt(str);\n \t if(++putnum == n)break;\n }\n \n System.out.println(String.valueOf(getMaxNumber(array)));\n \n }catch(Exception e){\n System.out.println(e);\n }\n }\n \n public static int getMaxNumber(int array[]){\n\t int maxNumber = Integer.MIN_VALUE;\n\t int minNumber = array[0];\n\t for(int i = 1;i < array.length;++i){\n\t\t final int divide = array[i] - minNumber;\n\t\t \n\t\t if(divide > maxNumber){\n\t\t\t maxNumber = divide;\n\t\t }\n\t\t \n\t\t if(minNumber > array[i]){\n\t\t\t minNumber = array[i];\n\t\t }\n\t }\n\t return maxNumber;\n }\n}",
"import java.io.*;",
"io.*",
"java",
"class Main\n{\n \n public static void main(String[] args)\n {\n try{\n \t// ??\\???????????????\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n // ????????°???????????????\n int n = Integer.parseInt(br.readLine());\n int[] array = new int[n];\n int putnum = 0;\n while(true){\n \t String str = br.readLine();\n \t array[putnum] = Integer.parseInt(str);\n \t if(++putnum == n)break;\n }\n \n System.out.println(String.valueOf(getMaxNumber(array)));\n \n }catch(Exception e){\n System.out.println(e);\n }\n }\n \n public static int getMaxNumber(int array[]){\n\t int maxNumber = Integer.MIN_VALUE;\n\t int minNumber = array[0];\n\t for(int i = 1;i < array.length;++i){\n\t\t final int divide = array[i] - minNumber;\n\t\t \n\t\t if(divide > maxNumber){\n\t\t\t maxNumber = divide;\n\t\t }\n\t\t \n\t\t if(minNumber > array[i]){\n\t\t\t minNumber = array[i];\n\t\t }\n\t }\n\t return maxNumber;\n }\n}",
"Main",
"public static void main(String[] args)\n {\n try{\n \t// ??\\???????????????\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n // ????????°???????????????\n int n = Integer.parseInt(br.readLine());\n int[] array = new int[n];\n int putnum = 0;\n while(true){\n \t String str = br.readLine();\n \t array[putnum] = Integer.parseInt(str);\n \t if(++putnum == n)break;\n }\n \n System.out.println(String.valueOf(getMaxNumber(array)));\n \n }catch(Exception e){\n System.out.println(e);\n }\n }",
"main",
"{\n try{\n \t// ??\\???????????????\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n // ????????°???????????????\n int n = Integer.parseInt(br.readLine());\n int[] array = new int[n];\n int putnum = 0;\n while(true){\n \t String str = br.readLine();\n \t array[putnum] = Integer.parseInt(str);\n \t if(++putnum == n)break;\n }\n \n System.out.println(String.valueOf(getMaxNumber(array)));\n \n }catch(Exception e){\n System.out.println(e);\n }\n }",
"try{\n \t// ??\\???????????????\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n // ????????°???????????????\n int n = Integer.parseInt(br.readLine());\n int[] array = new int[n];\n int putnum = 0;\n while(true){\n \t String str = br.readLine();\n \t array[putnum] = Integer.parseInt(str);\n \t if(++putnum == n)break;\n }\n \n System.out.println(String.valueOf(getMaxNumber(array)));\n \n }catch(Exception e){\n System.out.println(e);\n }",
"catch(Exception e){\n System.out.println(e);\n }",
"Exception e",
"{\n System.out.println(e);\n }",
"System.out.println(e)",
"System.out.println",
"System.out",
"System",
"System.out",
"e",
"{\n \t// ??\\???????????????\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n // ????????°???????????????\n int n = Integer.parseInt(br.readLine());\n int[] array = new int[n];\n int putnum = 0;\n while(true){\n \t String str = br.readLine();\n \t array[putnum] = Integer.parseInt(str);\n \t if(++putnum == n)break;\n }\n \n System.out.println(String.valueOf(getMaxNumber(array)));\n \n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int n = Integer.parseInt(br.readLine());",
"n",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int[] array = new int[n];",
"array",
"new int[n]",
"n",
"int putnum = 0;",
"putnum",
"0",
"while(true){\n \t String str = br.readLine();\n \t array[putnum] = Integer.parseInt(str);\n \t if(++putnum == n)break;\n }",
"true",
"{\n \t String str = br.readLine();\n \t array[putnum] = Integer.parseInt(str);\n \t if(++putnum == n)break;\n }",
"String str = br.readLine();",
"str",
"br.readLine()",
"br.readLine",
"br",
"array[putnum] = Integer.parseInt(str)",
"array[putnum]",
"array",
"putnum",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"if(++putnum == n)break;",
"++putnum == n",
"++putnum",
"putnum",
"n",
"break;",
"System.out.println(String.valueOf(getMaxNumber(array)))",
"System.out.println",
"System.out",
"System",
"System.out",
"String.valueOf(getMaxNumber(array))",
"String.valueOf",
"String",
"getMaxNumber(array)",
"getMaxNumber",
"array",
"String[] args",
"args",
"public static int getMaxNumber(int array[]){\n\t int maxNumber = Integer.MIN_VALUE;\n\t int minNumber = array[0];\n\t for(int i = 1;i < array.length;++i){\n\t\t final int divide = array[i] - minNumber;\n\t\t \n\t\t if(divide > maxNumber){\n\t\t\t maxNumber = divide;\n\t\t }\n\t\t \n\t\t if(minNumber > array[i]){\n\t\t\t minNumber = array[i];\n\t\t }\n\t }\n\t return maxNumber;\n }",
"getMaxNumber",
"{\n\t int maxNumber = Integer.MIN_VALUE;\n\t int minNumber = array[0];\n\t for(int i = 1;i < array.length;++i){\n\t\t final int divide = array[i] - minNumber;\n\t\t \n\t\t if(divide > maxNumber){\n\t\t\t maxNumber = divide;\n\t\t }\n\t\t \n\t\t if(minNumber > array[i]){\n\t\t\t minNumber = array[i];\n\t\t }\n\t }\n\t return maxNumber;\n }",
"int maxNumber = Integer.MIN_VALUE;",
"maxNumber",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int minNumber = array[0];",
"minNumber",
"array[0]",
"array",
"0",
"for(int i = 1;i < array.length;++i){\n\t\t final int divide = array[i] - minNumber;\n\t\t \n\t\t if(divide > maxNumber){\n\t\t\t maxNumber = divide;\n\t\t }\n\t\t \n\t\t if(minNumber > array[i]){\n\t\t\t minNumber = array[i];\n\t\t }\n\t }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < array.length",
"i",
"array.length",
"array",
"array.length",
"++i",
"++i",
"i",
"{\n\t\t final int divide = array[i] - minNumber;\n\t\t \n\t\t if(divide > maxNumber){\n\t\t\t maxNumber = divide;\n\t\t }\n\t\t \n\t\t if(minNumber > array[i]){\n\t\t\t minNumber = array[i];\n\t\t }\n\t }",
"{\n\t\t final int divide = array[i] - minNumber;\n\t\t \n\t\t if(divide > maxNumber){\n\t\t\t maxNumber = divide;\n\t\t }\n\t\t \n\t\t if(minNumber > array[i]){\n\t\t\t minNumber = array[i];\n\t\t }\n\t }",
"final int divide = array[i] - minNumber;",
"divide",
"array[i] - minNumber",
"array[i]",
"array",
"i",
"minNumber",
"if(divide > maxNumber){\n\t\t\t maxNumber = divide;\n\t\t }",
"divide > maxNumber",
"divide",
"maxNumber",
"{\n\t\t\t maxNumber = divide;\n\t\t }",
"maxNumber = divide",
"maxNumber",
"divide",
"if(minNumber > array[i]){\n\t\t\t minNumber = array[i];\n\t\t }",
"minNumber > array[i]",
"minNumber",
"array[i]",
"array",
"i",
"{\n\t\t\t minNumber = array[i];\n\t\t }",
"minNumber = array[i]",
"minNumber",
"array[i]",
"array",
"i",
"return maxNumber;",
"maxNumber",
"int array[]",
"array"
] | import java.io.*;
class Main
{
public static void main(String[] args)
{
try{
// ??\???????????????
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// ????????°???????????????
int n = Integer.parseInt(br.readLine());
int[] array = new int[n];
int putnum = 0;
while(true){
String str = br.readLine();
array[putnum] = Integer.parseInt(str);
if(++putnum == n)break;
}
System.out.println(String.valueOf(getMaxNumber(array)));
}catch(Exception e){
System.out.println(e);
}
}
public static int getMaxNumber(int array[]){
int maxNumber = Integer.MIN_VALUE;
int minNumber = array[0];
for(int i = 1;i < array.length;++i){
final int divide = array[i] - minNumber;
if(divide > maxNumber){
maxNumber = divide;
}
if(minNumber > array[i]){
minNumber = array[i];
}
}
return maxNumber;
}
} |
[
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,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
2,
4,
18,
13,
17,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
13,
4,
18,
13,
13,
0,
13,
4,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
2,
13,
13,
30,
29,
13,
30,
29,
2,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
29,
13,
30,
29,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
143,
11
],
[
143,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
14,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
43,
44
],
[
14,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
14,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
53,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
14,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
67,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
62,
73
],
[
74,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
77,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
74,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
87,
89
],
[
87,
90
],
[
90,
91
],
[
91,
92
],
[
90,
93
],
[
14,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
12,
100
],
[
100,
101
],
[
143,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
108,
110
],
[
105,
111
],
[
111,
112
],
[
112,
113
],
[
105,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
102,
119
],
[
119,
120
],
[
102,
121
],
[
121,
122
],
[
102,
123
],
[
123,
124
],
[
143,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
132,
133
],
[
133,
134
],
[
128,
135
],
[
135,
136
],
[
136,
137
],
[
125,
138
],
[
138,
139
],
[
125,
140
],
[
140,
141
],
[
0,
142
],
[
142,
143
],
[
142,
144
]
] | [
"import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tList<Integer> list = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlist.add(in.nextInt());\n\t\t}\n\t\tint minv = list.get(0);\n\t\tint maxv = list.get(1) - list.get(0);\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tmaxv = max(maxv,minv,list.get(i));\n\t\t\tminv = min(minv,list.get(i));\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}\n\tstatic int max(int maxv, int minv, int r){\n\t\tif(maxv > (r -minv) ){\n\t\t\treturn maxv;\n\t\t}else{\n\t\t\treturn r -minv;\n\t\t}\n\t}\n\tstatic int min(int minv, int r){\n\t\tif(minv > r){\n\t\t\treturn r;\n\t\t}else{\n\t\t\treturn minv;\n\t\t}\n\t}\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tList<Integer> list = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlist.add(in.nextInt());\n\t\t}\n\t\tint minv = list.get(0);\n\t\tint maxv = list.get(1) - list.get(0);\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tmaxv = max(maxv,minv,list.get(i));\n\t\t\tminv = min(minv,list.get(i));\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}\n\tstatic int max(int maxv, int minv, int r){\n\t\tif(maxv > (r -minv) ){\n\t\t\treturn maxv;\n\t\t}else{\n\t\t\treturn r -minv;\n\t\t}\n\t}\n\tstatic int min(int minv, int r){\n\t\tif(minv > r){\n\t\t\treturn r;\n\t\t}else{\n\t\t\treturn minv;\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tList<Integer> list = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlist.add(in.nextInt());\n\t\t}\n\t\tint minv = list.get(0);\n\t\tint maxv = list.get(1) - list.get(0);\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tmaxv = max(maxv,minv,list.get(i));\n\t\t\tminv = min(minv,list.get(i));\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}",
"main",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tList<Integer> list = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlist.add(in.nextInt());\n\t\t}\n\t\tint minv = list.get(0);\n\t\tint maxv = list.get(1) - list.get(0);\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tmaxv = max(maxv,minv,list.get(i));\n\t\t\tminv = min(minv,list.get(i));\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"List<Integer> list = new ArrayList<>();",
"list",
"new ArrayList<>()",
"for (int i = 0; i < n; i++) {\n\t\t\tlist.add(in.nextInt());\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tlist.add(in.nextInt());\n\t\t}",
"{\n\t\t\tlist.add(in.nextInt());\n\t\t}",
"list.add(in.nextInt())",
"list.add",
"list",
"in.nextInt()",
"in.nextInt",
"in",
"int minv = list.get(0);",
"minv",
"list.get(0)",
"list.get",
"list",
"0",
"int maxv = list.get(1) - list.get(0);",
"maxv",
"list.get(1) - list.get(0)",
"list.get(1)",
"list.get",
"list",
"1",
"list.get(0)",
"list.get",
"list",
"0",
"for (int i = 1; i < n; i++) {\n\t\t\tmaxv = max(maxv,minv,list.get(i));\n\t\t\tminv = min(minv,list.get(i));\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tmaxv = max(maxv,minv,list.get(i));\n\t\t\tminv = min(minv,list.get(i));\n\t\t}",
"{\n\t\t\tmaxv = max(maxv,minv,list.get(i));\n\t\t\tminv = min(minv,list.get(i));\n\t\t}",
"maxv = max(maxv,minv,list.get(i))",
"maxv",
"max(maxv,minv,list.get(i))",
"max",
"maxv",
"minv",
"list.get(i)",
"list.get",
"list",
"i",
"minv = min(minv,list.get(i))",
"minv",
"min(minv,list.get(i))",
"min",
"minv",
"list.get(i)",
"list.get",
"list",
"i",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String[] args",
"args",
"static int max(int maxv, int minv, int r){\n\t\tif(maxv > (r -minv) ){\n\t\t\treturn maxv;\n\t\t}else{\n\t\t\treturn r -minv;\n\t\t}\n\t}",
"max",
"{\n\t\tif(maxv > (r -minv) ){\n\t\t\treturn maxv;\n\t\t}else{\n\t\t\treturn r -minv;\n\t\t}\n\t}",
"if(maxv > (r -minv) ){\n\t\t\treturn maxv;\n\t\t}else{\n\t\t\treturn r -minv;\n\t\t}",
"maxv > (r -minv)",
"maxv",
"(r -minv)",
"r",
"minv",
"{\n\t\t\treturn maxv;\n\t\t}",
"return maxv;",
"maxv",
"{\n\t\t\treturn r -minv;\n\t\t}",
"return r -minv;",
"r -minv",
"r",
"minv",
"int maxv",
"maxv",
"int minv",
"minv",
"int r",
"r",
"static int min(int minv, int r){\n\t\tif(minv > r){\n\t\t\treturn r;\n\t\t}else{\n\t\t\treturn minv;\n\t\t}\n\t}",
"min",
"{\n\t\tif(minv > r){\n\t\t\treturn r;\n\t\t}else{\n\t\t\treturn minv;\n\t\t}\n\t}",
"if(minv > r){\n\t\t\treturn r;\n\t\t}else{\n\t\t\treturn minv;\n\t\t}",
"minv > r",
"minv",
"r",
"{\n\t\t\treturn r;\n\t\t}",
"return r;",
"r",
"{\n\t\t\treturn minv;\n\t\t}",
"return minv;",
"minv",
"int minv",
"minv",
"int r",
"r",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tList<Integer> list = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlist.add(in.nextInt());\n\t\t}\n\t\tint minv = list.get(0);\n\t\tint maxv = list.get(1) - list.get(0);\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tmaxv = max(maxv,minv,list.get(i));\n\t\t\tminv = min(minv,list.get(i));\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}\n\tstatic int max(int maxv, int minv, int r){\n\t\tif(maxv > (r -minv) ){\n\t\t\treturn maxv;\n\t\t}else{\n\t\t\treturn r -minv;\n\t\t}\n\t}\n\tstatic int min(int minv, int r){\n\t\tif(minv > r){\n\t\t\treturn r;\n\t\t}else{\n\t\t\treturn minv;\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt();\n\t\tList<Integer> list = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tlist.add(in.nextInt());\n\t\t}\n\t\tint minv = list.get(0);\n\t\tint maxv = list.get(1) - list.get(0);\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tmaxv = max(maxv,minv,list.get(i));\n\t\t\tminv = min(minv,list.get(i));\n\t\t}\n\t\tSystem.out.println(maxv);\n\t}\n\tstatic int max(int maxv, int minv, int r){\n\t\tif(maxv > (r -minv) ){\n\t\t\treturn maxv;\n\t\t}else{\n\t\t\treturn r -minv;\n\t\t}\n\t}\n\tstatic int min(int minv, int r){\n\t\tif(minv > r){\n\t\t\treturn r;\n\t\t}else{\n\t\t\treturn minv;\n\t\t}\n\t}\n}",
"Main"
] | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
List<Integer> list = new ArrayList<>();
for (int i = 0; i < n; i++) {
list.add(in.nextInt());
}
int minv = list.get(0);
int maxv = list.get(1) - list.get(0);
for (int i = 1; i < n; i++) {
maxv = max(maxv,minv,list.get(i));
minv = min(minv,list.get(i));
}
System.out.println(maxv);
}
static int max(int maxv, int minv, int r){
if(maxv > (r -minv) ){
return maxv;
}else{
return r -minv;
}
}
static int min(int minv, int r){
if(minv > r){
return r;
}else{
return minv;
}
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
2,
13,
13,
14,
2,
13,
13,
0,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
0,
13,
13,
14,
2,
13,
2,
13,
13,
0,
13,
2,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
88,
5
],
[
88,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
36,
40
],
[
40,
41
],
[
40,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
43,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
65,
67
],
[
61,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
68,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
8,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
6,
85
],
[
85,
86
],
[
0,
87
],
[
87,
88
],
[
87,
89
]
] | [
"import java.util.Scanner;\n\npublic class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner input = new Scanner(System.in);\n\t\tint n = input.nextInt();\n\t\tint mnv = input.nextInt();\n\t\tint mxv, t;\n\t\tt = input.nextInt();\n\t\tmxv = t - mnv;\n\t\tif(t < mnv)\n\t\t\tmnv = t;\t\n\t\tfor(int i = 2; i < n; i++)\n\t\t{\n\t\t\tt = input.nextInt();\n\t\t\tif(t < mnv)\n\t\t\t\tmnv = t;\n\t\t\telse if(mxv < t - mnv)\n\t\t\t\tmxv\t= t - mnv;\n\t\t}\n\t\tSystem.out.println(mxv);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner input = new Scanner(System.in);\n\t\tint n = input.nextInt();\n\t\tint mnv = input.nextInt();\n\t\tint mxv, t;\n\t\tt = input.nextInt();\n\t\tmxv = t - mnv;\n\t\tif(t < mnv)\n\t\t\tmnv = t;\t\n\t\tfor(int i = 2; i < n; i++)\n\t\t{\n\t\t\tt = input.nextInt();\n\t\t\tif(t < mnv)\n\t\t\t\tmnv = t;\n\t\t\telse if(mxv < t - mnv)\n\t\t\t\tmxv\t= t - mnv;\n\t\t}\n\t\tSystem.out.println(mxv);\n\t}\n}",
"Main",
"public static void main(String args[])\n\t{\n\t\tScanner input = new Scanner(System.in);\n\t\tint n = input.nextInt();\n\t\tint mnv = input.nextInt();\n\t\tint mxv, t;\n\t\tt = input.nextInt();\n\t\tmxv = t - mnv;\n\t\tif(t < mnv)\n\t\t\tmnv = t;\t\n\t\tfor(int i = 2; i < n; i++)\n\t\t{\n\t\t\tt = input.nextInt();\n\t\t\tif(t < mnv)\n\t\t\t\tmnv = t;\n\t\t\telse if(mxv < t - mnv)\n\t\t\t\tmxv\t= t - mnv;\n\t\t}\n\t\tSystem.out.println(mxv);\n\t}",
"main",
"{\n\t\tScanner input = new Scanner(System.in);\n\t\tint n = input.nextInt();\n\t\tint mnv = input.nextInt();\n\t\tint mxv, t;\n\t\tt = input.nextInt();\n\t\tmxv = t - mnv;\n\t\tif(t < mnv)\n\t\t\tmnv = t;\t\n\t\tfor(int i = 2; i < n; i++)\n\t\t{\n\t\t\tt = input.nextInt();\n\t\t\tif(t < mnv)\n\t\t\t\tmnv = t;\n\t\t\telse if(mxv < t - mnv)\n\t\t\t\tmxv\t= t - mnv;\n\t\t}\n\t\tSystem.out.println(mxv);\n\t}",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"int n = input.nextInt();",
"n",
"input.nextInt()",
"input.nextInt",
"input",
"int mnv = input.nextInt();",
"mnv",
"input.nextInt()",
"input.nextInt",
"input",
"int mxv",
"mxv",
"t;",
"t",
"t = input.nextInt()",
"t",
"input.nextInt()",
"input.nextInt",
"input",
"mxv = t - mnv",
"mxv",
"t - mnv",
"t",
"mnv",
"if(t < mnv)\n\t\t\tmnv = t;",
"t < mnv",
"t",
"mnv",
"mnv = t",
"mnv",
"t",
"for(int i = 2; i < n; i++)\n\t\t{\n\t\t\tt = input.nextInt();\n\t\t\tif(t < mnv)\n\t\t\t\tmnv = t;\n\t\t\telse if(mxv < t - mnv)\n\t\t\t\tmxv\t= t - mnv;\n\t\t}",
"int i = 2;",
"int i = 2;",
"i",
"2",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tt = input.nextInt();\n\t\t\tif(t < mnv)\n\t\t\t\tmnv = t;\n\t\t\telse if(mxv < t - mnv)\n\t\t\t\tmxv\t= t - mnv;\n\t\t}",
"{\n\t\t\tt = input.nextInt();\n\t\t\tif(t < mnv)\n\t\t\t\tmnv = t;\n\t\t\telse if(mxv < t - mnv)\n\t\t\t\tmxv\t= t - mnv;\n\t\t}",
"t = input.nextInt()",
"t",
"input.nextInt()",
"input.nextInt",
"input",
"if(t < mnv)\n\t\t\t\tmnv = t;\n\t\t\telse if(mxv < t - mnv)\n\t\t\t\tmxv\t= t - mnv;",
"t < mnv",
"t",
"mnv",
"mnv = t",
"mnv",
"t",
"if(mxv < t - mnv)\n\t\t\t\tmxv\t= t - mnv;",
"mxv < t - mnv",
"mxv",
"t - mnv",
"t",
"mnv",
"mxv\t= t - mnv",
"mxv",
"t - mnv",
"t",
"mnv",
"System.out.println(mxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"mxv",
"String args[]",
"args",
"public class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner input = new Scanner(System.in);\n\t\tint n = input.nextInt();\n\t\tint mnv = input.nextInt();\n\t\tint mxv, t;\n\t\tt = input.nextInt();\n\t\tmxv = t - mnv;\n\t\tif(t < mnv)\n\t\t\tmnv = t;\t\n\t\tfor(int i = 2; i < n; i++)\n\t\t{\n\t\t\tt = input.nextInt();\n\t\t\tif(t < mnv)\n\t\t\t\tmnv = t;\n\t\t\telse if(mxv < t - mnv)\n\t\t\t\tmxv\t= t - mnv;\n\t\t}\n\t\tSystem.out.println(mxv);\n\t}\n}",
"public class Main\n{\n\tpublic static void main(String args[])\n\t{\n\t\tScanner input = new Scanner(System.in);\n\t\tint n = input.nextInt();\n\t\tint mnv = input.nextInt();\n\t\tint mxv, t;\n\t\tt = input.nextInt();\n\t\tmxv = t - mnv;\n\t\tif(t < mnv)\n\t\t\tmnv = t;\t\n\t\tfor(int i = 2; i < n; i++)\n\t\t{\n\t\t\tt = input.nextInt();\n\t\t\tif(t < mnv)\n\t\t\t\tmnv = t;\n\t\t\telse if(mxv < t - mnv)\n\t\t\t\tmxv\t= t - mnv;\n\t\t}\n\t\tSystem.out.println(mxv);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int mnv = input.nextInt();
int mxv, t;
t = input.nextInt();
mxv = t - mnv;
if(t < mnv)
mnv = t;
for(int i = 2; i < n; i++)
{
t = input.nextInt();
if(t < mnv)
mnv = t;
else if(mxv < t - mnv)
mxv = t - mnv;
}
System.out.println(mxv);
}
} |
[
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,
40,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
8,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
65,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
62,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
76,
80
],
[
80,
81
],
[
80,
82
],
[
8,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
6,
89
],
[
89,
90
]
] | [
"import java.util.*;\nclass Main{\n public static void main(String[] args){\n \t//final int MAX =200000;\n \t\n \n \tScanner sc = new Scanner(System.in);\n \t//int n = Integer.parseInt(sc.next());\n \tint n =sc.nextInt();\n \tint[] R=new int[n];\n \t\n \tfor(int i=0;i<n;i++){\n \t\t// R[i]=Integer.parseInt(sc.next());\n \t\t R[i]=sc.nextInt();\n \t}\n \tlong maxv=-2000000000;\n \t\t\t \n \tlong minv=R[0];\n \tfor(int i=1;i<n;i++){\n \t\tmaxv=Math.max(maxv,R[i]-minv);\n \t\tminv=Math.min(minv,R[i]);\n \t}\n \tSystem.out.println(maxv);\n \t\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String[] args){\n \t//final int MAX =200000;\n \t\n \n \tScanner sc = new Scanner(System.in);\n \t//int n = Integer.parseInt(sc.next());\n \tint n =sc.nextInt();\n \tint[] R=new int[n];\n \t\n \tfor(int i=0;i<n;i++){\n \t\t// R[i]=Integer.parseInt(sc.next());\n \t\t R[i]=sc.nextInt();\n \t}\n \tlong maxv=-2000000000;\n \t\t\t \n \tlong minv=R[0];\n \tfor(int i=1;i<n;i++){\n \t\tmaxv=Math.max(maxv,R[i]-minv);\n \t\tminv=Math.min(minv,R[i]);\n \t}\n \tSystem.out.println(maxv);\n \t\n }\n}",
"Main",
"public static void main(String[] args){\n \t//final int MAX =200000;\n \t\n \n \tScanner sc = new Scanner(System.in);\n \t//int n = Integer.parseInt(sc.next());\n \tint n =sc.nextInt();\n \tint[] R=new int[n];\n \t\n \tfor(int i=0;i<n;i++){\n \t\t// R[i]=Integer.parseInt(sc.next());\n \t\t R[i]=sc.nextInt();\n \t}\n \tlong maxv=-2000000000;\n \t\t\t \n \tlong minv=R[0];\n \tfor(int i=1;i<n;i++){\n \t\tmaxv=Math.max(maxv,R[i]-minv);\n \t\tminv=Math.min(minv,R[i]);\n \t}\n \tSystem.out.println(maxv);\n \t\n }",
"main",
"{\n \t//final int MAX =200000;\n \t\n \n \tScanner sc = new Scanner(System.in);\n \t//int n = Integer.parseInt(sc.next());\n \tint n =sc.nextInt();\n \tint[] R=new int[n];\n \t\n \tfor(int i=0;i<n;i++){\n \t\t// R[i]=Integer.parseInt(sc.next());\n \t\t R[i]=sc.nextInt();\n \t}\n \tlong maxv=-2000000000;\n \t\t\t \n \tlong minv=R[0];\n \tfor(int i=1;i<n;i++){\n \t\tmaxv=Math.max(maxv,R[i]-minv);\n \t\tminv=Math.min(minv,R[i]);\n \t}\n \tSystem.out.println(maxv);\n \t\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n =sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] R=new int[n];",
"R",
"new int[n]",
"n",
"for(int i=0;i<n;i++){\n \t\t// R[i]=Integer.parseInt(sc.next());\n \t\t R[i]=sc.nextInt();\n \t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n \t\t// R[i]=Integer.parseInt(sc.next());\n \t\t R[i]=sc.nextInt();\n \t}",
"{\n \t\t// R[i]=Integer.parseInt(sc.next());\n \t\t R[i]=sc.nextInt();\n \t}",
"R[i]=sc.nextInt()",
"R[i]",
"R",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long maxv=-2000000000;",
"maxv",
"-2000000000",
"2000000000",
"long minv=R[0];",
"minv",
"R[0]",
"R",
"0",
"for(int i=1;i<n;i++){\n \t\tmaxv=Math.max(maxv,R[i]-minv);\n \t\tminv=Math.min(minv,R[i]);\n \t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n \t\tmaxv=Math.max(maxv,R[i]-minv);\n \t\tminv=Math.min(minv,R[i]);\n \t}",
"{\n \t\tmaxv=Math.max(maxv,R[i]-minv);\n \t\tminv=Math.min(minv,R[i]);\n \t}",
"maxv=Math.max(maxv,R[i]-minv)",
"maxv",
"Math.max(maxv,R[i]-minv)",
"Math.max",
"Math",
"maxv",
"R[i]-minv",
"R[i]",
"R",
"i",
"minv",
"minv=Math.min(minv,R[i])",
"minv",
"Math.min(minv,R[i])",
"Math.min",
"Math",
"minv",
"R[i]",
"R",
"i",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String[] args",
"args"
] | import java.util.*;
class Main{
public static void main(String[] args){
//final int MAX =200000;
Scanner sc = new Scanner(System.in);
//int n = Integer.parseInt(sc.next());
int n =sc.nextInt();
int[] R=new int[n];
for(int i=0;i<n;i++){
// R[i]=Integer.parseInt(sc.next());
R[i]=sc.nextInt();
}
long maxv=-2000000000;
long minv=R[0];
for(int i=1;i<n;i++){
maxv=Math.max(maxv,R[i]-minv);
minv=Math.min(minv,R[i]);
}
System.out.println(maxv);
}
} |
[
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,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
2,
4,
18,
13,
17,
4,
18,
13,
17,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
2,
4,
18,
13,
2,
13,
17,
13,
30,
0,
13,
2,
4,
18,
13,
2,
13,
17,
13,
14,
2,
13,
4,
18,
13,
2,
13,
17,
30,
0,
13,
4,
18,
13,
2,
13,
17,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
4,
18,
13,
29,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
4,
18,
4,
18,
4,
18,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
18,
13,
13,
29,
13,
29,
17,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
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
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
23,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
23,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
40,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
23,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
23,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
55,
65
],
[
65,
66
],
[
66,
67
],
[
55,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
73,
80
],
[
70,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
88,
90
],
[
84,
91
],
[
69,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
98,
99
],
[
98,
100
],
[
92,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
107,
108
],
[
107,
109
],
[
23,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
23,
116
],
[
116,
117
],
[
117,
118
],
[
21,
119
],
[
119,
120
],
[
0,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
132,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
145,
146
],
[
146,
147
],
[
128,
148
],
[
148,
149
],
[
121,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
153,
154
],
[
153,
155
],
[
152,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
161,
163
],
[
156,
164
],
[
164,
165
],
[
165,
166
],
[
156,
167
],
[
168,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
169,
172
],
[
172,
173
],
[
152,
174
],
[
174,
175
],
[
150,
176
],
[
176,
177
],
[
121,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
181,
188
],
[
188,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
196,
197
],
[
191,
198
],
[
188,
199
],
[
199,
200
],
[
199,
201
],
[
188,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
202,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
209,
211
],
[
202,
212
],
[
212,
213
],
[
213,
214
],
[
202,
215
],
[
216,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
217,
220
],
[
220,
221
],
[
221,
222
],
[
220,
223
],
[
223,
224
],
[
223,
225
],
[
188,
226
],
[
226,
227
],
[
180,
228
],
[
228,
229
],
[
121,
230
],
[
230,
231
],
[
230,
232
],
[
232,
233
],
[
233,
234
],
[
234,
235
],
[
234,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
233,
240
],
[
240,
241
],
[
241,
242
],
[
242,
243
]
] | [
"import java.util.List;\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.List;\n\nclass Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tInput stdIn = new Input();\n\t\tint n = stdIn.getValue();\n\t\tList<Integer> r = stdIn.getValueLines(n);\n\n\t\tint maxv = r.get(1) - r.get(0);\n\t\t;\n\t\tint minv = r.get(0);\n\n\t\t//\t\tSystem.out.println(n);\n\t\t//\t\tSystem.out.println(r);\n\n\t\tfor (int i = 0; i < n-1; i++) {\n\t\t\tif (maxv < r.get(i + 1) - minv) {\n\t\t\t\tmaxv = r.get(i + 1) - minv;\n\t\t\t}\n\t\t\tif (minv > r.get(i + 1)) {\n\t\t\t\tminv = r.get(i + 1);\n\t\t\t}\n//\t\t\tSystem.out.println(\"j[\" + (i + 1) + \"]:\" + r.get(i + 1) + \" i[\" + i + \"]:\" + r.get(i) + \" maxv: \" + maxv\n//\t\t\t\t\t+ \"minv:\" + minv);\n\t\t}\n\t\tSystem.out.println(maxv);\n\n\t\tstdIn.close();\n\t}\n}\nclass Input {\n\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\tpublic int getValue() {\n\t\tint n = 0;\n\t\ttry {\n\t\t\tn = Integer.parseInt(br.readLine());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn n;\n\t}\n\n\tpublic List<Integer> getValueLines(int n) {\n\t\tList<Integer> values = new ArrayList<>();\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tvalues.add(getValue());\n\t\t}\n\t\treturn values;\n\t}\n\n\tpublic List<Integer> getLine() {\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tList<Integer> ary = new ArrayList<>();\n\t\t\tfor (int i = 0; i < s.length; i++) {\n\t\t\t\tary.add(Integer.parseInt(s[i]));\n\t\t\t}\n\t\t\treturn ary;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic void close() {\n\t\ttry {\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"import java.util.List;",
"List",
"java.util",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.List;",
"List",
"java.util",
"class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tInput stdIn = new Input();\n\t\tint n = stdIn.getValue();\n\t\tList<Integer> r = stdIn.getValueLines(n);\n\n\t\tint maxv = r.get(1) - r.get(0);\n\t\t;\n\t\tint minv = r.get(0);\n\n\t\t//\t\tSystem.out.println(n);\n\t\t//\t\tSystem.out.println(r);\n\n\t\tfor (int i = 0; i < n-1; i++) {\n\t\t\tif (maxv < r.get(i + 1) - minv) {\n\t\t\t\tmaxv = r.get(i + 1) - minv;\n\t\t\t}\n\t\t\tif (minv > r.get(i + 1)) {\n\t\t\t\tminv = r.get(i + 1);\n\t\t\t}\n//\t\t\tSystem.out.println(\"j[\" + (i + 1) + \"]:\" + r.get(i + 1) + \" i[\" + i + \"]:\" + r.get(i) + \" maxv: \" + maxv\n//\t\t\t\t\t+ \"minv:\" + minv);\n\t\t}\n\t\tSystem.out.println(maxv);\n\n\t\tstdIn.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tInput stdIn = new Input();\n\t\tint n = stdIn.getValue();\n\t\tList<Integer> r = stdIn.getValueLines(n);\n\n\t\tint maxv = r.get(1) - r.get(0);\n\t\t;\n\t\tint minv = r.get(0);\n\n\t\t//\t\tSystem.out.println(n);\n\t\t//\t\tSystem.out.println(r);\n\n\t\tfor (int i = 0; i < n-1; i++) {\n\t\t\tif (maxv < r.get(i + 1) - minv) {\n\t\t\t\tmaxv = r.get(i + 1) - minv;\n\t\t\t}\n\t\t\tif (minv > r.get(i + 1)) {\n\t\t\t\tminv = r.get(i + 1);\n\t\t\t}\n//\t\t\tSystem.out.println(\"j[\" + (i + 1) + \"]:\" + r.get(i + 1) + \" i[\" + i + \"]:\" + r.get(i) + \" maxv: \" + maxv\n//\t\t\t\t\t+ \"minv:\" + minv);\n\t\t}\n\t\tSystem.out.println(maxv);\n\n\t\tstdIn.close();\n\t}",
"main",
"{\n\n\t\tInput stdIn = new Input();\n\t\tint n = stdIn.getValue();\n\t\tList<Integer> r = stdIn.getValueLines(n);\n\n\t\tint maxv = r.get(1) - r.get(0);\n\t\t;\n\t\tint minv = r.get(0);\n\n\t\t//\t\tSystem.out.println(n);\n\t\t//\t\tSystem.out.println(r);\n\n\t\tfor (int i = 0; i < n-1; i++) {\n\t\t\tif (maxv < r.get(i + 1) - minv) {\n\t\t\t\tmaxv = r.get(i + 1) - minv;\n\t\t\t}\n\t\t\tif (minv > r.get(i + 1)) {\n\t\t\t\tminv = r.get(i + 1);\n\t\t\t}\n//\t\t\tSystem.out.println(\"j[\" + (i + 1) + \"]:\" + r.get(i + 1) + \" i[\" + i + \"]:\" + r.get(i) + \" maxv: \" + maxv\n//\t\t\t\t\t+ \"minv:\" + minv);\n\t\t}\n\t\tSystem.out.println(maxv);\n\n\t\tstdIn.close();\n\t}",
"Input stdIn = new Input();",
"stdIn",
"new Input()",
"int n = stdIn.getValue();",
"n",
"stdIn.getValue()",
"stdIn.getValue",
"stdIn",
"List<Integer> r = stdIn.getValueLines(n);",
"r",
"stdIn.getValueLines(n)",
"stdIn.getValueLines",
"stdIn",
"n",
"int maxv = r.get(1) - r.get(0);",
"maxv",
"r.get(1) - r.get(0)",
"r.get(1)",
"r.get",
"r",
"1",
"r.get(0)",
"r.get",
"r",
"0",
"int minv = r.get(0);",
"minv",
"r.get(0)",
"r.get",
"r",
"0",
"for (int i = 0; i < n-1; i++) {\n\t\t\tif (maxv < r.get(i + 1) - minv) {\n\t\t\t\tmaxv = r.get(i + 1) - minv;\n\t\t\t}\n\t\t\tif (minv > r.get(i + 1)) {\n\t\t\t\tminv = r.get(i + 1);\n\t\t\t}\n//\t\t\tSystem.out.println(\"j[\" + (i + 1) + \"]:\" + r.get(i + 1) + \" i[\" + i + \"]:\" + r.get(i) + \" maxv: \" + maxv\n//\t\t\t\t\t+ \"minv:\" + minv);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tif (maxv < r.get(i + 1) - minv) {\n\t\t\t\tmaxv = r.get(i + 1) - minv;\n\t\t\t}\n\t\t\tif (minv > r.get(i + 1)) {\n\t\t\t\tminv = r.get(i + 1);\n\t\t\t}\n//\t\t\tSystem.out.println(\"j[\" + (i + 1) + \"]:\" + r.get(i + 1) + \" i[\" + i + \"]:\" + r.get(i) + \" maxv: \" + maxv\n//\t\t\t\t\t+ \"minv:\" + minv);\n\t\t}",
"{\n\t\t\tif (maxv < r.get(i + 1) - minv) {\n\t\t\t\tmaxv = r.get(i + 1) - minv;\n\t\t\t}\n\t\t\tif (minv > r.get(i + 1)) {\n\t\t\t\tminv = r.get(i + 1);\n\t\t\t}\n//\t\t\tSystem.out.println(\"j[\" + (i + 1) + \"]:\" + r.get(i + 1) + \" i[\" + i + \"]:\" + r.get(i) + \" maxv: \" + maxv\n//\t\t\t\t\t+ \"minv:\" + minv);\n\t\t}",
"if (maxv < r.get(i + 1) - minv) {\n\t\t\t\tmaxv = r.get(i + 1) - minv;\n\t\t\t}",
"maxv < r.get(i + 1) - minv",
"maxv",
"r.get(i + 1) - minv",
"r.get(i + 1)",
"r.get",
"r",
"i + 1",
"i",
"1",
"minv",
"{\n\t\t\t\tmaxv = r.get(i + 1) - minv;\n\t\t\t}",
"maxv = r.get(i + 1) - minv",
"maxv",
"r.get(i + 1) - minv",
"r.get(i + 1)",
"r.get",
"r",
"i + 1",
"i",
"1",
"minv",
"if (minv > r.get(i + 1)) {\n\t\t\t\tminv = r.get(i + 1);\n\t\t\t}",
"minv > r.get(i + 1)",
"minv",
"r.get(i + 1)",
"r.get",
"r",
"i + 1",
"i",
"1",
"{\n\t\t\t\tminv = r.get(i + 1);\n\t\t\t}",
"minv = r.get(i + 1)",
"minv",
"r.get(i + 1)",
"r.get",
"r",
"i + 1",
"i",
"1",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"stdIn.close()",
"stdIn.close",
"stdIn",
"String[] args",
"args",
"class Input {\n\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\tpublic int getValue() {\n\t\tint n = 0;\n\t\ttry {\n\t\t\tn = Integer.parseInt(br.readLine());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn n;\n\t}\n\n\tpublic List<Integer> getValueLines(int n) {\n\t\tList<Integer> values = new ArrayList<>();\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tvalues.add(getValue());\n\t\t}\n\t\treturn values;\n\t}\n\n\tpublic List<Integer> getLine() {\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tList<Integer> ary = new ArrayList<>();\n\t\t\tfor (int i = 0; i < s.length; i++) {\n\t\t\t\tary.add(Integer.parseInt(s[i]));\n\t\t\t}\n\t\t\treturn ary;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic void close() {\n\t\ttry {\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}",
"Input",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"public int getValue() {\n\t\tint n = 0;\n\t\ttry {\n\t\t\tn = Integer.parseInt(br.readLine());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn n;\n\t}",
"getValue",
"{\n\t\tint n = 0;\n\t\ttry {\n\t\t\tn = Integer.parseInt(br.readLine());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn n;\n\t}",
"int n = 0;",
"n",
"0",
"try {\n\t\t\tn = Integer.parseInt(br.readLine());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tn = Integer.parseInt(br.readLine());\n\t\t}",
"n = Integer.parseInt(br.readLine())",
"n",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"return n;",
"n",
"public List<Integer> getValueLines(int n) {\n\t\tList<Integer> values = new ArrayList<>();\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tvalues.add(getValue());\n\t\t}\n\t\treturn values;\n\t}",
"getValueLines",
"{\n\t\tList<Integer> values = new ArrayList<>();\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tvalues.add(getValue());\n\t\t}\n\t\treturn values;\n\t}",
"List<Integer> values = new ArrayList<>();",
"values",
"new ArrayList<>()",
"for(int i = 0; i < n; i++) {\n\t\t\tvalues.add(getValue());\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tvalues.add(getValue());\n\t\t}",
"{\n\t\t\tvalues.add(getValue());\n\t\t}",
"values.add(getValue())",
"values.add",
"values",
"getValue()",
"getValue",
"return values;",
"values",
"int n",
"n",
"public List<Integer> getLine() {\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tList<Integer> ary = new ArrayList<>();\n\t\t\tfor (int i = 0; i < s.length; i++) {\n\t\t\t\tary.add(Integer.parseInt(s[i]));\n\t\t\t}\n\t\t\treturn ary;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"getLine",
"{\n\t\ttry {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tList<Integer> ary = new ArrayList<>();\n\t\t\tfor (int i = 0; i < s.length; i++) {\n\t\t\t\tary.add(Integer.parseInt(s[i]));\n\t\t\t}\n\t\t\treturn ary;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"try {\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tList<Integer> ary = new ArrayList<>();\n\t\t\tfor (int i = 0; i < s.length; i++) {\n\t\t\t\tary.add(Integer.parseInt(s[i]));\n\t\t\t}\n\t\t\treturn ary;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tString[] s = br.readLine().trim().split(\" \");\n\t\t\tList<Integer> ary = new ArrayList<>();\n\t\t\tfor (int i = 0; i < s.length; i++) {\n\t\t\t\tary.add(Integer.parseInt(s[i]));\n\t\t\t}\n\t\t\treturn ary;\n\t\t}",
"String[] s = br.readLine().trim().split(\" \");",
"s",
"br.readLine().trim().split(\" \")",
"br.readLine().trim().split",
"br.readLine().trim()",
"br.readLine().trim",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"List<Integer> ary = new ArrayList<>();",
"ary",
"new ArrayList<>()",
"for (int i = 0; i < s.length; i++) {\n\t\t\t\tary.add(Integer.parseInt(s[i]));\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < s.length",
"i",
"s.length",
"s",
"s.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tary.add(Integer.parseInt(s[i]));\n\t\t\t}",
"{\n\t\t\t\tary.add(Integer.parseInt(s[i]));\n\t\t\t}",
"ary.add(Integer.parseInt(s[i]))",
"ary.add",
"ary",
"Integer.parseInt(s[i])",
"Integer.parseInt",
"Integer",
"s[i]",
"s",
"i",
"return ary;",
"ary",
"return null;",
"null",
"public void close() {\n\t\ttry {\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"close",
"{\n\t\ttry {\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"try {\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}",
"IOException e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tbr.close();\n\t\t}",
"br.close()",
"br.close",
"br"
] | import java.util.List;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
class Main {
public static void main(String[] args) {
Input stdIn = new Input();
int n = stdIn.getValue();
List<Integer> r = stdIn.getValueLines(n);
int maxv = r.get(1) - r.get(0);
;
int minv = r.get(0);
// System.out.println(n);
// System.out.println(r);
for (int i = 0; i < n-1; i++) {
if (maxv < r.get(i + 1) - minv) {
maxv = r.get(i + 1) - minv;
}
if (minv > r.get(i + 1)) {
minv = r.get(i + 1);
}
// System.out.println("j[" + (i + 1) + "]:" + r.get(i + 1) + " i[" + i + "]:" + r.get(i) + " maxv: " + maxv
// + "minv:" + minv);
}
System.out.println(maxv);
stdIn.close();
}
}
class Input {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public int getValue() {
int n = 0;
try {
n = Integer.parseInt(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
return n;
}
public List<Integer> getValueLines(int n) {
List<Integer> values = new ArrayList<>();
for(int i = 0; i < n; i++) {
values.add(getValue());
}
return values;
}
public List<Integer> getLine() {
try {
String[] s = br.readLine().trim().split(" ");
List<Integer> ary = new ArrayList<>();
for (int i = 0; i < s.length; i++) {
ary.add(Integer.parseInt(s[i]));
}
return ary;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public void close() {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
} |
[
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,
4,
18,
13,
41,
13,
2,
13,
13,
41,
13,
4,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
85,
5
],
[
85,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
8,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
32,
34
],
[
8,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
37,
41
],
[
8,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
47,
49
],
[
42,
50
],
[
50,
51
],
[
51,
52
],
[
42,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
54,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
62,
66
],
[
66,
67
],
[
66,
68
],
[
54,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
71,
75
],
[
8,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
6,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
] | [
"import java.util.*;\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n StringBuilder bd = new StringBuilder();\n\n int n = sc.nextInt();\n\n int r0 = sc.nextInt();\n int r1 = sc.nextInt();\n\n int max = r1 - r0;\n int min = Math.min(r0, r1);\n\n for (int i=2; i<n; i++) {\n int r = sc.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min, r);\n }\n\n System.out.println(max);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n StringBuilder bd = new StringBuilder();\n\n int n = sc.nextInt();\n\n int r0 = sc.nextInt();\n int r1 = sc.nextInt();\n\n int max = r1 - r0;\n int min = Math.min(r0, r1);\n\n for (int i=2; i<n; i++) {\n int r = sc.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min, r);\n }\n\n System.out.println(max);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n StringBuilder bd = new StringBuilder();\n\n int n = sc.nextInt();\n\n int r0 = sc.nextInt();\n int r1 = sc.nextInt();\n\n int max = r1 - r0;\n int min = Math.min(r0, r1);\n\n for (int i=2; i<n; i++) {\n int r = sc.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min, r);\n }\n\n System.out.println(max);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n StringBuilder bd = new StringBuilder();\n\n int n = sc.nextInt();\n\n int r0 = sc.nextInt();\n int r1 = sc.nextInt();\n\n int max = r1 - r0;\n int min = Math.min(r0, r1);\n\n for (int i=2; i<n; i++) {\n int r = sc.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min, r);\n }\n\n System.out.println(max);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"StringBuilder bd = new StringBuilder();",
"bd",
"new StringBuilder()",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int r0 = sc.nextInt();",
"r0",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int r1 = sc.nextInt();",
"r1",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int max = r1 - r0;",
"max",
"r1 - r0",
"r1",
"r0",
"int min = Math.min(r0, r1);",
"min",
"Math.min(r0, r1)",
"Math.min",
"Math",
"r0",
"r1",
"for (int i=2; i<n; i++) {\n int r = sc.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min, r);\n }",
"int i=2;",
"int i=2;",
"i",
"2",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n int r = sc.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min, r);\n }",
"{\n int r = sc.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min, r);\n }",
"int r = sc.nextInt();",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"max = Math.max(max, r-min)",
"max",
"Math.max(max, r-min)",
"Math.max",
"Math",
"max",
"r-min",
"r",
"min",
"min = Math.min(min, r)",
"min",
"Math.min(min, r)",
"Math.min",
"Math",
"min",
"r",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n StringBuilder bd = new StringBuilder();\n\n int n = sc.nextInt();\n\n int r0 = sc.nextInt();\n int r1 = sc.nextInt();\n\n int max = r1 - r0;\n int min = Math.min(r0, r1);\n\n for (int i=2; i<n; i++) {\n int r = sc.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min, r);\n }\n\n System.out.println(max);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n StringBuilder bd = new StringBuilder();\n\n int n = sc.nextInt();\n\n int r0 = sc.nextInt();\n int r1 = sc.nextInt();\n\n int max = r1 - r0;\n int min = Math.min(r0, r1);\n\n for (int i=2; i<n; i++) {\n int r = sc.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min, r);\n }\n\n System.out.println(max);\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
StringBuilder bd = new StringBuilder();
int n = sc.nextInt();
int r0 = sc.nextInt();
int r1 = sc.nextInt();
int max = r1 - r0;
int min = Math.min(r0, r1);
for (int i=2; i<n; i++) {
int r = sc.nextInt();
max = Math.max(max, r-min);
min = Math.min(min, r);
}
System.out.println(max);
}
}
|
[
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,
0,
18,
13,
13,
4,
18,
13,
41,
13,
2,
18,
13,
17,
18,
13,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
2,
18,
13,
13,
13,
14,
2,
13,
13,
0,
13,
13,
14,
2,
13,
18,
13,
13,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
33,
37
],
[
37,
38
],
[
38,
39
],
[
8,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
46,
48
],
[
8,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
78,
79
],
[
78,
80
],
[
66,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
81,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
8,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
6,
98
],
[
98,
99
]
] | [
"import java.util.Scanner;\n\nclass Main{\n public static void main(String[] args){\n Scanner stdIn = new Scanner(System.in);\n int n = stdIn.nextInt();\n int[] r = new int[n];\n for(int i = 0; i < n; i++)\n r[i] = stdIn.nextInt();\n\n int maxv = r[1] - r[0];\n int minv = r[0];\n for(int j = 1; j < n; j++){\n int diff = r[j] - minv;\n if(diff > maxv)\n maxv = diff;\n if(minv > r[j])\n minv = r[j];\n }\n\n System.out.println(maxv);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String[] args){\n Scanner stdIn = new Scanner(System.in);\n int n = stdIn.nextInt();\n int[] r = new int[n];\n for(int i = 0; i < n; i++)\n r[i] = stdIn.nextInt();\n\n int maxv = r[1] - r[0];\n int minv = r[0];\n for(int j = 1; j < n; j++){\n int diff = r[j] - minv;\n if(diff > maxv)\n maxv = diff;\n if(minv > r[j])\n minv = r[j];\n }\n\n System.out.println(maxv);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner stdIn = new Scanner(System.in);\n int n = stdIn.nextInt();\n int[] r = new int[n];\n for(int i = 0; i < n; i++)\n r[i] = stdIn.nextInt();\n\n int maxv = r[1] - r[0];\n int minv = r[0];\n for(int j = 1; j < n; j++){\n int diff = r[j] - minv;\n if(diff > maxv)\n maxv = diff;\n if(minv > r[j])\n minv = r[j];\n }\n\n System.out.println(maxv);\n }",
"main",
"{\n Scanner stdIn = new Scanner(System.in);\n int n = stdIn.nextInt();\n int[] r = new int[n];\n for(int i = 0; i < n; i++)\n r[i] = stdIn.nextInt();\n\n int maxv = r[1] - r[0];\n int minv = r[0];\n for(int j = 1; j < n; j++){\n int diff = r[j] - minv;\n if(diff > maxv)\n maxv = diff;\n if(minv > r[j])\n minv = r[j];\n }\n\n System.out.println(maxv);\n }",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int n = stdIn.nextInt();",
"n",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int[] r = new int[n];",
"r",
"new int[n]",
"n",
"for(int i = 0; i < n; i++)\n r[i] = stdIn.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"r[i] = stdIn.nextInt();",
"r[i] = stdIn.nextInt()",
"r[i]",
"r",
"i",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int maxv = r[1] - r[0];",
"maxv",
"r[1] - r[0]",
"r[1]",
"r",
"1",
"r[0]",
"r",
"0",
"int minv = r[0];",
"minv",
"r[0]",
"r",
"0",
"for(int j = 1; j < n; j++){\n int diff = r[j] - minv;\n if(diff > maxv)\n maxv = diff;\n if(minv > r[j])\n minv = r[j];\n }",
"int j = 1;",
"int j = 1;",
"j",
"1",
"j < n",
"j",
"n",
"j++",
"j++",
"j",
"{\n int diff = r[j] - minv;\n if(diff > maxv)\n maxv = diff;\n if(minv > r[j])\n minv = r[j];\n }",
"{\n int diff = r[j] - minv;\n if(diff > maxv)\n maxv = diff;\n if(minv > r[j])\n minv = r[j];\n }",
"int diff = r[j] - minv;",
"diff",
"r[j] - minv",
"r[j]",
"r",
"j",
"minv",
"if(diff > maxv)\n maxv = diff;",
"diff > maxv",
"diff",
"maxv",
"maxv = diff",
"maxv",
"diff",
"if(minv > r[j])\n minv = r[j];",
"minv > r[j]",
"minv",
"r[j]",
"r",
"j",
"minv = r[j]",
"minv",
"r[j]",
"r",
"j",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
int n = stdIn.nextInt();
int[] r = new int[n];
for(int i = 0; i < n; i++)
r[i] = stdIn.nextInt();
int maxv = r[1] - r[0];
int minv = r[0];
for(int j = 1; j < n; j++){
int diff = r[j] - minv;
if(diff > maxv)
maxv = diff;
if(minv > r[j])
minv = r[j];
}
System.out.println(maxv);
}
} |
[
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,
18,
13,
17,
41,
13,
2,
18,
13,
17,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
8,
2,
13,
2,
18,
13,
13,
13,
13,
2,
18,
13,
13,
13,
0,
13,
8,
2,
13,
18,
13,
13,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
105,
5
],
[
105,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
53,
63
],
[
63,
64
],
[
64,
65
],
[
53,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
70,
78
],
[
70,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
67,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
86,
92
],
[
92,
93
],
[
92,
94
],
[
86,
95
],
[
8,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
6,
102
],
[
102,
103
],
[
0,
104
],
[
104,
105
],
[
104,
106
]
] | [
"import java.util.Scanner;\npublic class Main {\n public static void main(String[] args) {\n Scanner sc =new Scanner(System.in);\n int z = sc.nextInt();\n int[] r = new int[z];\n for(int i = 0; i < z; i++){\n r[i] = sc.nextInt();\n }\n int min = r[0];\n int max = r[1] - min;\n for(int i = 1; i < r.length; i++){\n max = max > r[i] - min ? max : r[i] - min;\n min = min > r[i] ? r[i] : min;\n }\n System.out.println(max);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sc =new Scanner(System.in);\n int z = sc.nextInt();\n int[] r = new int[z];\n for(int i = 0; i < z; i++){\n r[i] = sc.nextInt();\n }\n int min = r[0];\n int max = r[1] - min;\n for(int i = 1; i < r.length; i++){\n max = max > r[i] - min ? max : r[i] - min;\n min = min > r[i] ? r[i] : min;\n }\n System.out.println(max);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc =new Scanner(System.in);\n int z = sc.nextInt();\n int[] r = new int[z];\n for(int i = 0; i < z; i++){\n r[i] = sc.nextInt();\n }\n int min = r[0];\n int max = r[1] - min;\n for(int i = 1; i < r.length; i++){\n max = max > r[i] - min ? max : r[i] - min;\n min = min > r[i] ? r[i] : min;\n }\n System.out.println(max);\n }",
"main",
"{\n Scanner sc =new Scanner(System.in);\n int z = sc.nextInt();\n int[] r = new int[z];\n for(int i = 0; i < z; i++){\n r[i] = sc.nextInt();\n }\n int min = r[0];\n int max = r[1] - min;\n for(int i = 1; i < r.length; i++){\n max = max > r[i] - min ? max : r[i] - min;\n min = min > r[i] ? r[i] : min;\n }\n System.out.println(max);\n }",
"Scanner sc =new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int z = sc.nextInt();",
"z",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] r = new int[z];",
"r",
"new int[z]",
"z",
"for(int i = 0; i < z; i++){\n r[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < z",
"i",
"z",
"i++",
"i++",
"i",
"{\n r[i] = sc.nextInt();\n }",
"{\n r[i] = sc.nextInt();\n }",
"r[i] = sc.nextInt()",
"r[i]",
"r",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int min = r[0];",
"min",
"r[0]",
"r",
"0",
"int max = r[1] - min;",
"max",
"r[1] - min",
"r[1]",
"r",
"1",
"min",
"for(int i = 1; i < r.length; i++){\n max = max > r[i] - min ? max : r[i] - min;\n min = min > r[i] ? r[i] : min;\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < r.length",
"i",
"r.length",
"r",
"r.length",
"i++",
"i++",
"i",
"{\n max = max > r[i] - min ? max : r[i] - min;\n min = min > r[i] ? r[i] : min;\n }",
"{\n max = max > r[i] - min ? max : r[i] - min;\n min = min > r[i] ? r[i] : min;\n }",
"max = max > r[i] - min ? max : r[i] - min",
"max",
"max > r[i] - min ? max : r[i] - min",
"max > r[i] - min",
"max",
"r[i] - min",
"r[i]",
"r",
"i",
"min",
"max",
"r[i] - min",
"r[i]",
"r",
"i",
"min",
"min = min > r[i] ? r[i] : min",
"min",
"min > r[i] ? r[i] : min",
"min > r[i]",
"min",
"r[i]",
"r",
"i",
"r[i]",
"r",
"i",
"min",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc =new Scanner(System.in);\n int z = sc.nextInt();\n int[] r = new int[z];\n for(int i = 0; i < z; i++){\n r[i] = sc.nextInt();\n }\n int min = r[0];\n int max = r[1] - min;\n for(int i = 1; i < r.length; i++){\n max = max > r[i] - min ? max : r[i] - min;\n min = min > r[i] ? r[i] : min;\n }\n System.out.println(max);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc =new Scanner(System.in);\n int z = sc.nextInt();\n int[] r = new int[z];\n for(int i = 0; i < z; i++){\n r[i] = sc.nextInt();\n }\n int min = r[0];\n int max = r[1] - min;\n for(int i = 1; i < r.length; i++){\n max = max > r[i] - min ? max : r[i] - min;\n min = min > r[i] ? r[i] : min;\n }\n System.out.println(max);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
int z = sc.nextInt();
int[] r = new int[z];
for(int i = 0; i < z; i++){
r[i] = sc.nextInt();
}
int min = r[0];
int max = r[1] - min;
for(int i = 1; i < r.length; i++){
max = max > r[i] - min ? max : r[i] - min;
min = min > r[i] ? r[i] : min;
}
System.out.println(max);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
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,
4,
18,
13,
0,
13,
2,
18,
13,
17,
18,
13,
17,
0,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
18,
13,
13,
13,
13,
30,
0,
13,
2,
18,
13,
13,
13,
14,
2,
18,
13,
13,
13,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
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
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
43,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
8,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
54,
55
],
[
54,
56
],
[
8,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
8,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
67,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
62,
73
],
[
74,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
76,
82
],
[
75,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
74,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
91,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
100,
102
],
[
8,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
103,
108
],
[
6,
109
],
[
109,
110
],
[
0,
111
],
[
111,
112
],
[
111,
113
]
] | [
"import java.util.*;\n\n/**\n * D\n */\npublic class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n int max_v, min_v;\n int n = sc.nextInt();\n\n int array[] = new int[n];\n\n for(int i=0; i<n; i++) {\n array[i] = sc.nextInt();\n }\n\n sc.close();\n\n max_v = array[1] - array[0];\n min_v = array[0];\n\n for(int i=1; i<n; i++) {\n\n if(array[i] - min_v > max_v) {\n max_v = array[i] - min_v;\n }\n\n if(array[i] < min_v) {\n min_v = array[i];\n }\n\n }\n\n System.out.println(max_v);\n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n int max_v, min_v;\n int n = sc.nextInt();\n\n int array[] = new int[n];\n\n for(int i=0; i<n; i++) {\n array[i] = sc.nextInt();\n }\n\n sc.close();\n\n max_v = array[1] - array[0];\n min_v = array[0];\n\n for(int i=1; i<n; i++) {\n\n if(array[i] - min_v > max_v) {\n max_v = array[i] - min_v;\n }\n\n if(array[i] < min_v) {\n min_v = array[i];\n }\n\n }\n\n System.out.println(max_v);\n\n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n int max_v, min_v;\n int n = sc.nextInt();\n\n int array[] = new int[n];\n\n for(int i=0; i<n; i++) {\n array[i] = sc.nextInt();\n }\n\n sc.close();\n\n max_v = array[1] - array[0];\n min_v = array[0];\n\n for(int i=1; i<n; i++) {\n\n if(array[i] - min_v > max_v) {\n max_v = array[i] - min_v;\n }\n\n if(array[i] < min_v) {\n min_v = array[i];\n }\n\n }\n\n System.out.println(max_v);\n\n }",
"main",
"{\n\n Scanner sc = new Scanner(System.in);\n\n int max_v, min_v;\n int n = sc.nextInt();\n\n int array[] = new int[n];\n\n for(int i=0; i<n; i++) {\n array[i] = sc.nextInt();\n }\n\n sc.close();\n\n max_v = array[1] - array[0];\n min_v = array[0];\n\n for(int i=1; i<n; i++) {\n\n if(array[i] - min_v > max_v) {\n max_v = array[i] - min_v;\n }\n\n if(array[i] < min_v) {\n min_v = array[i];\n }\n\n }\n\n System.out.println(max_v);\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int max_v",
"max_v",
"min_v;",
"min_v",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int array[] = new int[n];",
"array",
"new int[n]",
"n",
"for(int i=0; i<n; i++) {\n array[i] = sc.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n array[i] = sc.nextInt();\n }",
"{\n array[i] = sc.nextInt();\n }",
"array[i] = sc.nextInt()",
"array[i]",
"array",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.close()",
"sc.close",
"sc",
"max_v = array[1] - array[0]",
"max_v",
"array[1] - array[0]",
"array[1]",
"array",
"1",
"array[0]",
"array",
"0",
"min_v = array[0]",
"min_v",
"array[0]",
"array",
"0",
"for(int i=1; i<n; i++) {\n\n if(array[i] - min_v > max_v) {\n max_v = array[i] - min_v;\n }\n\n if(array[i] < min_v) {\n min_v = array[i];\n }\n\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\n if(array[i] - min_v > max_v) {\n max_v = array[i] - min_v;\n }\n\n if(array[i] < min_v) {\n min_v = array[i];\n }\n\n }",
"{\n\n if(array[i] - min_v > max_v) {\n max_v = array[i] - min_v;\n }\n\n if(array[i] < min_v) {\n min_v = array[i];\n }\n\n }",
"if(array[i] - min_v > max_v) {\n max_v = array[i] - min_v;\n }",
"array[i] - min_v > max_v",
"array[i] - min_v",
"array[i]",
"array",
"i",
"min_v",
"max_v",
"{\n max_v = array[i] - min_v;\n }",
"max_v = array[i] - min_v",
"max_v",
"array[i] - min_v",
"array[i]",
"array",
"i",
"min_v",
"if(array[i] < min_v) {\n min_v = array[i];\n }",
"array[i] < min_v",
"array[i]",
"array",
"i",
"min_v",
"{\n min_v = array[i];\n }",
"min_v = array[i]",
"min_v",
"array[i]",
"array",
"i",
"System.out.println(max_v)",
"System.out.println",
"System.out",
"System",
"System.out",
"max_v",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n int max_v, min_v;\n int n = sc.nextInt();\n\n int array[] = new int[n];\n\n for(int i=0; i<n; i++) {\n array[i] = sc.nextInt();\n }\n\n sc.close();\n\n max_v = array[1] - array[0];\n min_v = array[0];\n\n for(int i=1; i<n; i++) {\n\n if(array[i] - min_v > max_v) {\n max_v = array[i] - min_v;\n }\n\n if(array[i] < min_v) {\n min_v = array[i];\n }\n\n }\n\n System.out.println(max_v);\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n int max_v, min_v;\n int n = sc.nextInt();\n\n int array[] = new int[n];\n\n for(int i=0; i<n; i++) {\n array[i] = sc.nextInt();\n }\n\n sc.close();\n\n max_v = array[1] - array[0];\n min_v = array[0];\n\n for(int i=1; i<n; i++) {\n\n if(array[i] - min_v > max_v) {\n max_v = array[i] - min_v;\n }\n\n if(array[i] < min_v) {\n min_v = array[i];\n }\n\n }\n\n System.out.println(max_v);\n\n }\n}",
"Main"
] | import java.util.*;
/**
* D
*/
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int max_v, min_v;
int n = sc.nextInt();
int array[] = new int[n];
for(int i=0; i<n; i++) {
array[i] = sc.nextInt();
}
sc.close();
max_v = array[1] - array[0];
min_v = array[0];
for(int i=1; i<n; i++) {
if(array[i] - min_v > max_v) {
max_v = array[i] - min_v;
}
if(array[i] < min_v) {
min_v = array[i];
}
}
System.out.println(max_v);
}
}
|
[
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,
41,
13,
17,
41,
13,
17,
41,
13,
40,
17,
41,
13,
17,
28,
13,
4,
18,
13,
20,
13,
30,
30,
14,
13,
30,
0,
13,
13,
0,
13,
17,
0,
13,
17,
30,
14,
2,
13,
13,
30,
0,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
17,
4,
18,
13,
13,
4,
18,
13,
12,
13,
30,
4,
18,
20,
23,
13,
6,
13,
41,
13,
17,
41,
13,
41,
13,
17,
41,
13,
17,
41,
13,
40,
17,
41,
13,
17,
12,
13,
30,
4,
13,
18,
13,
13,
13,
12,
13,
30,
4,
13,
13,
4,
13,
13,
23,
13,
23,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
0,
13,
20,
13,
23,
13,
12,
13,
30,
40,
13,
4,
13,
12,
13,
30,
14,
2,
2,
13,
13,
4,
18,
13,
30,
0,
13,
4,
18,
13,
13,
0,
13,
17,
12,
13,
30,
29,
2,
2,
17,
13,
2,
13,
17,
23,
13,
12,
13,
30,
29,
2,
13,
17,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
41,
13,
42,
2,
40,
4,
13,
0,
13,
18,
13,
13,
40,
4,
13,
13,
4,
13,
14,
4,
13,
18,
13,
13,
30,
0,
13,
40,
17,
4,
13,
42,
4,
13,
0,
13,
18,
13,
13,
30,
0,
13,
17,
0,
13,
2,
13,
17,
4,
13,
4,
13,
29,
2,
13,
13,
12,
13,
30,
4,
13,
29,
4,
13,
12,
13,
30,
4,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
14,
40,
4,
18,
18,
36,
13,
18,
13,
13,
4,
18,
18,
36,
13,
10,
6,
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
],
[
13,
15
],
[
0,
16
],
[
345,
17
],
[
345,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
20,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
20,
32
],
[
32,
33
],
[
32,
34
],
[
20,
35
],
[
35,
36
],
[
35,
37
],
[
20,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
20,
42
],
[
42,
43
],
[
42,
44
],
[
20,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
45,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
60,
62
],
[
56,
63
],
[
63,
64
],
[
63,
65
],
[
54,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
66,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
66,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
66,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
96,
98
],
[
20,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
20,
103
],
[
103,
104
],
[
104,
105
],
[
345,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
106,
112
],
[
112,
113
],
[
0,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
119,
120
],
[
114,
121
],
[
121,
122
],
[
121,
123
],
[
114,
124
],
[
124,
125
],
[
124,
126
],
[
114,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
114,
131
],
[
131,
132
],
[
131,
133
],
[
114,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
139,
141
],
[
137,
142
],
[
114,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
149,
150
],
[
149,
151
],
[
143,
152
],
[
152,
153
],
[
143,
154
],
[
154,
155
],
[
114,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
156,
162
],
[
162,
163
],
[
114,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
164,
171
],
[
171,
172
],
[
114,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
175,
178
],
[
178,
179
],
[
114,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
188,
189
],
[
189,
190
],
[
183,
191
],
[
191,
192
],
[
192,
193
],
[
192,
194
],
[
194,
195
],
[
195,
196
],
[
194,
197
],
[
191,
198
],
[
198,
199
],
[
198,
200
],
[
114,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
205,
209
],
[
209,
210
],
[
209,
211
],
[
201,
212
],
[
212,
213
],
[
114,
214
],
[
214,
215
],
[
214,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
214,
221
],
[
221,
222
],
[
114,
223
],
[
223,
224
],
[
223,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
225,
229
],
[
229,
230
],
[
229,
231
],
[
225,
232
],
[
232,
233
],
[
225,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
237,
239
],
[
239,
240
],
[
239,
241
],
[
241,
242
],
[
241,
243
],
[
235,
244
],
[
244,
245
],
[
245,
246
],
[
245,
247
],
[
234,
248
],
[
248,
249
],
[
225,
250
],
[
250,
251
],
[
251,
252
],
[
251,
253
],
[
253,
254
],
[
253,
255
],
[
250,
256
],
[
256,
257
],
[
257,
258
],
[
257,
259
],
[
259,
260
],
[
256,
261
],
[
261,
262
],
[
225,
263
],
[
263,
264
],
[
264,
265
],
[
264,
266
],
[
266,
267
],
[
266,
268
],
[
268,
269
],
[
268,
270
],
[
263,
271
],
[
271,
272
],
[
272,
273
],
[
272,
274
],
[
271,
275
],
[
275,
276
],
[
275,
277
],
[
277,
278
],
[
277,
279
],
[
271,
280
],
[
280,
281
],
[
225,
282
],
[
282,
283
],
[
225,
284
],
[
284,
285
],
[
285,
286
],
[
285,
287
],
[
114,
288
],
[
288,
289
],
[
288,
290
],
[
290,
291
],
[
291,
292
],
[
290,
293
],
[
293,
294
],
[
294,
295
],
[
114,
296
],
[
296,
297
],
[
296,
298
],
[
298,
299
],
[
299,
300
],
[
298,
301
],
[
301,
302
],
[
302,
303
],
[
303,
304
],
[
303,
305
],
[
301,
306
],
[
306,
307
],
[
306,
308
],
[
308,
309
],
[
308,
310
],
[
301,
311
],
[
311,
312
],
[
312,
313
],
[
301,
314
],
[
315,
315
],
[
315,
316
],
[
316,
317
],
[
317,
318
],
[
317,
319
],
[
316,
320
],
[
320,
321
],
[
298,
322
],
[
322,
323
],
[
296,
324
],
[
324,
325
],
[
114,
326
],
[
326,
327
],
[
326,
328
],
[
328,
329
],
[
329,
330
],
[
330,
331
],
[
331,
332
],
[
332,
333
],
[
333,
334
],
[
333,
335
],
[
331,
336
],
[
336,
337
],
[
336,
338
],
[
329,
339
],
[
339,
340
],
[
340,
341
],
[
341,
342
],
[
341,
343
],
[
0,
344
],
[
344,
345
],
[
344,
346
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\n \npublic class Main {\n\tpublic void exec() throws IOException {\n InputUtil in = new InputUtil();\n PrintWriter out = new PrintWriter(System.out);\n int n = in.nextInt();\n int min=200000,max=1,maxRtDiff=-1000000000;\n boolean first = true;\n for(int rt: in.nextInt(new int[n])){\n \tif(first) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t\tfirst = false;\n \t}else{\n \tif(max < rt) {\n \t\tmax = rt;\n \t}\n \t\tint rtDiff = max - min;\n \t\tif(maxRtDiff < rtDiff) {\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}\n \tif(rt < min) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t}\n \t}\n }\n out.println(maxRtDiff);\n out.flush();\n }\n\n public static void main(String[] args) throws IOException {\n new Main().exec();\n }\n}\n\n\n/**\n * --------------------------------------------------\n * Input Utility\n * --------------------------------------------------\n */\nclass InputUtil {\n\t//Static Fields\n\tprivate static final int BUFSIZ = 50000;\n\t\n\t//Fields\n\tprotected InputStream in;\n\tprivate char[] buf = null;\n\tprivate int ptr = 0;\n\tprivate int max = -1;\n\tprivate BufferedReader br = null;\n\t\n\t//Constructors\n\tpublic InputUtil() {this(System.in,BUFSIZ);}\n\tpublic InputUtil(InputStream in, int bufsiz) {\n\t\tinitBuf(bufsiz);\n\t\tinitIn(in);\n\t}\n\t\n\t//Methods\n\t//Initializer\n\tprotected void initIn(InputStream in) {br = new BufferedReader(new InputStreamReader(this.in = in));}\n\tprotected void initBuf(int bufsiz) {buf = new char[bufsiz];}\n\t\n\t//buffer operation\n\tprivate void next() throws IOException {ptr++; readBuf();}\n\tprivate void readBuf() throws IOException {\n\t\tif(ptr >= max && br.ready()) {\n\t\t\tmax = br.read(buf);\n\t\t\tptr = 0;\n\t\t}\n\t}\n\t//Number Input Reader/Parser\n\tprivate boolean isNum(char b) {return '0' <= b && b <= '9'; }\n\tprivate boolean isMinus(char b) {return b=='-'; }\n\n\tprivate int _nextInt() throws IOException {\n\t\tint sign = 1;\n\t\tint res = 0;\n\t\tchar c;\n\t\twhile (!isNum(c=buf[ptr]) && !isMinus(c)) \n\t\t\tnext();\n\t\tif (isMinus(buf[ptr])) {\n\t\t\tsign = -1;\n\t\t\tnext();\n\t\t}\n\t\twhile (isNum(c=buf[ptr])) {\n\t\t\tres *= 10;\n\t\t\tres += c - '0' ;\n\t\t\tnext();\n\t\t}\n\t\tnext();\n\t\treturn sign * res;\n\t}\n\t\n\tpublic int nextInt() throws IOException {\n\t\treadBuf();\n\t\treturn _nextInt();\n\t}\n\n\tpublic int[] nextInt(int[] result) throws IOException {\n\t\treadBuf();\n\t\tfor(int i=0; i<result.length; i++) {\n\t\t\tresult[i] = _nextInt();\n\t\t}\n\t\treturn result;\n\t}\n\t\n\t//Close \n\tpublic void close() throws IOException {\n\t\tif(!this.in.equals(System.in)) \n\t\t\tthis.in.close();\n\t}\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"public class Main {\n\tpublic void exec() throws IOException {\n InputUtil in = new InputUtil();\n PrintWriter out = new PrintWriter(System.out);\n int n = in.nextInt();\n int min=200000,max=1,maxRtDiff=-1000000000;\n boolean first = true;\n for(int rt: in.nextInt(new int[n])){\n \tif(first) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t\tfirst = false;\n \t}else{\n \tif(max < rt) {\n \t\tmax = rt;\n \t}\n \t\tint rtDiff = max - min;\n \t\tif(maxRtDiff < rtDiff) {\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}\n \tif(rt < min) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t}\n \t}\n }\n out.println(maxRtDiff);\n out.flush();\n }\n\n public static void main(String[] args) throws IOException {\n new Main().exec();\n }\n}",
"Main",
"public void exec() throws IOException {\n InputUtil in = new InputUtil();\n PrintWriter out = new PrintWriter(System.out);\n int n = in.nextInt();\n int min=200000,max=1,maxRtDiff=-1000000000;\n boolean first = true;\n for(int rt: in.nextInt(new int[n])){\n \tif(first) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t\tfirst = false;\n \t}else{\n \tif(max < rt) {\n \t\tmax = rt;\n \t}\n \t\tint rtDiff = max - min;\n \t\tif(maxRtDiff < rtDiff) {\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}\n \tif(rt < min) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t}\n \t}\n }\n out.println(maxRtDiff);\n out.flush();\n }",
"exec",
"{\n InputUtil in = new InputUtil();\n PrintWriter out = new PrintWriter(System.out);\n int n = in.nextInt();\n int min=200000,max=1,maxRtDiff=-1000000000;\n boolean first = true;\n for(int rt: in.nextInt(new int[n])){\n \tif(first) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t\tfirst = false;\n \t}else{\n \tif(max < rt) {\n \t\tmax = rt;\n \t}\n \t\tint rtDiff = max - min;\n \t\tif(maxRtDiff < rtDiff) {\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}\n \tif(rt < min) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t}\n \t}\n }\n out.println(maxRtDiff);\n out.flush();\n }",
"InputUtil in = new InputUtil();",
"in",
"new InputUtil()",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int min=200000",
"min",
"200000",
"max=1",
"max",
"1",
"maxRtDiff=-1000000000;",
"maxRtDiff",
"-1000000000",
"1000000000",
"boolean first = true;",
"first",
"true",
"for(int rt: in.nextInt(new int[n])){\n \tif(first) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t\tfirst = false;\n \t}else{\n \tif(max < rt) {\n \t\tmax = rt;\n \t}\n \t\tint rtDiff = max - min;\n \t\tif(maxRtDiff < rtDiff) {\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}\n \tif(rt < min) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t}\n \t}\n }",
"int rt",
"in.nextInt(new int[n])",
"in.nextInt",
"in",
"new int[n]",
"n",
"{\n \tif(first) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t\tfirst = false;\n \t}else{\n \tif(max < rt) {\n \t\tmax = rt;\n \t}\n \t\tint rtDiff = max - min;\n \t\tif(maxRtDiff < rtDiff) {\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}\n \tif(rt < min) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t}\n \t}\n }",
"{\n \tif(first) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t\tfirst = false;\n \t}else{\n \tif(max < rt) {\n \t\tmax = rt;\n \t}\n \t\tint rtDiff = max - min;\n \t\tif(maxRtDiff < rtDiff) {\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}\n \tif(rt < min) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t}\n \t}\n }",
"if(first) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t\tfirst = false;\n \t}else{\n \tif(max < rt) {\n \t\tmax = rt;\n \t}\n \t\tint rtDiff = max - min;\n \t\tif(maxRtDiff < rtDiff) {\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}\n \tif(rt < min) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t}\n \t}",
"first",
"{\n \t\tmin = rt;\n \t\tmax = 1;\n \t\tfirst = false;\n \t}",
"min = rt",
"min",
"rt",
"max = 1",
"max",
"1",
"first = false",
"first",
"false",
"{\n \tif(max < rt) {\n \t\tmax = rt;\n \t}\n \t\tint rtDiff = max - min;\n \t\tif(maxRtDiff < rtDiff) {\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}\n \tif(rt < min) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t}\n \t}",
"if(max < rt) {\n \t\tmax = rt;\n \t}",
"max < rt",
"max",
"rt",
"{\n \t\tmax = rt;\n \t}",
"max = rt",
"max",
"rt",
"int rtDiff = max - min;",
"rtDiff",
"max - min",
"max",
"min",
"if(maxRtDiff < rtDiff) {\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}",
"maxRtDiff < rtDiff",
"maxRtDiff",
"rtDiff",
"{\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}",
"maxRtDiff = rtDiff",
"maxRtDiff",
"rtDiff",
"if(rt < min) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t}",
"rt < min",
"rt",
"min",
"{\n \t\tmin = rt;\n \t\tmax = 1;\n \t}",
"min = rt",
"min",
"rt",
"max = 1",
"max",
"1",
"out.println(maxRtDiff)",
"out.println",
"out",
"maxRtDiff",
"out.flush()",
"out.flush",
"out",
"public static void main(String[] args) throws IOException {\n new Main().exec();\n }",
"main",
"{\n new Main().exec();\n }",
"new Main().exec()",
"new Main().exec",
"new Main()",
"String[] args",
"args",
"class InputUtil {\n\t//Static Fields\n\tprivate static final int BUFSIZ = 50000;\n\t\n\t//Fields\n\tprotected InputStream in;\n\tprivate char[] buf = null;\n\tprivate int ptr = 0;\n\tprivate int max = -1;\n\tprivate BufferedReader br = null;\n\t\n\t//Constructors\n\tpublic InputUtil() {this(System.in,BUFSIZ);}\n\tpublic InputUtil(InputStream in, int bufsiz) {\n\t\tinitBuf(bufsiz);\n\t\tinitIn(in);\n\t}\n\t\n\t//Methods\n\t//Initializer\n\tprotected void initIn(InputStream in) {br = new BufferedReader(new InputStreamReader(this.in = in));}\n\tprotected void initBuf(int bufsiz) {buf = new char[bufsiz];}\n\t\n\t//buffer operation\n\tprivate void next() throws IOException {ptr++; readBuf();}\n\tprivate void readBuf() throws IOException {\n\t\tif(ptr >= max && br.ready()) {\n\t\t\tmax = br.read(buf);\n\t\t\tptr = 0;\n\t\t}\n\t}\n\t//Number Input Reader/Parser\n\tprivate boolean isNum(char b) {return '0' <= b && b <= '9'; }\n\tprivate boolean isMinus(char b) {return b=='-'; }\n\n\tprivate int _nextInt() throws IOException {\n\t\tint sign = 1;\n\t\tint res = 0;\n\t\tchar c;\n\t\twhile (!isNum(c=buf[ptr]) && !isMinus(c)) \n\t\t\tnext();\n\t\tif (isMinus(buf[ptr])) {\n\t\t\tsign = -1;\n\t\t\tnext();\n\t\t}\n\t\twhile (isNum(c=buf[ptr])) {\n\t\t\tres *= 10;\n\t\t\tres += c - '0' ;\n\t\t\tnext();\n\t\t}\n\t\tnext();\n\t\treturn sign * res;\n\t}\n\t\n\tpublic int nextInt() throws IOException {\n\t\treadBuf();\n\t\treturn _nextInt();\n\t}\n\n\tpublic int[] nextInt(int[] result) throws IOException {\n\t\treadBuf();\n\t\tfor(int i=0; i<result.length; i++) {\n\t\t\tresult[i] = _nextInt();\n\t\t}\n\t\treturn result;\n\t}\n\t\n\t//Close \n\tpublic void close() throws IOException {\n\t\tif(!this.in.equals(System.in)) \n\t\t\tthis.in.close();\n\t}\n\n}",
"InputUtil",
"//Static Fields\n\tprivate static final int BUFSIZ = 50000;",
"BUFSIZ",
"50000",
"//Fields\n\tprotected InputStream in;",
"in",
"private char[] buf = null;",
"buf",
"null",
"private int ptr = 0;",
"ptr",
"0",
"private int max = -1;",
"max",
"-1",
"1",
"private BufferedReader br = null;",
"br",
"null",
"//Constructors\n\tpublic InputUtil() {this(System.in,BUFSIZ);}",
"InputUtil",
"{this(System.in,BUFSIZ);}",
"this(System.in,BUFSIZ)",
"this",
"System.in",
"System",
"System.in",
"BUFSIZ",
"public InputUtil(InputStream in, int bufsiz) {\n\t\tinitBuf(bufsiz);\n\t\tinitIn(in);\n\t}",
"InputUtil",
"{\n\t\tinitBuf(bufsiz);\n\t\tinitIn(in);\n\t}",
"initBuf(bufsiz)",
"initBuf",
"bufsiz",
"initIn(in)",
"initIn",
"in",
"InputStream in",
"in",
"int bufsiz",
"bufsiz",
"//Methods\n\t//Initializer\n\tprotected void initIn(InputStream in) {br = new BufferedReader(new InputStreamReader(this.in = in));}",
"initIn",
"{br = new BufferedReader(new InputStreamReader(this.in = in));}",
"br = new BufferedReader(new InputStreamReader(this.in = in))",
"br",
"new BufferedReader(new InputStreamReader(this.in = in))",
"InputStream in",
"in",
"protected void initBuf(int bufsiz) {buf = new char[bufsiz];}",
"initBuf",
"{buf = new char[bufsiz];}",
"buf = new char[bufsiz]",
"buf",
"new char[bufsiz]",
"bufsiz",
"int bufsiz",
"bufsiz",
"//buffer operation\n\tprivate void next() throws IOException {ptr++; readBuf();}",
"next",
"{ptr++; readBuf();}",
"ptr++",
"ptr",
"readBuf()",
"readBuf",
"private void readBuf() throws IOException {\n\t\tif(ptr >= max && br.ready()) {\n\t\t\tmax = br.read(buf);\n\t\t\tptr = 0;\n\t\t}\n\t}",
"readBuf",
"{\n\t\tif(ptr >= max && br.ready()) {\n\t\t\tmax = br.read(buf);\n\t\t\tptr = 0;\n\t\t}\n\t}",
"if(ptr >= max && br.ready()) {\n\t\t\tmax = br.read(buf);\n\t\t\tptr = 0;\n\t\t}",
"ptr >= max && br.ready()",
"ptr >= max",
"ptr",
"max",
"br.ready()",
"br.ready",
"br",
"{\n\t\t\tmax = br.read(buf);\n\t\t\tptr = 0;\n\t\t}",
"max = br.read(buf)",
"max",
"br.read(buf)",
"br.read",
"br",
"buf",
"ptr = 0",
"ptr",
"0",
"//Number Input Reader/Parser\n\tprivate boolean isNum(char b) {return '0' <= b && b <= '9'; }",
"isNum",
"{return '0' <= b && b <= '9'; }",
"return '0' <= b && b <= '9';",
"'0' <= b && b <= '9'",
"'0' <= b",
"'0'",
"b",
"b <= '9'",
"b",
"'9'",
"char b",
"b",
"private boolean isMinus(char b) {return b=='-'; }",
"isMinus",
"{return b=='-'; }",
"return b=='-';",
"b=='-'",
"b",
"'-'",
"char b",
"b",
"private int _nextInt() throws IOException {\n\t\tint sign = 1;\n\t\tint res = 0;\n\t\tchar c;\n\t\twhile (!isNum(c=buf[ptr]) && !isMinus(c)) \n\t\t\tnext();\n\t\tif (isMinus(buf[ptr])) {\n\t\t\tsign = -1;\n\t\t\tnext();\n\t\t}\n\t\twhile (isNum(c=buf[ptr])) {\n\t\t\tres *= 10;\n\t\t\tres += c - '0' ;\n\t\t\tnext();\n\t\t}\n\t\tnext();\n\t\treturn sign * res;\n\t}",
"_nextInt",
"{\n\t\tint sign = 1;\n\t\tint res = 0;\n\t\tchar c;\n\t\twhile (!isNum(c=buf[ptr]) && !isMinus(c)) \n\t\t\tnext();\n\t\tif (isMinus(buf[ptr])) {\n\t\t\tsign = -1;\n\t\t\tnext();\n\t\t}\n\t\twhile (isNum(c=buf[ptr])) {\n\t\t\tres *= 10;\n\t\t\tres += c - '0' ;\n\t\t\tnext();\n\t\t}\n\t\tnext();\n\t\treturn sign * res;\n\t}",
"int sign = 1;",
"sign",
"1",
"int res = 0;",
"res",
"0",
"char c;",
"c",
"while (!isNum(c=buf[ptr]) && !isMinus(c)) \n\t\t\tnext();",
"!isNum(c=buf[ptr]) && !isMinus(c)",
"!isNum(c=buf[ptr])",
"isNum(c=buf[ptr])",
"isNum",
"c=buf[ptr]",
"c",
"buf[ptr]",
"buf",
"ptr",
"!isMinus(c)",
"isMinus(c)",
"isMinus",
"c",
"next()",
"next",
"if (isMinus(buf[ptr])) {\n\t\t\tsign = -1;\n\t\t\tnext();\n\t\t}",
"isMinus(buf[ptr])",
"isMinus",
"buf[ptr]",
"buf",
"ptr",
"{\n\t\t\tsign = -1;\n\t\t\tnext();\n\t\t}",
"sign = -1",
"sign",
"-1",
"1",
"next()",
"next",
"while (isNum(c=buf[ptr])) {\n\t\t\tres *= 10;\n\t\t\tres += c - '0' ;\n\t\t\tnext();\n\t\t}",
"isNum(c=buf[ptr])",
"isNum",
"c=buf[ptr]",
"c",
"buf[ptr]",
"buf",
"ptr",
"{\n\t\t\tres *= 10;\n\t\t\tres += c - '0' ;\n\t\t\tnext();\n\t\t}",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"next()",
"next",
"next()",
"next",
"return sign * res;",
"sign * res",
"sign",
"res",
"public int nextInt() throws IOException {\n\t\treadBuf();\n\t\treturn _nextInt();\n\t}",
"nextInt",
"{\n\t\treadBuf();\n\t\treturn _nextInt();\n\t}",
"readBuf()",
"readBuf",
"return _nextInt();",
"_nextInt()",
"_nextInt",
"public int[] nextInt(int[] result) throws IOException {\n\t\treadBuf();\n\t\tfor(int i=0; i<result.length; i++) {\n\t\t\tresult[i] = _nextInt();\n\t\t}\n\t\treturn result;\n\t}",
"nextInt",
"{\n\t\treadBuf();\n\t\tfor(int i=0; i<result.length; i++) {\n\t\t\tresult[i] = _nextInt();\n\t\t}\n\t\treturn result;\n\t}",
"readBuf()",
"readBuf",
"for(int i=0; i<result.length; i++) {\n\t\t\tresult[i] = _nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<result.length",
"i",
"result.length",
"result",
"result.length",
"i++",
"i++",
"i",
"{\n\t\t\tresult[i] = _nextInt();\n\t\t}",
"{\n\t\t\tresult[i] = _nextInt();\n\t\t}",
"result[i] = _nextInt()",
"result[i]",
"result",
"i",
"_nextInt()",
"_nextInt",
"return result;",
"result",
"int[] result",
"result",
"//Close \n\tpublic void close() throws IOException {\n\t\tif(!this.in.equals(System.in)) \n\t\t\tthis.in.close();\n\t}",
"close",
"{\n\t\tif(!this.in.equals(System.in)) \n\t\t\tthis.in.close();\n\t}",
"if(!this.in.equals(System.in)) \n\t\t\tthis.in.close();",
"!this.in.equals(System.in)",
"this.in.equals(System.in)",
"this.in.equals",
"this.in",
"this",
"this.in",
"System.in",
"System",
"System.in",
"this.in.close()",
"this.in.close",
"this.in",
"this",
"this.in",
"public class Main {\n\tpublic void exec() throws IOException {\n InputUtil in = new InputUtil();\n PrintWriter out = new PrintWriter(System.out);\n int n = in.nextInt();\n int min=200000,max=1,maxRtDiff=-1000000000;\n boolean first = true;\n for(int rt: in.nextInt(new int[n])){\n \tif(first) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t\tfirst = false;\n \t}else{\n \tif(max < rt) {\n \t\tmax = rt;\n \t}\n \t\tint rtDiff = max - min;\n \t\tif(maxRtDiff < rtDiff) {\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}\n \tif(rt < min) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t}\n \t}\n }\n out.println(maxRtDiff);\n out.flush();\n }\n\n public static void main(String[] args) throws IOException {\n new Main().exec();\n }\n}",
"public class Main {\n\tpublic void exec() throws IOException {\n InputUtil in = new InputUtil();\n PrintWriter out = new PrintWriter(System.out);\n int n = in.nextInt();\n int min=200000,max=1,maxRtDiff=-1000000000;\n boolean first = true;\n for(int rt: in.nextInt(new int[n])){\n \tif(first) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t\tfirst = false;\n \t}else{\n \tif(max < rt) {\n \t\tmax = rt;\n \t}\n \t\tint rtDiff = max - min;\n \t\tif(maxRtDiff < rtDiff) {\n \t\t\tmaxRtDiff = rtDiff;\n \t\t}\n \tif(rt < min) {\n \t\tmin = rt;\n \t\tmax = 1;\n \t}\n \t}\n }\n out.println(maxRtDiff);\n out.flush();\n }\n\n public static void main(String[] args) throws IOException {\n new Main().exec();\n }\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Main {
public void exec() throws IOException {
InputUtil in = new InputUtil();
PrintWriter out = new PrintWriter(System.out);
int n = in.nextInt();
int min=200000,max=1,maxRtDiff=-1000000000;
boolean first = true;
for(int rt: in.nextInt(new int[n])){
if(first) {
min = rt;
max = 1;
first = false;
}else{
if(max < rt) {
max = rt;
}
int rtDiff = max - min;
if(maxRtDiff < rtDiff) {
maxRtDiff = rtDiff;
}
if(rt < min) {
min = rt;
max = 1;
}
}
}
out.println(maxRtDiff);
out.flush();
}
public static void main(String[] args) throws IOException {
new Main().exec();
}
}
/**
* --------------------------------------------------
* Input Utility
* --------------------------------------------------
*/
class InputUtil {
//Static Fields
private static final int BUFSIZ = 50000;
//Fields
protected InputStream in;
private char[] buf = null;
private int ptr = 0;
private int max = -1;
private BufferedReader br = null;
//Constructors
public InputUtil() {this(System.in,BUFSIZ);}
public InputUtil(InputStream in, int bufsiz) {
initBuf(bufsiz);
initIn(in);
}
//Methods
//Initializer
protected void initIn(InputStream in) {br = new BufferedReader(new InputStreamReader(this.in = in));}
protected void initBuf(int bufsiz) {buf = new char[bufsiz];}
//buffer operation
private void next() throws IOException {ptr++; readBuf();}
private void readBuf() throws IOException {
if(ptr >= max && br.ready()) {
max = br.read(buf);
ptr = 0;
}
}
//Number Input Reader/Parser
private boolean isNum(char b) {return '0' <= b && b <= '9'; }
private boolean isMinus(char b) {return b=='-'; }
private int _nextInt() throws IOException {
int sign = 1;
int res = 0;
char c;
while (!isNum(c=buf[ptr]) && !isMinus(c))
next();
if (isMinus(buf[ptr])) {
sign = -1;
next();
}
while (isNum(c=buf[ptr])) {
res *= 10;
res += c - '0' ;
next();
}
next();
return sign * res;
}
public int nextInt() throws IOException {
readBuf();
return _nextInt();
}
public int[] nextInt(int[] result) throws IOException {
readBuf();
for(int i=0; i<result.length; i++) {
result[i] = _nextInt();
}
return result;
}
//Close
public void close() throws IOException {
if(!this.in.equals(System.in))
this.in.close();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
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,
2,
18,
13,
17,
18,
13,
17,
41,
13,
18,
13,
17,
41,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
2,
13,
17,
13,
0,
13,
18,
13,
2,
13,
17,
0,
13,
2,
18,
13,
13,
13,
14,
2,
13,
13,
0,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
0,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
29,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
154,
8
],
[
154,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
11,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
18,
20
],
[
11,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
9,
27
],
[
27,
28
],
[
154,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
38,
40
],
[
31,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
31,
46
],
[
46,
47
],
[
31,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
48,
58
],
[
58,
59
],
[
59,
60
],
[
48,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
64,
70
],
[
63,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
62,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
62,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
85,
89
],
[
89,
90
],
[
89,
91
],
[
31,
92
],
[
92,
93
],
[
29,
94
],
[
94,
95
],
[
154,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
102,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
118,
119
],
[
119,
120
],
[
109,
121
],
[
121,
122
],
[
121,
123
],
[
109,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
125,
133
],
[
133,
134
],
[
134,
135
],
[
125,
136
],
[
137,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
142,
143
],
[
143,
144
],
[
142,
145
],
[
145,
146
],
[
146,
147
],
[
109,
148
],
[
148,
149
],
[
149,
150
],
[
98,
151
],
[
151,
152
],
[
0,
153
],
[
153,
154
],
[
153,
155
]
] | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tfinal int[] list = getList();\n\t\tfinal int diff = getMaxDiff(list);\n\t\t\n\t\tSystem.out.println(diff);\n\t}\n\t\n\tpublic static int getMaxDiff(int[] list) {\n int maxDiff = list[1] - list[0];\n int min = list[0];\n \n int diff;\n for (int i = 2; i < list.length; i++) {\n \tif (list[i-1] < min) min = list[i-1];\n \tdiff = list[i] - min;\n \tif (maxDiff < diff) maxDiff = diff;\n }\n \n return maxDiff;\n }\n\t\n\tpublic static int[] getList() {\n\t\tint[] list = null;\n\t\t\n\t\ttry {\n\t\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tfinal int n = Integer.parseInt(reader.readLine());\n\t\t\tlist = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tlist[i] = Integer.parseInt(reader.readLine());\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn list;\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tfinal int[] list = getList();\n\t\tfinal int diff = getMaxDiff(list);\n\t\t\n\t\tSystem.out.println(diff);\n\t}\n\t\n\tpublic static int getMaxDiff(int[] list) {\n int maxDiff = list[1] - list[0];\n int min = list[0];\n \n int diff;\n for (int i = 2; i < list.length; i++) {\n \tif (list[i-1] < min) min = list[i-1];\n \tdiff = list[i] - min;\n \tif (maxDiff < diff) maxDiff = diff;\n }\n \n return maxDiff;\n }\n\t\n\tpublic static int[] getList() {\n\t\tint[] list = null;\n\t\t\n\t\ttry {\n\t\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tfinal int n = Integer.parseInt(reader.readLine());\n\t\t\tlist = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tlist[i] = Integer.parseInt(reader.readLine());\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn list;\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tfinal int[] list = getList();\n\t\tfinal int diff = getMaxDiff(list);\n\t\t\n\t\tSystem.out.println(diff);\n\t}",
"main",
"{\n\t\tfinal int[] list = getList();\n\t\tfinal int diff = getMaxDiff(list);\n\t\t\n\t\tSystem.out.println(diff);\n\t}",
"final int[] list = getList();",
"list",
"getList()",
"getList",
"final int diff = getMaxDiff(list);",
"diff",
"getMaxDiff(list)",
"getMaxDiff",
"list",
"System.out.println(diff)",
"System.out.println",
"System.out",
"System",
"System.out",
"diff",
"String[] args",
"args",
"public static int getMaxDiff(int[] list) {\n int maxDiff = list[1] - list[0];\n int min = list[0];\n \n int diff;\n for (int i = 2; i < list.length; i++) {\n \tif (list[i-1] < min) min = list[i-1];\n \tdiff = list[i] - min;\n \tif (maxDiff < diff) maxDiff = diff;\n }\n \n return maxDiff;\n }",
"getMaxDiff",
"{\n int maxDiff = list[1] - list[0];\n int min = list[0];\n \n int diff;\n for (int i = 2; i < list.length; i++) {\n \tif (list[i-1] < min) min = list[i-1];\n \tdiff = list[i] - min;\n \tif (maxDiff < diff) maxDiff = diff;\n }\n \n return maxDiff;\n }",
"int maxDiff = list[1] - list[0];",
"maxDiff",
"list[1] - list[0]",
"list[1]",
"list",
"1",
"list[0]",
"list",
"0",
"int min = list[0];",
"min",
"list[0]",
"list",
"0",
"int diff;",
"diff",
"for (int i = 2; i < list.length; i++) {\n \tif (list[i-1] < min) min = list[i-1];\n \tdiff = list[i] - min;\n \tif (maxDiff < diff) maxDiff = diff;\n }",
"int i = 2;",
"int i = 2;",
"i",
"2",
"i < list.length",
"i",
"list.length",
"list",
"list.length",
"i++",
"i++",
"i",
"{\n \tif (list[i-1] < min) min = list[i-1];\n \tdiff = list[i] - min;\n \tif (maxDiff < diff) maxDiff = diff;\n }",
"{\n \tif (list[i-1] < min) min = list[i-1];\n \tdiff = list[i] - min;\n \tif (maxDiff < diff) maxDiff = diff;\n }",
"if (list[i-1] < min) min = list[i-1];",
"list[i-1] < min",
"list[i-1]",
"list",
"i-1",
"i",
"1",
"min",
"min = list[i-1]",
"min",
"list[i-1]",
"list",
"i-1",
"i",
"1",
"diff = list[i] - min",
"diff",
"list[i] - min",
"list[i]",
"list",
"i",
"min",
"if (maxDiff < diff) maxDiff = diff;",
"maxDiff < diff",
"maxDiff",
"diff",
"maxDiff = diff",
"maxDiff",
"diff",
"return maxDiff;",
"maxDiff",
"int[] list",
"list",
"public static int[] getList() {\n\t\tint[] list = null;\n\t\t\n\t\ttry {\n\t\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tfinal int n = Integer.parseInt(reader.readLine());\n\t\t\tlist = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tlist[i] = Integer.parseInt(reader.readLine());\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn list;\n\t}",
"getList",
"{\n\t\tint[] list = null;\n\t\t\n\t\ttry {\n\t\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tfinal int n = Integer.parseInt(reader.readLine());\n\t\t\tlist = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tlist[i] = Integer.parseInt(reader.readLine());\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn list;\n\t}",
"int[] list = null;",
"list",
"null",
"try {\n\t\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tfinal int n = Integer.parseInt(reader.readLine());\n\t\t\tlist = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tlist[i] = Integer.parseInt(reader.readLine());\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}",
"catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}",
"Exception e",
"{\n\t\t\te.printStackTrace();\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tfinal int n = Integer.parseInt(reader.readLine());\n\t\t\tlist = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tlist[i] = Integer.parseInt(reader.readLine());\n\t\t\t}\n\t\t\treader.close();\n\t\t}",
"final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"final int n = Integer.parseInt(reader.readLine());",
"n",
"Integer.parseInt(reader.readLine())",
"Integer.parseInt",
"Integer",
"reader.readLine()",
"reader.readLine",
"reader",
"list = new int[n]",
"list",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n\t\t\t\tlist[i] = Integer.parseInt(reader.readLine());\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\t\tlist[i] = Integer.parseInt(reader.readLine());\n\t\t\t}",
"{\n\t\t\t\tlist[i] = Integer.parseInt(reader.readLine());\n\t\t\t}",
"list[i] = Integer.parseInt(reader.readLine())",
"list[i]",
"list",
"i",
"Integer.parseInt(reader.readLine())",
"Integer.parseInt",
"Integer",
"reader.readLine()",
"reader.readLine",
"reader",
"reader.close()",
"reader.close",
"reader",
"return list;",
"list",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tfinal int[] list = getList();\n\t\tfinal int diff = getMaxDiff(list);\n\t\t\n\t\tSystem.out.println(diff);\n\t}\n\t\n\tpublic static int getMaxDiff(int[] list) {\n int maxDiff = list[1] - list[0];\n int min = list[0];\n \n int diff;\n for (int i = 2; i < list.length; i++) {\n \tif (list[i-1] < min) min = list[i-1];\n \tdiff = list[i] - min;\n \tif (maxDiff < diff) maxDiff = diff;\n }\n \n return maxDiff;\n }\n\t\n\tpublic static int[] getList() {\n\t\tint[] list = null;\n\t\t\n\t\ttry {\n\t\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tfinal int n = Integer.parseInt(reader.readLine());\n\t\t\tlist = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tlist[i] = Integer.parseInt(reader.readLine());\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn list;\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tfinal int[] list = getList();\n\t\tfinal int diff = getMaxDiff(list);\n\t\t\n\t\tSystem.out.println(diff);\n\t}\n\t\n\tpublic static int getMaxDiff(int[] list) {\n int maxDiff = list[1] - list[0];\n int min = list[0];\n \n int diff;\n for (int i = 2; i < list.length; i++) {\n \tif (list[i-1] < min) min = list[i-1];\n \tdiff = list[i] - min;\n \tif (maxDiff < diff) maxDiff = diff;\n }\n \n return maxDiff;\n }\n\t\n\tpublic static int[] getList() {\n\t\tint[] list = null;\n\t\t\n\t\ttry {\n\t\t\tfinal BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tfinal int n = Integer.parseInt(reader.readLine());\n\t\t\tlist = new int[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tlist[i] = Integer.parseInt(reader.readLine());\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn list;\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
final int[] list = getList();
final int diff = getMaxDiff(list);
System.out.println(diff);
}
public static int getMaxDiff(int[] list) {
int maxDiff = list[1] - list[0];
int min = list[0];
int diff;
for (int i = 2; i < list.length; i++) {
if (list[i-1] < min) min = list[i-1];
diff = list[i] - min;
if (maxDiff < diff) maxDiff = diff;
}
return maxDiff;
}
public static int[] getList() {
int[] list = null;
try {
final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
final int n = Integer.parseInt(reader.readLine());
list = new int[n];
for (int i = 0; i < n; i++) {
list[i] = Integer.parseInt(reader.readLine());
}
reader.close();
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
20,
0,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
40,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
18,
13,
13,
30,
11,
1,
41,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
2,
18,
13,
13,
18,
13,
13,
17,
2,
13,
18,
13,
13,
0,
13,
18,
13,
13,
14,
2,
13,
2,
18,
13,
13,
18,
13,
13,
0,
13,
2,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
139,
5
],
[
139,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
11,
13
],
[
8,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
30,
38
],
[
38,
39
],
[
39,
40
],
[
30,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
8,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
50,
60
],
[
60,
61
],
[
61,
62
],
[
50,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
65,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
76,
78
],
[
72,
79
],
[
79,
80
],
[
79,
81
],
[
72,
82
],
[
82,
83
],
[
83,
84
],
[
72,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
94,
96
],
[
89,
97
],
[
88,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
100,
102
],
[
87,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
105,
107
],
[
86,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
115,
116
],
[
115,
117
],
[
108,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
120,
124
],
[
124,
125
],
[
124,
126
],
[
8,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
127,
132
],
[
8,
133
],
[
133,
134
],
[
134,
135
],
[
6,
136
],
[
136,
137
],
[
0,
138
],
[
138,
139
],
[
138,
140
]
] | [
"import java.util.Scanner;\n\npublic class Main{\n\n\n\tpublic static void main(String[] args){\n\n\t\tint n;\n\n\t\tScanner scan=new Scanner(System.in);\n\t\tn=scan.nextInt();\n\t\tint[] box=new int[n];\n\t\tint max=-1000000001;\n\t\tint min=1000000001;\n\n\t\tfor(int i=0;i<n;i++){\n\t\tbox[i]=scan.nextInt();\n\t\t}\n\n\t\tfor(int i=0;i<n-1;i++){\n\n\t\t\tif(min>box[i]){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}\n\t\t\t}//if(min>box[i])\n\t\t}\n\t\tSystem.out.println(max);\n\n\n\n\t\tscan.close();\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\n\n\tpublic static void main(String[] args){\n\n\t\tint n;\n\n\t\tScanner scan=new Scanner(System.in);\n\t\tn=scan.nextInt();\n\t\tint[] box=new int[n];\n\t\tint max=-1000000001;\n\t\tint min=1000000001;\n\n\t\tfor(int i=0;i<n;i++){\n\t\tbox[i]=scan.nextInt();\n\t\t}\n\n\t\tfor(int i=0;i<n-1;i++){\n\n\t\t\tif(min>box[i]){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}\n\t\t\t}//if(min>box[i])\n\t\t}\n\t\tSystem.out.println(max);\n\n\n\n\t\tscan.close();\n\n\t}\n\n}",
"Main",
"public static void main(String[] args){\n\n\t\tint n;\n\n\t\tScanner scan=new Scanner(System.in);\n\t\tn=scan.nextInt();\n\t\tint[] box=new int[n];\n\t\tint max=-1000000001;\n\t\tint min=1000000001;\n\n\t\tfor(int i=0;i<n;i++){\n\t\tbox[i]=scan.nextInt();\n\t\t}\n\n\t\tfor(int i=0;i<n-1;i++){\n\n\t\t\tif(min>box[i]){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}\n\t\t\t}//if(min>box[i])\n\t\t}\n\t\tSystem.out.println(max);\n\n\n\n\t\tscan.close();\n\n\t}",
"main",
"{\n\n\t\tint n;\n\n\t\tScanner scan=new Scanner(System.in);\n\t\tn=scan.nextInt();\n\t\tint[] box=new int[n];\n\t\tint max=-1000000001;\n\t\tint min=1000000001;\n\n\t\tfor(int i=0;i<n;i++){\n\t\tbox[i]=scan.nextInt();\n\t\t}\n\n\t\tfor(int i=0;i<n-1;i++){\n\n\t\t\tif(min>box[i]){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}\n\t\t\t}//if(min>box[i])\n\t\t}\n\t\tSystem.out.println(max);\n\n\n\n\t\tscan.close();\n\n\t}",
"int n;",
"n",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"n=scan.nextInt()",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] box=new int[n];",
"box",
"new int[n]",
"n",
"int max=-1000000001;",
"max",
"-1000000001",
"1000000001",
"int min=1000000001;",
"min",
"1000000001",
"for(int i=0;i<n;i++){\n\t\tbox[i]=scan.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\tbox[i]=scan.nextInt();\n\t\t}",
"{\n\t\tbox[i]=scan.nextInt();\n\t\t}",
"box[i]=scan.nextInt()",
"box[i]",
"box",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for(int i=0;i<n-1;i++){\n\n\t\t\tif(min>box[i]){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}\n\t\t\t}//if(min>box[i])\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n\n\t\t\tif(min>box[i]){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}\n\t\t\t}//if(min>box[i])\n\t\t}",
"{\n\n\t\t\tif(min>box[i]){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}\n\t\t\t}//if(min>box[i])\n\t\t}",
"if(min>box[i]){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}\n\t\t\t}//if(min>box[i])",
"min>box[i]",
"min",
"box[i]",
"box",
"i",
"{\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}\n\t\t\t}",
"for(int j=i+1;j<n;j++){\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}",
"int j=i+1;",
"int j=i+1;",
"j",
"i+1",
"i",
"1",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}",
"{\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}",
"if(box[j]-box[i]>0&&min>box[i])min=box[i];",
"box[j]-box[i]>0&&min>box[i]",
"box[j]-box[i]>0",
"box[j]-box[i]",
"box[j]",
"box",
"j",
"box[i]",
"box",
"i",
"0",
"min>box[i]",
"min",
"box[i]",
"box",
"i",
"min=box[i]",
"min",
"box[i]",
"box",
"i",
"if(max<box[j]-box[i])max=box[j]-box[i];",
"max<box[j]-box[i]",
"max",
"box[j]-box[i]",
"box[j]",
"box",
"j",
"box[i]",
"box",
"i",
"max=box[j]-box[i]",
"max",
"box[j]-box[i]",
"box[j]",
"box",
"j",
"box[i]",
"box",
"i",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main{\n\n\n\tpublic static void main(String[] args){\n\n\t\tint n;\n\n\t\tScanner scan=new Scanner(System.in);\n\t\tn=scan.nextInt();\n\t\tint[] box=new int[n];\n\t\tint max=-1000000001;\n\t\tint min=1000000001;\n\n\t\tfor(int i=0;i<n;i++){\n\t\tbox[i]=scan.nextInt();\n\t\t}\n\n\t\tfor(int i=0;i<n-1;i++){\n\n\t\t\tif(min>box[i]){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}\n\t\t\t}//if(min>box[i])\n\t\t}\n\t\tSystem.out.println(max);\n\n\n\n\t\tscan.close();\n\n\t}\n\n}",
"public class Main{\n\n\n\tpublic static void main(String[] args){\n\n\t\tint n;\n\n\t\tScanner scan=new Scanner(System.in);\n\t\tn=scan.nextInt();\n\t\tint[] box=new int[n];\n\t\tint max=-1000000001;\n\t\tint min=1000000001;\n\n\t\tfor(int i=0;i<n;i++){\n\t\tbox[i]=scan.nextInt();\n\t\t}\n\n\t\tfor(int i=0;i<n-1;i++){\n\n\t\t\tif(min>box[i]){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(box[j]-box[i]>0&&min>box[i])min=box[i];\n\t\t\t\tif(max<box[j]-box[i])max=box[j]-box[i];\n\t\t\t}\n\t\t\t}//if(min>box[i])\n\t\t}\n\t\tSystem.out.println(max);\n\n\n\n\t\tscan.close();\n\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args){
int n;
Scanner scan=new Scanner(System.in);
n=scan.nextInt();
int[] box=new int[n];
int max=-1000000001;
int min=1000000001;
for(int i=0;i<n;i++){
box[i]=scan.nextInt();
}
for(int i=0;i<n-1;i++){
if(min>box[i]){
for(int j=i+1;j<n;j++){
if(box[j]-box[i]>0&&min>box[i])min=box[i];
if(max<box[j]-box[i])max=box[j]-box[i];
}
}//if(min>box[i])
}
System.out.println(max);
scan.close();
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
12,
13,
30,
41,
13,
20,
13,
41,
13,
20,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
96,
5
],
[
96,
6
],
[
6,
7
],
[
6,
8
],
[
96,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
16
],
[
16,
17
],
[
16,
18
],
[
11,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
11,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
11,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
11,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
11,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
69,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
66,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
80,
84
],
[
84,
85
],
[
84,
86
],
[
11,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
87,
92
],
[
9,
93
],
[
93,
94
],
[
0,
95
],
[
95,
96
],
[
95,
97
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n private static final int MAXSIZE = 200000;\n\n public static void main(String[] args) {\n int[] R = new int[MAXSIZE];\n\n Scanner sc = new Scanner(System.in);\n int rLength = sc.nextInt();\n\n for (int idx = 0; idx < rLength; idx++) {\n R[idx] = sc.nextInt();\n }\n\n int res = Integer.MIN_VALUE;\n int currMin = R[0];\n for (int idx = 1; idx < rLength; idx++) {\n res = Math.max(res, R[idx] - currMin);\n currMin = Math.min(currMin, R[idx]);\n }\n\n System.out.println(res);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n private static final int MAXSIZE = 200000;\n\n public static void main(String[] args) {\n int[] R = new int[MAXSIZE];\n\n Scanner sc = new Scanner(System.in);\n int rLength = sc.nextInt();\n\n for (int idx = 0; idx < rLength; idx++) {\n R[idx] = sc.nextInt();\n }\n\n int res = Integer.MIN_VALUE;\n int currMin = R[0];\n for (int idx = 1; idx < rLength; idx++) {\n res = Math.max(res, R[idx] - currMin);\n currMin = Math.min(currMin, R[idx]);\n }\n\n System.out.println(res);\n }\n}",
"Main",
"private static final int MAXSIZE = 200000;",
"MAXSIZE",
"200000",
"public static void main(String[] args) {\n int[] R = new int[MAXSIZE];\n\n Scanner sc = new Scanner(System.in);\n int rLength = sc.nextInt();\n\n for (int idx = 0; idx < rLength; idx++) {\n R[idx] = sc.nextInt();\n }\n\n int res = Integer.MIN_VALUE;\n int currMin = R[0];\n for (int idx = 1; idx < rLength; idx++) {\n res = Math.max(res, R[idx] - currMin);\n currMin = Math.min(currMin, R[idx]);\n }\n\n System.out.println(res);\n }",
"main",
"{\n int[] R = new int[MAXSIZE];\n\n Scanner sc = new Scanner(System.in);\n int rLength = sc.nextInt();\n\n for (int idx = 0; idx < rLength; idx++) {\n R[idx] = sc.nextInt();\n }\n\n int res = Integer.MIN_VALUE;\n int currMin = R[0];\n for (int idx = 1; idx < rLength; idx++) {\n res = Math.max(res, R[idx] - currMin);\n currMin = Math.min(currMin, R[idx]);\n }\n\n System.out.println(res);\n }",
"int[] R = new int[MAXSIZE];",
"R",
"new int[MAXSIZE]",
"MAXSIZE",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int rLength = sc.nextInt();",
"rLength",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int idx = 0; idx < rLength; idx++) {\n R[idx] = sc.nextInt();\n }",
"int idx = 0;",
"int idx = 0;",
"idx",
"0",
"idx < rLength",
"idx",
"rLength",
"idx++",
"idx++",
"idx",
"{\n R[idx] = sc.nextInt();\n }",
"{\n R[idx] = sc.nextInt();\n }",
"R[idx] = sc.nextInt()",
"R[idx]",
"R",
"idx",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int res = Integer.MIN_VALUE;",
"res",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int currMin = R[0];",
"currMin",
"R[0]",
"R",
"0",
"for (int idx = 1; idx < rLength; idx++) {\n res = Math.max(res, R[idx] - currMin);\n currMin = Math.min(currMin, R[idx]);\n }",
"int idx = 1;",
"int idx = 1;",
"idx",
"1",
"idx < rLength",
"idx",
"rLength",
"idx++",
"idx++",
"idx",
"{\n res = Math.max(res, R[idx] - currMin);\n currMin = Math.min(currMin, R[idx]);\n }",
"{\n res = Math.max(res, R[idx] - currMin);\n currMin = Math.min(currMin, R[idx]);\n }",
"res = Math.max(res, R[idx] - currMin)",
"res",
"Math.max(res, R[idx] - currMin)",
"Math.max",
"Math",
"res",
"R[idx] - currMin",
"R[idx]",
"R",
"idx",
"currMin",
"currMin = Math.min(currMin, R[idx])",
"currMin",
"Math.min(currMin, R[idx])",
"Math.min",
"Math",
"currMin",
"R[idx]",
"R",
"idx",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"String[] args",
"args",
"public class Main {\n private static final int MAXSIZE = 200000;\n\n public static void main(String[] args) {\n int[] R = new int[MAXSIZE];\n\n Scanner sc = new Scanner(System.in);\n int rLength = sc.nextInt();\n\n for (int idx = 0; idx < rLength; idx++) {\n R[idx] = sc.nextInt();\n }\n\n int res = Integer.MIN_VALUE;\n int currMin = R[0];\n for (int idx = 1; idx < rLength; idx++) {\n res = Math.max(res, R[idx] - currMin);\n currMin = Math.min(currMin, R[idx]);\n }\n\n System.out.println(res);\n }\n}",
"public class Main {\n private static final int MAXSIZE = 200000;\n\n public static void main(String[] args) {\n int[] R = new int[MAXSIZE];\n\n Scanner sc = new Scanner(System.in);\n int rLength = sc.nextInt();\n\n for (int idx = 0; idx < rLength; idx++) {\n R[idx] = sc.nextInt();\n }\n\n int res = Integer.MIN_VALUE;\n int currMin = R[0];\n for (int idx = 1; idx < rLength; idx++) {\n res = Math.max(res, R[idx] - currMin);\n currMin = Math.min(currMin, R[idx]);\n }\n\n System.out.println(res);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
private static final int MAXSIZE = 200000;
public static void main(String[] args) {
int[] R = new int[MAXSIZE];
Scanner sc = new Scanner(System.in);
int rLength = sc.nextInt();
for (int idx = 0; idx < rLength; idx++) {
R[idx] = sc.nextInt();
}
int res = Integer.MIN_VALUE;
int currMin = R[0];
for (int idx = 1; idx < rLength; idx++) {
res = Math.max(res, R[idx] - currMin);
currMin = Math.min(currMin, R[idx]);
}
System.out.println(res);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
14,
2,
13,
13,
30,
29,
13,
30,
29,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
29,
13,
30,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
30,
41,
13,
4,
18,
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,
4,
18,
13,
41,
13,
18,
13,
17,
41,
13,
2,
18,
13,
17,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
13,
13,
18,
13,
13,
0,
13,
4,
13,
13,
2,
18,
13,
2,
13,
17,
13,
4,
18,
18,
13,
13,
13,
23,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
9,
13
],
[
13,
14
],
[
14,
15
],
[
9,
16
],
[
16,
17
],
[
17,
18
],
[
6,
19
],
[
19,
20
],
[
6,
21
],
[
21,
22
],
[
4,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
26,
30
],
[
30,
31
],
[
31,
32
],
[
26,
33
],
[
33,
34
],
[
34,
35
],
[
23,
36
],
[
36,
37
],
[
23,
38
],
[
38,
39
],
[
4,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
46,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
63,
64
],
[
56,
65
],
[
65,
66
],
[
65,
67
],
[
56,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
69,
77
],
[
77,
78
],
[
78,
79
],
[
69,
80
],
[
81,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
89,
90
],
[
90,
91
],
[
56,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
94,
96
],
[
56,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
103,
105
],
[
56,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
113,
115
],
[
106,
116
],
[
116,
117
],
[
117,
118
],
[
106,
119
],
[
120,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
123,
125
],
[
123,
126
],
[
126,
127
],
[
126,
128
],
[
120,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
131,
133
],
[
131,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
134,
140
],
[
56,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
40,
147
],
[
147,
148
]
] | [
"import java.io.*;\n\nclass Main{\n \n public static int maxv(int x, int y){\n if(x >= y){\n return x;\n }else{\n return y;\n }\n }\n\n public static int minv(int x, int y){\n if(x <= y){\n return x;\n }else{\n return y;\n }\n }\n\n public static void main(String[] args){\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n try { \n int N = Integer.parseInt(reader.readLine());;\n \n\n int[] a = new int[N];\n\n for(int i = 0; i < N; i ++){\n a[i] = Integer.parseInt(reader.readLine());\n }\n\n int min = a[0];\n int max = a[1] - a[0];\n\n for(int i = 0; i < (N- 1); i++){\n min = minv(min, a[i]);\n max = maxv(max, (a[i + 1] - min));\n }\n\n System.out.println(max);\n \n } catch (IOException e) {\n //TODO: handle exception\n System.out.println(e);\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"class Main{\n \n public static int maxv(int x, int y){\n if(x >= y){\n return x;\n }else{\n return y;\n }\n }\n\n public static int minv(int x, int y){\n if(x <= y){\n return x;\n }else{\n return y;\n }\n }\n\n public static void main(String[] args){\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n try { \n int N = Integer.parseInt(reader.readLine());;\n \n\n int[] a = new int[N];\n\n for(int i = 0; i < N; i ++){\n a[i] = Integer.parseInt(reader.readLine());\n }\n\n int min = a[0];\n int max = a[1] - a[0];\n\n for(int i = 0; i < (N- 1); i++){\n min = minv(min, a[i]);\n max = maxv(max, (a[i + 1] - min));\n }\n\n System.out.println(max);\n \n } catch (IOException e) {\n //TODO: handle exception\n System.out.println(e);\n }\n }\n}",
"Main",
"public static int maxv(int x, int y){\n if(x >= y){\n return x;\n }else{\n return y;\n }\n }",
"maxv",
"{\n if(x >= y){\n return x;\n }else{\n return y;\n }\n }",
"if(x >= y){\n return x;\n }else{\n return y;\n }",
"x >= y",
"x",
"y",
"{\n return x;\n }",
"return x;",
"x",
"{\n return y;\n }",
"return y;",
"y",
"int x",
"x",
"int y",
"y",
"public static int minv(int x, int y){\n if(x <= y){\n return x;\n }else{\n return y;\n }\n }",
"minv",
"{\n if(x <= y){\n return x;\n }else{\n return y;\n }\n }",
"if(x <= y){\n return x;\n }else{\n return y;\n }",
"x <= y",
"x",
"y",
"{\n return x;\n }",
"return x;",
"x",
"{\n return y;\n }",
"return y;",
"y",
"int x",
"x",
"int y",
"y",
"public static void main(String[] args){\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n try { \n int N = Integer.parseInt(reader.readLine());;\n \n\n int[] a = new int[N];\n\n for(int i = 0; i < N; i ++){\n a[i] = Integer.parseInt(reader.readLine());\n }\n\n int min = a[0];\n int max = a[1] - a[0];\n\n for(int i = 0; i < (N- 1); i++){\n min = minv(min, a[i]);\n max = maxv(max, (a[i + 1] - min));\n }\n\n System.out.println(max);\n \n } catch (IOException e) {\n //TODO: handle exception\n System.out.println(e);\n }\n }",
"main",
"{\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n try { \n int N = Integer.parseInt(reader.readLine());;\n \n\n int[] a = new int[N];\n\n for(int i = 0; i < N; i ++){\n a[i] = Integer.parseInt(reader.readLine());\n }\n\n int min = a[0];\n int max = a[1] - a[0];\n\n for(int i = 0; i < (N- 1); i++){\n min = minv(min, a[i]);\n max = maxv(max, (a[i + 1] - min));\n }\n\n System.out.println(max);\n \n } catch (IOException e) {\n //TODO: handle exception\n System.out.println(e);\n }\n }",
"BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"try { \n int N = Integer.parseInt(reader.readLine());;\n \n\n int[] a = new int[N];\n\n for(int i = 0; i < N; i ++){\n a[i] = Integer.parseInt(reader.readLine());\n }\n\n int min = a[0];\n int max = a[1] - a[0];\n\n for(int i = 0; i < (N- 1); i++){\n min = minv(min, a[i]);\n max = maxv(max, (a[i + 1] - min));\n }\n\n System.out.println(max);\n \n } catch (IOException e) {\n //TODO: handle exception\n System.out.println(e);\n }",
"catch (IOException e) {\n //TODO: handle exception\n System.out.println(e);\n }",
"IOException e",
"{\n //TODO: handle exception\n System.out.println(e);\n }",
"System.out.println(e)",
"System.out.println",
"System.out",
"System",
"System.out",
"e",
"{ \n int N = Integer.parseInt(reader.readLine());;\n \n\n int[] a = new int[N];\n\n for(int i = 0; i < N; i ++){\n a[i] = Integer.parseInt(reader.readLine());\n }\n\n int min = a[0];\n int max = a[1] - a[0];\n\n for(int i = 0; i < (N- 1); i++){\n min = minv(min, a[i]);\n max = maxv(max, (a[i + 1] - min));\n }\n\n System.out.println(max);\n \n }",
"int N = Integer.parseInt(reader.readLine());",
"N",
"Integer.parseInt(reader.readLine())",
"Integer.parseInt",
"Integer",
"reader.readLine()",
"reader.readLine",
"reader",
"int[] a = new int[N];",
"a",
"new int[N]",
"N",
"for(int i = 0; i < N; i ++){\n a[i] = Integer.parseInt(reader.readLine());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i ++",
"i ++",
"i",
"{\n a[i] = Integer.parseInt(reader.readLine());\n }",
"{\n a[i] = Integer.parseInt(reader.readLine());\n }",
"a[i] = Integer.parseInt(reader.readLine())",
"a[i]",
"a",
"i",
"Integer.parseInt(reader.readLine())",
"Integer.parseInt",
"Integer",
"reader.readLine()",
"reader.readLine",
"reader",
"int min = a[0];",
"min",
"a[0]",
"a",
"0",
"int max = a[1] - a[0];",
"max",
"a[1] - a[0]",
"a[1]",
"a",
"1",
"a[0]",
"a",
"0",
"for(int i = 0; i < (N- 1); i++){\n min = minv(min, a[i]);\n max = maxv(max, (a[i + 1] - min));\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < (N- 1)",
"i",
"(N- 1)",
"N",
"1",
"i++",
"i++",
"i",
"{\n min = minv(min, a[i]);\n max = maxv(max, (a[i + 1] - min));\n }",
"{\n min = minv(min, a[i]);\n max = maxv(max, (a[i + 1] - min));\n }",
"min = minv(min, a[i])",
"min",
"minv(min, a[i])",
"minv",
"min",
"a[i]",
"a",
"i",
"max = maxv(max, (a[i + 1] - min))",
"max",
"maxv(max, (a[i + 1] - min))",
"maxv",
"max",
"(a[i + 1] - min)",
"a[i + 1]",
"a",
"i + 1",
"i",
"1",
"min",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args"
] | import java.io.*;
class Main{
public static int maxv(int x, int y){
if(x >= y){
return x;
}else{
return y;
}
}
public static int minv(int x, int y){
if(x <= y){
return x;
}else{
return y;
}
}
public static void main(String[] args){
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
int N = Integer.parseInt(reader.readLine());;
int[] a = new int[N];
for(int i = 0; i < N; i ++){
a[i] = Integer.parseInt(reader.readLine());
}
int min = a[0];
int max = a[1] - a[0];
for(int i = 0; i < (N- 1); i++){
min = minv(min, a[i]);
max = maxv(max, (a[i + 1] - min));
}
System.out.println(max);
} catch (IOException e) {
//TODO: handle exception
System.out.println(e);
}
}
} |
[
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,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
20,
23,
13,
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,
41,
13,
2,
18,
13,
17,
18,
13,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
14,
2,
2,
13,
17,
2,
13,
18,
13,
13,
30,
0,
13,
4,
18,
4,
18,
4,
18,
13,
17,
0,
13,
17,
29,
18,
13,
40,
13,
12,
13,
30,
29,
4,
13,
12,
13,
30,
0,
13,
17,
0,
13,
17,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
10,
6,
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
],
[
13,
15
],
[
0,
16
],
[
325,
17
],
[
325,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
20,
29
],
[
29,
30
],
[
29,
31
],
[
20,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
20,
53
],
[
53,
54
],
[
54,
55
],
[
18,
56
],
[
56,
57
],
[
0,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
58,
62
],
[
62,
63
],
[
58,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
66,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
64,
77
],
[
77,
78
],
[
64,
79
],
[
79,
80
],
[
58,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
90,
91
],
[
90,
92
],
[
83,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
83,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
103,
104
],
[
103,
105
],
[
98,
106
],
[
106,
107
],
[
107,
108
],
[
98,
109
],
[
110,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
113,
116
],
[
113,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
110,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
124,
128
],
[
128,
129
],
[
128,
130
],
[
83,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
0,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
137,
141
],
[
141,
142
],
[
137,
143
],
[
143,
144
],
[
137,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
137,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
151,
157
],
[
157,
158
],
[
137,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
169,
171
],
[
162,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
175,
182
],
[
172,
183
],
[
183,
184
],
[
183,
185
],
[
161,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
137,
191
],
[
191,
192
],
[
191,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
137,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
200,
201
],
[
200,
202
],
[
199,
203
],
[
203,
204
],
[
203,
205
],
[
199,
206
],
[
206,
207
],
[
207,
208
],
[
208,
209
],
[
137,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
214,
217
],
[
217,
218
],
[
137,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
223,
226
],
[
226,
227
],
[
137,
228
],
[
228,
229
],
[
228,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
232,
235
],
[
235,
236
],
[
137,
237
],
[
237,
238
],
[
237,
239
],
[
239,
240
],
[
240,
241
],
[
240,
242
],
[
239,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
246,
248
],
[
244,
249
],
[
249,
250
],
[
249,
251
],
[
244,
252
],
[
252,
253
],
[
253,
254
],
[
244,
255
],
[
255,
256
],
[
256,
257
],
[
257,
258
],
[
257,
259
],
[
256,
260
],
[
260,
261
],
[
239,
262
],
[
262,
263
],
[
237,
264
],
[
264,
265
],
[
137,
266
],
[
266,
267
],
[
266,
268
],
[
268,
269
],
[
269,
270
],
[
269,
271
],
[
268,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
275,
277
],
[
273,
278
],
[
278,
279
],
[
278,
280
],
[
273,
281
],
[
281,
282
],
[
282,
283
],
[
273,
284
],
[
284,
285
],
[
285,
286
],
[
286,
287
],
[
286,
288
],
[
285,
289
],
[
289,
290
],
[
268,
291
],
[
291,
292
],
[
266,
293
],
[
293,
294
],
[
137,
295
],
[
295,
296
],
[
295,
297
],
[
297,
298
],
[
298,
299
],
[
298,
300
],
[
297,
302
],
[
302,
303
],
[
303,
304
],
[
304,
305
],
[
304,
306
],
[
302,
307
],
[
307,
308
],
[
307,
309
],
[
302,
310
],
[
310,
311
],
[
311,
312
],
[
302,
313
],
[
313,
314
],
[
314,
315
],
[
315,
316
],
[
315,
317
],
[
314,
318
],
[
318,
319
],
[
297,
320
],
[
320,
321
],
[
295,
322
],
[
322,
323
],
[
0,
324
],
[
324,
325
],
[
324,
326
]
] | [
"import java.io.BufferedReader;\nimport java.io.FileInputStream;\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tContestScanner scan = new ContestScanner();\n\n\t\tint n = scan.nextInt();\n\n\t\tint[] R = new int[n];\n\n\t\tfor(int i=0; i < n; i++)\n\t\t{\n\t\t\tR[i] = scan.nextInt();\n\t\t}\n\n\t\t(new Solve(n, R)).solve();\n\t}\n}\nclass Solve {\n\tprivate final int n;\n\tprivate final int[] R;\n\n\tpublic Solve(final int n, final int[] R)\n\t{\n\t\tthis.n = n;\n\t\tthis.R = R;\n\t}\n\n\tpublic void solve()\n\t{\n\t\tint max = R[1] - R[0];\n\t\tint left = R[0];\n\n\t\tfor(int i=1; i < n; i++)\n\t\t{\n\t\t\tmax = Math.max(max, R[i] - left);\n\t\t\tleft = Math.min(left, R[i]);\n\t\t}\n\n\t\tSystem.out.println(max);\n\t}\n}\nclass ContestScanner {\n\tBufferedReader reader;\n\tString[] line;\n\tint index;\n\tpublic ContestScanner() {\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t}\n\n\tpublic ContestScanner(String filename) throws FileNotFoundException {\n\t\treader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));\n\t}\n\n\tpublic String nextToken() throws IOException {\n\t\tif(line == null || index >= line.length)\n\t\t{\n\t\t\tline = reader.readLine().trim().split(\" \");\n\t\t\tindex = 0;\n\t\t}\n\n\t\treturn line[index++];\n\t}\n\n\tpublic String next() throws IOException {\n\t\treturn nextToken();\n\t}\n\n\tpublic String readLine() throws IOException {\n\t\tline = null;\n\t\tindex = 0;\n\n\t\treturn reader.readLine();\n\t}\n\n\tpublic int nextInt() throws IOException, NumberFormatException {\n\t\treturn Integer.parseInt(nextToken());\n\t}\n\n\tpublic long nextLong() throws IOException, NumberFormatException {\n\t\treturn Long.parseLong(nextToken());\n\t}\n\n\tpublic double nextDouble() throws IOException, NumberFormatException {\n\t\treturn Double.parseDouble(nextToken());\n\t}\n\n\tpublic int[] nextIntArray(int N) throws IOException, NumberFormatException {\n\t\tint[] result = new int[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextInt();\n\n\t\treturn result;\n\t}\n\n\tpublic long[] nextLongArray(int N) throws IOException, NumberFormatException {\n\t\tlong[] result = new long[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextLong();\n\n\t\treturn result;\n\t}\n\n\tpublic double[] nexDoubleArray(int N) throws IOException, NumberFormatException {\n\t\tdouble[] result = new double[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextDouble();\n\n\t\treturn result;\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.FileInputStream;",
"FileInputStream",
"java.io",
"import java.io.FileNotFoundException;",
"FileNotFoundException",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tContestScanner scan = new ContestScanner();\n\n\t\tint n = scan.nextInt();\n\n\t\tint[] R = new int[n];\n\n\t\tfor(int i=0; i < n; i++)\n\t\t{\n\t\t\tR[i] = scan.nextInt();\n\t\t}\n\n\t\t(new Solve(n, R)).solve();\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tContestScanner scan = new ContestScanner();\n\n\t\tint n = scan.nextInt();\n\n\t\tint[] R = new int[n];\n\n\t\tfor(int i=0; i < n; i++)\n\t\t{\n\t\t\tR[i] = scan.nextInt();\n\t\t}\n\n\t\t(new Solve(n, R)).solve();\n\t}",
"main",
"{\n\t\tContestScanner scan = new ContestScanner();\n\n\t\tint n = scan.nextInt();\n\n\t\tint[] R = new int[n];\n\n\t\tfor(int i=0; i < n; i++)\n\t\t{\n\t\t\tR[i] = scan.nextInt();\n\t\t}\n\n\t\t(new Solve(n, R)).solve();\n\t}",
"ContestScanner scan = new ContestScanner();",
"scan",
"new ContestScanner()",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] R = new int[n];",
"R",
"new int[n]",
"n",
"for(int i=0; i < n; i++)\n\t\t{\n\t\t\tR[i] = scan.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tR[i] = scan.nextInt();\n\t\t}",
"{\n\t\t\tR[i] = scan.nextInt();\n\t\t}",
"R[i] = scan.nextInt()",
"R[i]",
"R",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"(new Solve(n, R)).solve()",
"(new Solve(n, R)).solve",
"(new Solve(n, R))",
"String[] args",
"args",
"class Solve {\n\tprivate final int n;\n\tprivate final int[] R;\n\n\tpublic Solve(final int n, final int[] R)\n\t{\n\t\tthis.n = n;\n\t\tthis.R = R;\n\t}\n\n\tpublic void solve()\n\t{\n\t\tint max = R[1] - R[0];\n\t\tint left = R[0];\n\n\t\tfor(int i=1; i < n; i++)\n\t\t{\n\t\t\tmax = Math.max(max, R[i] - left);\n\t\t\tleft = Math.min(left, R[i]);\n\t\t}\n\n\t\tSystem.out.println(max);\n\t}\n}",
"Solve",
"private final int n;",
"n",
"private final int[] R;",
"R",
"public Solve(final int n, final int[] R)\n\t{\n\t\tthis.n = n;\n\t\tthis.R = R;\n\t}",
"Solve",
"{\n\t\tthis.n = n;\n\t\tthis.R = R;\n\t}",
"this.n = n",
"this.n",
"this",
"this.n",
"n",
"this.R = R",
"this.R",
"this",
"this.R",
"R",
"final int n",
"n",
"final int[] R",
"R",
"public void solve()\n\t{\n\t\tint max = R[1] - R[0];\n\t\tint left = R[0];\n\n\t\tfor(int i=1; i < n; i++)\n\t\t{\n\t\t\tmax = Math.max(max, R[i] - left);\n\t\t\tleft = Math.min(left, R[i]);\n\t\t}\n\n\t\tSystem.out.println(max);\n\t}",
"solve",
"{\n\t\tint max = R[1] - R[0];\n\t\tint left = R[0];\n\n\t\tfor(int i=1; i < n; i++)\n\t\t{\n\t\t\tmax = Math.max(max, R[i] - left);\n\t\t\tleft = Math.min(left, R[i]);\n\t\t}\n\n\t\tSystem.out.println(max);\n\t}",
"int max = R[1] - R[0];",
"max",
"R[1] - R[0]",
"R[1]",
"R",
"1",
"R[0]",
"R",
"0",
"int left = R[0];",
"left",
"R[0]",
"R",
"0",
"for(int i=1; i < n; i++)\n\t\t{\n\t\t\tmax = Math.max(max, R[i] - left);\n\t\t\tleft = Math.min(left, R[i]);\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tmax = Math.max(max, R[i] - left);\n\t\t\tleft = Math.min(left, R[i]);\n\t\t}",
"{\n\t\t\tmax = Math.max(max, R[i] - left);\n\t\t\tleft = Math.min(left, R[i]);\n\t\t}",
"max = Math.max(max, R[i] - left)",
"max",
"Math.max(max, R[i] - left)",
"Math.max",
"Math",
"max",
"R[i] - left",
"R[i]",
"R",
"i",
"left",
"left = Math.min(left, R[i])",
"left",
"Math.min(left, R[i])",
"Math.min",
"Math",
"left",
"R[i]",
"R",
"i",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"class ContestScanner {\n\tBufferedReader reader;\n\tString[] line;\n\tint index;\n\tpublic ContestScanner() {\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t}\n\n\tpublic ContestScanner(String filename) throws FileNotFoundException {\n\t\treader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));\n\t}\n\n\tpublic String nextToken() throws IOException {\n\t\tif(line == null || index >= line.length)\n\t\t{\n\t\t\tline = reader.readLine().trim().split(\" \");\n\t\t\tindex = 0;\n\t\t}\n\n\t\treturn line[index++];\n\t}\n\n\tpublic String next() throws IOException {\n\t\treturn nextToken();\n\t}\n\n\tpublic String readLine() throws IOException {\n\t\tline = null;\n\t\tindex = 0;\n\n\t\treturn reader.readLine();\n\t}\n\n\tpublic int nextInt() throws IOException, NumberFormatException {\n\t\treturn Integer.parseInt(nextToken());\n\t}\n\n\tpublic long nextLong() throws IOException, NumberFormatException {\n\t\treturn Long.parseLong(nextToken());\n\t}\n\n\tpublic double nextDouble() throws IOException, NumberFormatException {\n\t\treturn Double.parseDouble(nextToken());\n\t}\n\n\tpublic int[] nextIntArray(int N) throws IOException, NumberFormatException {\n\t\tint[] result = new int[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextInt();\n\n\t\treturn result;\n\t}\n\n\tpublic long[] nextLongArray(int N) throws IOException, NumberFormatException {\n\t\tlong[] result = new long[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextLong();\n\n\t\treturn result;\n\t}\n\n\tpublic double[] nexDoubleArray(int N) throws IOException, NumberFormatException {\n\t\tdouble[] result = new double[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextDouble();\n\n\t\treturn result;\n\t}\n}",
"ContestScanner",
"BufferedReader reader;",
"reader",
"String[] line;",
"line",
"int index;",
"index",
"public ContestScanner() {\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t}",
"ContestScanner",
"{\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t}",
"reader = new BufferedReader(new InputStreamReader(System.in))",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"public ContestScanner(String filename) throws FileNotFoundException {\n\t\treader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));\n\t}",
"ContestScanner",
"{\n\t\treader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));\n\t}",
"reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)))",
"reader",
"new BufferedReader(new InputStreamReader(new FileInputStream(filename)))",
"String filename",
"filename",
"public String nextToken() throws IOException {\n\t\tif(line == null || index >= line.length)\n\t\t{\n\t\t\tline = reader.readLine().trim().split(\" \");\n\t\t\tindex = 0;\n\t\t}\n\n\t\treturn line[index++];\n\t}",
"nextToken",
"{\n\t\tif(line == null || index >= line.length)\n\t\t{\n\t\t\tline = reader.readLine().trim().split(\" \");\n\t\t\tindex = 0;\n\t\t}\n\n\t\treturn line[index++];\n\t}",
"if(line == null || index >= line.length)\n\t\t{\n\t\t\tline = reader.readLine().trim().split(\" \");\n\t\t\tindex = 0;\n\t\t}",
"line == null || index >= line.length",
"line == null",
"line",
"null",
"index >= line.length",
"index",
"line.length",
"line",
"line.length",
"{\n\t\t\tline = reader.readLine().trim().split(\" \");\n\t\t\tindex = 0;\n\t\t}",
"line = reader.readLine().trim().split(\" \")",
"line",
"reader.readLine().trim().split(\" \")",
"reader.readLine().trim().split",
"reader.readLine().trim()",
"reader.readLine().trim",
"reader.readLine()",
"reader.readLine",
"reader",
"\" \"",
"index = 0",
"index",
"0",
"return line[index++];",
"line[index++]",
"line",
"index++",
"index",
"public String next() throws IOException {\n\t\treturn nextToken();\n\t}",
"next",
"{\n\t\treturn nextToken();\n\t}",
"return nextToken();",
"nextToken()",
"nextToken",
"public String readLine() throws IOException {\n\t\tline = null;\n\t\tindex = 0;\n\n\t\treturn reader.readLine();\n\t}",
"readLine",
"{\n\t\tline = null;\n\t\tindex = 0;\n\n\t\treturn reader.readLine();\n\t}",
"line = null",
"line",
"null",
"index = 0",
"index",
"0",
"return reader.readLine();",
"reader.readLine()",
"reader.readLine",
"reader",
"public int nextInt() throws IOException, NumberFormatException {\n\t\treturn Integer.parseInt(nextToken());\n\t}",
"nextInt",
"{\n\t\treturn Integer.parseInt(nextToken());\n\t}",
"return Integer.parseInt(nextToken());",
"Integer.parseInt(nextToken())",
"Integer.parseInt",
"Integer",
"nextToken()",
"nextToken",
"public long nextLong() throws IOException, NumberFormatException {\n\t\treturn Long.parseLong(nextToken());\n\t}",
"nextLong",
"{\n\t\treturn Long.parseLong(nextToken());\n\t}",
"return Long.parseLong(nextToken());",
"Long.parseLong(nextToken())",
"Long.parseLong",
"Long",
"nextToken()",
"nextToken",
"public double nextDouble() throws IOException, NumberFormatException {\n\t\treturn Double.parseDouble(nextToken());\n\t}",
"nextDouble",
"{\n\t\treturn Double.parseDouble(nextToken());\n\t}",
"return Double.parseDouble(nextToken());",
"Double.parseDouble(nextToken())",
"Double.parseDouble",
"Double",
"nextToken()",
"nextToken",
"public int[] nextIntArray(int N) throws IOException, NumberFormatException {\n\t\tint[] result = new int[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextInt();\n\n\t\treturn result;\n\t}",
"nextIntArray",
"{\n\t\tint[] result = new int[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextInt();\n\n\t\treturn result;\n\t}",
"int[] result = new int[N];",
"result",
"new int[N]",
"N",
"for(int i=0; i < N; i++) result[i] = nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"result[i] = nextInt();",
"result[i] = nextInt()",
"result[i]",
"result",
"i",
"nextInt()",
"nextInt",
"return result;",
"result",
"int N",
"N",
"public long[] nextLongArray(int N) throws IOException, NumberFormatException {\n\t\tlong[] result = new long[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextLong();\n\n\t\treturn result;\n\t}",
"nextLongArray",
"{\n\t\tlong[] result = new long[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextLong();\n\n\t\treturn result;\n\t}",
"long[] result = new long[N];",
"result",
"new long[N]",
"N",
"for(int i=0; i < N; i++) result[i] = nextLong();",
"int i=0;",
"int i=0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"result[i] = nextLong();",
"result[i] = nextLong()",
"result[i]",
"result",
"i",
"nextLong()",
"nextLong",
"return result;",
"result",
"int N",
"N",
"public double[] nexDoubleArray(int N) throws IOException, NumberFormatException {\n\t\tdouble[] result = new double[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextDouble();\n\n\t\treturn result;\n\t}",
"nexDoubleArray",
"{\n\t\tdouble[] result = new double[N];\n\n\t\tfor(int i=0; i < N; i++) result[i] = nextDouble();\n\n\t\treturn result;\n\t}",
"double[] result = new double[N];",
"result",
"new double[N]",
"N",
"for(int i=0; i < N; i++) result[i] = nextDouble();",
"int i=0;",
"int i=0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"result[i] = nextDouble();",
"result[i] = nextDouble()",
"result[i]",
"result",
"i",
"nextDouble()",
"nextDouble",
"return result;",
"result",
"int N",
"N",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tContestScanner scan = new ContestScanner();\n\n\t\tint n = scan.nextInt();\n\n\t\tint[] R = new int[n];\n\n\t\tfor(int i=0; i < n; i++)\n\t\t{\n\t\t\tR[i] = scan.nextInt();\n\t\t}\n\n\t\t(new Solve(n, R)).solve();\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tContestScanner scan = new ContestScanner();\n\n\t\tint n = scan.nextInt();\n\n\t\tint[] R = new int[n];\n\n\t\tfor(int i=0; i < n; i++)\n\t\t{\n\t\t\tR[i] = scan.nextInt();\n\t\t}\n\n\t\t(new Solve(n, R)).solve();\n\t}\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
ContestScanner scan = new ContestScanner();
int n = scan.nextInt();
int[] R = new int[n];
for(int i=0; i < n; i++)
{
R[i] = scan.nextInt();
}
(new Solve(n, R)).solve();
}
}
class Solve {
private final int n;
private final int[] R;
public Solve(final int n, final int[] R)
{
this.n = n;
this.R = R;
}
public void solve()
{
int max = R[1] - R[0];
int left = R[0];
for(int i=1; i < n; i++)
{
max = Math.max(max, R[i] - left);
left = Math.min(left, R[i]);
}
System.out.println(max);
}
}
class ContestScanner {
BufferedReader reader;
String[] line;
int index;
public ContestScanner() {
reader = new BufferedReader(new InputStreamReader(System.in));
}
public ContestScanner(String filename) throws FileNotFoundException {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
}
public String nextToken() throws IOException {
if(line == null || index >= line.length)
{
line = reader.readLine().trim().split(" ");
index = 0;
}
return line[index++];
}
public String next() throws IOException {
return nextToken();
}
public String readLine() throws IOException {
line = null;
index = 0;
return reader.readLine();
}
public int nextInt() throws IOException, NumberFormatException {
return Integer.parseInt(nextToken());
}
public long nextLong() throws IOException, NumberFormatException {
return Long.parseLong(nextToken());
}
public double nextDouble() throws IOException, NumberFormatException {
return Double.parseDouble(nextToken());
}
public int[] nextIntArray(int N) throws IOException, NumberFormatException {
int[] result = new int[N];
for(int i=0; i < N; i++) result[i] = nextInt();
return result;
}
public long[] nextLongArray(int N) throws IOException, NumberFormatException {
long[] result = new long[N];
for(int i=0; i < N; i++) result[i] = nextLong();
return result;
}
public double[] nexDoubleArray(int N) throws IOException, NumberFormatException {
double[] result = new double[N];
for(int i=0; i < N; i++) result[i] = nextDouble();
return result;
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
4,
18,
13,
41,
13,
40,
17,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
4,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
92,
5
],
[
92,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
20,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
35,
36
],
[
36,
37
],
[
8,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
8,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
63,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
67,
72
],
[
60,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
75,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
8,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
6,
89
],
[
89,
90
],
[
0,
91
],
[
91,
92
],
[
91,
93
]
] | [
"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();\n\t\t\n\t\tList<Integer> data=new ArrayList<>();\n\t\t\n\t\tfor(int i=0;i<n;i++)data.add(cin.nextInt());\n\t\t\n\t\tint res=-2000000000,minv=data.get(0);\n\t\t\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tres=Math.max(res, data.get(i)-minv);\n\t\t\tminv=Math.min(minv, data.get(i));\n\t\t}\n\t\tSystem.out.println(res);\n\t}\n\n}\n",
"import java.util.*;",
"util.*",
"java",
"public 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();\n\t\t\n\t\tList<Integer> data=new ArrayList<>();\n\t\t\n\t\tfor(int i=0;i<n;i++)data.add(cin.nextInt());\n\t\t\n\t\tint res=-2000000000,minv=data.get(0);\n\t\t\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tres=Math.max(res, data.get(i)-minv);\n\t\t\tminv=Math.min(minv, data.get(i));\n\t\t}\n\t\tSystem.out.println(res);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner cin=new Scanner(System.in);\n\t\t\n\t\tint n=cin.nextInt();\n\t\t\n\t\tList<Integer> data=new ArrayList<>();\n\t\t\n\t\tfor(int i=0;i<n;i++)data.add(cin.nextInt());\n\t\t\n\t\tint res=-2000000000,minv=data.get(0);\n\t\t\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tres=Math.max(res, data.get(i)-minv);\n\t\t\tminv=Math.min(minv, data.get(i));\n\t\t}\n\t\tSystem.out.println(res);\n\t}",
"main",
"{\n\t\tScanner cin=new Scanner(System.in);\n\t\t\n\t\tint n=cin.nextInt();\n\t\t\n\t\tList<Integer> data=new ArrayList<>();\n\t\t\n\t\tfor(int i=0;i<n;i++)data.add(cin.nextInt());\n\t\t\n\t\tint res=-2000000000,minv=data.get(0);\n\t\t\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tres=Math.max(res, data.get(i)-minv);\n\t\t\tminv=Math.min(minv, data.get(i));\n\t\t}\n\t\tSystem.out.println(res);\n\t}",
"Scanner cin=new Scanner(System.in);",
"cin",
"new Scanner(System.in)",
"int n=cin.nextInt();",
"n",
"cin.nextInt()",
"cin.nextInt",
"cin",
"List<Integer> data=new ArrayList<>();",
"data",
"new ArrayList<>()",
"for(int i=0;i<n;i++)data.add(cin.nextInt());",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"data.add(cin.nextInt());",
"data.add(cin.nextInt())",
"data.add",
"data",
"cin.nextInt()",
"cin.nextInt",
"cin",
"int res=-2000000000",
"res",
"-2000000000",
"2000000000",
"minv=data.get(0);",
"minv",
"data.get(0)",
"data.get",
"data",
"0",
"for(int i=1;i<n;i++) {\n\t\t\tres=Math.max(res, data.get(i)-minv);\n\t\t\tminv=Math.min(minv, data.get(i));\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tres=Math.max(res, data.get(i)-minv);\n\t\t\tminv=Math.min(minv, data.get(i));\n\t\t}",
"{\n\t\t\tres=Math.max(res, data.get(i)-minv);\n\t\t\tminv=Math.min(minv, data.get(i));\n\t\t}",
"res=Math.max(res, data.get(i)-minv)",
"res",
"Math.max(res, data.get(i)-minv)",
"Math.max",
"Math",
"res",
"data.get(i)-minv",
"data.get(i)",
"data.get",
"data",
"i",
"minv",
"minv=Math.min(minv, data.get(i))",
"minv",
"Math.min(minv, data.get(i))",
"Math.min",
"Math",
"minv",
"data.get(i)",
"data.get",
"data",
"i",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"String[] args",
"args",
"public 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();\n\t\t\n\t\tList<Integer> data=new ArrayList<>();\n\t\t\n\t\tfor(int i=0;i<n;i++)data.add(cin.nextInt());\n\t\t\n\t\tint res=-2000000000,minv=data.get(0);\n\t\t\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tres=Math.max(res, data.get(i)-minv);\n\t\t\tminv=Math.min(minv, data.get(i));\n\t\t}\n\t\tSystem.out.println(res);\n\t}\n\n}",
"public 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();\n\t\t\n\t\tList<Integer> data=new ArrayList<>();\n\t\t\n\t\tfor(int i=0;i<n;i++)data.add(cin.nextInt());\n\t\t\n\t\tint res=-2000000000,minv=data.get(0);\n\t\t\n\t\tfor(int i=1;i<n;i++) {\n\t\t\tres=Math.max(res, data.get(i)-minv);\n\t\t\tminv=Math.min(minv, data.get(i));\n\t\t}\n\t\tSystem.out.println(res);\n\t}\n\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner cin=new Scanner(System.in);
int n=cin.nextInt();
List<Integer> data=new ArrayList<>();
for(int i=0;i<n;i++)data.add(cin.nextInt());
int res=-2000000000,minv=data.get(0);
for(int i=1;i<n;i++) {
res=Math.max(res, data.get(i)-minv);
minv=Math.min(minv, data.get(i));
}
System.out.println(res);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
20,
0,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
40,
4,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
77,
5
],
[
77,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
11,
13
],
[
8,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
27,
30
],
[
27,
31
],
[
8,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
32,
42
],
[
42,
43
],
[
43,
44
],
[
32,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
46,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
54,
58
],
[
58,
59
],
[
58,
60
],
[
46,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
63,
67
],
[
8,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
6,
74
],
[
74,
75
],
[
0,
76
],
[
76,
77
],
[
76,
78
]
] | [
"import java.util.*;\n\npublic class Main {\n public static void main(String args[]) {\n // input\n\n int num;\n\n Scanner inp = new Scanner(System.in);\n\n num = inp.nextInt();\n\n int min = inp.nextInt();\n int max = (int) -(Math.pow(10,9));\n\n for (int i = 0; i < num-1; i++) {\n int r = inp.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min,r);\n }\n\n System.out.println(max);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String args[]) {\n // input\n\n int num;\n\n Scanner inp = new Scanner(System.in);\n\n num = inp.nextInt();\n\n int min = inp.nextInt();\n int max = (int) -(Math.pow(10,9));\n\n for (int i = 0; i < num-1; i++) {\n int r = inp.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min,r);\n }\n\n System.out.println(max);\n }\n}",
"Main",
"public static void main(String args[]) {\n // input\n\n int num;\n\n Scanner inp = new Scanner(System.in);\n\n num = inp.nextInt();\n\n int min = inp.nextInt();\n int max = (int) -(Math.pow(10,9));\n\n for (int i = 0; i < num-1; i++) {\n int r = inp.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min,r);\n }\n\n System.out.println(max);\n }",
"main",
"{\n // input\n\n int num;\n\n Scanner inp = new Scanner(System.in);\n\n num = inp.nextInt();\n\n int min = inp.nextInt();\n int max = (int) -(Math.pow(10,9));\n\n for (int i = 0; i < num-1; i++) {\n int r = inp.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min,r);\n }\n\n System.out.println(max);\n }",
"int num;",
"num",
"Scanner inp = new Scanner(System.in);",
"inp",
"new Scanner(System.in)",
"num = inp.nextInt()",
"num",
"inp.nextInt()",
"inp.nextInt",
"inp",
"int min = inp.nextInt();",
"min",
"inp.nextInt()",
"inp.nextInt",
"inp",
"int max = (int) -(Math.pow(10,9));",
"max",
"(int) -(Math.pow(10,9))",
"(Math.pow(10,9))",
"Math.pow",
"Math",
"10",
"9",
"for (int i = 0; i < num-1; i++) {\n int r = inp.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min,r);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < num-1",
"i",
"num-1",
"num",
"1",
"i++",
"i++",
"i",
"{\n int r = inp.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min,r);\n }",
"{\n int r = inp.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min,r);\n }",
"int r = inp.nextInt();",
"r",
"inp.nextInt()",
"inp.nextInt",
"inp",
"max = Math.max(max, r-min)",
"max",
"Math.max(max, r-min)",
"Math.max",
"Math",
"max",
"r-min",
"r",
"min",
"min = Math.min(min,r)",
"min",
"Math.min(min,r)",
"Math.min",
"Math",
"min",
"r",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String args[]",
"args",
"public class Main {\n public static void main(String args[]) {\n // input\n\n int num;\n\n Scanner inp = new Scanner(System.in);\n\n num = inp.nextInt();\n\n int min = inp.nextInt();\n int max = (int) -(Math.pow(10,9));\n\n for (int i = 0; i < num-1; i++) {\n int r = inp.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min,r);\n }\n\n System.out.println(max);\n }\n}",
"public class Main {\n public static void main(String args[]) {\n // input\n\n int num;\n\n Scanner inp = new Scanner(System.in);\n\n num = inp.nextInt();\n\n int min = inp.nextInt();\n int max = (int) -(Math.pow(10,9));\n\n for (int i = 0; i < num-1; i++) {\n int r = inp.nextInt();\n max = Math.max(max, r-min);\n min = Math.min(min,r);\n }\n\n System.out.println(max);\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String args[]) {
// input
int num;
Scanner inp = new Scanner(System.in);
num = inp.nextInt();
int min = inp.nextInt();
int max = (int) -(Math.pow(10,9));
for (int i = 0; i < num-1; i++) {
int r = inp.nextInt();
max = Math.max(max, r-min);
min = Math.min(min,r);
}
System.out.println(max);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
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,
4,
18,
13,
41,
13,
18,
13,
17,
41,
13,
2,
18,
13,
17,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
2,
18,
13,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
14,
2,
18,
13,
13,
13,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
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
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
8,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
8,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
58,
60
],
[
8,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
73,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
81,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
73,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
89,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
8,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
6,
107
],
[
107,
108
],
[
0,
109
],
[
109,
110
],
[
109,
111
]
] | [
"import java.util.*;\npublic class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.nextLine());\n int[] arr = new int[n];\n \n for(int i = 0; i < n; i ++) {\n arr[i] = Integer.parseInt(sc.nextLine());\n }\n \n int min = arr[0];\n int maxP = arr[1] - arr[0];\n \n for(int i = 1; i < n; i ++) {\n int dif = arr[i] - min;\n if(dif > maxP) {\n maxP = dif; \n }\n if(arr[i] < min) {\n min = arr[i];\n }\n }\n \n System.out.println(maxP);\n \n }//main\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.nextLine());\n int[] arr = new int[n];\n \n for(int i = 0; i < n; i ++) {\n arr[i] = Integer.parseInt(sc.nextLine());\n }\n \n int min = arr[0];\n int maxP = arr[1] - arr[0];\n \n for(int i = 1; i < n; i ++) {\n int dif = arr[i] - min;\n if(dif > maxP) {\n maxP = dif; \n }\n if(arr[i] < min) {\n min = arr[i];\n }\n }\n \n System.out.println(maxP);\n \n }//main\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.nextLine());\n int[] arr = new int[n];\n \n for(int i = 0; i < n; i ++) {\n arr[i] = Integer.parseInt(sc.nextLine());\n }\n \n int min = arr[0];\n int maxP = arr[1] - arr[0];\n \n for(int i = 1; i < n; i ++) {\n int dif = arr[i] - min;\n if(dif > maxP) {\n maxP = dif; \n }\n if(arr[i] < min) {\n min = arr[i];\n }\n }\n \n System.out.println(maxP);\n \n }//main",
"main",
"{\n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.nextLine());\n int[] arr = new int[n];\n \n for(int i = 0; i < n; i ++) {\n arr[i] = Integer.parseInt(sc.nextLine());\n }\n \n int min = arr[0];\n int maxP = arr[1] - arr[0];\n \n for(int i = 1; i < n; i ++) {\n int dif = arr[i] - min;\n if(dif > maxP) {\n maxP = dif; \n }\n if(arr[i] < min) {\n min = arr[i];\n }\n }\n \n System.out.println(maxP);\n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = Integer.parseInt(sc.nextLine());",
"n",
"Integer.parseInt(sc.nextLine())",
"Integer.parseInt",
"Integer",
"sc.nextLine()",
"sc.nextLine",
"sc",
"int[] arr = new int[n];",
"arr",
"new int[n]",
"n",
"for(int i = 0; i < n; i ++) {\n arr[i] = Integer.parseInt(sc.nextLine());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i ++",
"i ++",
"i",
"{\n arr[i] = Integer.parseInt(sc.nextLine());\n }",
"{\n arr[i] = Integer.parseInt(sc.nextLine());\n }",
"arr[i] = Integer.parseInt(sc.nextLine())",
"arr[i]",
"arr",
"i",
"Integer.parseInt(sc.nextLine())",
"Integer.parseInt",
"Integer",
"sc.nextLine()",
"sc.nextLine",
"sc",
"int min = arr[0];",
"min",
"arr[0]",
"arr",
"0",
"int maxP = arr[1] - arr[0];",
"maxP",
"arr[1] - arr[0]",
"arr[1]",
"arr",
"1",
"arr[0]",
"arr",
"0",
"for(int i = 1; i < n; i ++) {\n int dif = arr[i] - min;\n if(dif > maxP) {\n maxP = dif; \n }\n if(arr[i] < min) {\n min = arr[i];\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i ++",
"i ++",
"i",
"{\n int dif = arr[i] - min;\n if(dif > maxP) {\n maxP = dif; \n }\n if(arr[i] < min) {\n min = arr[i];\n }\n }",
"{\n int dif = arr[i] - min;\n if(dif > maxP) {\n maxP = dif; \n }\n if(arr[i] < min) {\n min = arr[i];\n }\n }",
"int dif = arr[i] - min;",
"dif",
"arr[i] - min",
"arr[i]",
"arr",
"i",
"min",
"if(dif > maxP) {\n maxP = dif; \n }",
"dif > maxP",
"dif",
"maxP",
"{\n maxP = dif; \n }",
"maxP = dif",
"maxP",
"dif",
"if(arr[i] < min) {\n min = arr[i];\n }",
"arr[i] < min",
"arr[i]",
"arr",
"i",
"min",
"{\n min = arr[i];\n }",
"min = arr[i]",
"min",
"arr[i]",
"arr",
"i",
"System.out.println(maxP)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxP",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.nextLine());\n int[] arr = new int[n];\n \n for(int i = 0; i < n; i ++) {\n arr[i] = Integer.parseInt(sc.nextLine());\n }\n \n int min = arr[0];\n int maxP = arr[1] - arr[0];\n \n for(int i = 1; i < n; i ++) {\n int dif = arr[i] - min;\n if(dif > maxP) {\n maxP = dif; \n }\n if(arr[i] < min) {\n min = arr[i];\n }\n }\n \n System.out.println(maxP);\n \n }//main\n}",
"public class Main{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.nextLine());\n int[] arr = new int[n];\n \n for(int i = 0; i < n; i ++) {\n arr[i] = Integer.parseInt(sc.nextLine());\n }\n \n int min = arr[0];\n int maxP = arr[1] - arr[0];\n \n for(int i = 1; i < n; i ++) {\n int dif = arr[i] - min;\n if(dif > maxP) {\n maxP = dif; \n }\n if(arr[i] < min) {\n min = arr[i];\n }\n }\n \n System.out.println(maxP);\n \n }//main\n}",
"Main"
] | import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.nextLine());
int[] arr = new int[n];
for(int i = 0; i < n; i ++) {
arr[i] = Integer.parseInt(sc.nextLine());
}
int min = arr[0];
int maxP = arr[1] - arr[0];
for(int i = 1; i < n; i ++) {
int dif = arr[i] - min;
if(dif > maxP) {
maxP = dif;
}
if(arr[i] < min) {
min = arr[i];
}
}
System.out.println(maxP);
}//main
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
17,
12,
13,
30,
41,
13,
20,
13,
41,
13,
20,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
40,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
95,
5
],
[
95,
6
],
[
6,
7
],
[
6,
8
],
[
95,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
16
],
[
16,
17
],
[
16,
18
],
[
11,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
11,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
24,
32
],
[
32,
33
],
[
33,
34
],
[
24,
35
],
[
36,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
42,
43
],
[
11,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
11,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
11,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
68,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
65,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
79,
83
],
[
83,
84
],
[
83,
85
],
[
11,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
9,
92
],
[
92,
93
],
[
0,
94
],
[
94,
95
],
[
94,
96
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n static final int max = 200000;\n public static void main(String[]args){\n int R[] = new int[max];\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n for (int i = 0; i<n; i++)\n {\n R[i]= scanner.nextInt();\n }\n\n int maxv = -2000000000; //设置一个足够小的值\n int minv = R[0];\n\n for (int i = 1; i<n; i++){\n maxv = Math.max(maxv,R[i]-minv);\n minv = Math.min(minv,R[i]);\n }\n System.out.println(maxv);\n }\n}\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n static final int max = 200000;\n public static void main(String[]args){\n int R[] = new int[max];\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n for (int i = 0; i<n; i++)\n {\n R[i]= scanner.nextInt();\n }\n\n int maxv = -2000000000; //设置一个足够小的值\n int minv = R[0];\n\n for (int i = 1; i<n; i++){\n maxv = Math.max(maxv,R[i]-minv);\n minv = Math.min(minv,R[i]);\n }\n System.out.println(maxv);\n }\n}",
"Main",
"static final int max = 200000;",
"max",
"200000",
"public static void main(String[]args){\n int R[] = new int[max];\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n for (int i = 0; i<n; i++)\n {\n R[i]= scanner.nextInt();\n }\n\n int maxv = -2000000000; //设置一个足够小的值\n int minv = R[0];\n\n for (int i = 1; i<n; i++){\n maxv = Math.max(maxv,R[i]-minv);\n minv = Math.min(minv,R[i]);\n }\n System.out.println(maxv);\n }",
"main",
"{\n int R[] = new int[max];\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n for (int i = 0; i<n; i++)\n {\n R[i]= scanner.nextInt();\n }\n\n int maxv = -2000000000; //设置一个足够小的值\n int minv = R[0];\n\n for (int i = 1; i<n; i++){\n maxv = Math.max(maxv,R[i]-minv);\n minv = Math.min(minv,R[i]);\n }\n System.out.println(maxv);\n }",
"int R[] = new int[max];",
"R",
"new int[max]",
"max",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int n = scanner.nextInt();",
"n",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"for (int i = 0; i<n; i++)\n {\n R[i]= scanner.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n R[i]= scanner.nextInt();\n }",
"{\n R[i]= scanner.nextInt();\n }",
"R[i]= scanner.nextInt()",
"R[i]",
"R",
"i",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int maxv = -2000000000;",
"maxv",
"-2000000000",
"2000000000",
"int minv = R[0];",
"minv",
"R[0]",
"R",
"0",
"for (int i = 1; i<n; i++){\n maxv = Math.max(maxv,R[i]-minv);\n minv = Math.min(minv,R[i]);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n maxv = Math.max(maxv,R[i]-minv);\n minv = Math.min(minv,R[i]);\n }",
"{\n maxv = Math.max(maxv,R[i]-minv);\n minv = Math.min(minv,R[i]);\n }",
"maxv = Math.max(maxv,R[i]-minv)",
"maxv",
"Math.max(maxv,R[i]-minv)",
"Math.max",
"Math",
"maxv",
"R[i]-minv",
"R[i]",
"R",
"i",
"minv",
"minv = Math.min(minv,R[i])",
"minv",
"Math.min(minv,R[i])",
"Math.min",
"Math",
"minv",
"R[i]",
"R",
"i",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String[]args",
"args",
"public class Main {\n\n static final int max = 200000;\n public static void main(String[]args){\n int R[] = new int[max];\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n for (int i = 0; i<n; i++)\n {\n R[i]= scanner.nextInt();\n }\n\n int maxv = -2000000000; //设置一个足够小的值\n int minv = R[0];\n\n for (int i = 1; i<n; i++){\n maxv = Math.max(maxv,R[i]-minv);\n minv = Math.min(minv,R[i]);\n }\n System.out.println(maxv);\n }\n}",
"public class Main {\n\n static final int max = 200000;\n public static void main(String[]args){\n int R[] = new int[max];\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n for (int i = 0; i<n; i++)\n {\n R[i]= scanner.nextInt();\n }\n\n int maxv = -2000000000; //设置一个足够小的值\n int minv = R[0];\n\n for (int i = 1; i<n; i++){\n maxv = Math.max(maxv,R[i]-minv);\n minv = Math.min(minv,R[i]);\n }\n System.out.println(maxv);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
static final int max = 200000;
public static void main(String[]args){
int R[] = new int[max];
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
for (int i = 0; i<n; i++)
{
R[i]= scanner.nextInt();
}
int maxv = -2000000000; //设置一个足够小的值
int minv = R[0];
for (int i = 1; i<n; i++){
maxv = Math.max(maxv,R[i]-minv);
minv = Math.min(minv,R[i]);
}
System.out.println(maxv);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
13,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
8,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
30,
38
],
[
38,
39
],
[
39,
40
],
[
30,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
42,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
50,
54
],
[
54,
55
],
[
54,
56
],
[
42,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
59,
63
],
[
8,
64
],
[
64,
65
],
[
65,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
6,
73
],
[
73,
74
]
] | [
"import java.util.Scanner;\n\nclass Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt(),r=sc.nextInt(),minv=r,maxv=Integer.MIN_VALUE;\n\t\tfor(int i=1;i<n;++i) {\n\t\t\tr=sc.nextInt();\n\t\t\tmaxv=Math.max(maxv, r-minv);\n\t\t\tminv=Math.min(minv, r);\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(maxv);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n\tpublic static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt(),r=sc.nextInt(),minv=r,maxv=Integer.MIN_VALUE;\n\t\tfor(int i=1;i<n;++i) {\n\t\t\tr=sc.nextInt();\n\t\t\tmaxv=Math.max(maxv, r-minv);\n\t\t\tminv=Math.min(minv, r);\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(maxv);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt(),r=sc.nextInt(),minv=r,maxv=Integer.MIN_VALUE;\n\t\tfor(int i=1;i<n;++i) {\n\t\t\tr=sc.nextInt();\n\t\t\tmaxv=Math.max(maxv, r-minv);\n\t\t\tminv=Math.min(minv, r);\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(maxv);\n\t}",
"main",
"{\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt(),r=sc.nextInt(),minv=r,maxv=Integer.MIN_VALUE;\n\t\tfor(int i=1;i<n;++i) {\n\t\t\tr=sc.nextInt();\n\t\t\tmaxv=Math.max(maxv, r-minv);\n\t\t\tminv=Math.min(minv, r);\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(maxv);\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"r=sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"minv=r",
"minv",
"r",
"maxv=Integer.MIN_VALUE;",
"maxv",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"for(int i=1;i<n;++i) {\n\t\t\tr=sc.nextInt();\n\t\t\tmaxv=Math.max(maxv, r-minv);\n\t\t\tminv=Math.min(minv, r);\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<n",
"i",
"n",
"++i",
"++i",
"i",
"{\n\t\t\tr=sc.nextInt();\n\t\t\tmaxv=Math.max(maxv, r-minv);\n\t\t\tminv=Math.min(minv, r);\n\t\t}",
"{\n\t\t\tr=sc.nextInt();\n\t\t\tmaxv=Math.max(maxv, r-minv);\n\t\t\tminv=Math.min(minv, r);\n\t\t}",
"r=sc.nextInt()",
"r",
"sc.nextInt()",
"sc.nextInt",
"sc",
"maxv=Math.max(maxv, r-minv)",
"maxv",
"Math.max(maxv, r-minv)",
"Math.max",
"Math",
"maxv",
"r-minv",
"r",
"minv",
"minv=Math.min(minv, r)",
"minv",
"Math.min(minv, r)",
"Math.min",
"Math",
"minv",
"r",
"sc.close()",
"sc.close",
"sc",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt(),r=sc.nextInt(),minv=r,maxv=Integer.MIN_VALUE;
for(int i=1;i<n;++i) {
r=sc.nextInt();
maxv=Math.max(maxv, r-minv);
minv=Math.min(minv, r);
}
sc.close();
System.out.println(maxv);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
4,
18,
13,
0,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
40,
13,
4,
13,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
17,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
2,
18,
13,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
111,
5
],
[
111,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
39,
47
],
[
47,
48
],
[
8,
49
],
[
49,
50
],
[
49,
51
],
[
6,
52
],
[
52,
53
],
[
111,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
56,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
56,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
67,
77
],
[
77,
78
],
[
78,
79
],
[
67,
80
],
[
81,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
84,
92
],
[
81,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
95,
99
],
[
99,
100
],
[
99,
101
],
[
56,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
54,
108
],
[
108,
109
],
[
0,
110
],
[
110,
111
],
[
110,
112
]
] | [
"import java.util.Scanner;\n\n\npublic class Main{\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner s = new Scanner(System.in);\n\t\tint[] values = null;\n\t\tint cnt = s.nextInt();\n\t\tvalues = new int[cnt];\n\t\tint i = 0;\n\t\tfor(int j=0 ; j<cnt ; j++){\n\t\t\tvalues[i] = s.nextInt();\n\t\t\ti++;\n\t\t}\n\t\tsolve(values);\n\t}\n\n\tpublic static void solve(int[] values) {\n\t\tint mini = values[0];\n\t\tint max = Integer.MIN_VALUE;\n\n\t\tfor(int i=1 ; i<values.length ; i++) {\n\t\t\tmax = Math.max(values[i] - mini, max);\n\t\t\tmini = Math.min(mini, values[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner s = new Scanner(System.in);\n\t\tint[] values = null;\n\t\tint cnt = s.nextInt();\n\t\tvalues = new int[cnt];\n\t\tint i = 0;\n\t\tfor(int j=0 ; j<cnt ; j++){\n\t\t\tvalues[i] = s.nextInt();\n\t\t\ti++;\n\t\t}\n\t\tsolve(values);\n\t}\n\n\tpublic static void solve(int[] values) {\n\t\tint mini = values[0];\n\t\tint max = Integer.MIN_VALUE;\n\n\t\tfor(int i=1 ; i<values.length ; i++) {\n\t\t\tmax = Math.max(values[i] - mini, max);\n\t\t\tmini = Math.min(mini, values[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner s = new Scanner(System.in);\n\t\tint[] values = null;\n\t\tint cnt = s.nextInt();\n\t\tvalues = new int[cnt];\n\t\tint i = 0;\n\t\tfor(int j=0 ; j<cnt ; j++){\n\t\t\tvalues[i] = s.nextInt();\n\t\t\ti++;\n\t\t}\n\t\tsolve(values);\n\t}",
"main",
"{\n\n\t\tScanner s = new Scanner(System.in);\n\t\tint[] values = null;\n\t\tint cnt = s.nextInt();\n\t\tvalues = new int[cnt];\n\t\tint i = 0;\n\t\tfor(int j=0 ; j<cnt ; j++){\n\t\t\tvalues[i] = s.nextInt();\n\t\t\ti++;\n\t\t}\n\t\tsolve(values);\n\t}",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int[] values = null;",
"values",
"null",
"int cnt = s.nextInt();",
"cnt",
"s.nextInt()",
"s.nextInt",
"s",
"values = new int[cnt]",
"values",
"new int[cnt]",
"cnt",
"int i = 0;",
"i",
"0",
"for(int j=0 ; j<cnt ; j++){\n\t\t\tvalues[i] = s.nextInt();\n\t\t\ti++;\n\t\t}",
"int j=0 ;",
"int j=0 ;",
"j",
"0",
"j<cnt",
"j",
"cnt",
"j++",
"j++",
"j",
"{\n\t\t\tvalues[i] = s.nextInt();\n\t\t\ti++;\n\t\t}",
"{\n\t\t\tvalues[i] = s.nextInt();\n\t\t\ti++;\n\t\t}",
"values[i] = s.nextInt()",
"values[i]",
"values",
"i",
"s.nextInt()",
"s.nextInt",
"s",
"i++",
"i",
"solve(values)",
"solve",
"values",
"String[] args",
"args",
"public static void solve(int[] values) {\n\t\tint mini = values[0];\n\t\tint max = Integer.MIN_VALUE;\n\n\t\tfor(int i=1 ; i<values.length ; i++) {\n\t\t\tmax = Math.max(values[i] - mini, max);\n\t\t\tmini = Math.min(mini, values[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"solve",
"{\n\t\tint mini = values[0];\n\t\tint max = Integer.MIN_VALUE;\n\n\t\tfor(int i=1 ; i<values.length ; i++) {\n\t\t\tmax = Math.max(values[i] - mini, max);\n\t\t\tmini = Math.min(mini, values[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"int mini = values[0];",
"mini",
"values[0]",
"values",
"0",
"int max = Integer.MIN_VALUE;",
"max",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"for(int i=1 ; i<values.length ; i++) {\n\t\t\tmax = Math.max(values[i] - mini, max);\n\t\t\tmini = Math.min(mini, values[i]);\n\t\t}",
"int i=1 ;",
"int i=1 ;",
"i",
"1",
"i<values.length",
"i",
"values.length",
"values",
"values.length",
"i++",
"i++",
"i",
"{\n\t\t\tmax = Math.max(values[i] - mini, max);\n\t\t\tmini = Math.min(mini, values[i]);\n\t\t}",
"{\n\t\t\tmax = Math.max(values[i] - mini, max);\n\t\t\tmini = Math.min(mini, values[i]);\n\t\t}",
"max = Math.max(values[i] - mini, max)",
"max",
"Math.max(values[i] - mini, max)",
"Math.max",
"Math",
"values[i] - mini",
"values[i]",
"values",
"i",
"mini",
"max",
"mini = Math.min(mini, values[i])",
"mini",
"Math.min(mini, values[i])",
"Math.min",
"Math",
"mini",
"values[i]",
"values",
"i",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"int[] values",
"values",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner s = new Scanner(System.in);\n\t\tint[] values = null;\n\t\tint cnt = s.nextInt();\n\t\tvalues = new int[cnt];\n\t\tint i = 0;\n\t\tfor(int j=0 ; j<cnt ; j++){\n\t\t\tvalues[i] = s.nextInt();\n\t\t\ti++;\n\t\t}\n\t\tsolve(values);\n\t}\n\n\tpublic static void solve(int[] values) {\n\t\tint mini = values[0];\n\t\tint max = Integer.MIN_VALUE;\n\n\t\tfor(int i=1 ; i<values.length ; i++) {\n\t\t\tmax = Math.max(values[i] - mini, max);\n\t\t\tmini = Math.min(mini, values[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner s = new Scanner(System.in);\n\t\tint[] values = null;\n\t\tint cnt = s.nextInt();\n\t\tvalues = new int[cnt];\n\t\tint i = 0;\n\t\tfor(int j=0 ; j<cnt ; j++){\n\t\t\tvalues[i] = s.nextInt();\n\t\t\ti++;\n\t\t}\n\t\tsolve(values);\n\t}\n\n\tpublic static void solve(int[] values) {\n\t\tint mini = values[0];\n\t\tint max = Integer.MIN_VALUE;\n\n\t\tfor(int i=1 ; i<values.length ; i++) {\n\t\t\tmax = Math.max(values[i] - mini, max);\n\t\t\tmini = Math.min(mini, values[i]);\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int[] values = null;
int cnt = s.nextInt();
values = new int[cnt];
int i = 0;
for(int j=0 ; j<cnt ; j++){
values[i] = s.nextInt();
i++;
}
solve(values);
}
public static void solve(int[] values) {
int mini = values[0];
int max = Integer.MIN_VALUE;
for(int i=1 ; i<values.length ; i++) {
max = Math.max(values[i] - mini, max);
mini = Math.min(mini, values[i]);
}
System.out.println(max);
}
} |
[
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,
40,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
78,
5
],
[
78,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
8,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
44,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
55,
59
],
[
59,
60
],
[
59,
61
],
[
44,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
64,
68
],
[
8,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
6,
75
],
[
75,
76
],
[
0,
77
],
[
77,
78
],
[
77,
79
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = Integer.parseInt(scanner.next());\n Integer minValue = Integer.parseInt(scanner.next());\n Integer maxDiff = -1000000001;\n for (int i = 1; i < n; i++) {\n int value = Integer.parseInt(scanner.next());\n maxDiff = Math.max(maxDiff, value - minValue);\n minValue = Math.min(minValue, value);\n }\n System.out.println(maxDiff);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = Integer.parseInt(scanner.next());\n Integer minValue = Integer.parseInt(scanner.next());\n Integer maxDiff = -1000000001;\n for (int i = 1; i < n; i++) {\n int value = Integer.parseInt(scanner.next());\n maxDiff = Math.max(maxDiff, value - minValue);\n minValue = Math.min(minValue, value);\n }\n System.out.println(maxDiff);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = Integer.parseInt(scanner.next());\n Integer minValue = Integer.parseInt(scanner.next());\n Integer maxDiff = -1000000001;\n for (int i = 1; i < n; i++) {\n int value = Integer.parseInt(scanner.next());\n maxDiff = Math.max(maxDiff, value - minValue);\n minValue = Math.min(minValue, value);\n }\n System.out.println(maxDiff);\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n int n = Integer.parseInt(scanner.next());\n Integer minValue = Integer.parseInt(scanner.next());\n Integer maxDiff = -1000000001;\n for (int i = 1; i < n; i++) {\n int value = Integer.parseInt(scanner.next());\n maxDiff = Math.max(maxDiff, value - minValue);\n minValue = Math.min(minValue, value);\n }\n System.out.println(maxDiff);\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int n = Integer.parseInt(scanner.next());",
"n",
"Integer.parseInt(scanner.next())",
"Integer.parseInt",
"Integer",
"scanner.next()",
"scanner.next",
"scanner",
"Integer minValue = Integer.parseInt(scanner.next());",
"minValue",
"Integer.parseInt(scanner.next())",
"Integer.parseInt",
"Integer",
"scanner.next()",
"scanner.next",
"scanner",
"Integer maxDiff = -1000000001;",
"maxDiff",
"-1000000001",
"1000000001",
"for (int i = 1; i < n; i++) {\n int value = Integer.parseInt(scanner.next());\n maxDiff = Math.max(maxDiff, value - minValue);\n minValue = Math.min(minValue, value);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n int value = Integer.parseInt(scanner.next());\n maxDiff = Math.max(maxDiff, value - minValue);\n minValue = Math.min(minValue, value);\n }",
"{\n int value = Integer.parseInt(scanner.next());\n maxDiff = Math.max(maxDiff, value - minValue);\n minValue = Math.min(minValue, value);\n }",
"int value = Integer.parseInt(scanner.next());",
"value",
"Integer.parseInt(scanner.next())",
"Integer.parseInt",
"Integer",
"scanner.next()",
"scanner.next",
"scanner",
"maxDiff = Math.max(maxDiff, value - minValue)",
"maxDiff",
"Math.max(maxDiff, value - minValue)",
"Math.max",
"Math",
"maxDiff",
"value - minValue",
"value",
"minValue",
"minValue = Math.min(minValue, value)",
"minValue",
"Math.min(minValue, value)",
"Math.min",
"Math",
"minValue",
"value",
"System.out.println(maxDiff)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxDiff",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = Integer.parseInt(scanner.next());\n Integer minValue = Integer.parseInt(scanner.next());\n Integer maxDiff = -1000000001;\n for (int i = 1; i < n; i++) {\n int value = Integer.parseInt(scanner.next());\n maxDiff = Math.max(maxDiff, value - minValue);\n minValue = Math.min(minValue, value);\n }\n System.out.println(maxDiff);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = Integer.parseInt(scanner.next());\n Integer minValue = Integer.parseInt(scanner.next());\n Integer maxDiff = -1000000001;\n for (int i = 1; i < n; i++) {\n int value = Integer.parseInt(scanner.next());\n maxDiff = Math.max(maxDiff, value - minValue);\n minValue = Math.min(minValue, value);\n }\n System.out.println(maxDiff);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = Integer.parseInt(scanner.next());
Integer minValue = Integer.parseInt(scanner.next());
Integer maxDiff = -1000000001;
for (int i = 1; i < n; i++) {
int value = Integer.parseInt(scanner.next());
maxDiff = Math.max(maxDiff, value - minValue);
minValue = Math.min(minValue, value);
}
System.out.println(maxDiff);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
70,
5
],
[
70,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
19,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
47,
51
],
[
51,
52
],
[
51,
53
],
[
39,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
56,
60
],
[
8,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
6,
67
],
[
67,
68
],
[
0,
69
],
[
69,
70
],
[
69,
71
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int count = sc.nextInt();\n int max = Integer.MIN_VALUE, min = sc.nextInt();\n for (int i = 1; i < count; i++) {\n int v = sc.nextInt();\n max = Math.max(max, v - min);\n min = Math.min(min, v);\n }\n System.out.println(max);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int count = sc.nextInt();\n int max = Integer.MIN_VALUE, min = sc.nextInt();\n for (int i = 1; i < count; i++) {\n int v = sc.nextInt();\n max = Math.max(max, v - min);\n min = Math.min(min, v);\n }\n System.out.println(max);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int count = sc.nextInt();\n int max = Integer.MIN_VALUE, min = sc.nextInt();\n for (int i = 1; i < count; i++) {\n int v = sc.nextInt();\n max = Math.max(max, v - min);\n min = Math.min(min, v);\n }\n System.out.println(max);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int count = sc.nextInt();\n int max = Integer.MIN_VALUE, min = sc.nextInt();\n for (int i = 1; i < count; i++) {\n int v = sc.nextInt();\n max = Math.max(max, v - min);\n min = Math.min(min, v);\n }\n System.out.println(max);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int count = sc.nextInt();",
"count",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int max = Integer.MIN_VALUE",
"max",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"min = sc.nextInt();",
"min",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 1; i < count; i++) {\n int v = sc.nextInt();\n max = Math.max(max, v - min);\n min = Math.min(min, v);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < count",
"i",
"count",
"i++",
"i++",
"i",
"{\n int v = sc.nextInt();\n max = Math.max(max, v - min);\n min = Math.min(min, v);\n }",
"{\n int v = sc.nextInt();\n max = Math.max(max, v - min);\n min = Math.min(min, v);\n }",
"int v = sc.nextInt();",
"v",
"sc.nextInt()",
"sc.nextInt",
"sc",
"max = Math.max(max, v - min)",
"max",
"Math.max(max, v - min)",
"Math.max",
"Math",
"max",
"v - min",
"v",
"min",
"min = Math.min(min, v)",
"min",
"Math.min(min, v)",
"Math.min",
"Math",
"min",
"v",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int count = sc.nextInt();\n int max = Integer.MIN_VALUE, min = sc.nextInt();\n for (int i = 1; i < count; i++) {\n int v = sc.nextInt();\n max = Math.max(max, v - min);\n min = Math.min(min, v);\n }\n System.out.println(max);\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int count = sc.nextInt();\n int max = Integer.MIN_VALUE, min = sc.nextInt();\n for (int i = 1; i < count; i++) {\n int v = sc.nextInt();\n max = Math.max(max, v - min);\n min = Math.min(min, v);\n }\n System.out.println(max);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int count = sc.nextInt();
int max = Integer.MIN_VALUE, min = sc.nextInt();
for (int i = 1; i < count; i++) {
int v = sc.nextInt();
max = Math.max(max, v - min);
min = Math.min(min, v);
}
System.out.println(max);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
40,
17,
41,
13,
4,
18,
13,
0,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
2,
13,
13,
30,
0,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
81,
5
],
[
81,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
32,
42
],
[
42,
43
],
[
43,
44
],
[
32,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
46,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
52,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
46,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
8,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
6,
78
],
[
78,
79
],
[
0,
80
],
[
80,
81
],
[
80,
82
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t int min = 1000000000, profit = -1000000000;\n\t int getNum = scan.nextInt();\n\t min = getNum;\n\n\t\tfor(int i = 0; i < n-1; i++) {\n\t\t getNum = scan.nextInt();\n\n\t\t if(profit < getNum-min) {\n\t\t\t\tprofit = getNum-min;\n\t\t}\n\n\t\t\tif(min > getNum) {\n\t\t\t\tmin = getNum;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(profit);\n\t\t}\n\t}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t int min = 1000000000, profit = -1000000000;\n\t int getNum = scan.nextInt();\n\t min = getNum;\n\n\t\tfor(int i = 0; i < n-1; i++) {\n\t\t getNum = scan.nextInt();\n\n\t\t if(profit < getNum-min) {\n\t\t\t\tprofit = getNum-min;\n\t\t}\n\n\t\t\tif(min > getNum) {\n\t\t\t\tmin = getNum;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(profit);\n\t\t}\n\t}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t int min = 1000000000, profit = -1000000000;\n\t int getNum = scan.nextInt();\n\t min = getNum;\n\n\t\tfor(int i = 0; i < n-1; i++) {\n\t\t getNum = scan.nextInt();\n\n\t\t if(profit < getNum-min) {\n\t\t\t\tprofit = getNum-min;\n\t\t}\n\n\t\t\tif(min > getNum) {\n\t\t\t\tmin = getNum;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(profit);\n\t\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t int min = 1000000000, profit = -1000000000;\n\t int getNum = scan.nextInt();\n\t min = getNum;\n\n\t\tfor(int i = 0; i < n-1; i++) {\n\t\t getNum = scan.nextInt();\n\n\t\t if(profit < getNum-min) {\n\t\t\t\tprofit = getNum-min;\n\t\t}\n\n\t\t\tif(min > getNum) {\n\t\t\t\tmin = getNum;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(profit);\n\t\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int min = 1000000000",
"min",
"1000000000",
"profit = -1000000000;",
"profit",
"-1000000000",
"1000000000",
"int getNum = scan.nextInt();",
"getNum",
"scan.nextInt()",
"scan.nextInt",
"scan",
"min = getNum",
"min",
"getNum",
"for(int i = 0; i < n-1; i++) {\n\t\t getNum = scan.nextInt();\n\n\t\t if(profit < getNum-min) {\n\t\t\t\tprofit = getNum-min;\n\t\t}\n\n\t\t\tif(min > getNum) {\n\t\t\t\tmin = getNum;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n\t\t getNum = scan.nextInt();\n\n\t\t if(profit < getNum-min) {\n\t\t\t\tprofit = getNum-min;\n\t\t}\n\n\t\t\tif(min > getNum) {\n\t\t\t\tmin = getNum;\n\t\t\t}\n\t\t}",
"{\n\t\t getNum = scan.nextInt();\n\n\t\t if(profit < getNum-min) {\n\t\t\t\tprofit = getNum-min;\n\t\t}\n\n\t\t\tif(min > getNum) {\n\t\t\t\tmin = getNum;\n\t\t\t}\n\t\t}",
"getNum = scan.nextInt()",
"getNum",
"scan.nextInt()",
"scan.nextInt",
"scan",
"if(profit < getNum-min) {\n\t\t\t\tprofit = getNum-min;\n\t\t}",
"profit < getNum-min",
"profit",
"getNum-min",
"getNum",
"min",
"{\n\t\t\t\tprofit = getNum-min;\n\t\t}",
"profit = getNum-min",
"profit",
"getNum-min",
"getNum",
"min",
"if(min > getNum) {\n\t\t\t\tmin = getNum;\n\t\t\t}",
"min > getNum",
"min",
"getNum",
"{\n\t\t\t\tmin = getNum;\n\t\t\t}",
"min = getNum",
"min",
"getNum",
"System.out.println(profit)",
"System.out.println",
"System.out",
"System",
"System.out",
"profit",
"String[] args",
"args",
"public class Main {\n\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t int min = 1000000000, profit = -1000000000;\n\t int getNum = scan.nextInt();\n\t min = getNum;\n\n\t\tfor(int i = 0; i < n-1; i++) {\n\t\t getNum = scan.nextInt();\n\n\t\t if(profit < getNum-min) {\n\t\t\t\tprofit = getNum-min;\n\t\t}\n\n\t\t\tif(min > getNum) {\n\t\t\t\tmin = getNum;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(profit);\n\t\t}\n\t}",
"public class Main {\n\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t int min = 1000000000, profit = -1000000000;\n\t int getNum = scan.nextInt();\n\t min = getNum;\n\n\t\tfor(int i = 0; i < n-1; i++) {\n\t\t getNum = scan.nextInt();\n\n\t\t if(profit < getNum-min) {\n\t\t\t\tprofit = getNum-min;\n\t\t}\n\n\t\t\tif(min > getNum) {\n\t\t\t\tmin = getNum;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(profit);\n\t\t}\n\t}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int min = 1000000000, profit = -1000000000;
int getNum = scan.nextInt();
min = getNum;
for(int i = 0; i < n-1; i++) {
getNum = scan.nextInt();
if(profit < getNum-min) {
profit = getNum-min;
}
if(min > getNum) {
min = getNum;
}
}
System.out.println(profit);
}
}
|
[
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,
17,
29,
13,
12,
13,
30,
41,
13,
4,
18,
13,
18,
4,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
4,
13,
17,
4,
18,
13,
13,
41,
13,
4,
18,
13,
17,
41,
13,
13,
41,
13,
13,
41,
13,
17,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
13,
14,
2,
13,
17,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
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
],
[
13,
15
],
[
0,
16
],
[
184,
17
],
[
184,
18
],
[
18,
19
],
[
18,
20
],
[
184,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
23,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
23,
35
],
[
35,
36
],
[
184,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
39,
49
],
[
49,
50
],
[
49,
51
],
[
39,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
64,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
39,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
39,
84
],
[
84,
85
],
[
84,
86
],
[
39,
87
],
[
87,
88
],
[
87,
89
],
[
39,
90
],
[
90,
91
],
[
90,
92
],
[
39,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
39,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
98,
108
],
[
108,
109
],
[
109,
110
],
[
98,
111
],
[
112,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
115,
118
],
[
112,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
121,
123
],
[
112,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
112,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
136,
140
],
[
140,
141
],
[
140,
142
],
[
132,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
153,
155
],
[
147,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
156,
160
],
[
160,
161
],
[
161,
162
],
[
161,
163
],
[
112,
164
],
[
164,
165
],
[
164,
166
],
[
39,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
39,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
175,
180
],
[
37,
181
],
[
181,
182
],
[
0,
183
],
[
183,
184
],
[
183,
185
]
] | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class Main {\n\t\n\tprivate static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\n\tpublic static String[] readStandartInput() throws IOException{\n\t\tString str = br.readLine();\n\t\tString[] list = str.split(\" \");\n\t\t\n\t\treturn list;\n\t}\n\t\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tint n = Integer.valueOf(readStandartInput()[0]);\n\t\tList<Integer> list = new ArrayList<>();\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint a = Integer.valueOf(readStandartInput()[0]);\n\t\t\tlist.add(a);\n\t\t}\n\t\t\n\t\t\n\t\tint old = list.get(0);\n\t\tint max = old;\n\t\tint min = old;\n\t\tint maxBenefit = 0;\n\t\tint maxDelta = Integer.MIN_VALUE;\n\t\t\n\t\tfor(int i = 1; i < list.size(); i++){\n\t\t\tint r = list.get(i);\n\t\t\tint delta = r - old;\n\t\t\tif(maxDelta < delta){\n\t\t\t\tmaxDelta = delta;\n\t\t\t}\n\t\t\tif(r < min){\n\t\t\t\tmin = r;\n\t\t\t\tmax = r;\n\t\t\t}else if(max < r){\n\t\t\t\tmax = r;\n\t\t\t\tint benefit = max - min;\n\t\t\t\tif(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}\n\t\t\t}\n\t\t\told = r;\n\t\t}\n\t\tif(maxBenefit == 0){\n\t\t\tmaxBenefit = maxDelta;\n\t\t}\n\t\t\n\t\tSystem.out.println(maxBenefit);\n\t\t\n\t\t\n\t}\n\t\n}\n",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.List;",
"List",
"java.util",
"public class Main {\n\t\n\tprivate static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\n\tpublic static String[] readStandartInput() throws IOException{\n\t\tString str = br.readLine();\n\t\tString[] list = str.split(\" \");\n\t\t\n\t\treturn list;\n\t}\n\t\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tint n = Integer.valueOf(readStandartInput()[0]);\n\t\tList<Integer> list = new ArrayList<>();\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint a = Integer.valueOf(readStandartInput()[0]);\n\t\t\tlist.add(a);\n\t\t}\n\t\t\n\t\t\n\t\tint old = list.get(0);\n\t\tint max = old;\n\t\tint min = old;\n\t\tint maxBenefit = 0;\n\t\tint maxDelta = Integer.MIN_VALUE;\n\t\t\n\t\tfor(int i = 1; i < list.size(); i++){\n\t\t\tint r = list.get(i);\n\t\t\tint delta = r - old;\n\t\t\tif(maxDelta < delta){\n\t\t\t\tmaxDelta = delta;\n\t\t\t}\n\t\t\tif(r < min){\n\t\t\t\tmin = r;\n\t\t\t\tmax = r;\n\t\t\t}else if(max < r){\n\t\t\t\tmax = r;\n\t\t\t\tint benefit = max - min;\n\t\t\t\tif(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}\n\t\t\t}\n\t\t\told = r;\n\t\t}\n\t\tif(maxBenefit == 0){\n\t\t\tmaxBenefit = maxDelta;\n\t\t}\n\t\t\n\t\tSystem.out.println(maxBenefit);\n\t\t\n\t\t\n\t}\n\t\n}",
"Main",
"private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"public static String[] readStandartInput() throws IOException{\n\t\tString str = br.readLine();\n\t\tString[] list = str.split(\" \");\n\t\t\n\t\treturn list;\n\t}",
"readStandartInput",
"{\n\t\tString str = br.readLine();\n\t\tString[] list = str.split(\" \");\n\t\t\n\t\treturn list;\n\t}",
"String str = br.readLine();",
"str",
"br.readLine()",
"br.readLine",
"br",
"String[] list = str.split(\" \");",
"list",
"str.split(\" \")",
"str.split",
"str",
"\" \"",
"return list;",
"list",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tint n = Integer.valueOf(readStandartInput()[0]);\n\t\tList<Integer> list = new ArrayList<>();\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint a = Integer.valueOf(readStandartInput()[0]);\n\t\t\tlist.add(a);\n\t\t}\n\t\t\n\t\t\n\t\tint old = list.get(0);\n\t\tint max = old;\n\t\tint min = old;\n\t\tint maxBenefit = 0;\n\t\tint maxDelta = Integer.MIN_VALUE;\n\t\t\n\t\tfor(int i = 1; i < list.size(); i++){\n\t\t\tint r = list.get(i);\n\t\t\tint delta = r - old;\n\t\t\tif(maxDelta < delta){\n\t\t\t\tmaxDelta = delta;\n\t\t\t}\n\t\t\tif(r < min){\n\t\t\t\tmin = r;\n\t\t\t\tmax = r;\n\t\t\t}else if(max < r){\n\t\t\t\tmax = r;\n\t\t\t\tint benefit = max - min;\n\t\t\t\tif(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}\n\t\t\t}\n\t\t\told = r;\n\t\t}\n\t\tif(maxBenefit == 0){\n\t\t\tmaxBenefit = maxDelta;\n\t\t}\n\t\t\n\t\tSystem.out.println(maxBenefit);\n\t\t\n\t\t\n\t}",
"main",
"{\n\t\tint n = Integer.valueOf(readStandartInput()[0]);\n\t\tList<Integer> list = new ArrayList<>();\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint a = Integer.valueOf(readStandartInput()[0]);\n\t\t\tlist.add(a);\n\t\t}\n\t\t\n\t\t\n\t\tint old = list.get(0);\n\t\tint max = old;\n\t\tint min = old;\n\t\tint maxBenefit = 0;\n\t\tint maxDelta = Integer.MIN_VALUE;\n\t\t\n\t\tfor(int i = 1; i < list.size(); i++){\n\t\t\tint r = list.get(i);\n\t\t\tint delta = r - old;\n\t\t\tif(maxDelta < delta){\n\t\t\t\tmaxDelta = delta;\n\t\t\t}\n\t\t\tif(r < min){\n\t\t\t\tmin = r;\n\t\t\t\tmax = r;\n\t\t\t}else if(max < r){\n\t\t\t\tmax = r;\n\t\t\t\tint benefit = max - min;\n\t\t\t\tif(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}\n\t\t\t}\n\t\t\told = r;\n\t\t}\n\t\tif(maxBenefit == 0){\n\t\t\tmaxBenefit = maxDelta;\n\t\t}\n\t\t\n\t\tSystem.out.println(maxBenefit);\n\t\t\n\t\t\n\t}",
"int n = Integer.valueOf(readStandartInput()[0]);",
"n",
"Integer.valueOf(readStandartInput()[0])",
"Integer.valueOf",
"Integer",
"readStandartInput()[0]",
"readStandartInput()",
"readStandartInput",
"0",
"List<Integer> list = new ArrayList<>();",
"list",
"new ArrayList<>()",
"for(int i = 0; i < n; i++){\n\t\t\tint a = Integer.valueOf(readStandartInput()[0]);\n\t\t\tlist.add(a);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tint a = Integer.valueOf(readStandartInput()[0]);\n\t\t\tlist.add(a);\n\t\t}",
"{\n\t\t\tint a = Integer.valueOf(readStandartInput()[0]);\n\t\t\tlist.add(a);\n\t\t}",
"int a = Integer.valueOf(readStandartInput()[0]);",
"a",
"Integer.valueOf(readStandartInput()[0])",
"Integer.valueOf",
"Integer",
"readStandartInput()[0]",
"readStandartInput()",
"readStandartInput",
"0",
"list.add(a)",
"list.add",
"list",
"a",
"int old = list.get(0);",
"old",
"list.get(0)",
"list.get",
"list",
"0",
"int max = old;",
"max",
"old",
"int min = old;",
"min",
"old",
"int maxBenefit = 0;",
"maxBenefit",
"0",
"int maxDelta = Integer.MIN_VALUE;",
"maxDelta",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"for(int i = 1; i < list.size(); i++){\n\t\t\tint r = list.get(i);\n\t\t\tint delta = r - old;\n\t\t\tif(maxDelta < delta){\n\t\t\t\tmaxDelta = delta;\n\t\t\t}\n\t\t\tif(r < min){\n\t\t\t\tmin = r;\n\t\t\t\tmax = r;\n\t\t\t}else if(max < r){\n\t\t\t\tmax = r;\n\t\t\t\tint benefit = max - min;\n\t\t\t\tif(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}\n\t\t\t}\n\t\t\told = r;\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < list.size()",
"i",
"list.size()",
"list.size",
"list",
"i++",
"i++",
"i",
"{\n\t\t\tint r = list.get(i);\n\t\t\tint delta = r - old;\n\t\t\tif(maxDelta < delta){\n\t\t\t\tmaxDelta = delta;\n\t\t\t}\n\t\t\tif(r < min){\n\t\t\t\tmin = r;\n\t\t\t\tmax = r;\n\t\t\t}else if(max < r){\n\t\t\t\tmax = r;\n\t\t\t\tint benefit = max - min;\n\t\t\t\tif(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}\n\t\t\t}\n\t\t\told = r;\n\t\t}",
"{\n\t\t\tint r = list.get(i);\n\t\t\tint delta = r - old;\n\t\t\tif(maxDelta < delta){\n\t\t\t\tmaxDelta = delta;\n\t\t\t}\n\t\t\tif(r < min){\n\t\t\t\tmin = r;\n\t\t\t\tmax = r;\n\t\t\t}else if(max < r){\n\t\t\t\tmax = r;\n\t\t\t\tint benefit = max - min;\n\t\t\t\tif(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}\n\t\t\t}\n\t\t\told = r;\n\t\t}",
"int r = list.get(i);",
"r",
"list.get(i)",
"list.get",
"list",
"i",
"int delta = r - old;",
"delta",
"r - old",
"r",
"old",
"if(maxDelta < delta){\n\t\t\t\tmaxDelta = delta;\n\t\t\t}",
"maxDelta < delta",
"maxDelta",
"delta",
"{\n\t\t\t\tmaxDelta = delta;\n\t\t\t}",
"maxDelta = delta",
"maxDelta",
"delta",
"if(r < min){\n\t\t\t\tmin = r;\n\t\t\t\tmax = r;\n\t\t\t}else if(max < r){\n\t\t\t\tmax = r;\n\t\t\t\tint benefit = max - min;\n\t\t\t\tif(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}\n\t\t\t}",
"r < min",
"r",
"min",
"{\n\t\t\t\tmin = r;\n\t\t\t\tmax = r;\n\t\t\t}",
"min = r",
"min",
"r",
"max = r",
"max",
"r",
"if(max < r){\n\t\t\t\tmax = r;\n\t\t\t\tint benefit = max - min;\n\t\t\t\tif(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}\n\t\t\t}",
"max < r",
"max",
"r",
"{\n\t\t\t\tmax = r;\n\t\t\t\tint benefit = max - min;\n\t\t\t\tif(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}\n\t\t\t}",
"max = r",
"max",
"r",
"int benefit = max - min;",
"benefit",
"max - min",
"max",
"min",
"if(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}",
"maxBenefit < benefit",
"maxBenefit",
"benefit",
"{\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}",
"maxBenefit = benefit",
"maxBenefit",
"benefit",
"old = r",
"old",
"r",
"if(maxBenefit == 0){\n\t\t\tmaxBenefit = maxDelta;\n\t\t}",
"maxBenefit == 0",
"maxBenefit",
"0",
"{\n\t\t\tmaxBenefit = maxDelta;\n\t\t}",
"maxBenefit = maxDelta",
"maxBenefit",
"maxDelta",
"System.out.println(maxBenefit)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxBenefit",
"String[] args",
"args",
"public class Main {\n\t\n\tprivate static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\n\tpublic static String[] readStandartInput() throws IOException{\n\t\tString str = br.readLine();\n\t\tString[] list = str.split(\" \");\n\t\t\n\t\treturn list;\n\t}\n\t\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tint n = Integer.valueOf(readStandartInput()[0]);\n\t\tList<Integer> list = new ArrayList<>();\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint a = Integer.valueOf(readStandartInput()[0]);\n\t\t\tlist.add(a);\n\t\t}\n\t\t\n\t\t\n\t\tint old = list.get(0);\n\t\tint max = old;\n\t\tint min = old;\n\t\tint maxBenefit = 0;\n\t\tint maxDelta = Integer.MIN_VALUE;\n\t\t\n\t\tfor(int i = 1; i < list.size(); i++){\n\t\t\tint r = list.get(i);\n\t\t\tint delta = r - old;\n\t\t\tif(maxDelta < delta){\n\t\t\t\tmaxDelta = delta;\n\t\t\t}\n\t\t\tif(r < min){\n\t\t\t\tmin = r;\n\t\t\t\tmax = r;\n\t\t\t}else if(max < r){\n\t\t\t\tmax = r;\n\t\t\t\tint benefit = max - min;\n\t\t\t\tif(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}\n\t\t\t}\n\t\t\told = r;\n\t\t}\n\t\tif(maxBenefit == 0){\n\t\t\tmaxBenefit = maxDelta;\n\t\t}\n\t\t\n\t\tSystem.out.println(maxBenefit);\n\t\t\n\t\t\n\t}\n\t\n}",
"public class Main {\n\t\n\tprivate static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\n\tpublic static String[] readStandartInput() throws IOException{\n\t\tString str = br.readLine();\n\t\tString[] list = str.split(\" \");\n\t\t\n\t\treturn list;\n\t}\n\t\n\tpublic static void main(String[] args) throws NumberFormatException, IOException {\n\t\tint n = Integer.valueOf(readStandartInput()[0]);\n\t\tList<Integer> list = new ArrayList<>();\n\t\t\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tint a = Integer.valueOf(readStandartInput()[0]);\n\t\t\tlist.add(a);\n\t\t}\n\t\t\n\t\t\n\t\tint old = list.get(0);\n\t\tint max = old;\n\t\tint min = old;\n\t\tint maxBenefit = 0;\n\t\tint maxDelta = Integer.MIN_VALUE;\n\t\t\n\t\tfor(int i = 1; i < list.size(); i++){\n\t\t\tint r = list.get(i);\n\t\t\tint delta = r - old;\n\t\t\tif(maxDelta < delta){\n\t\t\t\tmaxDelta = delta;\n\t\t\t}\n\t\t\tif(r < min){\n\t\t\t\tmin = r;\n\t\t\t\tmax = r;\n\t\t\t}else if(max < r){\n\t\t\t\tmax = r;\n\t\t\t\tint benefit = max - min;\n\t\t\t\tif(maxBenefit < benefit){\n\t\t\t\t\tmaxBenefit = benefit;\n\t\t\t\t}\n\t\t\t}\n\t\t\told = r;\n\t\t}\n\t\tif(maxBenefit == 0){\n\t\t\tmaxBenefit = maxDelta;\n\t\t}\n\t\t\n\t\tSystem.out.println(maxBenefit);\n\t\t\n\t\t\n\t}\n\t\n}",
"Main"
] | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Main {
private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public static String[] readStandartInput() throws IOException{
String str = br.readLine();
String[] list = str.split(" ");
return list;
}
public static void main(String[] args) throws NumberFormatException, IOException {
int n = Integer.valueOf(readStandartInput()[0]);
List<Integer> list = new ArrayList<>();
for(int i = 0; i < n; i++){
int a = Integer.valueOf(readStandartInput()[0]);
list.add(a);
}
int old = list.get(0);
int max = old;
int min = old;
int maxBenefit = 0;
int maxDelta = Integer.MIN_VALUE;
for(int i = 1; i < list.size(); i++){
int r = list.get(i);
int delta = r - old;
if(maxDelta < delta){
maxDelta = delta;
}
if(r < min){
min = r;
max = r;
}else if(max < r){
max = r;
int benefit = max - min;
if(maxBenefit < benefit){
maxBenefit = benefit;
}
}
old = r;
}
if(maxBenefit == 0){
maxBenefit = maxDelta;
}
System.out.println(maxBenefit);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
40,
17,
41,
13,
40,
17,
41,
13,
17,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
13,
0,
13,
13,
9,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
14,
2,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
13,
9,
14,
2,
13,
13,
30,
0,
13,
13,
0,
13,
2,
13,
13,
14,
2,
13,
13,
0,
13,
13,
9,
14,
2,
13,
13,
0,
13,
13,
14,
2,
13,
13,
0,
13,
17,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
41,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
60,
61
],
[
53,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
70,
71
],
[
70,
72
],
[
66,
73
],
[
53,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
74,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
81,
83
],
[
78,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
88,
89
],
[
88,
90
],
[
78,
91
],
[
91,
92
],
[
91,
93
],
[
78,
94
],
[
94,
95
],
[
94,
96
],
[
78,
97
],
[
53,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
98,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
108,
110
],
[
102,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
115,
116
],
[
115,
117
],
[
102,
118
],
[
8,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
119,
123
],
[
123,
124
],
[
123,
125
],
[
119,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
130,
131
],
[
130,
132
],
[
8,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
6,
139
],
[
139,
140
]
] | [
"import java.util.Scanner;\n\nclass Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n\n int n = Integer.parseInt(scan.nextLine());\n double Rj = 0;\n double Ri = 0;\n double newR;\n double maxProfit = -1000000000;\n double tmpProfit = -1000000000;\n double tmp = 0;\n\n int value;\n for (int i=0; i<n; i++){\n newR = Integer.parseInt(scan.nextLine());\n if (i == 0){\n Rj = newR;\n Ri = newR;\n continue;\n }\n if (newR < Ri){\n tmp = newR - Ri;\n if (tmp > tmpProfit)\n tmpProfit = tmp;\n Ri = newR;\n Rj = newR;\n continue;\n }\n if (newR >= Rj){\n Rj = newR;\n tmp = Rj - Ri;\n if (tmp > maxProfit)\n maxProfit = tmp;\n continue;\n }\n }\n\n if (tmpProfit > maxProfit)\n maxProfit = tmpProfit;\n else if (tmpProfit == maxProfit)\n maxProfit = 0;\n\n System.out.println((int)(maxProfit));\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n\n int n = Integer.parseInt(scan.nextLine());\n double Rj = 0;\n double Ri = 0;\n double newR;\n double maxProfit = -1000000000;\n double tmpProfit = -1000000000;\n double tmp = 0;\n\n int value;\n for (int i=0; i<n; i++){\n newR = Integer.parseInt(scan.nextLine());\n if (i == 0){\n Rj = newR;\n Ri = newR;\n continue;\n }\n if (newR < Ri){\n tmp = newR - Ri;\n if (tmp > tmpProfit)\n tmpProfit = tmp;\n Ri = newR;\n Rj = newR;\n continue;\n }\n if (newR >= Rj){\n Rj = newR;\n tmp = Rj - Ri;\n if (tmp > maxProfit)\n maxProfit = tmp;\n continue;\n }\n }\n\n if (tmpProfit > maxProfit)\n maxProfit = tmpProfit;\n else if (tmpProfit == maxProfit)\n maxProfit = 0;\n\n System.out.println((int)(maxProfit));\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n\n int n = Integer.parseInt(scan.nextLine());\n double Rj = 0;\n double Ri = 0;\n double newR;\n double maxProfit = -1000000000;\n double tmpProfit = -1000000000;\n double tmp = 0;\n\n int value;\n for (int i=0; i<n; i++){\n newR = Integer.parseInt(scan.nextLine());\n if (i == 0){\n Rj = newR;\n Ri = newR;\n continue;\n }\n if (newR < Ri){\n tmp = newR - Ri;\n if (tmp > tmpProfit)\n tmpProfit = tmp;\n Ri = newR;\n Rj = newR;\n continue;\n }\n if (newR >= Rj){\n Rj = newR;\n tmp = Rj - Ri;\n if (tmp > maxProfit)\n maxProfit = tmp;\n continue;\n }\n }\n\n if (tmpProfit > maxProfit)\n maxProfit = tmpProfit;\n else if (tmpProfit == maxProfit)\n maxProfit = 0;\n\n System.out.println((int)(maxProfit));\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n\n int n = Integer.parseInt(scan.nextLine());\n double Rj = 0;\n double Ri = 0;\n double newR;\n double maxProfit = -1000000000;\n double tmpProfit = -1000000000;\n double tmp = 0;\n\n int value;\n for (int i=0; i<n; i++){\n newR = Integer.parseInt(scan.nextLine());\n if (i == 0){\n Rj = newR;\n Ri = newR;\n continue;\n }\n if (newR < Ri){\n tmp = newR - Ri;\n if (tmp > tmpProfit)\n tmpProfit = tmp;\n Ri = newR;\n Rj = newR;\n continue;\n }\n if (newR >= Rj){\n Rj = newR;\n tmp = Rj - Ri;\n if (tmp > maxProfit)\n maxProfit = tmp;\n continue;\n }\n }\n\n if (tmpProfit > maxProfit)\n maxProfit = tmpProfit;\n else if (tmpProfit == maxProfit)\n maxProfit = 0;\n\n System.out.println((int)(maxProfit));\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = Integer.parseInt(scan.nextLine());",
"n",
"Integer.parseInt(scan.nextLine())",
"Integer.parseInt",
"Integer",
"scan.nextLine()",
"scan.nextLine",
"scan",
"double Rj = 0;",
"Rj",
"0",
"double Ri = 0;",
"Ri",
"0",
"double newR;",
"newR",
"double maxProfit = -1000000000;",
"maxProfit",
"-1000000000",
"1000000000",
"double tmpProfit = -1000000000;",
"tmpProfit",
"-1000000000",
"1000000000",
"double tmp = 0;",
"tmp",
"0",
"int value;",
"value",
"for (int i=0; i<n; i++){\n newR = Integer.parseInt(scan.nextLine());\n if (i == 0){\n Rj = newR;\n Ri = newR;\n continue;\n }\n if (newR < Ri){\n tmp = newR - Ri;\n if (tmp > tmpProfit)\n tmpProfit = tmp;\n Ri = newR;\n Rj = newR;\n continue;\n }\n if (newR >= Rj){\n Rj = newR;\n tmp = Rj - Ri;\n if (tmp > maxProfit)\n maxProfit = tmp;\n continue;\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n newR = Integer.parseInt(scan.nextLine());\n if (i == 0){\n Rj = newR;\n Ri = newR;\n continue;\n }\n if (newR < Ri){\n tmp = newR - Ri;\n if (tmp > tmpProfit)\n tmpProfit = tmp;\n Ri = newR;\n Rj = newR;\n continue;\n }\n if (newR >= Rj){\n Rj = newR;\n tmp = Rj - Ri;\n if (tmp > maxProfit)\n maxProfit = tmp;\n continue;\n }\n }",
"{\n newR = Integer.parseInt(scan.nextLine());\n if (i == 0){\n Rj = newR;\n Ri = newR;\n continue;\n }\n if (newR < Ri){\n tmp = newR - Ri;\n if (tmp > tmpProfit)\n tmpProfit = tmp;\n Ri = newR;\n Rj = newR;\n continue;\n }\n if (newR >= Rj){\n Rj = newR;\n tmp = Rj - Ri;\n if (tmp > maxProfit)\n maxProfit = tmp;\n continue;\n }\n }",
"newR = Integer.parseInt(scan.nextLine())",
"newR",
"Integer.parseInt(scan.nextLine())",
"Integer.parseInt",
"Integer",
"scan.nextLine()",
"scan.nextLine",
"scan",
"if (i == 0){\n Rj = newR;\n Ri = newR;\n continue;\n }",
"i == 0",
"i",
"0",
"{\n Rj = newR;\n Ri = newR;\n continue;\n }",
"Rj = newR",
"Rj",
"newR",
"Ri = newR",
"Ri",
"newR",
"continue;",
"if (newR < Ri){\n tmp = newR - Ri;\n if (tmp > tmpProfit)\n tmpProfit = tmp;\n Ri = newR;\n Rj = newR;\n continue;\n }",
"newR < Ri",
"newR",
"Ri",
"{\n tmp = newR - Ri;\n if (tmp > tmpProfit)\n tmpProfit = tmp;\n Ri = newR;\n Rj = newR;\n continue;\n }",
"tmp = newR - Ri",
"tmp",
"newR - Ri",
"newR",
"Ri",
"if (tmp > tmpProfit)\n tmpProfit = tmp;",
"tmp > tmpProfit",
"tmp",
"tmpProfit",
"tmpProfit = tmp",
"tmpProfit",
"tmp",
"Ri = newR",
"Ri",
"newR",
"Rj = newR",
"Rj",
"newR",
"continue;",
"if (newR >= Rj){\n Rj = newR;\n tmp = Rj - Ri;\n if (tmp > maxProfit)\n maxProfit = tmp;\n continue;\n }",
"newR >= Rj",
"newR",
"Rj",
"{\n Rj = newR;\n tmp = Rj - Ri;\n if (tmp > maxProfit)\n maxProfit = tmp;\n continue;\n }",
"Rj = newR",
"Rj",
"newR",
"tmp = Rj - Ri",
"tmp",
"Rj - Ri",
"Rj",
"Ri",
"if (tmp > maxProfit)\n maxProfit = tmp;",
"tmp > maxProfit",
"tmp",
"maxProfit",
"maxProfit = tmp",
"maxProfit",
"tmp",
"continue;",
"if (tmpProfit > maxProfit)\n maxProfit = tmpProfit;\n else if (tmpProfit == maxProfit)\n maxProfit = 0;",
"tmpProfit > maxProfit",
"tmpProfit",
"maxProfit",
"maxProfit = tmpProfit",
"maxProfit",
"tmpProfit",
"if (tmpProfit == maxProfit)\n maxProfit = 0;",
"tmpProfit == maxProfit",
"tmpProfit",
"maxProfit",
"maxProfit = 0",
"maxProfit",
"0",
"System.out.println((int)(maxProfit))",
"System.out.println",
"System.out",
"System",
"System.out",
"(int)(maxProfit)",
"String[] args",
"args"
] | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = Integer.parseInt(scan.nextLine());
double Rj = 0;
double Ri = 0;
double newR;
double maxProfit = -1000000000;
double tmpProfit = -1000000000;
double tmp = 0;
int value;
for (int i=0; i<n; i++){
newR = Integer.parseInt(scan.nextLine());
if (i == 0){
Rj = newR;
Ri = newR;
continue;
}
if (newR < Ri){
tmp = newR - Ri;
if (tmp > tmpProfit)
tmpProfit = tmp;
Ri = newR;
Rj = newR;
continue;
}
if (newR >= Rj){
Rj = newR;
tmp = Rj - Ri;
if (tmp > maxProfit)
maxProfit = tmp;
continue;
}
}
if (tmpProfit > maxProfit)
maxProfit = tmpProfit;
else if (tmpProfit == maxProfit)
maxProfit = 0;
System.out.println((int)(maxProfit));
}
} |
[
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,
4,
18,
18,
13,
13,
4,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
40,
17,
11,
1,
41,
13,
13,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
18,
13,
13,
30,
0,
13,
18,
13,
13,
29,
2,
13,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
151,
5
],
[
151,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
8,
49
],
[
49,
50
],
[
50,
51
],
[
6,
52
],
[
52,
53
],
[
151,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
56,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
56,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
67,
77
],
[
77,
78
],
[
78,
79
],
[
67,
80
],
[
81,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
84,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
81,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
95,
98
],
[
95,
99
],
[
99,
100
],
[
99,
101
],
[
56,
102
],
[
102,
103
],
[
54,
104
],
[
104,
105
],
[
151,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
108,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
113,
123
],
[
123,
124
],
[
124,
125
],
[
113,
126
],
[
127,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
131,
132
],
[
131,
133
],
[
128,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
137,
139
],
[
108,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
106,
144
],
[
144,
145
],
[
106,
146
],
[
146,
147
],
[
106,
148
],
[
148,
149
],
[
0,
150
],
[
150,
151
],
[
150,
152
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\t\t/**\n\t\t * それぞれの購入地点から得られる最大利ざやを求め、\n\t\t * 最も利益の大きい値を出力する\n\t\t * @param args\n\t\t */\n\t\tpublic static void main(String args[]){\n\t\t\tScanner scan = new Scanner(System.in);\n\t\t\tint num = scan.nextInt();\n\t\t\tint[] value = new int[num];\n\t\t\tfor(int i = 0;i < num;i++){\n\t\t\t\tvalue[i] = scan.nextInt();\n\t\t\t}\n\n\t\t\n\t\t\t\n\t\t\tSystem.out.println(ExchangeMax(value));\n\t\t\t\n\t\t\tscan.close();\n\t\t\t\t\n\t\t/*\tlong profit = -999999999;\n\t\t\tfor(int i = 0; i< num; i++){\n\t\t\t\tif(profit < Exchange(value[i],value,i+1)){\n\t\t\t\t\tprofit = Exchange(value[i],value,i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(profit);\n\t\t\t*/\n\t\t}\n\t\t\n\t\t/**\n\t\t * \n\t\t */\n\t\tstatic int ExchangeMax(int[] value){\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tint min = value[0];\n\t\t\tfor(int i = 1; i < value.length;i++){\n\t\t\t\tmax = Math.max(max, value[i] - min);\n\t\t\t\tmin = Math.min(min, value[i]);\n\t\t\t}\n\t\t\treturn max;\n\t\t}\n\t\t/**\n\t\t * 購入地点からの最大利ざやを求める\n\t\t * @param buy\t\t買値\n\t\t * @param value\t価格変動値\n\t\t * @param n\t\t何番目から売りに入るか\n\t\t * @return\n\t\t */\n\t\tstatic long Exchange(int buy, int[] value,int n){\n\t\t\tlong max_sell = -999999999;\n\t\t\tfor(int i = n; i < value.length;i++){\n\t\t\t\tif(max_sell < value[i]){\n\t\t\t\t\tmax_sell = value[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn max_sell - buy;\n\t\t\t}\n}\n\n",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\t\t/**\n\t\t * それぞれの購入地点から得られる最大利ざやを求め、\n\t\t * 最も利益の大きい値を出力する\n\t\t * @param args\n\t\t */\n\t\tpublic static void main(String args[]){\n\t\t\tScanner scan = new Scanner(System.in);\n\t\t\tint num = scan.nextInt();\n\t\t\tint[] value = new int[num];\n\t\t\tfor(int i = 0;i < num;i++){\n\t\t\t\tvalue[i] = scan.nextInt();\n\t\t\t}\n\n\t\t\n\t\t\t\n\t\t\tSystem.out.println(ExchangeMax(value));\n\t\t\t\n\t\t\tscan.close();\n\t\t\t\t\n\t\t/*\tlong profit = -999999999;\n\t\t\tfor(int i = 0; i< num; i++){\n\t\t\t\tif(profit < Exchange(value[i],value,i+1)){\n\t\t\t\t\tprofit = Exchange(value[i],value,i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(profit);\n\t\t\t*/\n\t\t}\n\t\t\n\t\t/**\n\t\t * \n\t\t */\n\t\tstatic int ExchangeMax(int[] value){\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tint min = value[0];\n\t\t\tfor(int i = 1; i < value.length;i++){\n\t\t\t\tmax = Math.max(max, value[i] - min);\n\t\t\t\tmin = Math.min(min, value[i]);\n\t\t\t}\n\t\t\treturn max;\n\t\t}\n\t\t/**\n\t\t * 購入地点からの最大利ざやを求める\n\t\t * @param buy\t\t買値\n\t\t * @param value\t価格変動値\n\t\t * @param n\t\t何番目から売りに入るか\n\t\t * @return\n\t\t */\n\t\tstatic long Exchange(int buy, int[] value,int n){\n\t\t\tlong max_sell = -999999999;\n\t\t\tfor(int i = n; i < value.length;i++){\n\t\t\t\tif(max_sell < value[i]){\n\t\t\t\t\tmax_sell = value[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn max_sell - buy;\n\t\t\t}\n}",
"Main",
"/**\n\t\t * それぞれの購入地点から得られる最大利ざやを求め、\n\t\t * 最も利益の大きい値を出力する\n\t\t * @param args\n\t\t */\n\t\tpublic static void main(String args[]){\n\t\t\tScanner scan = new Scanner(System.in);\n\t\t\tint num = scan.nextInt();\n\t\t\tint[] value = new int[num];\n\t\t\tfor(int i = 0;i < num;i++){\n\t\t\t\tvalue[i] = scan.nextInt();\n\t\t\t}\n\n\t\t\n\t\t\t\n\t\t\tSystem.out.println(ExchangeMax(value));\n\t\t\t\n\t\t\tscan.close();\n\t\t\t\t\n\t\t/*\tlong profit = -999999999;\n\t\t\tfor(int i = 0; i< num; i++){\n\t\t\t\tif(profit < Exchange(value[i],value,i+1)){\n\t\t\t\t\tprofit = Exchange(value[i],value,i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(profit);\n\t\t\t*/\n\t\t}",
"main",
"{\n\t\t\tScanner scan = new Scanner(System.in);\n\t\t\tint num = scan.nextInt();\n\t\t\tint[] value = new int[num];\n\t\t\tfor(int i = 0;i < num;i++){\n\t\t\t\tvalue[i] = scan.nextInt();\n\t\t\t}\n\n\t\t\n\t\t\t\n\t\t\tSystem.out.println(ExchangeMax(value));\n\t\t\t\n\t\t\tscan.close();\n\t\t\t\t\n\t\t/*\tlong profit = -999999999;\n\t\t\tfor(int i = 0; i< num; i++){\n\t\t\t\tif(profit < Exchange(value[i],value,i+1)){\n\t\t\t\t\tprofit = Exchange(value[i],value,i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(profit);\n\t\t\t*/\n\t\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int num = scan.nextInt();",
"num",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] value = new int[num];",
"value",
"new int[num]",
"num",
"for(int i = 0;i < num;i++){\n\t\t\t\tvalue[i] = scan.nextInt();\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < num",
"i",
"num",
"i++",
"i++",
"i",
"{\n\t\t\t\tvalue[i] = scan.nextInt();\n\t\t\t}",
"{\n\t\t\t\tvalue[i] = scan.nextInt();\n\t\t\t}",
"value[i] = scan.nextInt()",
"value[i]",
"value",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"System.out.println(ExchangeMax(value))",
"System.out.println",
"System.out",
"System",
"System.out",
"ExchangeMax(value)",
"ExchangeMax",
"value",
"scan.close()",
"scan.close",
"scan",
"String args[]",
"args",
"/**\n\t\t * \n\t\t */\n\t\tstatic int ExchangeMax(int[] value){\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tint min = value[0];\n\t\t\tfor(int i = 1; i < value.length;i++){\n\t\t\t\tmax = Math.max(max, value[i] - min);\n\t\t\t\tmin = Math.min(min, value[i]);\n\t\t\t}\n\t\t\treturn max;\n\t\t}",
"ExchangeMax",
"{\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tint min = value[0];\n\t\t\tfor(int i = 1; i < value.length;i++){\n\t\t\t\tmax = Math.max(max, value[i] - min);\n\t\t\t\tmin = Math.min(min, value[i]);\n\t\t\t}\n\t\t\treturn max;\n\t\t}",
"int max = Integer.MIN_VALUE;",
"max",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int min = value[0];",
"min",
"value[0]",
"value",
"0",
"for(int i = 1; i < value.length;i++){\n\t\t\t\tmax = Math.max(max, value[i] - min);\n\t\t\t\tmin = Math.min(min, value[i]);\n\t\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < value.length",
"i",
"value.length",
"value",
"value.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tmax = Math.max(max, value[i] - min);\n\t\t\t\tmin = Math.min(min, value[i]);\n\t\t\t}",
"{\n\t\t\t\tmax = Math.max(max, value[i] - min);\n\t\t\t\tmin = Math.min(min, value[i]);\n\t\t\t}",
"max = Math.max(max, value[i] - min)",
"max",
"Math.max(max, value[i] - min)",
"Math.max",
"Math",
"max",
"value[i] - min",
"value[i]",
"value",
"i",
"min",
"min = Math.min(min, value[i])",
"min",
"Math.min(min, value[i])",
"Math.min",
"Math",
"min",
"value[i]",
"value",
"i",
"return max;",
"max",
"int[] value",
"value",
"/**\n\t\t * 購入地点からの最大利ざやを求める\n\t\t * @param buy\t\t買値\n\t\t * @param value\t価格変動値\n\t\t * @param n\t\t何番目から売りに入るか\n\t\t * @return\n\t\t */\n\t\tstatic long Exchange(int buy, int[] value,int n){\n\t\t\tlong max_sell = -999999999;\n\t\t\tfor(int i = n; i < value.length;i++){\n\t\t\t\tif(max_sell < value[i]){\n\t\t\t\t\tmax_sell = value[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn max_sell - buy;\n\t\t\t}",
"Exchange",
"{\n\t\t\tlong max_sell = -999999999;\n\t\t\tfor(int i = n; i < value.length;i++){\n\t\t\t\tif(max_sell < value[i]){\n\t\t\t\t\tmax_sell = value[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn max_sell - buy;\n\t\t\t}",
"long max_sell = -999999999;",
"max_sell",
"-999999999",
"999999999",
"for(int i = n; i < value.length;i++){\n\t\t\t\tif(max_sell < value[i]){\n\t\t\t\t\tmax_sell = value[i];\n\t\t\t\t}\n\t\t\t}",
"int i = n;",
"int i = n;",
"i",
"n",
"i < value.length",
"i",
"value.length",
"value",
"value.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tif(max_sell < value[i]){\n\t\t\t\t\tmax_sell = value[i];\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(max_sell < value[i]){\n\t\t\t\t\tmax_sell = value[i];\n\t\t\t\t}\n\t\t\t}",
"if(max_sell < value[i]){\n\t\t\t\t\tmax_sell = value[i];\n\t\t\t\t}",
"max_sell < value[i]",
"max_sell",
"value[i]",
"value",
"i",
"{\n\t\t\t\t\tmax_sell = value[i];\n\t\t\t\t}",
"max_sell = value[i]",
"max_sell",
"value[i]",
"value",
"i",
"return max_sell - buy;",
"max_sell - buy",
"max_sell",
"buy",
"int buy",
"buy",
"int[] value",
"value",
"int n",
"n",
"public class Main {\n\n\t\t/**\n\t\t * それぞれの購入地点から得られる最大利ざやを求め、\n\t\t * 最も利益の大きい値を出力する\n\t\t * @param args\n\t\t */\n\t\tpublic static void main(String args[]){\n\t\t\tScanner scan = new Scanner(System.in);\n\t\t\tint num = scan.nextInt();\n\t\t\tint[] value = new int[num];\n\t\t\tfor(int i = 0;i < num;i++){\n\t\t\t\tvalue[i] = scan.nextInt();\n\t\t\t}\n\n\t\t\n\t\t\t\n\t\t\tSystem.out.println(ExchangeMax(value));\n\t\t\t\n\t\t\tscan.close();\n\t\t\t\t\n\t\t/*\tlong profit = -999999999;\n\t\t\tfor(int i = 0; i< num; i++){\n\t\t\t\tif(profit < Exchange(value[i],value,i+1)){\n\t\t\t\t\tprofit = Exchange(value[i],value,i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(profit);\n\t\t\t*/\n\t\t}\n\t\t\n\t\t/**\n\t\t * \n\t\t */\n\t\tstatic int ExchangeMax(int[] value){\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tint min = value[0];\n\t\t\tfor(int i = 1; i < value.length;i++){\n\t\t\t\tmax = Math.max(max, value[i] - min);\n\t\t\t\tmin = Math.min(min, value[i]);\n\t\t\t}\n\t\t\treturn max;\n\t\t}\n\t\t/**\n\t\t * 購入地点からの最大利ざやを求める\n\t\t * @param buy\t\t買値\n\t\t * @param value\t価格変動値\n\t\t * @param n\t\t何番目から売りに入るか\n\t\t * @return\n\t\t */\n\t\tstatic long Exchange(int buy, int[] value,int n){\n\t\t\tlong max_sell = -999999999;\n\t\t\tfor(int i = n; i < value.length;i++){\n\t\t\t\tif(max_sell < value[i]){\n\t\t\t\t\tmax_sell = value[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn max_sell - buy;\n\t\t\t}\n}",
"public class Main {\n\n\t\t/**\n\t\t * それぞれの購入地点から得られる最大利ざやを求め、\n\t\t * 最も利益の大きい値を出力する\n\t\t * @param args\n\t\t */\n\t\tpublic static void main(String args[]){\n\t\t\tScanner scan = new Scanner(System.in);\n\t\t\tint num = scan.nextInt();\n\t\t\tint[] value = new int[num];\n\t\t\tfor(int i = 0;i < num;i++){\n\t\t\t\tvalue[i] = scan.nextInt();\n\t\t\t}\n\n\t\t\n\t\t\t\n\t\t\tSystem.out.println(ExchangeMax(value));\n\t\t\t\n\t\t\tscan.close();\n\t\t\t\t\n\t\t/*\tlong profit = -999999999;\n\t\t\tfor(int i = 0; i< num; i++){\n\t\t\t\tif(profit < Exchange(value[i],value,i+1)){\n\t\t\t\t\tprofit = Exchange(value[i],value,i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(profit);\n\t\t\t*/\n\t\t}\n\t\t\n\t\t/**\n\t\t * \n\t\t */\n\t\tstatic int ExchangeMax(int[] value){\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tint min = value[0];\n\t\t\tfor(int i = 1; i < value.length;i++){\n\t\t\t\tmax = Math.max(max, value[i] - min);\n\t\t\t\tmin = Math.min(min, value[i]);\n\t\t\t}\n\t\t\treturn max;\n\t\t}\n\t\t/**\n\t\t * 購入地点からの最大利ざやを求める\n\t\t * @param buy\t\t買値\n\t\t * @param value\t価格変動値\n\t\t * @param n\t\t何番目から売りに入るか\n\t\t * @return\n\t\t */\n\t\tstatic long Exchange(int buy, int[] value,int n){\n\t\t\tlong max_sell = -999999999;\n\t\t\tfor(int i = n; i < value.length;i++){\n\t\t\t\tif(max_sell < value[i]){\n\t\t\t\t\tmax_sell = value[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn max_sell - buy;\n\t\t\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
/**
* それぞれの購入地点から得られる最大利ざやを求め、
* 最も利益の大きい値を出力する
* @param args
*/
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
int[] value = new int[num];
for(int i = 0;i < num;i++){
value[i] = scan.nextInt();
}
System.out.println(ExchangeMax(value));
scan.close();
/* long profit = -999999999;
for(int i = 0; i< num; i++){
if(profit < Exchange(value[i],value,i+1)){
profit = Exchange(value[i],value,i+1);
}
}
System.out.println(profit);
*/
}
/**
*
*/
static int ExchangeMax(int[] value){
int max = Integer.MIN_VALUE;
int min = value[0];
for(int i = 1; i < value.length;i++){
max = Math.max(max, value[i] - min);
min = Math.min(min, value[i]);
}
return max;
}
/**
* 購入地点からの最大利ざやを求める
* @param buy 買値
* @param value 価格変動値
* @param n 何番目から売りに入るか
* @return
*/
static long Exchange(int buy, int[] value,int n){
long max_sell = -999999999;
for(int i = n; i < value.length;i++){
if(max_sell < value[i]){
max_sell = value[i];
}
}
return max_sell - buy;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
41,
13,
4,
18,
13,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
2,
13,
13,
13,
0,
13,
2,
13,
13,
14,
2,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
4,
18,
13,
17,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
91,
5
],
[
91,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
29,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
34,
38
],
[
8,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
51,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
57,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
65,
67
],
[
51,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
72,
73
],
[
72,
74
],
[
8,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
8,
81
],
[
81,
82
],
[
82,
83
],
[
8,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
6,
88
],
[
88,
89
],
[
0,
90
],
[
90,
91
],
[
90,
92
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\n\t\tint R1 = scan.nextInt();\n\t\tint R2 = scan.nextInt();\n\n\t\tint gap = R2 - R1;\n\t\tint min = Math.min(R1, R2);\n\t\tfor (int i = 2; i < n; i++) {\n\t\t\tint R = scan.nextInt();\n\t\t\tif (R - min > gap)\n\t\t\t\tgap = R - min;\n\t\t\tif (R < min)\n\t\t\t\tmin = R;\n\t\t}\n\t\tSystem.out.println(gap);\n\t\t\n\t\tscan.close();\n\t\tSystem.exit(0);\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\n\t\tint R1 = scan.nextInt();\n\t\tint R2 = scan.nextInt();\n\n\t\tint gap = R2 - R1;\n\t\tint min = Math.min(R1, R2);\n\t\tfor (int i = 2; i < n; i++) {\n\t\t\tint R = scan.nextInt();\n\t\t\tif (R - min > gap)\n\t\t\t\tgap = R - min;\n\t\t\tif (R < min)\n\t\t\t\tmin = R;\n\t\t}\n\t\tSystem.out.println(gap);\n\t\t\n\t\tscan.close();\n\t\tSystem.exit(0);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\n\t\tint R1 = scan.nextInt();\n\t\tint R2 = scan.nextInt();\n\n\t\tint gap = R2 - R1;\n\t\tint min = Math.min(R1, R2);\n\t\tfor (int i = 2; i < n; i++) {\n\t\t\tint R = scan.nextInt();\n\t\t\tif (R - min > gap)\n\t\t\t\tgap = R - min;\n\t\t\tif (R < min)\n\t\t\t\tmin = R;\n\t\t}\n\t\tSystem.out.println(gap);\n\t\t\n\t\tscan.close();\n\t\tSystem.exit(0);\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\n\t\tint R1 = scan.nextInt();\n\t\tint R2 = scan.nextInt();\n\n\t\tint gap = R2 - R1;\n\t\tint min = Math.min(R1, R2);\n\t\tfor (int i = 2; i < n; i++) {\n\t\t\tint R = scan.nextInt();\n\t\t\tif (R - min > gap)\n\t\t\t\tgap = R - min;\n\t\t\tif (R < min)\n\t\t\t\tmin = R;\n\t\t}\n\t\tSystem.out.println(gap);\n\t\t\n\t\tscan.close();\n\t\tSystem.exit(0);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int R1 = scan.nextInt();",
"R1",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int R2 = scan.nextInt();",
"R2",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int gap = R2 - R1;",
"gap",
"R2 - R1",
"R2",
"R1",
"int min = Math.min(R1, R2);",
"min",
"Math.min(R1, R2)",
"Math.min",
"Math",
"R1",
"R2",
"for (int i = 2; i < n; i++) {\n\t\t\tint R = scan.nextInt();\n\t\t\tif (R - min > gap)\n\t\t\t\tgap = R - min;\n\t\t\tif (R < min)\n\t\t\t\tmin = R;\n\t\t}",
"int i = 2;",
"int i = 2;",
"i",
"2",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tint R = scan.nextInt();\n\t\t\tif (R - min > gap)\n\t\t\t\tgap = R - min;\n\t\t\tif (R < min)\n\t\t\t\tmin = R;\n\t\t}",
"{\n\t\t\tint R = scan.nextInt();\n\t\t\tif (R - min > gap)\n\t\t\t\tgap = R - min;\n\t\t\tif (R < min)\n\t\t\t\tmin = R;\n\t\t}",
"int R = scan.nextInt();",
"R",
"scan.nextInt()",
"scan.nextInt",
"scan",
"if (R - min > gap)\n\t\t\t\tgap = R - min;",
"R - min > gap",
"R - min",
"R",
"min",
"gap",
"gap = R - min",
"gap",
"R - min",
"R",
"min",
"if (R < min)\n\t\t\t\tmin = R;",
"R < min",
"R",
"min",
"min = R",
"min",
"R",
"System.out.println(gap)",
"System.out.println",
"System.out",
"System",
"System.out",
"gap",
"scan.close()",
"scan.close",
"scan",
"System.exit(0)",
"System.exit",
"System",
"0",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\n\t\tint R1 = scan.nextInt();\n\t\tint R2 = scan.nextInt();\n\n\t\tint gap = R2 - R1;\n\t\tint min = Math.min(R1, R2);\n\t\tfor (int i = 2; i < n; i++) {\n\t\t\tint R = scan.nextInt();\n\t\t\tif (R - min > gap)\n\t\t\t\tgap = R - min;\n\t\t\tif (R < min)\n\t\t\t\tmin = R;\n\t\t}\n\t\tSystem.out.println(gap);\n\t\t\n\t\tscan.close();\n\t\tSystem.exit(0);\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\n\t\tint R1 = scan.nextInt();\n\t\tint R2 = scan.nextInt();\n\n\t\tint gap = R2 - R1;\n\t\tint min = Math.min(R1, R2);\n\t\tfor (int i = 2; i < n; i++) {\n\t\t\tint R = scan.nextInt();\n\t\t\tif (R - min > gap)\n\t\t\t\tgap = R - min;\n\t\t\tif (R < min)\n\t\t\t\tmin = R;\n\t\t}\n\t\tSystem.out.println(gap);\n\t\t\n\t\tscan.close();\n\t\tSystem.exit(0);\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int R1 = scan.nextInt();
int R2 = scan.nextInt();
int gap = R2 - R1;
int min = Math.min(R1, R2);
for (int i = 2; i < n; i++) {
int R = scan.nextInt();
if (R - min > gap)
gap = R - min;
if (R < min)
min = R;
}
System.out.println(gap);
scan.close();
System.exit(0);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
2,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
70,
5
],
[
70,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
47,
51
],
[
51,
52
],
[
51,
53
],
[
39,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
56,
60
],
[
8,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
6,
67
],
[
67,
68
],
[
0,
69
],
[
69,
70
],
[
69,
71
]
] | [
"import java.util.Scanner;\n\npublic class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n\n // 初期値を仮で最小値に\n int minv = scan.nextInt();\n // 更新できるように最大値に十分小さい値を\n int maxv = Integer.MIN_VALUE;\n\n for(int i=1;i<n;i++){\n int in = scan.nextInt();\n // 最大値の更新\n maxv = Math.max(maxv, in-minv);\n // 最小値の更新\n minv = Math.min(minv, in);\n }\n System.out.println(maxv);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n\n // 初期値を仮で最小値に\n int minv = scan.nextInt();\n // 更新できるように最大値に十分小さい値を\n int maxv = Integer.MIN_VALUE;\n\n for(int i=1;i<n;i++){\n int in = scan.nextInt();\n // 最大値の更新\n maxv = Math.max(maxv, in-minv);\n // 最小値の更新\n minv = Math.min(minv, in);\n }\n System.out.println(maxv);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n\n // 初期値を仮で最小値に\n int minv = scan.nextInt();\n // 更新できるように最大値に十分小さい値を\n int maxv = Integer.MIN_VALUE;\n\n for(int i=1;i<n;i++){\n int in = scan.nextInt();\n // 最大値の更新\n maxv = Math.max(maxv, in-minv);\n // 最小値の更新\n minv = Math.min(minv, in);\n }\n System.out.println(maxv);\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n\n // 初期値を仮で最小値に\n int minv = scan.nextInt();\n // 更新できるように最大値に十分小さい値を\n int maxv = Integer.MIN_VALUE;\n\n for(int i=1;i<n;i++){\n int in = scan.nextInt();\n // 最大値の更新\n maxv = Math.max(maxv, in-minv);\n // 最小値の更新\n minv = Math.min(minv, in);\n }\n System.out.println(maxv);\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int minv = scan.nextInt();",
"minv",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int maxv = Integer.MIN_VALUE;",
"maxv",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"for(int i=1;i<n;i++){\n int in = scan.nextInt();\n // 最大値の更新\n maxv = Math.max(maxv, in-minv);\n // 最小値の更新\n minv = Math.min(minv, in);\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n int in = scan.nextInt();\n // 最大値の更新\n maxv = Math.max(maxv, in-minv);\n // 最小値の更新\n minv = Math.min(minv, in);\n }",
"{\n int in = scan.nextInt();\n // 最大値の更新\n maxv = Math.max(maxv, in-minv);\n // 最小値の更新\n minv = Math.min(minv, in);\n }",
"int in = scan.nextInt();",
"in",
"scan.nextInt()",
"scan.nextInt",
"scan",
"maxv = Math.max(maxv, in-minv)",
"maxv",
"Math.max(maxv, in-minv)",
"Math.max",
"Math",
"maxv",
"in-minv",
"in",
"minv",
"minv = Math.min(minv, in)",
"minv",
"Math.min(minv, in)",
"Math.min",
"Math",
"minv",
"in",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n\n // 初期値を仮で最小値に\n int minv = scan.nextInt();\n // 更新できるように最大値に十分小さい値を\n int maxv = Integer.MIN_VALUE;\n\n for(int i=1;i<n;i++){\n int in = scan.nextInt();\n // 最大値の更新\n maxv = Math.max(maxv, in-minv);\n // 最小値の更新\n minv = Math.min(minv, in);\n }\n System.out.println(maxv);\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n\n // 初期値を仮で最小値に\n int minv = scan.nextInt();\n // 更新できるように最大値に十分小さい値を\n int maxv = Integer.MIN_VALUE;\n\n for(int i=1;i<n;i++){\n int in = scan.nextInt();\n // 最大値の更新\n maxv = Math.max(maxv, in-minv);\n // 最小値の更新\n minv = Math.min(minv, in);\n }\n System.out.println(maxv);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
// 初期値を仮で最小値に
int minv = scan.nextInt();
// 更新できるように最大値に十分小さい値を
int maxv = Integer.MIN_VALUE;
for(int i=1;i<n;i++){
int in = scan.nextInt();
// 最大値の更新
maxv = Math.max(maxv, in-minv);
// 最小値の更新
minv = Math.min(minv, in);
}
System.out.println(maxv);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
40,
17,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
2,
13,
13,
13,
0,
13,
2,
13,
13,
14,
2,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
71,
5
],
[
71,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
38,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
44,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
38,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
59,
61
],
[
8,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
6,
68
],
[
68,
69
],
[
0,
70
],
[
70,
71
],
[
70,
72
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner stdIn = new Scanner(System.in);\n int n = stdIn.nextInt();\n int max = -2000000000;\n int min = stdIn.nextInt();\n for (int i = 1; i < n; i++) {\n int now = stdIn.nextInt();\n if (now - min > max) \n max = now - min;\n if (now < min)\n min = now;\n }\n System.out.println(max);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner stdIn = new Scanner(System.in);\n int n = stdIn.nextInt();\n int max = -2000000000;\n int min = stdIn.nextInt();\n for (int i = 1; i < n; i++) {\n int now = stdIn.nextInt();\n if (now - min > max) \n max = now - min;\n if (now < min)\n min = now;\n }\n System.out.println(max);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner stdIn = new Scanner(System.in);\n int n = stdIn.nextInt();\n int max = -2000000000;\n int min = stdIn.nextInt();\n for (int i = 1; i < n; i++) {\n int now = stdIn.nextInt();\n if (now - min > max) \n max = now - min;\n if (now < min)\n min = now;\n }\n System.out.println(max);\n }",
"main",
"{\n Scanner stdIn = new Scanner(System.in);\n int n = stdIn.nextInt();\n int max = -2000000000;\n int min = stdIn.nextInt();\n for (int i = 1; i < n; i++) {\n int now = stdIn.nextInt();\n if (now - min > max) \n max = now - min;\n if (now < min)\n min = now;\n }\n System.out.println(max);\n }",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int n = stdIn.nextInt();",
"n",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int max = -2000000000;",
"max",
"-2000000000",
"2000000000",
"int min = stdIn.nextInt();",
"min",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"for (int i = 1; i < n; i++) {\n int now = stdIn.nextInt();\n if (now - min > max) \n max = now - min;\n if (now < min)\n min = now;\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n int now = stdIn.nextInt();\n if (now - min > max) \n max = now - min;\n if (now < min)\n min = now;\n }",
"{\n int now = stdIn.nextInt();\n if (now - min > max) \n max = now - min;\n if (now < min)\n min = now;\n }",
"int now = stdIn.nextInt();",
"now",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"if (now - min > max) \n max = now - min;",
"now - min > max",
"now - min",
"now",
"min",
"max",
"max = now - min",
"max",
"now - min",
"now",
"min",
"if (now < min)\n min = now;",
"now < min",
"now",
"min",
"min = now",
"min",
"now",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner stdIn = new Scanner(System.in);\n int n = stdIn.nextInt();\n int max = -2000000000;\n int min = stdIn.nextInt();\n for (int i = 1; i < n; i++) {\n int now = stdIn.nextInt();\n if (now - min > max) \n max = now - min;\n if (now < min)\n min = now;\n }\n System.out.println(max);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner stdIn = new Scanner(System.in);\n int n = stdIn.nextInt();\n int max = -2000000000;\n int min = stdIn.nextInt();\n for (int i = 1; i < n; i++) {\n int now = stdIn.nextInt();\n if (now - min > max) \n max = now - min;\n if (now < min)\n min = now;\n }\n System.out.println(max);\n }\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int n = stdIn.nextInt();
int max = -2000000000;
int min = stdIn.nextInt();
for (int i = 1; i < n; i++) {
int now = stdIn.nextInt();
if (now - min > max)
max = now - min;
if (now < min)
min = now;
}
System.out.println(max);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
18,
13,
13,
0,
13,
4,
18,
13,
13,
2,
18,
13,
2,
13,
17,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
97,
5
],
[
97,
6
],
[
6,
7
],
[
6,
8
],
[
97,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
23,
31
],
[
31,
32
],
[
32,
33
],
[
23,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
36,
40
],
[
40,
41
],
[
41,
42
],
[
11,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
45,
47
],
[
11,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
11,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
68,
72
],
[
72,
73
],
[
72,
74
],
[
65,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
81,
87
],
[
11,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
9,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
]
] | [
"import java.util.Scanner;\npublic class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main (String[] args) {\n\t\tint n = sc.nextInt();\t\n\t\tint A [] = new int [n+1];\n\t\tfor (int i=1; i<=n; i++){\n\t\t\tA[i]=sc.nextInt();\n\t\t}\n\t\tint min = Integer.MAX_VALUE;\n\t\tint diff= Integer.MIN_VALUE;\n\t\tfor (int j=1; j<n; j++){\n\t\t\tmin = Math.min(min, A[j]);\n\t\t\tdiff = Math.max(diff, A[j+1]-min);\n\t\t}\n\t\tSystem.out.println(diff);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main (String[] args) {\n\t\tint n = sc.nextInt();\t\n\t\tint A [] = new int [n+1];\n\t\tfor (int i=1; i<=n; i++){\n\t\t\tA[i]=sc.nextInt();\n\t\t}\n\t\tint min = Integer.MAX_VALUE;\n\t\tint diff= Integer.MIN_VALUE;\n\t\tfor (int j=1; j<n; j++){\n\t\t\tmin = Math.min(min, A[j]);\n\t\t\tdiff = Math.max(diff, A[j+1]-min);\n\t\t}\n\t\tSystem.out.println(diff);\n\t}\n}",
"Main",
"static Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"public static void main (String[] args) {\n\t\tint n = sc.nextInt();\t\n\t\tint A [] = new int [n+1];\n\t\tfor (int i=1; i<=n; i++){\n\t\t\tA[i]=sc.nextInt();\n\t\t}\n\t\tint min = Integer.MAX_VALUE;\n\t\tint diff= Integer.MIN_VALUE;\n\t\tfor (int j=1; j<n; j++){\n\t\t\tmin = Math.min(min, A[j]);\n\t\t\tdiff = Math.max(diff, A[j+1]-min);\n\t\t}\n\t\tSystem.out.println(diff);\n\t}",
"main",
"{\n\t\tint n = sc.nextInt();\t\n\t\tint A [] = new int [n+1];\n\t\tfor (int i=1; i<=n; i++){\n\t\t\tA[i]=sc.nextInt();\n\t\t}\n\t\tint min = Integer.MAX_VALUE;\n\t\tint diff= Integer.MIN_VALUE;\n\t\tfor (int j=1; j<n; j++){\n\t\t\tmin = Math.min(min, A[j]);\n\t\t\tdiff = Math.max(diff, A[j+1]-min);\n\t\t}\n\t\tSystem.out.println(diff);\n\t}",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int A [] = new int [n+1];",
"A",
"new int [n+1]",
"n+1",
"n",
"1",
"for (int i=1; i<=n; i++){\n\t\t\tA[i]=sc.nextInt();\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tA[i]=sc.nextInt();\n\t\t}",
"{\n\t\t\tA[i]=sc.nextInt();\n\t\t}",
"A[i]=sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int min = Integer.MAX_VALUE;",
"min",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"int diff= Integer.MIN_VALUE;",
"diff",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"for (int j=1; j<n; j++){\n\t\t\tmin = Math.min(min, A[j]);\n\t\t\tdiff = Math.max(diff, A[j+1]-min);\n\t\t}",
"int j=1;",
"int j=1;",
"j",
"1",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\tmin = Math.min(min, A[j]);\n\t\t\tdiff = Math.max(diff, A[j+1]-min);\n\t\t}",
"{\n\t\t\tmin = Math.min(min, A[j]);\n\t\t\tdiff = Math.max(diff, A[j+1]-min);\n\t\t}",
"min = Math.min(min, A[j])",
"min",
"Math.min(min, A[j])",
"Math.min",
"Math",
"min",
"A[j]",
"A",
"j",
"diff = Math.max(diff, A[j+1]-min)",
"diff",
"Math.max(diff, A[j+1]-min)",
"Math.max",
"Math",
"diff",
"A[j+1]-min",
"A[j+1]",
"A",
"j+1",
"j",
"1",
"min",
"System.out.println(diff)",
"System.out.println",
"System.out",
"System",
"System.out",
"diff",
"String[] args",
"args",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main (String[] args) {\n\t\tint n = sc.nextInt();\t\n\t\tint A [] = new int [n+1];\n\t\tfor (int i=1; i<=n; i++){\n\t\t\tA[i]=sc.nextInt();\n\t\t}\n\t\tint min = Integer.MAX_VALUE;\n\t\tint diff= Integer.MIN_VALUE;\n\t\tfor (int j=1; j<n; j++){\n\t\t\tmin = Math.min(min, A[j]);\n\t\t\tdiff = Math.max(diff, A[j+1]-min);\n\t\t}\n\t\tSystem.out.println(diff);\n\t}\n}",
"public class Main {\n\tstatic Scanner sc = new Scanner(System.in);\n\tpublic static void main (String[] args) {\n\t\tint n = sc.nextInt();\t\n\t\tint A [] = new int [n+1];\n\t\tfor (int i=1; i<=n; i++){\n\t\t\tA[i]=sc.nextInt();\n\t\t}\n\t\tint min = Integer.MAX_VALUE;\n\t\tint diff= Integer.MIN_VALUE;\n\t\tfor (int j=1; j<n; j++){\n\t\t\tmin = Math.min(min, A[j]);\n\t\t\tdiff = Math.max(diff, A[j+1]-min);\n\t\t}\n\t\tSystem.out.println(diff);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main (String[] args) {
int n = sc.nextInt();
int A [] = new int [n+1];
for (int i=1; i<=n; i++){
A[i]=sc.nextInt();
}
int min = Integer.MAX_VALUE;
int diff= Integer.MIN_VALUE;
for (int j=1; j<n; j++){
min = Math.min(min, A[j]);
diff = Math.max(diff, A[j+1]-min);
}
System.out.println(diff);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
20,
0,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
0,
13,
2,
18,
13,
17,
18,
13,
17,
0,
13,
18,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
13,
13,
0,
13,
4,
18,
13,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
115,
5
],
[
115,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
8,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
8,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
29,
30
],
[
30,
31
],
[
8,
32
],
[
32,
33
],
[
32,
34
],
[
8,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
56,
57
],
[
57,
58
],
[
8,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
65,
67
],
[
8,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
8,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
78,
80
],
[
73,
81
],
[
81,
82
],
[
82,
83
],
[
73,
84
],
[
85,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
88,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
85,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
99,
103
],
[
103,
104
],
[
103,
105
],
[
8,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
6,
112
],
[
112,
113
],
[
0,
114
],
[
114,
115
],
[
114,
116
]
] | [
"import java.util.Scanner;\n\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n\t\tint n,i,j,a,maxv,minv;\n\t\tScanner sc=new Scanner(System.in);\n\t\tn=Integer.parseInt(sc.next());\n\t\tint r[]=new int[n];\n\t\tfor(i=0;i<n;i++){\n\t\t\tr[i]=Integer.parseInt(sc.next());\n\t\t}\n\n\t\tmaxv=r[1]-r[0];\n\t\tminv=r[0];\n\t\tfor(j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv, r[j]-minv);\n\t\t\tminv=Math.min(minv, r[j]);\n\t\t}\n\n\t\tSystem.out.println(maxv);\n\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n\t\tint n,i,j,a,maxv,minv;\n\t\tScanner sc=new Scanner(System.in);\n\t\tn=Integer.parseInt(sc.next());\n\t\tint r[]=new int[n];\n\t\tfor(i=0;i<n;i++){\n\t\t\tr[i]=Integer.parseInt(sc.next());\n\t\t}\n\n\t\tmaxv=r[1]-r[0];\n\t\tminv=r[0];\n\t\tfor(j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv, r[j]-minv);\n\t\t\tminv=Math.min(minv, r[j]);\n\t\t}\n\n\t\tSystem.out.println(maxv);\n\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n\t\tint n,i,j,a,maxv,minv;\n\t\tScanner sc=new Scanner(System.in);\n\t\tn=Integer.parseInt(sc.next());\n\t\tint r[]=new int[n];\n\t\tfor(i=0;i<n;i++){\n\t\t\tr[i]=Integer.parseInt(sc.next());\n\t\t}\n\n\t\tmaxv=r[1]-r[0];\n\t\tminv=r[0];\n\t\tfor(j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv, r[j]-minv);\n\t\t\tminv=Math.min(minv, r[j]);\n\t\t}\n\n\t\tSystem.out.println(maxv);\n\n\n\t}",
"main",
"{\n\t\t// TODO ?????????????????????????????????????????????\n\n\t\tint n,i,j,a,maxv,minv;\n\t\tScanner sc=new Scanner(System.in);\n\t\tn=Integer.parseInt(sc.next());\n\t\tint r[]=new int[n];\n\t\tfor(i=0;i<n;i++){\n\t\t\tr[i]=Integer.parseInt(sc.next());\n\t\t}\n\n\t\tmaxv=r[1]-r[0];\n\t\tminv=r[0];\n\t\tfor(j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv, r[j]-minv);\n\t\t\tminv=Math.min(minv, r[j]);\n\t\t}\n\n\t\tSystem.out.println(maxv);\n\n\n\t}",
"int n",
"n",
"i",
"i",
"j",
"j",
"a",
"a",
"maxv",
"maxv",
"minv;",
"minv",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"n=Integer.parseInt(sc.next())",
"n",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int r[]=new int[n];",
"r",
"new int[n]",
"n",
"for(i=0;i<n;i++){\n\t\t\tr[i]=Integer.parseInt(sc.next());\n\t\t}",
"i=0;",
"i=0",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tr[i]=Integer.parseInt(sc.next());\n\t\t}",
"{\n\t\t\tr[i]=Integer.parseInt(sc.next());\n\t\t}",
"r[i]=Integer.parseInt(sc.next())",
"r[i]",
"r",
"i",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"maxv=r[1]-r[0]",
"maxv",
"r[1]-r[0]",
"r[1]",
"r",
"1",
"r[0]",
"r",
"0",
"minv=r[0]",
"minv",
"r[0]",
"r",
"0",
"for(j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv, r[j]-minv);\n\t\t\tminv=Math.min(minv, r[j]);\n\t\t}",
"j=1;",
"j=1",
"j",
"1",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\tmaxv=Math.max(maxv, r[j]-minv);\n\t\t\tminv=Math.min(minv, r[j]);\n\t\t}",
"{\n\t\t\tmaxv=Math.max(maxv, r[j]-minv);\n\t\t\tminv=Math.min(minv, r[j]);\n\t\t}",
"maxv=Math.max(maxv, r[j]-minv)",
"maxv",
"Math.max(maxv, r[j]-minv)",
"Math.max",
"Math",
"maxv",
"r[j]-minv",
"r[j]",
"r",
"j",
"minv",
"minv=Math.min(minv, r[j])",
"minv",
"Math.min(minv, r[j])",
"Math.min",
"Math",
"minv",
"r[j]",
"r",
"j",
"System.out.println(maxv)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxv",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n\t\tint n,i,j,a,maxv,minv;\n\t\tScanner sc=new Scanner(System.in);\n\t\tn=Integer.parseInt(sc.next());\n\t\tint r[]=new int[n];\n\t\tfor(i=0;i<n;i++){\n\t\t\tr[i]=Integer.parseInt(sc.next());\n\t\t}\n\n\t\tmaxv=r[1]-r[0];\n\t\tminv=r[0];\n\t\tfor(j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv, r[j]-minv);\n\t\t\tminv=Math.min(minv, r[j]);\n\t\t}\n\n\t\tSystem.out.println(maxv);\n\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO ?????????????????????????????????????????????\n\n\t\tint n,i,j,a,maxv,minv;\n\t\tScanner sc=new Scanner(System.in);\n\t\tn=Integer.parseInt(sc.next());\n\t\tint r[]=new int[n];\n\t\tfor(i=0;i<n;i++){\n\t\t\tr[i]=Integer.parseInt(sc.next());\n\t\t}\n\n\t\tmaxv=r[1]-r[0];\n\t\tminv=r[0];\n\t\tfor(j=1;j<n;j++){\n\t\t\tmaxv=Math.max(maxv, r[j]-minv);\n\t\t\tminv=Math.min(minv, r[j]);\n\t\t}\n\n\t\tSystem.out.println(maxv);\n\n\n\t}\n\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
int n,i,j,a,maxv,minv;
Scanner sc=new Scanner(System.in);
n=Integer.parseInt(sc.next());
int r[]=new int[n];
for(i=0;i<n;i++){
r[i]=Integer.parseInt(sc.next());
}
maxv=r[1]-r[0];
minv=r[0];
for(j=1;j<n;j++){
maxv=Math.max(maxv, r[j]-minv);
minv=Math.min(minv, r[j]);
}
System.out.println(maxv);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
40,
17,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
77,
5
],
[
77,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
38,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
38,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
38,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
8,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
6,
74
],
[
74,
75
],
[
0,
76
],
[
76,
77
],
[
76,
78
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint maxValue = -1999999999;\n\t\tint min = sc.nextInt();\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tint nowNum = sc.nextInt();\n\t\t\tint maxValueCandidate = nowNum - min;\n\t\t\tif (maxValue < maxValueCandidate) {\n\t\t\t\tmaxValue = maxValueCandidate;\n\t\t\t}\n\t\t\tif(min > nowNum) {\n\t\t\t\tmin = nowNum;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(maxValue);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint maxValue = -1999999999;\n\t\tint min = sc.nextInt();\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tint nowNum = sc.nextInt();\n\t\t\tint maxValueCandidate = nowNum - min;\n\t\t\tif (maxValue < maxValueCandidate) {\n\t\t\t\tmaxValue = maxValueCandidate;\n\t\t\t}\n\t\t\tif(min > nowNum) {\n\t\t\t\tmin = nowNum;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(maxValue);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint maxValue = -1999999999;\n\t\tint min = sc.nextInt();\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tint nowNum = sc.nextInt();\n\t\t\tint maxValueCandidate = nowNum - min;\n\t\t\tif (maxValue < maxValueCandidate) {\n\t\t\t\tmaxValue = maxValueCandidate;\n\t\t\t}\n\t\t\tif(min > nowNum) {\n\t\t\t\tmin = nowNum;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(maxValue);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint maxValue = -1999999999;\n\t\tint min = sc.nextInt();\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tint nowNum = sc.nextInt();\n\t\t\tint maxValueCandidate = nowNum - min;\n\t\t\tif (maxValue < maxValueCandidate) {\n\t\t\t\tmaxValue = maxValueCandidate;\n\t\t\t}\n\t\t\tif(min > nowNum) {\n\t\t\t\tmin = nowNum;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(maxValue);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int maxValue = -1999999999;",
"maxValue",
"-1999999999",
"1999999999",
"int min = sc.nextInt();",
"min",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i = 1; i < n; i++) {\n\t\t\tint nowNum = sc.nextInt();\n\t\t\tint maxValueCandidate = nowNum - min;\n\t\t\tif (maxValue < maxValueCandidate) {\n\t\t\t\tmaxValue = maxValueCandidate;\n\t\t\t}\n\t\t\tif(min > nowNum) {\n\t\t\t\tmin = nowNum;\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tint nowNum = sc.nextInt();\n\t\t\tint maxValueCandidate = nowNum - min;\n\t\t\tif (maxValue < maxValueCandidate) {\n\t\t\t\tmaxValue = maxValueCandidate;\n\t\t\t}\n\t\t\tif(min > nowNum) {\n\t\t\t\tmin = nowNum;\n\t\t\t}\n\t\t}",
"{\n\t\t\tint nowNum = sc.nextInt();\n\t\t\tint maxValueCandidate = nowNum - min;\n\t\t\tif (maxValue < maxValueCandidate) {\n\t\t\t\tmaxValue = maxValueCandidate;\n\t\t\t}\n\t\t\tif(min > nowNum) {\n\t\t\t\tmin = nowNum;\n\t\t\t}\n\t\t}",
"int nowNum = sc.nextInt();",
"nowNum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int maxValueCandidate = nowNum - min;",
"maxValueCandidate",
"nowNum - min",
"nowNum",
"min",
"if (maxValue < maxValueCandidate) {\n\t\t\t\tmaxValue = maxValueCandidate;\n\t\t\t}",
"maxValue < maxValueCandidate",
"maxValue",
"maxValueCandidate",
"{\n\t\t\t\tmaxValue = maxValueCandidate;\n\t\t\t}",
"maxValue = maxValueCandidate",
"maxValue",
"maxValueCandidate",
"if(min > nowNum) {\n\t\t\t\tmin = nowNum;\n\t\t\t}",
"min > nowNum",
"min",
"nowNum",
"{\n\t\t\t\tmin = nowNum;\n\t\t\t}",
"min = nowNum",
"min",
"nowNum",
"sc.close()",
"sc.close",
"sc",
"System.out.println(maxValue)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxValue",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint maxValue = -1999999999;\n\t\tint min = sc.nextInt();\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tint nowNum = sc.nextInt();\n\t\t\tint maxValueCandidate = nowNum - min;\n\t\t\tif (maxValue < maxValueCandidate) {\n\t\t\t\tmaxValue = maxValueCandidate;\n\t\t\t}\n\t\t\tif(min > nowNum) {\n\t\t\t\tmin = nowNum;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(maxValue);\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint maxValue = -1999999999;\n\t\tint min = sc.nextInt();\n\t\tfor(int i = 1; i < n; i++) {\n\t\t\tint nowNum = sc.nextInt();\n\t\t\tint maxValueCandidate = nowNum - min;\n\t\t\tif (maxValue < maxValueCandidate) {\n\t\t\t\tmaxValue = maxValueCandidate;\n\t\t\t}\n\t\t\tif(min > nowNum) {\n\t\t\t\tmin = nowNum;\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t\tSystem.out.println(maxValue);\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int maxValue = -1999999999;
int min = sc.nextInt();
for(int i = 1; i < n; i++) {
int nowNum = sc.nextInt();
int maxValueCandidate = nowNum - min;
if (maxValue < maxValueCandidate) {
maxValue = maxValueCandidate;
}
if(min > nowNum) {
min = nowNum;
}
}
sc.close();
System.out.println(maxValue);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
40,
17,
4,
13,
13,
2,
13,
17,
11,
1,
41,
13,
2,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
18,
13,
17,
13,
4,
13,
13,
2,
13,
17,
41,
13,
2,
18,
13,
13,
18,
13,
17,
14,
2,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
12,
13,
30,
0,
18,
13,
17,
18,
13,
17,
0,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
17,
18,
13,
13,
30,
0,
18,
13,
17,
18,
13,
13,
0,
18,
13,
17,
13,
23,
13,
23,
13,
12,
13,
30,
4,
18,
20,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
166,
5
],
[
166,
6
],
[
6,
7
],
[
6,
8
],
[
166,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
12,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
12,
21
],
[
21,
22
],
[
21,
23
],
[
12,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
43,
44
],
[
12,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
12,
49
],
[
49,
50
],
[
49,
51
],
[
49,
52
],
[
52,
53
],
[
52,
54
],
[
12,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
59,
61
],
[
55,
62
],
[
62,
63
],
[
62,
64
],
[
55,
65
],
[
65,
66
],
[
66,
67
],
[
55,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
70,
76
],
[
76,
77
],
[
76,
78
],
[
76,
79
],
[
79,
80
],
[
79,
81
],
[
69,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
88,
89
],
[
88,
90
],
[
69,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
95,
96
],
[
95,
97
],
[
12,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
166,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
111,
112
],
[
111,
113
],
[
106,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
106,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
124,
125
],
[
124,
126
],
[
119,
127
],
[
127,
128
],
[
128,
129
],
[
119,
130
],
[
131,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
133,
137
],
[
137,
138
],
[
137,
139
],
[
132,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
141,
145
],
[
145,
146
],
[
145,
147
],
[
140,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
104,
153
],
[
153,
154
],
[
104,
155
],
[
155,
156
],
[
166,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
157,
163
],
[
163,
164
],
[
0,
165
],
[
165,
166
],
[
165,
167
]
] | [
"import java.util.Scanner;\n\npublic class Main {\n\tint[] min = new int[2];\n\t\n\tvoid run() {\n\t\t// 入力\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] array = new int[200000];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tint max = -1000000000;\t\n\t\tsearchMinimun(array, n-1);\n\t\tfor(int i = n-1; i > 0; i--) {\n\t\t\tif(min[1] == i) searchMinimun(array, i-1);\n\t\t\tint tmp = array[i] - min[0];\n\t\t\tif(tmp > max) max = tmp;\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n\t\n\tvoid searchMinimun(int[] array, int n) {\n\t\tmin[0] = array[0];\n\t\tmin[1] = 0;\n\t\tfor(int i = 1; i <= n; i++) {\n\t\t\tif(min[0] > array[i]) {\n\t\t\t\tmin[0] = array[i];\n\t\t\t\tmin[1] = i;\n\t\t\t}\n\t\t}\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tint[] min = new int[2];\n\t\n\tvoid run() {\n\t\t// 入力\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] array = new int[200000];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tint max = -1000000000;\t\n\t\tsearchMinimun(array, n-1);\n\t\tfor(int i = n-1; i > 0; i--) {\n\t\t\tif(min[1] == i) searchMinimun(array, i-1);\n\t\t\tint tmp = array[i] - min[0];\n\t\t\tif(tmp > max) max = tmp;\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n\t\n\tvoid searchMinimun(int[] array, int n) {\n\t\tmin[0] = array[0];\n\t\tmin[1] = 0;\n\t\tfor(int i = 1; i <= n; i++) {\n\t\t\tif(min[0] > array[i]) {\n\t\t\t\tmin[0] = array[i];\n\t\t\t\tmin[1] = i;\n\t\t\t}\n\t\t}\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"Main",
"int[] min = new int[2];",
"min",
"new int[2]",
"2",
"void run() {\n\t\t// 入力\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] array = new int[200000];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tint max = -1000000000;\t\n\t\tsearchMinimun(array, n-1);\n\t\tfor(int i = n-1; i > 0; i--) {\n\t\t\tif(min[1] == i) searchMinimun(array, i-1);\n\t\t\tint tmp = array[i] - min[0];\n\t\t\tif(tmp > max) max = tmp;\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"run",
"{\n\t\t// 入力\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] array = new int[200000];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tint max = -1000000000;\t\n\t\tsearchMinimun(array, n-1);\n\t\tfor(int i = n-1; i > 0; i--) {\n\t\t\tif(min[1] == i) searchMinimun(array, i-1);\n\t\t\tint tmp = array[i] - min[0];\n\t\t\tif(tmp > max) max = tmp;\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] array = new int[200000];",
"array",
"new int[200000]",
"200000",
"for(int i = 0; i < n; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tarray[i] = scan.nextInt();\n\t\t}",
"{\n\t\t\tarray[i] = scan.nextInt();\n\t\t}",
"array[i] = scan.nextInt()",
"array[i]",
"array",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int max = -1000000000;",
"max",
"-1000000000",
"1000000000",
"searchMinimun(array, n-1)",
"searchMinimun",
"array",
"n-1",
"n",
"1",
"for(int i = n-1; i > 0; i--) {\n\t\t\tif(min[1] == i) searchMinimun(array, i-1);\n\t\t\tint tmp = array[i] - min[0];\n\t\t\tif(tmp > max) max = tmp;\n\t\t}",
"int i = n-1;",
"int i = n-1;",
"i",
"n-1",
"n",
"1",
"i > 0",
"i",
"0",
"i--",
"i--",
"i",
"{\n\t\t\tif(min[1] == i) searchMinimun(array, i-1);\n\t\t\tint tmp = array[i] - min[0];\n\t\t\tif(tmp > max) max = tmp;\n\t\t}",
"{\n\t\t\tif(min[1] == i) searchMinimun(array, i-1);\n\t\t\tint tmp = array[i] - min[0];\n\t\t\tif(tmp > max) max = tmp;\n\t\t}",
"if(min[1] == i) searchMinimun(array, i-1);",
"min[1] == i",
"min[1]",
"min",
"1",
"i",
"searchMinimun(array, i-1)",
"searchMinimun",
"array",
"i-1",
"i",
"1",
"int tmp = array[i] - min[0];",
"tmp",
"array[i] - min[0]",
"array[i]",
"array",
"i",
"min[0]",
"min",
"0",
"if(tmp > max) max = tmp;",
"tmp > max",
"tmp",
"max",
"max = tmp",
"max",
"tmp",
"System.out.println(max)",
"System.out.println",
"System.out",
"System",
"System.out",
"max",
"void searchMinimun(int[] array, int n) {\n\t\tmin[0] = array[0];\n\t\tmin[1] = 0;\n\t\tfor(int i = 1; i <= n; i++) {\n\t\t\tif(min[0] > array[i]) {\n\t\t\t\tmin[0] = array[i];\n\t\t\t\tmin[1] = i;\n\t\t\t}\n\t\t}\n\t}",
"searchMinimun",
"{\n\t\tmin[0] = array[0];\n\t\tmin[1] = 0;\n\t\tfor(int i = 1; i <= n; i++) {\n\t\t\tif(min[0] > array[i]) {\n\t\t\t\tmin[0] = array[i];\n\t\t\t\tmin[1] = i;\n\t\t\t}\n\t\t}\n\t}",
"min[0] = array[0]",
"min[0]",
"min",
"0",
"array[0]",
"array",
"0",
"min[1] = 0",
"min[1]",
"min",
"1",
"0",
"for(int i = 1; i <= n; i++) {\n\t\t\tif(min[0] > array[i]) {\n\t\t\t\tmin[0] = array[i];\n\t\t\t\tmin[1] = i;\n\t\t\t}\n\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tif(min[0] > array[i]) {\n\t\t\t\tmin[0] = array[i];\n\t\t\t\tmin[1] = i;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(min[0] > array[i]) {\n\t\t\t\tmin[0] = array[i];\n\t\t\t\tmin[1] = i;\n\t\t\t}\n\t\t}",
"if(min[0] > array[i]) {\n\t\t\t\tmin[0] = array[i];\n\t\t\t\tmin[1] = i;\n\t\t\t}",
"min[0] > array[i]",
"min[0]",
"min",
"0",
"array[i]",
"array",
"i",
"{\n\t\t\t\tmin[0] = array[i];\n\t\t\t\tmin[1] = i;\n\t\t\t}",
"min[0] = array[i]",
"min[0]",
"min",
"0",
"array[i]",
"array",
"i",
"min[1] = i",
"min[1]",
"min",
"1",
"i",
"int[] array",
"array",
"int n",
"n",
"public static void main(String[] args) {\n\t\tnew Main().run();\n\t}",
"main",
"{\n\t\tnew Main().run();\n\t}",
"new Main().run()",
"new Main().run",
"new Main()",
"String[] args",
"args",
"public class Main {\n\tint[] min = new int[2];\n\t\n\tvoid run() {\n\t\t// 入力\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] array = new int[200000];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tint max = -1000000000;\t\n\t\tsearchMinimun(array, n-1);\n\t\tfor(int i = n-1; i > 0; i--) {\n\t\t\tif(min[1] == i) searchMinimun(array, i-1);\n\t\t\tint tmp = array[i] - min[0];\n\t\t\tif(tmp > max) max = tmp;\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n\t\n\tvoid searchMinimun(int[] array, int n) {\n\t\tmin[0] = array[0];\n\t\tmin[1] = 0;\n\t\tfor(int i = 1; i <= n; i++) {\n\t\t\tif(min[0] > array[i]) {\n\t\t\t\tmin[0] = array[i];\n\t\t\t\tmin[1] = i;\n\t\t\t}\n\t\t}\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"public class Main {\n\tint[] min = new int[2];\n\t\n\tvoid run() {\n\t\t// 入力\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] array = new int[200000];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tint max = -1000000000;\t\n\t\tsearchMinimun(array, n-1);\n\t\tfor(int i = n-1; i > 0; i--) {\n\t\t\tif(min[1] == i) searchMinimun(array, i-1);\n\t\t\tint tmp = array[i] - min[0];\n\t\t\tif(tmp > max) max = tmp;\n\t\t}\n\t\tSystem.out.println(max);\n\t}\n\t\n\tvoid searchMinimun(int[] array, int n) {\n\t\tmin[0] = array[0];\n\t\tmin[1] = 0;\n\t\tfor(int i = 1; i <= n; i++) {\n\t\t\tif(min[0] > array[i]) {\n\t\t\t\tmin[0] = array[i];\n\t\t\t\tmin[1] = i;\n\t\t\t}\n\t\t}\n\t}\n\tpublic static void main(String[] args) {\n\t\tnew Main().run();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
int[] min = new int[2];
void run() {
// 入力
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int[] array = new int[200000];
for(int i = 0; i < n; i++) {
array[i] = scan.nextInt();
}
int max = -1000000000;
searchMinimun(array, n-1);
for(int i = n-1; i > 0; i--) {
if(min[1] == i) searchMinimun(array, i-1);
int tmp = array[i] - min[0];
if(tmp > max) max = tmp;
}
System.out.println(max);
}
void searchMinimun(int[] array, int n) {
min[0] = array[0];
min[1] = 0;
for(int i = 1; i <= n; i++) {
if(min[0] > array[i]) {
min[0] = array[i];
min[1] = i;
}
}
}
public static void main(String[] args) {
new Main().run();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
2,
17,
17,
41,
13,
13,
41,
13,
40,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
13,
2,
13,
13,
0,
13,
2,
13,
13,
14,
2,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
29,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
75,
5
],
[
75,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
19,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
41,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
47,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
41,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
62,
64
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
8,
71
],
[
6,
72
],
[
72,
73
],
[
0,
74
],
[
74,
75
],
[
74,
76
]
] | [
"import java.util.Scanner;\n\n/**\n * Created by shoya on 2017/04/14.\n */\npublic class Main {\n public static void main(String... args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n final long INF = 1L << 60;\n long currentmin = INF;\n long maxpro = -INF;\n for (int i = 0; i < n; i++){\n long a = sc.nextInt();\n if (maxpro < a - currentmin)\n maxpro = a - currentmin;\n if (currentmin > a)\n currentmin = a;\n }\n System.out.println(maxpro);\n return;\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String... args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n final long INF = 1L << 60;\n long currentmin = INF;\n long maxpro = -INF;\n for (int i = 0; i < n; i++){\n long a = sc.nextInt();\n if (maxpro < a - currentmin)\n maxpro = a - currentmin;\n if (currentmin > a)\n currentmin = a;\n }\n System.out.println(maxpro);\n return;\n }\n}",
"Main",
"public static void main(String... args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n final long INF = 1L << 60;\n long currentmin = INF;\n long maxpro = -INF;\n for (int i = 0; i < n; i++){\n long a = sc.nextInt();\n if (maxpro < a - currentmin)\n maxpro = a - currentmin;\n if (currentmin > a)\n currentmin = a;\n }\n System.out.println(maxpro);\n return;\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n final long INF = 1L << 60;\n long currentmin = INF;\n long maxpro = -INF;\n for (int i = 0; i < n; i++){\n long a = sc.nextInt();\n if (maxpro < a - currentmin)\n maxpro = a - currentmin;\n if (currentmin > a)\n currentmin = a;\n }\n System.out.println(maxpro);\n return;\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"final long INF = 1L << 60;",
"INF",
"1L << 60",
"1L",
"60",
"long currentmin = INF;",
"currentmin",
"INF",
"long maxpro = -INF;",
"maxpro",
"-INF",
"INF",
"for (int i = 0; i < n; i++){\n long a = sc.nextInt();\n if (maxpro < a - currentmin)\n maxpro = a - currentmin;\n if (currentmin > a)\n currentmin = a;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n long a = sc.nextInt();\n if (maxpro < a - currentmin)\n maxpro = a - currentmin;\n if (currentmin > a)\n currentmin = a;\n }",
"{\n long a = sc.nextInt();\n if (maxpro < a - currentmin)\n maxpro = a - currentmin;\n if (currentmin > a)\n currentmin = a;\n }",
"long a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if (maxpro < a - currentmin)\n maxpro = a - currentmin;",
"maxpro < a - currentmin",
"maxpro",
"a - currentmin",
"a",
"currentmin",
"maxpro = a - currentmin",
"maxpro",
"a - currentmin",
"a",
"currentmin",
"if (currentmin > a)\n currentmin = a;",
"currentmin > a",
"currentmin",
"a",
"currentmin = a",
"currentmin",
"a",
"System.out.println(maxpro)",
"System.out.println",
"System.out",
"System",
"System.out",
"maxpro",
"return;",
"String... args",
"args",
"public class Main {\n public static void main(String... args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n final long INF = 1L << 60;\n long currentmin = INF;\n long maxpro = -INF;\n for (int i = 0; i < n; i++){\n long a = sc.nextInt();\n if (maxpro < a - currentmin)\n maxpro = a - currentmin;\n if (currentmin > a)\n currentmin = a;\n }\n System.out.println(maxpro);\n return;\n }\n}",
"public class Main {\n public static void main(String... args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n final long INF = 1L << 60;\n long currentmin = INF;\n long maxpro = -INF;\n for (int i = 0; i < n; i++){\n long a = sc.nextInt();\n if (maxpro < a - currentmin)\n maxpro = a - currentmin;\n if (currentmin > a)\n currentmin = a;\n }\n System.out.println(maxpro);\n return;\n }\n}",
"Main"
] | import java.util.Scanner;
/**
* Created by shoya on 2017/04/14.
*/
public class Main {
public static void main(String... args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
final long INF = 1L << 60;
long currentmin = INF;
long maxpro = -INF;
for (int i = 0; i < n; i++){
long a = sc.nextInt();
if (maxpro < a - currentmin)
maxpro = a - currentmin;
if (currentmin > a)
currentmin = a;
}
System.out.println(maxpro);
return;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
41,
13,
2,
18,
13,
17,
18,
13,
17,
41,
13,
18,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
18,
13,
13,
13,
0,
13,
2,
18,
13,
13,
13,
14,
2,
18,
13,
13,
13,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
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
],
[
13,
15
],
[
0,
16
],
[
124,
17
],
[
124,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
20,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
34,
35
],
[
20,
36
],
[
36,
37
],
[
36,
38
],
[
20,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
45,
47
],
[
40,
48
],
[
48,
49
],
[
49,
50
],
[
40,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
60,
61
],
[
20,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
68,
70
],
[
20,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
20,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
76,
84
],
[
84,
85
],
[
85,
86
],
[
76,
87
],
[
88,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
89,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
88,
104
],
[
104,
105
],
[
105,
106
],
[
106,
107
],
[
106,
108
],
[
105,
109
],
[
104,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
112,
114
],
[
20,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
18,
121
],
[
121,
122
],
[
0,
123
],
[
123,
124
],
[
123,
125
]
] | [
"import java.util.*;\nimport java.io.*;\nimport static java.util.Arrays.*;\nimport static java.util.Collections.*;\nimport static java.lang.Math.*;\n\npublic class Main {\n public static void main(String[] args) {\n int i, j;\n Scanner sc = new Scanner(System.in); \n int n = Integer.parseInt(sc.next());;\n int r[] = new int[n];\n for (i=0; i<n; i++)\n r[i] = Integer.parseInt(sc.next());;\n\n //res???max-min???????????????(???????????????mini?????´??°??§???????????¨???????????????)\n int res = r[1] - r[0];\n int mini = r[0];\n for (j=1; j<n; j++) {\n if (res < r[j] - mini) res = r[j] - mini;\n if (r[j] < mini) mini = r[j];\n }\n\n System.out.println(res);\n }\n}\n\n/*\n //O(n^2):TLE\n int res = r[1] - r[0];\n for (i=0; i<n-1; i++)\n for (j=i+1; j<n; j++)\n res = (res < r[j] - r[i]) ? r[j] - r[i] : res; \n printf(\"%d\\n\", res);\n*/\n \n/*\n //WA(mini???????¨??????´??°?????????maxj-mini????????????????????¨?????????)\n int maxj = r[1];\n int mini = r[0];\n for (j=1; j<n; j++) {\n if (maxj-mini < r[j]-mini) {\n maxj = r[j];\n if (j < n-1 && r[j] < mini) mini = r[j];\n }\n // if (j < n-1 && r[j] < mini) mini = r[j];\n }\n printf(\"%d\\n\", maxj-mini);\n*/",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import static java.util.Arrays.*;",
"import static java.util.Arrays.*;",
"import static java.util.Arrays.*;",
"import static java.util.Collections.*;",
"import static java.util.Collections.*;",
"import static java.util.Collections.*;",
"import static java.lang.Math.*;",
"import static java.lang.Math.*;",
"import static java.lang.Math.*;",
"public class Main {\n public static void main(String[] args) {\n int i, j;\n Scanner sc = new Scanner(System.in); \n int n = Integer.parseInt(sc.next());;\n int r[] = new int[n];\n for (i=0; i<n; i++)\n r[i] = Integer.parseInt(sc.next());;\n\n //res???max-min???????????????(???????????????mini?????´??°??§???????????¨???????????????)\n int res = r[1] - r[0];\n int mini = r[0];\n for (j=1; j<n; j++) {\n if (res < r[j] - mini) res = r[j] - mini;\n if (r[j] < mini) mini = r[j];\n }\n\n System.out.println(res);\n }\n}",
"Main",
"public static void main(String[] args) {\n int i, j;\n Scanner sc = new Scanner(System.in); \n int n = Integer.parseInt(sc.next());;\n int r[] = new int[n];\n for (i=0; i<n; i++)\n r[i] = Integer.parseInt(sc.next());;\n\n //res???max-min???????????????(???????????????mini?????´??°??§???????????¨???????????????)\n int res = r[1] - r[0];\n int mini = r[0];\n for (j=1; j<n; j++) {\n if (res < r[j] - mini) res = r[j] - mini;\n if (r[j] < mini) mini = r[j];\n }\n\n System.out.println(res);\n }",
"main",
"{\n int i, j;\n Scanner sc = new Scanner(System.in); \n int n = Integer.parseInt(sc.next());;\n int r[] = new int[n];\n for (i=0; i<n; i++)\n r[i] = Integer.parseInt(sc.next());;\n\n //res???max-min???????????????(???????????????mini?????´??°??§???????????¨???????????????)\n int res = r[1] - r[0];\n int mini = r[0];\n for (j=1; j<n; j++) {\n if (res < r[j] - mini) res = r[j] - mini;\n if (r[j] < mini) mini = r[j];\n }\n\n System.out.println(res);\n }",
"int i",
"i",
"j;",
"j",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = Integer.parseInt(sc.next());",
"n",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int r[] = new int[n];",
"r",
"new int[n]",
"n",
"for (i=0; i<n; i++)\n r[i] = Integer.parseInt(sc.next());",
"i=0;",
"i=0",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"r[i] = Integer.parseInt(sc.next());",
"r[i] = Integer.parseInt(sc.next())",
"r[i]",
"r",
"i",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int res = r[1] - r[0];",
"res",
"r[1] - r[0]",
"r[1]",
"r",
"1",
"r[0]",
"r",
"0",
"int mini = r[0];",
"mini",
"r[0]",
"r",
"0",
"for (j=1; j<n; j++) {\n if (res < r[j] - mini) res = r[j] - mini;\n if (r[j] < mini) mini = r[j];\n }",
"j=1;",
"j=1",
"j",
"1",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"{\n if (res < r[j] - mini) res = r[j] - mini;\n if (r[j] < mini) mini = r[j];\n }",
"{\n if (res < r[j] - mini) res = r[j] - mini;\n if (r[j] < mini) mini = r[j];\n }",
"if (res < r[j] - mini) res = r[j] - mini;",
"res < r[j] - mini",
"res",
"r[j] - mini",
"r[j]",
"r",
"j",
"mini",
"res = r[j] - mini",
"res",
"r[j] - mini",
"r[j]",
"r",
"j",
"mini",
"if (r[j] < mini) mini = r[j];",
"r[j] < mini",
"r[j]",
"r",
"j",
"mini",
"mini = r[j]",
"mini",
"r[j]",
"r",
"j",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n int i, j;\n Scanner sc = new Scanner(System.in); \n int n = Integer.parseInt(sc.next());;\n int r[] = new int[n];\n for (i=0; i<n; i++)\n r[i] = Integer.parseInt(sc.next());;\n\n //res???max-min???????????????(???????????????mini?????´??°??§???????????¨???????????????)\n int res = r[1] - r[0];\n int mini = r[0];\n for (j=1; j<n; j++) {\n if (res < r[j] - mini) res = r[j] - mini;\n if (r[j] < mini) mini = r[j];\n }\n\n System.out.println(res);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n int i, j;\n Scanner sc = new Scanner(System.in); \n int n = Integer.parseInt(sc.next());;\n int r[] = new int[n];\n for (i=0; i<n; i++)\n r[i] = Integer.parseInt(sc.next());;\n\n //res???max-min???????????????(???????????????mini?????´??°??§???????????¨???????????????)\n int res = r[1] - r[0];\n int mini = r[0];\n for (j=1; j<n; j++) {\n if (res < r[j] - mini) res = r[j] - mini;\n if (r[j] < mini) mini = r[j];\n }\n\n System.out.println(res);\n }\n}",
"Main"
] | import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args) {
int i, j;
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());;
int r[] = new int[n];
for (i=0; i<n; i++)
r[i] = Integer.parseInt(sc.next());;
//res???max-min???????????????(???????????????mini?????´??°??§???????????¨???????????????)
int res = r[1] - r[0];
int mini = r[0];
for (j=1; j<n; j++) {
if (res < r[j] - mini) res = r[j] - mini;
if (r[j] < mini) mini = r[j];
}
System.out.println(res);
}
}
/*
//O(n^2):TLE
int res = r[1] - r[0];
for (i=0; i<n-1; i++)
for (j=i+1; j<n; j++)
res = (res < r[j] - r[i]) ? r[j] - r[i] : res;
printf("%d\n", res);
*/
/*
//WA(mini???????¨??????´??°?????????maxj-mini????????????????????¨?????????)
int maxj = r[1];
int mini = r[0];
for (j=1; j<n; j++) {
if (maxj-mini < r[j]-mini) {
maxj = r[j];
if (j < n-1 && r[j] < mini) mini = r[j];
}
// if (j < n-1 && r[j] < mini) mini = r[j];
}
printf("%d\n", maxj-mini);
*/ |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
41,
13,
2,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
75,
5
],
[
75,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
19,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
39,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
39,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
6,
72
],
[
72,
73
],
[
0,
74
],
[
74,
75
],
[
74,
76
]
] | [
"import java.util.*;\npublic class Main {\n\n public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int max_profit = Integer.MIN_VALUE;\n int min = Integer.MAX_VALUE;\n for (int i = 0; i < n; ++i)\n {\n int data = sc.nextInt();\n int profit = data - min;\n if (profit > max_profit)\n {\n max_profit = profit;\n }\n if (data < min)\n {\n min = data;\n }\n }\n System.out.println(max_profit);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int max_profit = Integer.MIN_VALUE;\n int min = Integer.MAX_VALUE;\n for (int i = 0; i < n; ++i)\n {\n int data = sc.nextInt();\n int profit = data - min;\n if (profit > max_profit)\n {\n max_profit = profit;\n }\n if (data < min)\n {\n min = data;\n }\n }\n System.out.println(max_profit);\n }\n}",
"Main",
"public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int max_profit = Integer.MIN_VALUE;\n int min = Integer.MAX_VALUE;\n for (int i = 0; i < n; ++i)\n {\n int data = sc.nextInt();\n int profit = data - min;\n if (profit > max_profit)\n {\n max_profit = profit;\n }\n if (data < min)\n {\n min = data;\n }\n }\n System.out.println(max_profit);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int max_profit = Integer.MIN_VALUE;\n int min = Integer.MAX_VALUE;\n for (int i = 0; i < n; ++i)\n {\n int data = sc.nextInt();\n int profit = data - min;\n if (profit > max_profit)\n {\n max_profit = profit;\n }\n if (data < min)\n {\n min = data;\n }\n }\n System.out.println(max_profit);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int max_profit = Integer.MIN_VALUE;",
"max_profit",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"int min = Integer.MAX_VALUE;",
"min",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"for (int i = 0; i < n; ++i)\n {\n int data = sc.nextInt();\n int profit = data - min;\n if (profit > max_profit)\n {\n max_profit = profit;\n }\n if (data < min)\n {\n min = data;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"++i",
"++i",
"i",
"{\n int data = sc.nextInt();\n int profit = data - min;\n if (profit > max_profit)\n {\n max_profit = profit;\n }\n if (data < min)\n {\n min = data;\n }\n }",
"{\n int data = sc.nextInt();\n int profit = data - min;\n if (profit > max_profit)\n {\n max_profit = profit;\n }\n if (data < min)\n {\n min = data;\n }\n }",
"int data = sc.nextInt();",
"data",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int profit = data - min;",
"profit",
"data - min",
"data",
"min",
"if (profit > max_profit)\n {\n max_profit = profit;\n }",
"profit > max_profit",
"profit",
"max_profit",
"{\n max_profit = profit;\n }",
"max_profit = profit",
"max_profit",
"profit",
"if (data < min)\n {\n min = data;\n }",
"data < min",
"data",
"min",
"{\n min = data;\n }",
"min = data",
"min",
"data",
"System.out.println(max_profit)",
"System.out.println",
"System.out",
"System",
"System.out",
"max_profit",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int max_profit = Integer.MIN_VALUE;\n int min = Integer.MAX_VALUE;\n for (int i = 0; i < n; ++i)\n {\n int data = sc.nextInt();\n int profit = data - min;\n if (profit > max_profit)\n {\n max_profit = profit;\n }\n if (data < min)\n {\n min = data;\n }\n }\n System.out.println(max_profit);\n }\n}",
"public class Main {\n\n public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int max_profit = Integer.MIN_VALUE;\n int min = Integer.MAX_VALUE;\n for (int i = 0; i < n; ++i)\n {\n int data = sc.nextInt();\n int profit = data - min;\n if (profit > max_profit)\n {\n max_profit = profit;\n }\n if (data < min)\n {\n min = data;\n }\n }\n System.out.println(max_profit);\n }\n}",
"Main"
] | import java.util.*;
public class Main {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int max_profit = Integer.MIN_VALUE;
int min = Integer.MAX_VALUE;
for (int i = 0; i < n; ++i)
{
int data = sc.nextInt();
int profit = data - min;
if (profit > max_profit)
{
max_profit = profit;
}
if (data < min)
{
min = data;
}
}
System.out.println(max_profit);
}
} |
[
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,
2,
18,
13,
17,
18,
13,
17,
41,
13,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
2,
18,
13,
13,
13,
0,
13,
2,
18,
13,
13,
13,
14,
2,
18,
13,
13,
13,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
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
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
68,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
78,
82
],
[
67,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
83,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
8,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
6,
101
],
[
101,
102
]
] | [
"import java.util.Scanner;\nclass Main{\n public static void main(String[]arge){\n Scanner sc=new Scanner(System.in);\n \n int n=sc.nextInt(); \n int[] R = new int[n];\n \n for(int i=0; i<n; i++){\n R[i]=sc.nextInt();\n } \n int answer=R[1]-R[0];\n int min=R[0];\n for(int i=1; i<n; i++){\n \n if(answer<R[i] - min)\n answer=R[i]-min;\n if(R[i]<min){\n min=R[i];\n }\n \n \n }\n System.out.println(answer);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n public static void main(String[]arge){\n Scanner sc=new Scanner(System.in);\n \n int n=sc.nextInt(); \n int[] R = new int[n];\n \n for(int i=0; i<n; i++){\n R[i]=sc.nextInt();\n } \n int answer=R[1]-R[0];\n int min=R[0];\n for(int i=1; i<n; i++){\n \n if(answer<R[i] - min)\n answer=R[i]-min;\n if(R[i]<min){\n min=R[i];\n }\n \n \n }\n System.out.println(answer);\n }\n}",
"Main",
"public static void main(String[]arge){\n Scanner sc=new Scanner(System.in);\n \n int n=sc.nextInt(); \n int[] R = new int[n];\n \n for(int i=0; i<n; i++){\n R[i]=sc.nextInt();\n } \n int answer=R[1]-R[0];\n int min=R[0];\n for(int i=1; i<n; i++){\n \n if(answer<R[i] - min)\n answer=R[i]-min;\n if(R[i]<min){\n min=R[i];\n }\n \n \n }\n System.out.println(answer);\n }",
"main",
"{\n Scanner sc=new Scanner(System.in);\n \n int n=sc.nextInt(); \n int[] R = new int[n];\n \n for(int i=0; i<n; i++){\n R[i]=sc.nextInt();\n } \n int answer=R[1]-R[0];\n int min=R[0];\n for(int i=1; i<n; i++){\n \n if(answer<R[i] - min)\n answer=R[i]-min;\n if(R[i]<min){\n min=R[i];\n }\n \n \n }\n System.out.println(answer);\n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] R = new int[n];",
"R",
"new int[n]",
"n",
"for(int i=0; i<n; i++){\n R[i]=sc.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n R[i]=sc.nextInt();\n }",
"{\n R[i]=sc.nextInt();\n }",
"R[i]=sc.nextInt()",
"R[i]",
"R",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int answer=R[1]-R[0];",
"answer",
"R[1]-R[0]",
"R[1]",
"R",
"1",
"R[0]",
"R",
"0",
"int min=R[0];",
"min",
"R[0]",
"R",
"0",
"for(int i=1; i<n; i++){\n \n if(answer<R[i] - min)\n answer=R[i]-min;\n if(R[i]<min){\n min=R[i];\n }\n \n \n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n \n if(answer<R[i] - min)\n answer=R[i]-min;\n if(R[i]<min){\n min=R[i];\n }\n \n \n }",
"{\n \n if(answer<R[i] - min)\n answer=R[i]-min;\n if(R[i]<min){\n min=R[i];\n }\n \n \n }",
"if(answer<R[i] - min)\n answer=R[i]-min;",
"answer<R[i] - min",
"answer",
"R[i] - min",
"R[i]",
"R",
"i",
"min",
"answer=R[i]-min",
"answer",
"R[i]-min",
"R[i]",
"R",
"i",
"min",
"if(R[i]<min){\n min=R[i];\n }",
"R[i]<min",
"R[i]",
"R",
"i",
"min",
"{\n min=R[i];\n }",
"min=R[i]",
"min",
"R[i]",
"R",
"i",
"System.out.println(answer)",
"System.out.println",
"System.out",
"System",
"System.out",
"answer",
"String[]arge",
"arge"
] | import java.util.Scanner;
class Main{
public static void main(String[]arge){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int[] R = new int[n];
for(int i=0; i<n; i++){
R[i]=sc.nextInt();
}
int answer=R[1]-R[0];
int min=R[0];
for(int i=1; i<n; i++){
if(answer<R[i] - min)
answer=R[i]-min;
if(R[i]<min){
min=R[i];
}
}
System.out.println(answer);
}
} |
[
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,
20,
13,
11,
1,
41,
13,
2,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
14,
2,
13,
2,
13,
17,
30,
0,
18,
13,
13,
18,
13,
13,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
2,
13,
17,
18,
13,
13,
41,
13,
2,
18,
13,
17,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
2,
18,
13,
2,
13,
17,
18,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
141,
5
],
[
141,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
45,
52
],
[
52,
53
],
[
52,
54
],
[
45,
55
],
[
55,
56
],
[
56,
57
],
[
45,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
63,
65
],
[
60,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
71,
73
],
[
60,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
87,
89
],
[
8,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
96,
98
],
[
8,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
99,
109
],
[
109,
110
],
[
110,
111
],
[
99,
112
],
[
113,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
116,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
123,
125
],
[
120,
126
],
[
126,
127
],
[
126,
128
],
[
8,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
8,
135
],
[
135,
136
],
[
136,
137
],
[
6,
138
],
[
138,
139
],
[
0,
140
],
[
140,
141
],
[
140,
142
]
] | [
"import 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[] data = new int[n];\n\n \tfor (int i = 0; i < n; i++) {\n \t\tdata[i] = sc.nextInt();\n \t}\n\n \t// i以降の最大値を保持\n \tint[] dataMax = new int[n];\n \tfor (int i = n - 1; i >= 0; i--) {\n \t\tif (i == n - 1) {\n \t\t\tdataMax[i] = data[i];\n \t\t} else {\n \t\t\tdataMax[i] = Math.max(dataMax[i + 1], data[i]);\n \t\t}\n \t}\n\n \tint max_profit = data[1] - data[0];\n \tfor (int i = 0; i < n - 1; i++) {\n// \t\tif (i == 0 || data[i - 1] > data[i]) {\n \t\t\tmax_profit = Math.max(max_profit, dataMax[i + 1] - data[i]);\n// \t\t}\n \t}\n\t\t\n \tSystem.out.println(max_profit);\n \t\n sc.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public 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[] data = new int[n];\n\n \tfor (int i = 0; i < n; i++) {\n \t\tdata[i] = sc.nextInt();\n \t}\n\n \t// i以降の最大値を保持\n \tint[] dataMax = new int[n];\n \tfor (int i = n - 1; i >= 0; i--) {\n \t\tif (i == n - 1) {\n \t\t\tdataMax[i] = data[i];\n \t\t} else {\n \t\t\tdataMax[i] = Math.max(dataMax[i + 1], data[i]);\n \t\t}\n \t}\n\n \tint max_profit = data[1] - data[0];\n \tfor (int i = 0; i < n - 1; i++) {\n// \t\tif (i == 0 || data[i - 1] > data[i]) {\n \t\t\tmax_profit = Math.max(max_profit, dataMax[i + 1] - data[i]);\n// \t\t}\n \t}\n\t\t\n \tSystem.out.println(max_profit);\n \t\n sc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in); \n\n\t\tint n = sc.nextInt();\n\t\tint[] data = new int[n];\n\n \tfor (int i = 0; i < n; i++) {\n \t\tdata[i] = sc.nextInt();\n \t}\n\n \t// i以降の最大値を保持\n \tint[] dataMax = new int[n];\n \tfor (int i = n - 1; i >= 0; i--) {\n \t\tif (i == n - 1) {\n \t\t\tdataMax[i] = data[i];\n \t\t} else {\n \t\t\tdataMax[i] = Math.max(dataMax[i + 1], data[i]);\n \t\t}\n \t}\n\n \tint max_profit = data[1] - data[0];\n \tfor (int i = 0; i < n - 1; i++) {\n// \t\tif (i == 0 || data[i - 1] > data[i]) {\n \t\t\tmax_profit = Math.max(max_profit, dataMax[i + 1] - data[i]);\n// \t\t}\n \t}\n\t\t\n \tSystem.out.println(max_profit);\n \t\n sc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in); \n\n\t\tint n = sc.nextInt();\n\t\tint[] data = new int[n];\n\n \tfor (int i = 0; i < n; i++) {\n \t\tdata[i] = sc.nextInt();\n \t}\n\n \t// i以降の最大値を保持\n \tint[] dataMax = new int[n];\n \tfor (int i = n - 1; i >= 0; i--) {\n \t\tif (i == n - 1) {\n \t\t\tdataMax[i] = data[i];\n \t\t} else {\n \t\t\tdataMax[i] = Math.max(dataMax[i + 1], data[i]);\n \t\t}\n \t}\n\n \tint max_profit = data[1] - data[0];\n \tfor (int i = 0; i < n - 1; i++) {\n// \t\tif (i == 0 || data[i - 1] > data[i]) {\n \t\t\tmax_profit = Math.max(max_profit, dataMax[i + 1] - data[i]);\n// \t\t}\n \t}\n\t\t\n \tSystem.out.println(max_profit);\n \t\n sc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] data = new int[n];",
"data",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n \t\tdata[i] = sc.nextInt();\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n \t\tdata[i] = sc.nextInt();\n \t}",
"{\n \t\tdata[i] = sc.nextInt();\n \t}",
"data[i] = sc.nextInt()",
"data[i]",
"data",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] dataMax = new int[n];",
"dataMax",
"new int[n]",
"n",
"for (int i = n - 1; i >= 0; i--) {\n \t\tif (i == n - 1) {\n \t\t\tdataMax[i] = data[i];\n \t\t} else {\n \t\t\tdataMax[i] = Math.max(dataMax[i + 1], data[i]);\n \t\t}\n \t}",
"int i = n - 1;",
"int i = n - 1;",
"i",
"n - 1",
"n",
"1",
"i >= 0",
"i",
"0",
"i--",
"i--",
"i",
"{\n \t\tif (i == n - 1) {\n \t\t\tdataMax[i] = data[i];\n \t\t} else {\n \t\t\tdataMax[i] = Math.max(dataMax[i + 1], data[i]);\n \t\t}\n \t}",
"{\n \t\tif (i == n - 1) {\n \t\t\tdataMax[i] = data[i];\n \t\t} else {\n \t\t\tdataMax[i] = Math.max(dataMax[i + 1], data[i]);\n \t\t}\n \t}",
"if (i == n - 1) {\n \t\t\tdataMax[i] = data[i];\n \t\t} else {\n \t\t\tdataMax[i] = Math.max(dataMax[i + 1], data[i]);\n \t\t}",
"i == n - 1",
"i",
"n - 1",
"n",
"1",
"{\n \t\t\tdataMax[i] = data[i];\n \t\t}",
"dataMax[i] = data[i]",
"dataMax[i]",
"dataMax",
"i",
"data[i]",
"data",
"i",
"{\n \t\t\tdataMax[i] = Math.max(dataMax[i + 1], data[i]);\n \t\t}",
"dataMax[i] = Math.max(dataMax[i + 1], data[i])",
"dataMax[i]",
"dataMax",
"i",
"Math.max(dataMax[i + 1], data[i])",
"Math.max",
"Math",
"dataMax[i + 1]",
"dataMax",
"i + 1",
"i",
"1",
"data[i]",
"data",
"i",
"int max_profit = data[1] - data[0];",
"max_profit",
"data[1] - data[0]",
"data[1]",
"data",
"1",
"data[0]",
"data",
"0",
"for (int i = 0; i < n - 1; i++) {\n// \t\tif (i == 0 || data[i - 1] > data[i]) {\n \t\t\tmax_profit = Math.max(max_profit, dataMax[i + 1] - data[i]);\n// \t\t}\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"i++",
"i++",
"i",
"{\n// \t\tif (i == 0 || data[i - 1] > data[i]) {\n \t\t\tmax_profit = Math.max(max_profit, dataMax[i + 1] - data[i]);\n// \t\t}\n \t}",
"{\n// \t\tif (i == 0 || data[i - 1] > data[i]) {\n \t\t\tmax_profit = Math.max(max_profit, dataMax[i + 1] - data[i]);\n// \t\t}\n \t}",
"max_profit = Math.max(max_profit, dataMax[i + 1] - data[i])",
"max_profit",
"Math.max(max_profit, dataMax[i + 1] - data[i])",
"Math.max",
"Math",
"max_profit",
"dataMax[i + 1] - data[i]",
"dataMax[i + 1]",
"dataMax",
"i + 1",
"i",
"1",
"data[i]",
"data",
"i",
"System.out.println(max_profit)",
"System.out.println",
"System.out",
"System",
"System.out",
"max_profit",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public 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[] data = new int[n];\n\n \tfor (int i = 0; i < n; i++) {\n \t\tdata[i] = sc.nextInt();\n \t}\n\n \t// i以降の最大値を保持\n \tint[] dataMax = new int[n];\n \tfor (int i = n - 1; i >= 0; i--) {\n \t\tif (i == n - 1) {\n \t\t\tdataMax[i] = data[i];\n \t\t} else {\n \t\t\tdataMax[i] = Math.max(dataMax[i + 1], data[i]);\n \t\t}\n \t}\n\n \tint max_profit = data[1] - data[0];\n \tfor (int i = 0; i < n - 1; i++) {\n// \t\tif (i == 0 || data[i - 1] > data[i]) {\n \t\t\tmax_profit = Math.max(max_profit, dataMax[i + 1] - data[i]);\n// \t\t}\n \t}\n\t\t\n \tSystem.out.println(max_profit);\n \t\n sc.close();\n\t}\n}",
"public 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[] data = new int[n];\n\n \tfor (int i = 0; i < n; i++) {\n \t\tdata[i] = sc.nextInt();\n \t}\n\n \t// i以降の最大値を保持\n \tint[] dataMax = new int[n];\n \tfor (int i = n - 1; i >= 0; i--) {\n \t\tif (i == n - 1) {\n \t\t\tdataMax[i] = data[i];\n \t\t} else {\n \t\t\tdataMax[i] = Math.max(dataMax[i + 1], data[i]);\n \t\t}\n \t}\n\n \tint max_profit = data[1] - data[0];\n \tfor (int i = 0; i < n - 1; i++) {\n// \t\tif (i == 0 || data[i - 1] > data[i]) {\n \t\t\tmax_profit = Math.max(max_profit, dataMax[i + 1] - data[i]);\n// \t\t}\n \t}\n\t\t\n \tSystem.out.println(max_profit);\n \t\n sc.close();\n\t}\n}",
"Main"
] | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] data = new int[n];
for (int i = 0; i < n; i++) {
data[i] = sc.nextInt();
}
// i以降の最大値を保持
int[] dataMax = new int[n];
for (int i = n - 1; i >= 0; i--) {
if (i == n - 1) {
dataMax[i] = data[i];
} else {
dataMax[i] = Math.max(dataMax[i + 1], data[i]);
}
}
int max_profit = data[1] - data[0];
for (int i = 0; i < n - 1; i++) {
// if (i == 0 || data[i - 1] > data[i]) {
max_profit = Math.max(max_profit, dataMax[i + 1] - data[i]);
// }
}
System.out.println(max_profit);
sc.close();
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.