node_ids listlengths 4 1.4k | edge_index listlengths 1 2.22k | text listlengths 4 1.4k | source stringlengths 14 427k |
|---|---|---|---|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
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,
... | [
[
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
],... | [
"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... | 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... |
[
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... | [
[
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
... | [
"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]... | 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++) {
... |
[
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,
1... | [
[
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
],
... | [
"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\tmax... | 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... |
[
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... | [
[
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... | [
"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 = ... | 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];
... |
[
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,
... | [
[
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
],... | [
"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 ... | 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 =... |
[
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,... | [
[
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
],
... | [
"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; ... | 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 = ... |
[
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,... | [
[
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
],... | [
"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.read... | 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());
... |
[
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,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.*;\n\nclass Main {\n\tpublic static void main(String[] args) {\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint n = stdIn.nextInt();\n\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);... | 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);
}
... |
[
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,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.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 ... | 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 = ... |
[
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,
1... | [
[
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
],
... | [
"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 BufferedReade... | 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 InputStrea... |
[
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... | [
[
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
],... | [
"\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(ne... |
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(... |
[
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... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.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;... | 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;
doubl... |
[
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,
... | [
[
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
],
... | [
"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... | 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;
... |
[
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,
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
],
... | [
"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... | 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.nextI... |
[
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,
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
],
... | [
"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... | 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;
... |
[
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... | [
[
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
],... | [
"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... | 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 ... |
[
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,
... | [
[
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
],
... | [
"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\")));... | 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.next... |
[
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,
... | [
[
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
]... | [
"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);\... | 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... |
[
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... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.io.*;\nimport java.util.*;\n\nclass Main{\n 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 me... | 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] = Inte... |
[
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,
... | [
[
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
],... | [
"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<... | 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++){
... |
[
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,
... | [
[
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
],
... | [
"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.n... | 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();
... |
[
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,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.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... | 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... |
[
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... | [
[
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
... | [
"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... | 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 = In... |
[
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... | [
[
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
],... | [
"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());... | 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... |
[
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... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
12,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\n\nclass Main{\n\n 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 = ne... | 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];
... |
[
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... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.*;\n\nclass Main{\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n 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 ... | 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 = -200... |
[
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,
... | [
[
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
],
... | [
"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.nextI... | 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();
... |
[
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,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.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 in... | 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(... |
[
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,
1... | [
[
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
],... | [
"/**\n * ?????§?????????\n * FX????????§????????°?????????????????¨????????????????????¨??§????????????????????????????????¨?????§????????????????????°????????????100???????????? 1000???????????????????????????????????? 1?????? 108???????????£??????????£??????¨???(108??? ?????? 100???) ???? 1000?????? == 8000??????... | /**
* ?????§?????????
* FX????????§????????°?????????????????¨????????????????????¨??§????????????????????????????????¨?????§????????????????????°????????????100???????????? 1000???????????????????????????????????? 1?????? 108???????????£??????????£??????¨???(108??? ?????? 100???) ???? 1000?????? == 8000?????????????... |
[
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,
1... | [
[
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
],... | [
"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();\... | 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();
}
... |
[
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... | [
[
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
],... | [
"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();\... | 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... |
[
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,
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
],... | [
"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\tmin... | 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<... |
[
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... | [
[
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
],... | [
"\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\... |
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;... |
[
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,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.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 Buffer... | 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
Input... |
[
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,
... | [
[
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
],
... | [
"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\tin... | 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... |
[
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,... | [
[
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
],... | [
"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.... | 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.nextLi... |
[
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,
... | [
[
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
],
... | [
"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 Ri... | 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.nex... |
[
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,
1... | [
[
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
],
... | [
"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());... | 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... |
[
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,
1... | [
[
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
],
[... | [
"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 stat... | 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=... |
[
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,
4... | [
[
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
... | [
"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; ... | 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] - ... |
[
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,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.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 ... | 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());
}
... |
[
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... | [
[
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
... | [
"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=... | 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[... |
[
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... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.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 in... | 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.M... |
[
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... | [
[
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
],... | [
"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... | 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 mi... |
[
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,
1... | [
[
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
],
... | [
"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 ... | 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;... |
[
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,
1... | [
[
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
... | [
"\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 \t... |
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()... |
[
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... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.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++... | 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=... |
[
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,
... | [
[
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
],
... | [
"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... | 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;
... |
[
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,
... | [
[
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
],
... | [
"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... | 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+... |
[
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,... | [
[
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
],
... | [
"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\ti... | 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 ... |
[
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... | [
[
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
],
... | [
"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\... | 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 < ... |
[
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,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.*;\n\nclass Main{\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n 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 ... | 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++){
m... |
[
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,
... | [
[
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
],
... | [
"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=I... | 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(l... |
[
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,
... | [
[
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
],... | [
"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\t... | 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;... |
[
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... | [
[
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
],... | [
"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 in... | 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;
... |
[
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... | [
[
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
... | [
"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... | 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 vo... |
[
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,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.*;\n\nclass Main {\n\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);... | 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);
... |
[
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,... | [
[
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
],... | [
"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 = ... | 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();
... |
[
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,
... | [
[
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
],
... | [
"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 ... | 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 ... |
[
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,
... | [
[
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
],... | [
"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] = s... | 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... |
[
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,
... | [
[
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
],
... | [
"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... | 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(a... |
[
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,
1... | [
[
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
],
... | [
"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 i... | 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 pu... |
[
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,... | [
[
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
],... | [
"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.n... | 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 =... |
[
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,
... | [
[
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
],
... | [
"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 ... | 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.nextI... |
[
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,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.*;\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... | 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... |
[
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,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.util.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<Intege... | 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.getValueLine... |
[
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... | [
[
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
],
... | [
"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 ... | 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 = Ma... |
[
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,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.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 ... | 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++... |
[
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... | [
[
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
],... | [
"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 ... | 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]... |
[
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,... | [
[
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
],
... | [
"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.ne... | 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();
}
... |
[
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... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\n \npublic class Main {\n\tpublic void exec() throws IOException {\n InputUtil in = new InputUtil();\n PrintWriter out = new PrintWriter(System.out)... | 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... |
[
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,
... | [
[
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
]... | [
"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 ma... | 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];
... |
[
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... | [
[
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
],... | [
"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\... | 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>... |
[
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,
... | [
[
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
],... | [
"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+... | 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++) {
... |
[
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,
... | [
[
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
],
... | [
"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 ... | 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{
... |
[
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,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"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 ... | 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();
... |
[
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,... | [
[
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
],
... | [
"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... | 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=Ma... |
[
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,
... | [
[
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
],
... | [
"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; ... | 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++) {
... |
[
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,... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
110,
5
],
[
110,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],... | [
"import java.util.*;\npublic class Main{\n 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 ... | 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 ... |
[
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,
... | [
[
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
],... | [
"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]=... | 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... |
[
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,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.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\... | 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.p... |
[
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... | [
[
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
],... | [
"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... | 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... |
[
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,
... | [
[
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
],
... | [
"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 (in... | 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 < ... |
[
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,
... | [
[
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
],
... | [
"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... | 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... |
[
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,
... | [
[
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
],
... | [
"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\tf... | 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++) {
... |
[
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,
... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.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(... | 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 IOExceptio... |
[
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,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.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 ... | 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 = -100... |
[
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,... | [
[
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
],... | [
"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(... | 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] = sca... |
[
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,... | [
[
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
],
... | [
"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 <... | 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... |
[
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,
... | [
[
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
],
... | [
"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 ... | 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... |
[
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,
... | [
[
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
],
... | [
"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 - m... | 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)
... |
[
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... | [
[
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
],... | [
"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= Int... | 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... |
[
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,... | [
[
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
],... | [
"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... | 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())... |
[
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,... | [
[
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
],
... | [
"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 maxValueCa... | 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 (ma... |
[
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... | [
[
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,
1... | [
"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 = -10000000... | 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);
fo... |
[
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,... | [
[
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
],
... | [
"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;\... | 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... |
[
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,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
... | [
"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());;\... | 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[] = n... |
[
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,
3... | [
[
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
],
... | [
"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 ... | 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.ne... |
[
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,
1... | [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[... | [
"import java.util.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 answe... | 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];
... |
[
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,... | [
[
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
],... | [
"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[] d... | 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 (in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.