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,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
72,
5
],
[
72,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
28,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
40,
46
],
[
46,
47
],
[
46,
48
],
[
8,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
8,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
6,
69
],
[
69,
70
],
[
0,
71
],
[
71,
72
],
[
71,
73
]
] |
[
"import java.util.*;\n\npublic class Main {\npublic static void main(String[] args){\nScanner sc = new Scanner(System.in);\n \n// 整数の入力\nint days = sc.nextInt();\nint homeworks = sc.nextInt();\nint sum = 0;\nint temp =0;\n for (int i=0;i<homeworks;i++){\n temp = sc.nextInt();\n sum += temp;\n }\n \n int result = days- sum;\n if (result < 0){\n result = -1;\n }\nSystem.out.println(result);\n}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\npublic static void main(String[] args){\nScanner sc = new Scanner(System.in);\n \n// 整数の入力\nint days = sc.nextInt();\nint homeworks = sc.nextInt();\nint sum = 0;\nint temp =0;\n for (int i=0;i<homeworks;i++){\n temp = sc.nextInt();\n sum += temp;\n }\n \n int result = days- sum;\n if (result < 0){\n result = -1;\n }\nSystem.out.println(result);\n}\n}",
"Main",
"public static void main(String[] args){\nScanner sc = new Scanner(System.in);\n \n// 整数の入力\nint days = sc.nextInt();\nint homeworks = sc.nextInt();\nint sum = 0;\nint temp =0;\n for (int i=0;i<homeworks;i++){\n temp = sc.nextInt();\n sum += temp;\n }\n \n int result = days- sum;\n if (result < 0){\n result = -1;\n }\nSystem.out.println(result);\n}",
"main",
"{\nScanner sc = new Scanner(System.in);\n \n// 整数の入力\nint days = sc.nextInt();\nint homeworks = sc.nextInt();\nint sum = 0;\nint temp =0;\n for (int i=0;i<homeworks;i++){\n temp = sc.nextInt();\n sum += temp;\n }\n \n int result = days- sum;\n if (result < 0){\n result = -1;\n }\nSystem.out.println(result);\n}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int days = sc.nextInt();",
"days",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int homeworks = sc.nextInt();",
"homeworks",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"int temp =0;",
"temp",
"0",
"for (int i=0;i<homeworks;i++){\n temp = sc.nextInt();\n sum += temp;\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<homeworks",
"i",
"homeworks",
"i++",
"i++",
"i",
"{\n temp = sc.nextInt();\n sum += temp;\n }",
"{\n temp = sc.nextInt();\n sum += temp;\n }",
"temp = sc.nextInt()",
"temp",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum += temp",
"sum",
"temp",
"int result = days- sum;",
"result",
"days- sum",
"days",
"sum",
"if (result < 0){\n result = -1;\n }",
"result < 0",
"result",
"0",
"{\n result = -1;\n }",
"result = -1",
"result",
"-1",
"1",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main {\npublic static void main(String[] args){\nScanner sc = new Scanner(System.in);\n \n// 整数の入力\nint days = sc.nextInt();\nint homeworks = sc.nextInt();\nint sum = 0;\nint temp =0;\n for (int i=0;i<homeworks;i++){\n temp = sc.nextInt();\n sum += temp;\n }\n \n int result = days- sum;\n if (result < 0){\n result = -1;\n }\nSystem.out.println(result);\n}\n}",
"public class Main {\npublic static void main(String[] args){\nScanner sc = new Scanner(System.in);\n \n// 整数の入力\nint days = sc.nextInt();\nint homeworks = sc.nextInt();\nint sum = 0;\nint temp =0;\n for (int i=0;i<homeworks;i++){\n temp = sc.nextInt();\n sum += temp;\n }\n \n int result = days- sum;\n if (result < 0){\n result = -1;\n }\nSystem.out.println(result);\n}\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
// 整数の入力
int days = sc.nextInt();
int homeworks = sc.nextInt();
int sum = 0;
int temp =0;
for (int i=0;i<homeworks;i++){
temp = sc.nextInt();
sum += temp;
}
int result = days- sum;
if (result < 0){
result = -1;
}
System.out.println(result);
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
0,
13,
20,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
13,
4,
18,
18,
13,
13,
4,
18,
13,
2,
13,
13,
40,
17,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
13,
29,
4,
18,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
110,
5
],
[
110,
6
],
[
6,
7
],
[
110,
8
],
[
8,
9
],
[
8,
10
],
[
10,
11
],
[
11,
12
],
[
11,
13
],
[
10,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
10,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
10,
22
],
[
22,
23
],
[
22,
24
],
[
10,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
10,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
50,
52
],
[
47,
53
],
[
53,
54
],
[
8,
55
],
[
55,
56
],
[
110,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
59,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
57,
70
],
[
70,
71
],
[
110,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
110,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
86,
87
],
[
87,
88
],
[
110,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
96,
97
],
[
97,
98
],
[
110,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
106,
107
],
[
107,
108
],
[
0,
109
],
[
109,
110
],
[
109,
111
]
] |
[
"\nimport java.util.Scanner;\n\npublic class Main {\n\n\tstatic Scanner scanner;\n\n\tpublic static void main(String[] args) {\n\t scanner = new Scanner(System.in);\n\n int N=gi();\n int M=gi();\n \n long s=0;\n for (int i=0; i<M;i++) {\n \ts+=gi();\n }\n\n System.out.println(Math.max(N-s, -1));\n\t}\n\n\n\tpublic static long d(long n) {\n\t\tString a=String.valueOf(n);\n\t\treturn (long)a.length();\n\t}\n\n\t// 文字列として入力を取得\n\tpublic static String gs() {\n\t\treturn scanner.next();\n\t}\n\n\t// intとして入力を取得\n\tpublic static int gi() {\n\t\treturn Integer.parseInt(scanner.next());\n\t}\n\n\t// longとして入力を取得\n\tpublic static long gl() {\n\t\treturn Long.parseLong(scanner.next());\n\t}\n\n\t// doubleとして入力を取得\n\tpublic static double gd() {\n\t\treturn Double.parseDouble(scanner.next());\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tstatic Scanner scanner;\n\n\tpublic static void main(String[] args) {\n\t scanner = new Scanner(System.in);\n\n int N=gi();\n int M=gi();\n \n long s=0;\n for (int i=0; i<M;i++) {\n \ts+=gi();\n }\n\n System.out.println(Math.max(N-s, -1));\n\t}\n\n\n\tpublic static long d(long n) {\n\t\tString a=String.valueOf(n);\n\t\treturn (long)a.length();\n\t}\n\n\t// 文字列として入力を取得\n\tpublic static String gs() {\n\t\treturn scanner.next();\n\t}\n\n\t// intとして入力を取得\n\tpublic static int gi() {\n\t\treturn Integer.parseInt(scanner.next());\n\t}\n\n\t// longとして入力を取得\n\tpublic static long gl() {\n\t\treturn Long.parseLong(scanner.next());\n\t}\n\n\t// doubleとして入力を取得\n\tpublic static double gd() {\n\t\treturn Double.parseDouble(scanner.next());\n\t}\n}",
"Main",
"static Scanner scanner;",
"scanner",
"public static void main(String[] args) {\n\t scanner = new Scanner(System.in);\n\n int N=gi();\n int M=gi();\n \n long s=0;\n for (int i=0; i<M;i++) {\n \ts+=gi();\n }\n\n System.out.println(Math.max(N-s, -1));\n\t}",
"main",
"{\n\t scanner = new Scanner(System.in);\n\n int N=gi();\n int M=gi();\n \n long s=0;\n for (int i=0; i<M;i++) {\n \ts+=gi();\n }\n\n System.out.println(Math.max(N-s, -1));\n\t}",
"scanner = new Scanner(System.in)",
"scanner",
"new Scanner(System.in)",
"int N=gi();",
"N",
"gi()",
"gi",
"int M=gi();",
"M",
"gi()",
"gi",
"long s=0;",
"s",
"0",
"for (int i=0; i<M;i++) {\n \ts+=gi();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n \ts+=gi();\n }",
"{\n \ts+=gi();\n }",
"s+=gi()",
"s",
"gi()",
"gi",
"System.out.println(Math.max(N-s, -1))",
"System.out.println",
"System.out",
"System",
"System.out",
"Math.max(N-s, -1)",
"Math.max",
"Math",
"N-s",
"N",
"s",
"-1",
"1",
"String[] args",
"args",
"public static long d(long n) {\n\t\tString a=String.valueOf(n);\n\t\treturn (long)a.length();\n\t}",
"d",
"{\n\t\tString a=String.valueOf(n);\n\t\treturn (long)a.length();\n\t}",
"String a=String.valueOf(n);",
"a",
"String.valueOf(n)",
"String.valueOf",
"String",
"n",
"return (long)a.length();",
"(long)a.length()",
"a.length",
"a",
"long n",
"n",
"// 文字列として入力を取得\n\tpublic static String gs() {\n\t\treturn scanner.next();\n\t}",
"gs",
"{\n\t\treturn scanner.next();\n\t}",
"return scanner.next();",
"scanner.next()",
"scanner.next",
"scanner",
"// intとして入力を取得\n\tpublic static int gi() {\n\t\treturn Integer.parseInt(scanner.next());\n\t}",
"gi",
"{\n\t\treturn Integer.parseInt(scanner.next());\n\t}",
"return Integer.parseInt(scanner.next());",
"Integer.parseInt(scanner.next())",
"Integer.parseInt",
"Integer",
"scanner.next()",
"scanner.next",
"scanner",
"// longとして入力を取得\n\tpublic static long gl() {\n\t\treturn Long.parseLong(scanner.next());\n\t}",
"gl",
"{\n\t\treturn Long.parseLong(scanner.next());\n\t}",
"return Long.parseLong(scanner.next());",
"Long.parseLong(scanner.next())",
"Long.parseLong",
"Long",
"scanner.next()",
"scanner.next",
"scanner",
"// doubleとして入力を取得\n\tpublic static double gd() {\n\t\treturn Double.parseDouble(scanner.next());\n\t}",
"gd",
"{\n\t\treturn Double.parseDouble(scanner.next());\n\t}",
"return Double.parseDouble(scanner.next());",
"Double.parseDouble(scanner.next())",
"Double.parseDouble",
"Double",
"scanner.next()",
"scanner.next",
"scanner",
"public class Main {\n\n\tstatic Scanner scanner;\n\n\tpublic static void main(String[] args) {\n\t scanner = new Scanner(System.in);\n\n int N=gi();\n int M=gi();\n \n long s=0;\n for (int i=0; i<M;i++) {\n \ts+=gi();\n }\n\n System.out.println(Math.max(N-s, -1));\n\t}\n\n\n\tpublic static long d(long n) {\n\t\tString a=String.valueOf(n);\n\t\treturn (long)a.length();\n\t}\n\n\t// 文字列として入力を取得\n\tpublic static String gs() {\n\t\treturn scanner.next();\n\t}\n\n\t// intとして入力を取得\n\tpublic static int gi() {\n\t\treturn Integer.parseInt(scanner.next());\n\t}\n\n\t// longとして入力を取得\n\tpublic static long gl() {\n\t\treturn Long.parseLong(scanner.next());\n\t}\n\n\t// doubleとして入力を取得\n\tpublic static double gd() {\n\t\treturn Double.parseDouble(scanner.next());\n\t}\n}",
"public class Main {\n\n\tstatic Scanner scanner;\n\n\tpublic static void main(String[] args) {\n\t scanner = new Scanner(System.in);\n\n int N=gi();\n int M=gi();\n \n long s=0;\n for (int i=0; i<M;i++) {\n \ts+=gi();\n }\n\n System.out.println(Math.max(N-s, -1));\n\t}\n\n\n\tpublic static long d(long n) {\n\t\tString a=String.valueOf(n);\n\t\treturn (long)a.length();\n\t}\n\n\t// 文字列として入力を取得\n\tpublic static String gs() {\n\t\treturn scanner.next();\n\t}\n\n\t// intとして入力を取得\n\tpublic static int gi() {\n\t\treturn Integer.parseInt(scanner.next());\n\t}\n\n\t// longとして入力を取得\n\tpublic static long gl() {\n\t\treturn Long.parseLong(scanner.next());\n\t}\n\n\t// doubleとして入力を取得\n\tpublic static double gd() {\n\t\treturn Double.parseDouble(scanner.next());\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
static Scanner scanner;
public static void main(String[] args) {
scanner = new Scanner(System.in);
int N=gi();
int M=gi();
long s=0;
for (int i=0; i<M;i++) {
s+=gi();
}
System.out.println(Math.max(N-s, -1));
}
public static long d(long n) {
String a=String.valueOf(n);
return (long)a.length();
}
// 文字列として入力を取得
public static String gs() {
return scanner.next();
}
// intとして入力を取得
public static int gi() {
return Integer.parseInt(scanner.next());
}
// longとして入力を取得
public static long gl() {
return Long.parseLong(scanner.next());
}
// doubleとして入力を取得
public static double gd() {
return Double.parseDouble(scanner.next());
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
65,
5
],
[
65,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
40,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
43,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
6,
62
],
[
62,
63
],
[
0,
64
],
[
64,
65
],
[
64,
66
]
] |
[
"import java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args){\n\n//\t入力の読み込み\n\t\tScanner sc = new Scanner(System.in);\n\t\tint natsuyasumi = sc.nextInt();\n\t\tint shukudai = sc.nextInt();\n\n//\t宿題の数分、宿題やる日を夏休みから引く\n\t\tfor(int i=0 ; i<shukudai ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tnatsuyasumi -= bangou;\n\t\t}\n\n//\t遊べる日数が0日以上かどうか判断\n\t\tif(natsuyasumi>=0) {\n\t\t\tSystem.out.print(natsuyasumi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\n//\t入力の読み込み\n\t\tScanner sc = new Scanner(System.in);\n\t\tint natsuyasumi = sc.nextInt();\n\t\tint shukudai = sc.nextInt();\n\n//\t宿題の数分、宿題やる日を夏休みから引く\n\t\tfor(int i=0 ; i<shukudai ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tnatsuyasumi -= bangou;\n\t\t}\n\n//\t遊べる日数が0日以上かどうか判断\n\t\tif(natsuyasumi>=0) {\n\t\t\tSystem.out.print(natsuyasumi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\n//\t入力の読み込み\n\t\tScanner sc = new Scanner(System.in);\n\t\tint natsuyasumi = sc.nextInt();\n\t\tint shukudai = sc.nextInt();\n\n//\t宿題の数分、宿題やる日を夏休みから引く\n\t\tfor(int i=0 ; i<shukudai ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tnatsuyasumi -= bangou;\n\t\t}\n\n//\t遊べる日数が0日以上かどうか判断\n\t\tif(natsuyasumi>=0) {\n\t\t\tSystem.out.print(natsuyasumi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t}",
"main",
"{\n\n//\t入力の読み込み\n\t\tScanner sc = new Scanner(System.in);\n\t\tint natsuyasumi = sc.nextInt();\n\t\tint shukudai = sc.nextInt();\n\n//\t宿題の数分、宿題やる日を夏休みから引く\n\t\tfor(int i=0 ; i<shukudai ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tnatsuyasumi -= bangou;\n\t\t}\n\n//\t遊べる日数が0日以上かどうか判断\n\t\tif(natsuyasumi>=0) {\n\t\t\tSystem.out.print(natsuyasumi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int natsuyasumi = sc.nextInt();",
"natsuyasumi",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int shukudai = sc.nextInt();",
"shukudai",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=0 ; i<shukudai ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tnatsuyasumi -= bangou;\n\t\t}",
"int i=0 ;",
"int i=0 ;",
"i",
"0",
"i<shukudai",
"i",
"shukudai",
"i++",
"i++",
"i",
"{\n\t\t\tint bangou = sc.nextInt();\n\t\t\tnatsuyasumi -= bangou;\n\t\t}",
"{\n\t\t\tint bangou = sc.nextInt();\n\t\t\tnatsuyasumi -= bangou;\n\t\t}",
"int bangou = sc.nextInt();",
"bangou",
"sc.nextInt()",
"sc.nextInt",
"sc",
"natsuyasumi -= bangou",
"natsuyasumi",
"bangou",
"if(natsuyasumi>=0) {\n\t\t\tSystem.out.print(natsuyasumi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}",
"natsuyasumi>=0",
"natsuyasumi",
"0",
"{\n\t\t\tSystem.out.print(natsuyasumi);\n\t\t}",
"System.out.print(natsuyasumi)",
"System.out.print",
"System.out",
"System",
"System.out",
"natsuyasumi",
"{\n\t\t\tSystem.out.print(-1);\n\t\t}",
"System.out.print(-1)",
"System.out.print",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\n//\t入力の読み込み\n\t\tScanner sc = new Scanner(System.in);\n\t\tint natsuyasumi = sc.nextInt();\n\t\tint shukudai = sc.nextInt();\n\n//\t宿題の数分、宿題やる日を夏休みから引く\n\t\tfor(int i=0 ; i<shukudai ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tnatsuyasumi -= bangou;\n\t\t}\n\n//\t遊べる日数が0日以上かどうか判断\n\t\tif(natsuyasumi>=0) {\n\t\t\tSystem.out.print(natsuyasumi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\n//\t入力の読み込み\n\t\tScanner sc = new Scanner(System.in);\n\t\tint natsuyasumi = sc.nextInt();\n\t\tint shukudai = sc.nextInt();\n\n//\t宿題の数分、宿題やる日を夏休みから引く\n\t\tfor(int i=0 ; i<shukudai ; i++) {\n\t\t\tint bangou = sc.nextInt();\n\t\t\tnatsuyasumi -= bangou;\n\t\t}\n\n//\t遊べる日数が0日以上かどうか判断\n\t\tif(natsuyasumi>=0) {\n\t\t\tSystem.out.print(natsuyasumi);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.print(-1);\n\t\t}\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args){
// 入力の読み込み
Scanner sc = new Scanner(System.in);
int natsuyasumi = sc.nextInt();
int shukudai = sc.nextInt();
// 宿題の数分、宿題やる日を夏休みから引く
for(int i=0 ; i<shukudai ; i++) {
int bangou = sc.nextInt();
natsuyasumi -= bangou;
}
// 遊べる日数が0日以上かどうか判断
if(natsuyasumi>=0) {
System.out.print(natsuyasumi);
}
else {
System.out.print(-1);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
4,
18,
13,
17,
41,
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,
18,
13,
13,
0,
13,
18,
13,
13,
4,
18,
13,
8,
2,
13,
13,
2,
13,
13,
40,
17,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
103,
8
],
[
103,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
11,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
44,
49
],
[
11,
50
],
[
50,
51
],
[
50,
52
],
[
11,
54
],
[
54,
55
],
[
54,
56
],
[
11,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
62,
63
],
[
62,
64
],
[
57,
65
],
[
65,
66
],
[
66,
67
],
[
57,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
69,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
11,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
88,
92
],
[
92,
93
],
[
92,
94
],
[
88,
95
],
[
95,
96
],
[
11,
97
],
[
97,
98
],
[
98,
99
],
[
9,
100
],
[
100,
101
],
[
0,
102
],
[
102,
103
],
[
102,
104
]
] |
[
"import java.util.*;\nimport java.io.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n \n String[] input1 = br.readLine().split(\" \");\n int n = Integer.parseInt(input1[0]);\n int m = Integer.parseInt(input1[1]);\n \n String[] input2 = br.readLine().split(\" \");\n int[] cost = new int[m];\n int totalCost = 0;\n \n for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n totalCost += cost[i];\n }\n \n out.println(n >= totalCost ? n - totalCost : -1);\n out.close();\n \n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n \n String[] input1 = br.readLine().split(\" \");\n int n = Integer.parseInt(input1[0]);\n int m = Integer.parseInt(input1[1]);\n \n String[] input2 = br.readLine().split(\" \");\n int[] cost = new int[m];\n int totalCost = 0;\n \n for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n totalCost += cost[i];\n }\n \n out.println(n >= totalCost ? n - totalCost : -1);\n out.close();\n \n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n \n String[] input1 = br.readLine().split(\" \");\n int n = Integer.parseInt(input1[0]);\n int m = Integer.parseInt(input1[1]);\n \n String[] input2 = br.readLine().split(\" \");\n int[] cost = new int[m];\n int totalCost = 0;\n \n for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n totalCost += cost[i];\n }\n \n out.println(n >= totalCost ? n - totalCost : -1);\n out.close();\n \n }",
"main",
"{\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n \n String[] input1 = br.readLine().split(\" \");\n int n = Integer.parseInt(input1[0]);\n int m = Integer.parseInt(input1[1]);\n \n String[] input2 = br.readLine().split(\" \");\n int[] cost = new int[m];\n int totalCost = 0;\n \n for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n totalCost += cost[i];\n }\n \n out.println(n >= totalCost ? n - totalCost : -1);\n out.close();\n \n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));",
"out",
"new PrintWriter(new OutputStreamWriter(System.out))",
"String[] input1 = br.readLine().split(\" \");",
"input1",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int n = Integer.parseInt(input1[0]);",
"n",
"Integer.parseInt(input1[0])",
"Integer.parseInt",
"Integer",
"input1[0]",
"input1",
"0",
"int m = Integer.parseInt(input1[1]);",
"m",
"Integer.parseInt(input1[1])",
"Integer.parseInt",
"Integer",
"input1[1]",
"input1",
"1",
"String[] input2 = br.readLine().split(\" \");",
"input2",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int[] cost = new int[m];",
"cost",
"new int[m]",
"m",
"int totalCost = 0;",
"totalCost",
"0",
"for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n totalCost += cost[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n cost[i] = Integer.parseInt(input2[i]);\n totalCost += cost[i];\n }",
"{\n cost[i] = Integer.parseInt(input2[i]);\n totalCost += cost[i];\n }",
"cost[i] = Integer.parseInt(input2[i])",
"cost[i]",
"cost",
"i",
"Integer.parseInt(input2[i])",
"Integer.parseInt",
"Integer",
"input2[i]",
"input2",
"i",
"totalCost += cost[i]",
"totalCost",
"cost[i]",
"cost",
"i",
"out.println(n >= totalCost ? n - totalCost : -1)",
"out.println",
"out",
"n >= totalCost ? n - totalCost : -1",
"n >= totalCost",
"n",
"totalCost",
"n - totalCost",
"n",
"totalCost",
"-1",
"1",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n \n String[] input1 = br.readLine().split(\" \");\n int n = Integer.parseInt(input1[0]);\n int m = Integer.parseInt(input1[1]);\n \n String[] input2 = br.readLine().split(\" \");\n int[] cost = new int[m];\n int totalCost = 0;\n \n for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n totalCost += cost[i];\n }\n \n out.println(n >= totalCost ? n - totalCost : -1);\n out.close();\n \n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n \n String[] input1 = br.readLine().split(\" \");\n int n = Integer.parseInt(input1[0]);\n int m = Integer.parseInt(input1[1]);\n \n String[] input2 = br.readLine().split(\" \");\n int[] cost = new int[m];\n int totalCost = 0;\n \n for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n totalCost += cost[i];\n }\n \n out.println(n >= totalCost ? n - totalCost : -1);\n out.close();\n \n }\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
String[] input1 = br.readLine().split(" ");
int n = Integer.parseInt(input1[0]);
int m = Integer.parseInt(input1[1]);
String[] input2 = br.readLine().split(" ");
int[] cost = new int[m];
int totalCost = 0;
for(int i = 0; i < m; i++){
cost[i] = Integer.parseInt(input2[i]);
totalCost += cost[i];
}
out.println(n >= totalCost ? n - totalCost : -1);
out.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
17,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
13,
17,
30,
4,
13,
2,
13,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
41,
13,
17,
41,
13,
4,
18,
13,
41,
13,
17,
42,
2,
40,
13,
17,
4,
13,
4,
18,
13,
4,
18,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
4,
18,
18,
13,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
8,
2,
13,
17,
13,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
13,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
8,
2,
13,
17,
17,
2,
17,
4,
13,
2,
13,
2,
13,
17,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
13,
17
],
[
17,
18
],
[
13,
19
],
[
19,
20
],
[
19,
21
],
[
13,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
24,
33
],
[
33,
34
],
[
33,
35
],
[
24,
36
],
[
36,
37
],
[
36,
38
],
[
24,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
45,
47
],
[
40,
48
],
[
48,
49
],
[
49,
50
],
[
40,
51
],
[
52,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
24,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
59,
67
],
[
67,
68
],
[
68,
69
],
[
59,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
24,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
88,
90
],
[
13,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
97,
98
],
[
97,
99
],
[
93,
100
],
[
100,
101
],
[
100,
102
],
[
93,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
93,
108
],
[
108,
109
],
[
108,
110
],
[
93,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
112,
115
],
[
111,
116
],
[
116,
117
],
[
93,
118
],
[
118,
119
],
[
119,
120
],
[
93,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
91,
126
],
[
126,
127
],
[
13,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
128,
135
],
[
135,
136
],
[
13,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
137,
144
],
[
144,
145
],
[
13,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
149,
152
],
[
148,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
146,
158
],
[
158,
159
],
[
13,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
13,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
13,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
13,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
13,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
193,
195
],
[
192,
196
],
[
192,
197
],
[
197,
198
],
[
197,
199
],
[
197,
200
],
[
200,
201
],
[
200,
202
],
[
188,
203
],
[
203,
204
],
[
188,
205
],
[
205,
206
],
[
13,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
211,
216
],
[
216,
217
],
[
216,
218
],
[
216,
219
],
[
219,
220
],
[
219,
221
],
[
207,
222
],
[
222,
223
],
[
207,
224
],
[
224,
225
],
[
13,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
230,
234
],
[
230,
235
],
[
235,
236
],
[
235,
237
],
[
237,
238
],
[
237,
239
],
[
239,
240
],
[
239,
241
],
[
241,
242
],
[
241,
243
],
[
226,
244
],
[
244,
245
],
[
13,
246
],
[
246,
247
],
[
246,
248
],
[
248,
249
],
[
246,
250
],
[
250,
251
],
[
246,
252
],
[
252,
253
],
[
252,
254
],
[
254,
255
],
[
255,
256
],
[
255,
257
],
[
246,
258
],
[
258,
259
],
[
258,
260
],
[
260,
261
],
[
261,
262
],
[
261,
263
],
[
258,
264
],
[
264,
265
],
[
246,
266
],
[
266,
267
],
[
266,
268
],
[
268,
269
],
[
269,
270
],
[
270,
271
],
[
271,
272
],
[
271,
273
],
[
270,
274
],
[
274,
275
],
[
275,
276
],
[
276,
277
],
[
269,
278
],
[
278,
279
],
[
279,
280
],
[
280,
281
],
[
280,
282
],
[
282,
283
],
[
283,
284
],
[
284,
285
],
[
279,
286
],
[
286,
287
],
[
287,
288
],
[
287,
289
],
[
268,
290
],
[
290,
291
],
[
291,
292
],
[
292,
293
],
[
246,
294
],
[
294,
295
],
[
294,
296
],
[
296,
297
],
[
297,
298
],
[
298,
299
],
[
299,
300
],
[
298,
301
],
[
301,
302
],
[
246,
303
],
[
303,
304
],
[
303,
305
],
[
305,
306
],
[
306,
307
],
[
307,
308
],
[
308,
309
],
[
307,
310
],
[
310,
311
],
[
246,
312
],
[
312,
313
],
[
312,
314
],
[
314,
315
],
[
315,
316
],
[
316,
317
],
[
317,
318
],
[
316,
319
],
[
319,
320
],
[
246,
321
],
[
321,
322
],
[
321,
323
],
[
323,
324
],
[
324,
325
],
[
324,
326
],
[
323,
327
],
[
327,
328
],
[
328,
329
],
[
328,
330
],
[
330,
331
],
[
331,
332
],
[
332,
333
],
[
327,
334
],
[
334,
335
],
[
335,
336
],
[
335,
337
],
[
337,
338
],
[
338,
339
],
[
323,
340
],
[
340,
341
]
] |
[
" \nimport java.util.*;import java.io.*;import java.math.*;import java.lang.*;\n\n\n\nclass Main\n{\n\n \n public static void process()throws IOException\n {\n\n int n = ni();\n int m = ni();\n int sum=0;\n int a[] = new int[m];\n for(int i=0;i<m;i++)\n {\n a[i] = ni();\n }\n for(int i=0;i<m;i++)\n {\n sum+=a[i];\n }\n if(sum>n)\n {\n pn(\"-1\");\n }\n else\n {\n pn(n-sum);\n }\n \n\n\n \n\n \n\n\n } \n\n \n \n \n\n\n\n\n static AnotherReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc=new AnotherReader();\n boolean oj = true;\n\n // oj = System.getProperty(\"ONLINE_JUDGE\") != null;\n // if(!oj) sc=new AnotherReader(100);\n\n long s = System.currentTimeMillis();\n int t=1;//test cases\n while(t-->0)\n process();\n out.flush();\n // if(!oj)\n // System.out.println(System.currentTimeMillis()-s+\"ms\");\n System.out.close(); \n }\n\n static void pn(Object o){out.println(o);}\n static void p(Object o){out.print(o);}\n static void pni(Object o){out.println(o);System.out.flush();}\n static int ni()throws IOException{return sc.nextInt();}\n static long nl()throws IOException{return sc.nextLong();}\n static double nd()throws IOException{return sc.nextDouble();}\n static String nln()throws IOException{return sc.nextLine();}\n static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}\n static boolean multipleTC=false;\n\n\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n static class AnotherReader\n {\n BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException\n {\n br=new BufferedReader(new InputStreamReader(System.in));\n }\n AnotherReader(int a)throws FileNotFoundException\n {\n br = new BufferedReader(new FileReader(\"input.txt\"));\n }\n String next()throws IOException\n {\n while (st == null || !st.hasMoreElements()) \n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace(); \n }\n }\n return st.nextToken(); \n }\n int nextInt() throws IOException\n {\n return Integer.parseInt(next());\n }\n long nextLong() throws IOException\n { \n return Long.parseLong(next());\n }\n double nextDouble()throws IOException \n { \n return Double.parseDouble(next()); \n }\n String nextLine() throws IOException\n { \n String str = \"\"; \n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n } return str;\n }\n }\n \n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n}\n \n \n \n ",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.math.*;",
"math.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"class Main\n{\n\n \n public static void process()throws IOException\n {\n\n int n = ni();\n int m = ni();\n int sum=0;\n int a[] = new int[m];\n for(int i=0;i<m;i++)\n {\n a[i] = ni();\n }\n for(int i=0;i<m;i++)\n {\n sum+=a[i];\n }\n if(sum>n)\n {\n pn(\"-1\");\n }\n else\n {\n pn(n-sum);\n }\n \n\n\n \n\n \n\n\n } \n\n \n \n \n\n\n\n\n static AnotherReader sc;\n static PrintWriter out;\n public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc=new AnotherReader();\n boolean oj = true;\n\n // oj = System.getProperty(\"ONLINE_JUDGE\") != null;\n // if(!oj) sc=new AnotherReader(100);\n\n long s = System.currentTimeMillis();\n int t=1;//test cases\n while(t-->0)\n process();\n out.flush();\n // if(!oj)\n // System.out.println(System.currentTimeMillis()-s+\"ms\");\n System.out.close(); \n }\n\n static void pn(Object o){out.println(o);}\n static void p(Object o){out.print(o);}\n static void pni(Object o){out.println(o);System.out.flush();}\n static int ni()throws IOException{return sc.nextInt();}\n static long nl()throws IOException{return sc.nextLong();}\n static double nd()throws IOException{return sc.nextDouble();}\n static String nln()throws IOException{return sc.nextLine();}\n static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}\n static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}\n static boolean multipleTC=false;\n\n\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n static class AnotherReader\n {\n BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException\n {\n br=new BufferedReader(new InputStreamReader(System.in));\n }\n AnotherReader(int a)throws FileNotFoundException\n {\n br = new BufferedReader(new FileReader(\"input.txt\"));\n }\n String next()throws IOException\n {\n while (st == null || !st.hasMoreElements()) \n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace(); \n }\n }\n return st.nextToken(); \n }\n int nextInt() throws IOException\n {\n return Integer.parseInt(next());\n }\n long nextLong() throws IOException\n { \n return Long.parseLong(next());\n }\n double nextDouble()throws IOException \n { \n return Double.parseDouble(next()); \n }\n String nextLine() throws IOException\n { \n String str = \"\"; \n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n } return str;\n }\n }\n \n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n}",
"Main",
"static AnotherReader sc;",
"sc",
"static PrintWriter out;",
"out",
"static boolean multipleTC=false;",
"multipleTC",
"false",
"public static void process()throws IOException\n {\n\n int n = ni();\n int m = ni();\n int sum=0;\n int a[] = new int[m];\n for(int i=0;i<m;i++)\n {\n a[i] = ni();\n }\n for(int i=0;i<m;i++)\n {\n sum+=a[i];\n }\n if(sum>n)\n {\n pn(\"-1\");\n }\n else\n {\n pn(n-sum);\n }\n \n\n\n \n\n \n\n\n }",
"process",
"{\n\n int n = ni();\n int m = ni();\n int sum=0;\n int a[] = new int[m];\n for(int i=0;i<m;i++)\n {\n a[i] = ni();\n }\n for(int i=0;i<m;i++)\n {\n sum+=a[i];\n }\n if(sum>n)\n {\n pn(\"-1\");\n }\n else\n {\n pn(n-sum);\n }\n \n\n\n \n\n \n\n\n }",
"int n = ni();",
"n",
"ni()",
"ni",
"int m = ni();",
"m",
"ni()",
"ni",
"int sum=0;",
"sum",
"0",
"int a[] = new int[m];",
"a",
"new int[m]",
"m",
"for(int i=0;i<m;i++)\n {\n a[i] = ni();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n a[i] = ni();\n }",
"{\n a[i] = ni();\n }",
"a[i] = ni()",
"a[i]",
"a",
"i",
"ni()",
"ni",
"for(int i=0;i<m;i++)\n {\n sum+=a[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n sum+=a[i];\n }",
"{\n sum+=a[i];\n }",
"sum+=a[i]",
"sum",
"a[i]",
"a",
"i",
"if(sum>n)\n {\n pn(\"-1\");\n }\n else\n {\n pn(n-sum);\n }",
"sum>n",
"sum",
"n",
"{\n pn(\"-1\");\n }",
"pn(\"-1\")",
"pn",
"\"-1\"",
"{\n pn(n-sum);\n }",
"pn(n-sum)",
"pn",
"n-sum",
"n",
"sum",
"public static void main(String[]args)throws IOException\n {\n out = new PrintWriter(System.out);\n sc=new AnotherReader();\n boolean oj = true;\n\n // oj = System.getProperty(\"ONLINE_JUDGE\") != null;\n // if(!oj) sc=new AnotherReader(100);\n\n long s = System.currentTimeMillis();\n int t=1;//test cases\n while(t-->0)\n process();\n out.flush();\n // if(!oj)\n // System.out.println(System.currentTimeMillis()-s+\"ms\");\n System.out.close(); \n }",
"main",
"{\n out = new PrintWriter(System.out);\n sc=new AnotherReader();\n boolean oj = true;\n\n // oj = System.getProperty(\"ONLINE_JUDGE\") != null;\n // if(!oj) sc=new AnotherReader(100);\n\n long s = System.currentTimeMillis();\n int t=1;//test cases\n while(t-->0)\n process();\n out.flush();\n // if(!oj)\n // System.out.println(System.currentTimeMillis()-s+\"ms\");\n System.out.close(); \n }",
"out = new PrintWriter(System.out)",
"out",
"new PrintWriter(System.out)",
"sc=new AnotherReader()",
"sc",
"new AnotherReader()",
"boolean oj = true;",
"oj",
"true",
"long s = System.currentTimeMillis();",
"s",
"System.currentTimeMillis()",
"System.currentTimeMillis",
"System",
"int t=1;",
"t",
"1",
"while(t-->0)\n process();",
"t-->0",
"t--",
"t",
"0",
"process()",
"process",
"out.flush()",
"out.flush",
"out",
"System.out.close()",
"System.out.close",
"System.out",
"System",
"System.out",
"String[]args",
"args",
"static void pn(Object o){out.println(o);}",
"pn",
"{out.println(o);}",
"out.println(o)",
"out.println",
"out",
"o",
"Object o",
"o",
"static void p(Object o){out.print(o);}",
"p",
"{out.print(o);}",
"out.print(o)",
"out.print",
"out",
"o",
"Object o",
"o",
"static void pni(Object o){out.println(o);System.out.flush();}",
"pni",
"{out.println(o);System.out.flush();}",
"out.println(o)",
"out.println",
"out",
"o",
"System.out.flush()",
"System.out.flush",
"System.out",
"System",
"System.out",
"Object o",
"o",
"static int ni()throws IOException{return sc.nextInt();}",
"ni",
"{return sc.nextInt();}",
"return sc.nextInt();",
"sc.nextInt()",
"sc.nextInt",
"sc",
"static long nl()throws IOException{return sc.nextLong();}",
"nl",
"{return sc.nextLong();}",
"return sc.nextLong();",
"sc.nextLong()",
"sc.nextLong",
"sc",
"static double nd()throws IOException{return sc.nextDouble();}",
"nd",
"{return sc.nextDouble();}",
"return sc.nextDouble();",
"sc.nextDouble()",
"sc.nextDouble",
"sc",
"static String nln()throws IOException{return sc.nextLine();}",
"nln",
"{return sc.nextLine();}",
"return sc.nextLine();",
"sc.nextLine()",
"sc.nextLine",
"sc",
"static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}",
"gcd",
"{return (b==0)?a:gcd(b,a%b);}",
"return (b==0)?a:gcd(b,a%b);",
"(b==0)?a:gcd(b,a%b)",
"(b==0)",
"b",
"0",
"a",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}",
"gcd",
"{return (b==0)?a:gcd(b,a%b);}",
"return (b==0)?a:gcd(b,a%b);",
"(b==0)?a:gcd(b,a%b)",
"(b==0)",
"b",
"0",
"a",
"gcd(b,a%b)",
"gcd",
"b",
"a%b",
"a",
"b",
"int a",
"a",
"int b",
"b",
"static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}",
"bit",
"{return (n==0)?0:(1+bit(n&(n-1)));}",
"return (n==0)?0:(1+bit(n&(n-1)));",
"(n==0)?0:(1+bit(n&(n-1)))",
"(n==0)",
"n",
"0",
"0",
"(1+bit(n&(n-1)))",
"1",
"bit(n&(n-1))",
"bit",
"n&(n-1)",
"n",
"(n-1)",
"n",
"1",
"long n",
"n",
"static class AnotherReader\n {\n BufferedReader br; StringTokenizer st;\n AnotherReader()throws FileNotFoundException\n {\n br=new BufferedReader(new InputStreamReader(System.in));\n }\n AnotherReader(int a)throws FileNotFoundException\n {\n br = new BufferedReader(new FileReader(\"input.txt\"));\n }\n String next()throws IOException\n {\n while (st == null || !st.hasMoreElements()) \n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace(); \n }\n }\n return st.nextToken(); \n }\n int nextInt() throws IOException\n {\n return Integer.parseInt(next());\n }\n long nextLong() throws IOException\n { \n return Long.parseLong(next());\n }\n double nextDouble()throws IOException \n { \n return Double.parseDouble(next()); \n }\n String nextLine() throws IOException\n { \n String str = \"\"; \n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n } return str;\n }\n }",
"AnotherReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"AnotherReader()throws FileNotFoundException\n {\n br=new BufferedReader(new InputStreamReader(System.in));\n }",
"AnotherReader",
"{\n br=new BufferedReader(new InputStreamReader(System.in));\n }",
"br=new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"AnotherReader(int a)throws FileNotFoundException\n {\n br = new BufferedReader(new FileReader(\"input.txt\"));\n }",
"AnotherReader",
"{\n br = new BufferedReader(new FileReader(\"input.txt\"));\n }",
"br = new BufferedReader(new FileReader(\"input.txt\"))",
"br",
"new BufferedReader(new FileReader(\"input.txt\"))",
"int a",
"a",
"String next()throws IOException\n {\n while (st == null || !st.hasMoreElements()) \n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace(); \n }\n }\n return st.nextToken(); \n }",
"next",
"{\n while (st == null || !st.hasMoreElements()) \n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace(); \n }\n }\n return st.nextToken(); \n }",
"while (st == null || !st.hasMoreElements()) \n {\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace(); \n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace(); \n }\n }",
"try\n {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e)\n {\n e.printStackTrace(); \n }",
"catch (IOException e)\n {\n e.printStackTrace(); \n }",
"IOException e",
"{\n e.printStackTrace(); \n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() throws IOException\n {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() throws IOException\n { \n return Long.parseLong(next());\n }",
"nextLong",
"{ \n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble()throws IOException \n { \n return Double.parseDouble(next()); \n }",
"nextDouble",
"{ \n return Double.parseDouble(next()); \n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() throws IOException\n { \n String str = \"\"; \n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n } return str;\n }",
"nextLine",
"{ \n String str = \"\"; \n try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n } return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try\n {\n str = br.readLine();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }",
"catch (IOException e)\n {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str"
] |
import java.util.*;import java.io.*;import java.math.*;import java.lang.*;
class Main
{
public static void process()throws IOException
{
int n = ni();
int m = ni();
int sum=0;
int a[] = new int[m];
for(int i=0;i<m;i++)
{
a[i] = ni();
}
for(int i=0;i<m;i++)
{
sum+=a[i];
}
if(sum>n)
{
pn("-1");
}
else
{
pn(n-sum);
}
}
static AnotherReader sc;
static PrintWriter out;
public static void main(String[]args)throws IOException
{
out = new PrintWriter(System.out);
sc=new AnotherReader();
boolean oj = true;
// oj = System.getProperty("ONLINE_JUDGE") != null;
// if(!oj) sc=new AnotherReader(100);
long s = System.currentTimeMillis();
int t=1;//test cases
while(t-->0)
process();
out.flush();
// if(!oj)
// System.out.println(System.currentTimeMillis()-s+"ms");
System.out.close();
}
static void pn(Object o){out.println(o);}
static void p(Object o){out.print(o);}
static void pni(Object o){out.println(o);System.out.flush();}
static int ni()throws IOException{return sc.nextInt();}
static long nl()throws IOException{return sc.nextLong();}
static double nd()throws IOException{return sc.nextDouble();}
static String nln()throws IOException{return sc.nextLine();}
static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
static boolean multipleTC=false;
/////////////////////////////////////////////////////////////////////////////////////////////////////////
static class AnotherReader
{
BufferedReader br; StringTokenizer st;
AnotherReader()throws FileNotFoundException
{
br=new BufferedReader(new InputStreamReader(System.in));
}
AnotherReader(int a)throws FileNotFoundException
{
br = new BufferedReader(new FileReader("input.txt"));
}
String next()throws IOException
{
while (st == null || !st.hasMoreElements())
{
try
{
st = new StringTokenizer(br.readLine());
}
catch (IOException e)
{
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() throws IOException
{
return Integer.parseInt(next());
}
long nextLong() throws IOException
{
return Long.parseLong(next());
}
double nextDouble()throws IOException
{
return Double.parseDouble(next());
}
String nextLine() throws IOException
{
String str = "";
try
{
str = br.readLine();
}
catch (IOException e)
{
e.printStackTrace();
} return str;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
4,
18,
18,
13,
17,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
18,
13,
17,
17,
41,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
41,
13,
4,
18,
4,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
19,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
26,
28
],
[
19,
29
],
[
29,
30
],
[
30,
31
],
[
19,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
39,
40
],
[
11,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
11,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
54,
55
],
[
54,
56
],
[
11,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
59,
62
],
[
62,
63
],
[
62,
64
],
[
11,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
11,
73
],
[
73,
74
],
[
73,
75
],
[
76,
77
],
[
76,
78
],
[
11,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
79,
89
],
[
89,
90
],
[
90,
91
],
[
79,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
11,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
108,
111
],
[
11,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
112,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
11,
133
],
[
133,
134
],
[
134,
135
],
[
9,
136
],
[
136,
137
]
] |
[
"import java.util.Arrays;\nimport java.util.Scanner;\n\nclass Main {\n public static void main(final String[] args) {\n \n Scanner scanner = new Scanner(System.in);\n String[] arr = new String[2];\n for(int i = 0;i < arr.length;i++) {\n arr[i] = scanner.nextLine();\n }\n\n String[] line1 = arr[0].split(\" \");\n\n int n = Integer.parseInt(line1[0]);\n int m = Integer.parseInt(line1[1]);\n\n String[] line2 = arr[1].split(\" \");\n\n int[] a = new int[line2.length];\n for (int i = 0; i < line2.length; i++) {\n a[i] = Integer.parseInt(line2[i]);\n }\n\n int sum = Arrays.stream(a).sum();\n\n if(sum > n){\n System.out.println(-1);\n }else{\n System.out.println(n - sum);\n }\n\n scanner.close();\n }\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(final String[] args) {\n \n Scanner scanner = new Scanner(System.in);\n String[] arr = new String[2];\n for(int i = 0;i < arr.length;i++) {\n arr[i] = scanner.nextLine();\n }\n\n String[] line1 = arr[0].split(\" \");\n\n int n = Integer.parseInt(line1[0]);\n int m = Integer.parseInt(line1[1]);\n\n String[] line2 = arr[1].split(\" \");\n\n int[] a = new int[line2.length];\n for (int i = 0; i < line2.length; i++) {\n a[i] = Integer.parseInt(line2[i]);\n }\n\n int sum = Arrays.stream(a).sum();\n\n if(sum > n){\n System.out.println(-1);\n }else{\n System.out.println(n - sum);\n }\n\n scanner.close();\n }\n}",
"Main",
"public static void main(final String[] args) {\n \n Scanner scanner = new Scanner(System.in);\n String[] arr = new String[2];\n for(int i = 0;i < arr.length;i++) {\n arr[i] = scanner.nextLine();\n }\n\n String[] line1 = arr[0].split(\" \");\n\n int n = Integer.parseInt(line1[0]);\n int m = Integer.parseInt(line1[1]);\n\n String[] line2 = arr[1].split(\" \");\n\n int[] a = new int[line2.length];\n for (int i = 0; i < line2.length; i++) {\n a[i] = Integer.parseInt(line2[i]);\n }\n\n int sum = Arrays.stream(a).sum();\n\n if(sum > n){\n System.out.println(-1);\n }else{\n System.out.println(n - sum);\n }\n\n scanner.close();\n }",
"main",
"{\n \n Scanner scanner = new Scanner(System.in);\n String[] arr = new String[2];\n for(int i = 0;i < arr.length;i++) {\n arr[i] = scanner.nextLine();\n }\n\n String[] line1 = arr[0].split(\" \");\n\n int n = Integer.parseInt(line1[0]);\n int m = Integer.parseInt(line1[1]);\n\n String[] line2 = arr[1].split(\" \");\n\n int[] a = new int[line2.length];\n for (int i = 0; i < line2.length; i++) {\n a[i] = Integer.parseInt(line2[i]);\n }\n\n int sum = Arrays.stream(a).sum();\n\n if(sum > n){\n System.out.println(-1);\n }else{\n System.out.println(n - sum);\n }\n\n scanner.close();\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"String[] arr = new String[2];",
"arr",
"new String[2]",
"2",
"for(int i = 0;i < arr.length;i++) {\n arr[i] = scanner.nextLine();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n arr[i] = scanner.nextLine();\n }",
"{\n arr[i] = scanner.nextLine();\n }",
"arr[i] = scanner.nextLine()",
"arr[i]",
"arr",
"i",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"String[] line1 = arr[0].split(\" \");",
"line1",
"arr[0].split(\" \")",
"arr[0].split",
"arr[0]",
"arr",
"0",
"\" \"",
"int n = Integer.parseInt(line1[0]);",
"n",
"Integer.parseInt(line1[0])",
"Integer.parseInt",
"Integer",
"line1[0]",
"line1",
"0",
"int m = Integer.parseInt(line1[1]);",
"m",
"Integer.parseInt(line1[1])",
"Integer.parseInt",
"Integer",
"line1[1]",
"line1",
"1",
"String[] line2 = arr[1].split(\" \");",
"line2",
"arr[1].split(\" \")",
"arr[1].split",
"arr[1]",
"arr",
"1",
"\" \"",
"int[] a = new int[line2.length];",
"a",
"new int[line2.length]",
"line2.length",
"line2",
"line2.length",
"for (int i = 0; i < line2.length; i++) {\n a[i] = Integer.parseInt(line2[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < line2.length",
"i",
"line2.length",
"line2",
"line2.length",
"i++",
"i++",
"i",
"{\n a[i] = Integer.parseInt(line2[i]);\n }",
"{\n a[i] = Integer.parseInt(line2[i]);\n }",
"a[i] = Integer.parseInt(line2[i])",
"a[i]",
"a",
"i",
"Integer.parseInt(line2[i])",
"Integer.parseInt",
"Integer",
"line2[i]",
"line2",
"i",
"int sum = Arrays.stream(a).sum();",
"sum",
"Arrays.stream(a).sum()",
"Arrays.stream(a).sum",
"Arrays.stream(a)",
"Arrays.stream",
"Arrays",
"a",
"if(sum > n){\n System.out.println(-1);\n }else{\n System.out.println(n - sum);\n }",
"sum > n",
"sum",
"n",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(n - sum);\n }",
"System.out.println(n - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - sum",
"n",
"sum",
"scanner.close()",
"scanner.close",
"scanner",
"final String[] args",
"args"
] |
import java.util.Arrays;
import java.util.Scanner;
class Main {
public static void main(final String[] args) {
Scanner scanner = new Scanner(System.in);
String[] arr = new String[2];
for(int i = 0;i < arr.length;i++) {
arr[i] = scanner.nextLine();
}
String[] line1 = arr[0].split(" ");
int n = Integer.parseInt(line1[0]);
int m = Integer.parseInt(line1[1]);
String[] line2 = arr[1].split(" ");
int[] a = new int[line2.length];
for (int i = 0; i < line2.length; i++) {
a[i] = Integer.parseInt(line2[i]);
}
int sum = Arrays.stream(a).sum();
if(sum > n){
System.out.println(-1);
}else{
System.out.println(n - sum);
}
scanner.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
17,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
61,
5
],
[
61,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
8,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
40,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
6,
58
],
[
58,
59
],
[
0,
60
],
[
60,
61
],
[
60,
62
]
] |
[
"\nimport java.util.*;\n\npublic class Main {// Main\n\tpublic static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n for(int i =1 ; i <=m ;i++) {\n\t n-=sc.nextInt();\n }\n if(n>=0)\n System.out.println(n);\n else {\n \tSystem.out.println(-1);\n }\n\t}\n\n\t\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {// Main\n\tpublic static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n for(int i =1 ; i <=m ;i++) {\n\t n-=sc.nextInt();\n }\n if(n>=0)\n System.out.println(n);\n else {\n \tSystem.out.println(-1);\n }\n\t}\n\n\t\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n for(int i =1 ; i <=m ;i++) {\n\t n-=sc.nextInt();\n }\n if(n>=0)\n System.out.println(n);\n else {\n \tSystem.out.println(-1);\n }\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n for(int i =1 ; i <=m ;i++) {\n\t n-=sc.nextInt();\n }\n if(n>=0)\n System.out.println(n);\n else {\n \tSystem.out.println(-1);\n }\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i =1 ; i <=m ;i++) {\n\t n-=sc.nextInt();\n }",
"int i =1 ;",
"int i =1 ;",
"i",
"1",
"i <=m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t n-=sc.nextInt();\n }",
"{\n\t n-=sc.nextInt();\n }",
"n-=sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if(n>=0)\n System.out.println(n);\n else {\n \tSystem.out.println(-1);\n }",
"n>=0",
"n",
"0",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"{\n \tSystem.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {// Main\n\tpublic static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n for(int i =1 ; i <=m ;i++) {\n\t n-=sc.nextInt();\n }\n if(n>=0)\n System.out.println(n);\n else {\n \tSystem.out.println(-1);\n }\n\t}\n\n\t\n}",
"public class Main {// Main\n\tpublic static void main(String[] args) throws Exception {\n\t\tScanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n for(int i =1 ; i <=m ;i++) {\n\t n-=sc.nextInt();\n }\n if(n>=0)\n System.out.println(n);\n else {\n \tSystem.out.println(-1);\n }\n\t}\n\n\t\n}",
"Main"
] |
import java.util.*;
public class Main {// Main
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
for(int i =1 ; i <=m ;i++) {
n-=sc.nextInt();
}
if(n>=0)
System.out.println(n);
else {
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
18,
13,
13,
41,
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,
0,
13,
18,
13,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
85,
5
],
[
85,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
27,
29
],
[
8,
31
],
[
31,
32
],
[
31,
33
],
[
8,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
52,
53
],
[
46,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
8,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
60,
64
],
[
59,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
59,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
80,
81
],
[
6,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
] |
[
"import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n System.out.println();\n int A[]=new int[M];\n int total=0;\n for(int i=0;i<M;i++){\n A[i]=sc.nextInt();\n total+=A[i];\n }\n if(N-total>=0){\n System.out.println(N-total);\n }else{\n System.out.println(-1);\n }\n }\n}\n ",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n System.out.println();\n int A[]=new int[M];\n int total=0;\n for(int i=0;i<M;i++){\n A[i]=sc.nextInt();\n total+=A[i];\n }\n if(N-total>=0){\n System.out.println(N-total);\n }else{\n System.out.println(-1);\n }\n }\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n System.out.println();\n int A[]=new int[M];\n int total=0;\n for(int i=0;i<M;i++){\n A[i]=sc.nextInt();\n total+=A[i];\n }\n if(N-total>=0){\n System.out.println(N-total);\n }else{\n System.out.println(-1);\n }\n }",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n System.out.println();\n int A[]=new int[M];\n int total=0;\n for(int i=0;i<M;i++){\n A[i]=sc.nextInt();\n total+=A[i];\n }\n if(N-total>=0){\n System.out.println(N-total);\n }else{\n System.out.println(-1);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N=sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M=sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"int A[]=new int[M];",
"A",
"new int[M]",
"M",
"int total=0;",
"total",
"0",
"for(int i=0;i<M;i++){\n A[i]=sc.nextInt();\n total+=A[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n A[i]=sc.nextInt();\n total+=A[i];\n }",
"{\n A[i]=sc.nextInt();\n total+=A[i];\n }",
"A[i]=sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"total+=A[i]",
"total",
"A[i]",
"A",
"i",
"if(N-total>=0){\n System.out.println(N-total);\n }else{\n System.out.println(-1);\n }",
"N-total>=0",
"N-total",
"N",
"total",
"0",
"{\n System.out.println(N-total);\n }",
"System.out.println(N-total)",
"System.out.println",
"System.out",
"System",
"System.out",
"N-total",
"N",
"total",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n System.out.println();\n int A[]=new int[M];\n int total=0;\n for(int i=0;i<M;i++){\n A[i]=sc.nextInt();\n total+=A[i];\n }\n if(N-total>=0){\n System.out.println(N-total);\n }else{\n System.out.println(-1);\n }\n }\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n int N=sc.nextInt();\n int M=sc.nextInt();\n System.out.println();\n int A[]=new int[M];\n int total=0;\n for(int i=0;i<M;i++){\n A[i]=sc.nextInt();\n total+=A[i];\n }\n if(N-total>=0){\n System.out.println(N-total);\n }else{\n System.out.println(-1);\n }\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N=sc.nextInt();
int M=sc.nextInt();
System.out.println();
int A[]=new int[M];
int total=0;
for(int i=0;i<M;i++){
A[i]=sc.nextInt();
total+=A[i];
}
if(N-total>=0){
System.out.println(N-total);
}else{
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
17,
41,
13,
17,
41,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
106,
8
],
[
106,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
11,
21
],
[
21,
22
],
[
21,
23
],
[
11,
24
],
[
24,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
11,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
52,
53
],
[
53,
54
],
[
11,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
55,
65
],
[
65,
66
],
[
66,
67
],
[
55,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
69,
76
],
[
76,
77
],
[
76,
78
],
[
11,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
83,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
79,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
9,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] |
[
"import java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\t\n\t\tArrayList<Integer> hour=new ArrayList<>();\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint goukei=0;\n\t\tint hourdata=0;\n\t\tint result;\n\t\t\n\t\t//高橋君の夏休み\n\t\tint N=sc.nextInt();\n\t\t//高橋君の宿題の数\n\t\tint M=sc.nextInt();\n\t\t\n\t\t//宿題をやるのにかかる時間\n\t\tfor(int i=0;i<M;i++) {\n\t\t\thour.add(sc.nextInt());\n\t\t}\n\t\t\n\t\t//宿題をやるのにかかる時間の合計\n\t\tfor(int i=0;i<hour.size();i++) {\n\t\t\thourdata=hour.get(i);\n\t\t\tgoukei+=hourdata;\n\t\t}\n\t\t\n\t\tif(goukei<=N) {\n\t\t\tresult=N-goukei;\n\t\t\tSystem.out.println(result);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\t\n\t\tArrayList<Integer> hour=new ArrayList<>();\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint goukei=0;\n\t\tint hourdata=0;\n\t\tint result;\n\t\t\n\t\t//高橋君の夏休み\n\t\tint N=sc.nextInt();\n\t\t//高橋君の宿題の数\n\t\tint M=sc.nextInt();\n\t\t\n\t\t//宿題をやるのにかかる時間\n\t\tfor(int i=0;i<M;i++) {\n\t\t\thour.add(sc.nextInt());\n\t\t}\n\t\t\n\t\t//宿題をやるのにかかる時間の合計\n\t\tfor(int i=0;i<hour.size();i++) {\n\t\t\thourdata=hour.get(i);\n\t\t\tgoukei+=hourdata;\n\t\t}\n\t\t\n\t\tif(goukei<=N) {\n\t\t\tresult=N-goukei;\n\t\t\tSystem.out.println(result);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\t\n\t\tArrayList<Integer> hour=new ArrayList<>();\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint goukei=0;\n\t\tint hourdata=0;\n\t\tint result;\n\t\t\n\t\t//高橋君の夏休み\n\t\tint N=sc.nextInt();\n\t\t//高橋君の宿題の数\n\t\tint M=sc.nextInt();\n\t\t\n\t\t//宿題をやるのにかかる時間\n\t\tfor(int i=0;i<M;i++) {\n\t\t\thour.add(sc.nextInt());\n\t\t}\n\t\t\n\t\t//宿題をやるのにかかる時間の合計\n\t\tfor(int i=0;i<hour.size();i++) {\n\t\t\thourdata=hour.get(i);\n\t\t\tgoukei+=hourdata;\n\t\t}\n\t\t\n\t\tif(goukei<=N) {\n\t\t\tresult=N-goukei;\n\t\t\tSystem.out.println(result);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\t\n\t\tArrayList<Integer> hour=new ArrayList<>();\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint goukei=0;\n\t\tint hourdata=0;\n\t\tint result;\n\t\t\n\t\t//高橋君の夏休み\n\t\tint N=sc.nextInt();\n\t\t//高橋君の宿題の数\n\t\tint M=sc.nextInt();\n\t\t\n\t\t//宿題をやるのにかかる時間\n\t\tfor(int i=0;i<M;i++) {\n\t\t\thour.add(sc.nextInt());\n\t\t}\n\t\t\n\t\t//宿題をやるのにかかる時間の合計\n\t\tfor(int i=0;i<hour.size();i++) {\n\t\t\thourdata=hour.get(i);\n\t\t\tgoukei+=hourdata;\n\t\t}\n\t\t\n\t\tif(goukei<=N) {\n\t\t\tresult=N-goukei;\n\t\t\tSystem.out.println(result);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}",
"ArrayList<Integer> hour=new ArrayList<>();",
"hour",
"new ArrayList<>()",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int goukei=0;",
"goukei",
"0",
"int hourdata=0;",
"hourdata",
"0",
"int result;",
"result",
"int N=sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M=sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=0;i<M;i++) {\n\t\t\thour.add(sc.nextInt());\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\thour.add(sc.nextInt());\n\t\t}",
"{\n\t\t\thour.add(sc.nextInt());\n\t\t}",
"hour.add(sc.nextInt())",
"hour.add",
"hour",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=0;i<hour.size();i++) {\n\t\t\thourdata=hour.get(i);\n\t\t\tgoukei+=hourdata;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<hour.size()",
"i",
"hour.size()",
"hour.size",
"hour",
"i++",
"i++",
"i",
"{\n\t\t\thourdata=hour.get(i);\n\t\t\tgoukei+=hourdata;\n\t\t}",
"{\n\t\t\thourdata=hour.get(i);\n\t\t\tgoukei+=hourdata;\n\t\t}",
"hourdata=hour.get(i)",
"hourdata",
"hour.get(i)",
"hour.get",
"hour",
"i",
"goukei+=hourdata",
"goukei",
"hourdata",
"if(goukei<=N) {\n\t\t\tresult=N-goukei;\n\t\t\tSystem.out.println(result);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}",
"goukei<=N",
"goukei",
"N",
"{\n\t\t\tresult=N-goukei;\n\t\t\tSystem.out.println(result);\n\t\t}",
"result=N-goukei",
"result",
"N-goukei",
"N",
"goukei",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\t\n\t\tArrayList<Integer> hour=new ArrayList<>();\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint goukei=0;\n\t\tint hourdata=0;\n\t\tint result;\n\t\t\n\t\t//高橋君の夏休み\n\t\tint N=sc.nextInt();\n\t\t//高橋君の宿題の数\n\t\tint M=sc.nextInt();\n\t\t\n\t\t//宿題をやるのにかかる時間\n\t\tfor(int i=0;i<M;i++) {\n\t\t\thour.add(sc.nextInt());\n\t\t}\n\t\t\n\t\t//宿題をやるのにかかる時間の合計\n\t\tfor(int i=0;i<hour.size();i++) {\n\t\t\thourdata=hour.get(i);\n\t\t\tgoukei+=hourdata;\n\t\t}\n\t\t\n\t\tif(goukei<=N) {\n\t\t\tresult=N-goukei;\n\t\t\tSystem.out.println(result);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\t\n\t\tArrayList<Integer> hour=new ArrayList<>();\n\t\tScanner sc=new Scanner(System.in);\n\t\t\n\t\tint goukei=0;\n\t\tint hourdata=0;\n\t\tint result;\n\t\t\n\t\t//高橋君の夏休み\n\t\tint N=sc.nextInt();\n\t\t//高橋君の宿題の数\n\t\tint M=sc.nextInt();\n\t\t\n\t\t//宿題をやるのにかかる時間\n\t\tfor(int i=0;i<M;i++) {\n\t\t\thour.add(sc.nextInt());\n\t\t}\n\t\t\n\t\t//宿題をやるのにかかる時間の合計\n\t\tfor(int i=0;i<hour.size();i++) {\n\t\t\thourdata=hour.get(i);\n\t\t\tgoukei+=hourdata;\n\t\t}\n\t\t\n\t\tif(goukei<=N) {\n\t\t\tresult=N-goukei;\n\t\t\tSystem.out.println(result);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\n\t}\n\n}",
"Main"
] |
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
ArrayList<Integer> hour=new ArrayList<>();
Scanner sc=new Scanner(System.in);
int goukei=0;
int hourdata=0;
int result;
//高橋君の夏休み
int N=sc.nextInt();
//高橋君の宿題の数
int M=sc.nextInt();
//宿題をやるのにかかる時間
for(int i=0;i<M;i++) {
hour.add(sc.nextInt());
}
//宿題をやるのにかかる時間の合計
for(int i=0;i<hour.size();i++) {
hourdata=hour.get(i);
goukei+=hourdata;
}
if(goukei<=N) {
result=N-goukei;
System.out.println(result);
}else {
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
79,
14
],
[
79,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
17,
31
],
[
31,
32
],
[
31,
33
],
[
17,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
17,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
17,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
57,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
15,
76
],
[
76,
77
],
[
0,
78
],
[
78,
79
],
[
78,
80
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.*;\n \npublic class Main {\n public static void main(String args[]) throws IOException {\n\tScanner scanner = new Scanner(System.in);\n\tint summer = scanner.nextInt();\n\t//宿題の数\n\tint num = scanner.nextInt();\n\t//計算用\n int tmp = 0;\n \n\tfor(int i=0;i<num;i++){\n tmp += scanner.nextInt();\n\t}\n\t\n int day = summer - tmp;\n \n if(day>=0){\n System.out.println(day);\n }else{\n System.out.println(-1);\n }\n \n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String args[]) throws IOException {\n\tScanner scanner = new Scanner(System.in);\n\tint summer = scanner.nextInt();\n\t//宿題の数\n\tint num = scanner.nextInt();\n\t//計算用\n int tmp = 0;\n \n\tfor(int i=0;i<num;i++){\n tmp += scanner.nextInt();\n\t}\n\t\n int day = summer - tmp;\n \n if(day>=0){\n System.out.println(day);\n }else{\n System.out.println(-1);\n }\n \n }\n}",
"Main",
"public static void main(String args[]) throws IOException {\n\tScanner scanner = new Scanner(System.in);\n\tint summer = scanner.nextInt();\n\t//宿題の数\n\tint num = scanner.nextInt();\n\t//計算用\n int tmp = 0;\n \n\tfor(int i=0;i<num;i++){\n tmp += scanner.nextInt();\n\t}\n\t\n int day = summer - tmp;\n \n if(day>=0){\n System.out.println(day);\n }else{\n System.out.println(-1);\n }\n \n }",
"main",
"{\n\tScanner scanner = new Scanner(System.in);\n\tint summer = scanner.nextInt();\n\t//宿題の数\n\tint num = scanner.nextInt();\n\t//計算用\n int tmp = 0;\n \n\tfor(int i=0;i<num;i++){\n tmp += scanner.nextInt();\n\t}\n\t\n int day = summer - tmp;\n \n if(day>=0){\n System.out.println(day);\n }else{\n System.out.println(-1);\n }\n \n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int summer = scanner.nextInt();",
"summer",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int num = scanner.nextInt();",
"num",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int tmp = 0;",
"tmp",
"0",
"for(int i=0;i<num;i++){\n tmp += scanner.nextInt();\n\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<num",
"i",
"num",
"i++",
"i++",
"i",
"{\n tmp += scanner.nextInt();\n\t}",
"{\n tmp += scanner.nextInt();\n\t}",
"tmp += scanner.nextInt()",
"tmp",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int day = summer - tmp;",
"day",
"summer - tmp",
"summer",
"tmp",
"if(day>=0){\n System.out.println(day);\n }else{\n System.out.println(-1);\n }",
"day>=0",
"day",
"0",
"{\n System.out.println(day);\n }",
"System.out.println(day)",
"System.out.println",
"System.out",
"System",
"System.out",
"day",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String args[]",
"args",
"public class Main {\n public static void main(String args[]) throws IOException {\n\tScanner scanner = new Scanner(System.in);\n\tint summer = scanner.nextInt();\n\t//宿題の数\n\tint num = scanner.nextInt();\n\t//計算用\n int tmp = 0;\n \n\tfor(int i=0;i<num;i++){\n tmp += scanner.nextInt();\n\t}\n\t\n int day = summer - tmp;\n \n if(day>=0){\n System.out.println(day);\n }else{\n System.out.println(-1);\n }\n \n }\n}",
"public class Main {\n public static void main(String args[]) throws IOException {\n\tScanner scanner = new Scanner(System.in);\n\tint summer = scanner.nextInt();\n\t//宿題の数\n\tint num = scanner.nextInt();\n\t//計算用\n int tmp = 0;\n \n\tfor(int i=0;i<num;i++){\n tmp += scanner.nextInt();\n\t}\n\t\n int day = summer - tmp;\n \n if(day>=0){\n System.out.println(day);\n }else{\n System.out.println(-1);\n }\n \n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
public static void main(String args[]) throws IOException {
Scanner scanner = new Scanner(System.in);
int summer = scanner.nextInt();
//宿題の数
int num = scanner.nextInt();
//計算用
int tmp = 0;
for(int i=0;i<num;i++){
tmp += scanner.nextInt();
}
int day = summer - tmp;
if(day>=0){
System.out.println(day);
}else{
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
2,
13,
18,
13,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
18,
13,
13,
17,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
41,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
8,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
56,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
6,
74
],
[
74,
75
]
] |
[
"import java.util.*;\n\n // Compiler version JDK 11.0.2\n\n class Main\n {\n public static void main(String args[])\n { \n Scanner sc= new Scanner(System.in);\n long n = sc.nextLong();\n int m = sc.nextInt();\n int a[]= new int[m];\n long sum =0;\n for(int i =0;i<m;i ++)\n {\n a[i]= sc.nextInt();\n sum= sum + a[i];\n \n }\n if(n>=sum)\n System.out.println(n-sum);\n else\n System.out.println(\"-1\");\n \n }\n }",
"import java.util.*;",
"util.*",
"java",
"class Main\n {\n public static void main(String args[])\n { \n Scanner sc= new Scanner(System.in);\n long n = sc.nextLong();\n int m = sc.nextInt();\n int a[]= new int[m];\n long sum =0;\n for(int i =0;i<m;i ++)\n {\n a[i]= sc.nextInt();\n sum= sum + a[i];\n \n }\n if(n>=sum)\n System.out.println(n-sum);\n else\n System.out.println(\"-1\");\n \n }\n }",
"Main",
"public static void main(String args[])\n { \n Scanner sc= new Scanner(System.in);\n long n = sc.nextLong();\n int m = sc.nextInt();\n int a[]= new int[m];\n long sum =0;\n for(int i =0;i<m;i ++)\n {\n a[i]= sc.nextInt();\n sum= sum + a[i];\n \n }\n if(n>=sum)\n System.out.println(n-sum);\n else\n System.out.println(\"-1\");\n \n }",
"main",
"{ \n Scanner sc= new Scanner(System.in);\n long n = sc.nextLong();\n int m = sc.nextInt();\n int a[]= new int[m];\n long sum =0;\n for(int i =0;i<m;i ++)\n {\n a[i]= sc.nextInt();\n sum= sum + a[i];\n \n }\n if(n>=sum)\n System.out.println(n-sum);\n else\n System.out.println(\"-1\");\n \n }",
"Scanner sc= new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long n = sc.nextLong();",
"n",
"sc.nextLong()",
"sc.nextLong",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int a[]= new int[m];",
"a",
"new int[m]",
"m",
"long sum =0;",
"sum",
"0",
"for(int i =0;i<m;i ++)\n {\n a[i]= sc.nextInt();\n sum= sum + a[i];\n \n }",
"int i =0;",
"int i =0;",
"i",
"0",
"i<m",
"i",
"m",
"i ++",
"i ++",
"i",
"{\n a[i]= sc.nextInt();\n sum= sum + a[i];\n \n }",
"{\n a[i]= sc.nextInt();\n sum= sum + a[i];\n \n }",
"a[i]= sc.nextInt()",
"a[i]",
"a",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum= sum + a[i]",
"sum",
"sum + a[i]",
"sum",
"a[i]",
"a",
"i",
"if(n>=sum)\n System.out.println(n-sum);\n else\n System.out.println(\"-1\");",
"n>=sum",
"n",
"sum",
"System.out.println(n-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum",
"n",
"sum",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"String args[]",
"args"
] |
import java.util.*;
// Compiler version JDK 11.0.2
class Main
{
public static void main(String args[])
{
Scanner sc= new Scanner(System.in);
long n = sc.nextLong();
int m = sc.nextInt();
int a[]= new int[m];
long sum =0;
for(int i =0;i<m;i ++)
{
a[i]= sc.nextInt();
sum= sum + a[i];
}
if(n>=sum)
System.out.println(n-sum);
else
System.out.println("-1");
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
65,
5
],
[
65,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
8,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
6,
62
],
[
62,
63
],
[
0,
64
],
[
64,
65
],
[
64,
66
]
] |
[
"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 m = sc.nextInt();\n\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }\n\n int res = n - sum;\n if(res < 0) res = -1;\n\n System.out.println(res);\n\n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }\n\n int res = n - sum;\n if(res < 0) res = -1;\n\n System.out.println(res);\n\n\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }\n\n int res = n - sum;\n if(res < 0) res = -1;\n\n System.out.println(res);\n\n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }\n\n int res = n - sum;\n if(res < 0) res = -1;\n\n System.out.println(res);\n\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n sum += sc.nextInt();\n }",
"{\n sum += sc.nextInt();\n }",
"sum += sc.nextInt()",
"sum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int res = n - sum;",
"res",
"n - sum",
"n",
"sum",
"if(res < 0) res = -1;",
"res < 0",
"res",
"0",
"res = -1",
"res",
"-1",
"1",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }\n\n int res = n - sum;\n if(res < 0) res = -1;\n\n System.out.println(res);\n\n\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n int sum = 0;\n for (int i = 0; i < m; i++) {\n sum += sc.nextInt();\n }\n\n int res = n - sum;\n if(res < 0) res = -1;\n\n System.out.println(res);\n\n\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
for (int i = 0; i < m; i++) {
sum += sc.nextInt();
}
int res = n - sum;
if(res < 0) res = -1;
System.out.println(res);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
93,
8
],
[
93,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
11,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
28,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
11,
47
],
[
47,
48
],
[
47,
49
],
[
11,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
11,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
69,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
9,
90
],
[
90,
91
],
[
0,
92
],
[
92,
93
],
[
92,
94
]
] |
[
"import java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\t// n日間\n\t\tint n = scan.nextInt();\n\n\t\t// 宿題の数\n\t\t\n\t\tint m = scan.nextInt();\n\n\t\tArrayList list = new ArrayList();\n\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tint s = 0;\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\ts += (int)list.get(i);\n\t\t}\n\n\t\t// 休みより宿題が多い\n\t\tif(s > n) {\n\t\t\t// 宿題を終わらせることができない\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(n - s);\n\t\t}\n\n\t}\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\t// n日間\n\t\tint n = scan.nextInt();\n\n\t\t// 宿題の数\n\t\t\n\t\tint m = scan.nextInt();\n\n\t\tArrayList list = new ArrayList();\n\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tint s = 0;\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\ts += (int)list.get(i);\n\t\t}\n\n\t\t// 休みより宿題が多い\n\t\tif(s > n) {\n\t\t\t// 宿題を終わらせることができない\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(n - s);\n\t\t}\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\t// n日間\n\t\tint n = scan.nextInt();\n\n\t\t// 宿題の数\n\t\t\n\t\tint m = scan.nextInt();\n\n\t\tArrayList list = new ArrayList();\n\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tint s = 0;\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\ts += (int)list.get(i);\n\t\t}\n\n\t\t// 休みより宿題が多い\n\t\tif(s > n) {\n\t\t\t// 宿題を終わらせることができない\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(n - s);\n\t\t}\n\n\t}",
"main",
"{\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\t// n日間\n\t\tint n = scan.nextInt();\n\n\t\t// 宿題の数\n\t\t\n\t\tint m = scan.nextInt();\n\n\t\tArrayList list = new ArrayList();\n\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tint s = 0;\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\ts += (int)list.get(i);\n\t\t}\n\n\t\t// 休みより宿題が多い\n\t\tif(s > n) {\n\t\t\t// 宿題を終わらせることができない\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(n - s);\n\t\t}\n\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int m = scan.nextInt();",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"ArrayList list = new ArrayList();",
"list",
"new ArrayList()",
"for(int i = 0; i < m; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tlist.add(scan.nextInt());\n\t\t}",
"{\n\t\t\tlist.add(scan.nextInt());\n\t\t}",
"list.add(scan.nextInt())",
"list.add",
"list",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int s = 0;",
"s",
"0",
"for(int i = 0; i < m; i++) {\n\t\t\ts += (int)list.get(i);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\ts += (int)list.get(i);\n\t\t}",
"{\n\t\t\ts += (int)list.get(i);\n\t\t}",
"s += (int)list.get(i)",
"s",
"(int)list.get(i)",
"list.get",
"list",
"i",
"if(s > n) {\n\t\t\t// 宿題を終わらせることができない\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(n - s);\n\t\t}",
"s > n",
"s",
"n",
"{\n\t\t\t// 宿題を終わらせることができない\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(n - s);\n\t\t}",
"System.out.println(n - s)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - s",
"n",
"s",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\t// n日間\n\t\tint n = scan.nextInt();\n\n\t\t// 宿題の数\n\t\t\n\t\tint m = scan.nextInt();\n\n\t\tArrayList list = new ArrayList();\n\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tint s = 0;\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\ts += (int)list.get(i);\n\t\t}\n\n\t\t// 休みより宿題が多い\n\t\tif(s > n) {\n\t\t\t// 宿題を終わらせることができない\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(n - s);\n\t\t}\n\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\t// n日間\n\t\tint n = scan.nextInt();\n\n\t\t// 宿題の数\n\t\t\n\t\tint m = scan.nextInt();\n\n\t\tArrayList list = new ArrayList();\n\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tint s = 0;\n\t\tfor(int i = 0; i < m; i++) {\n\t\t\ts += (int)list.get(i);\n\t\t}\n\n\t\t// 休みより宿題が多い\n\t\tif(s > n) {\n\t\t\t// 宿題を終わらせることができない\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(n - s);\n\t\t}\n\n\t}\n}",
"Main"
] |
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
// n日間
int n = scan.nextInt();
// 宿題の数
int m = scan.nextInt();
ArrayList list = new ArrayList();
for(int i = 0; i < m; i++) {
list.add(scan.nextInt());
}
int s = 0;
for(int i = 0; i < m; i++) {
s += (int)list.get(i);
}
// 休みより宿題が多い
if(s > n) {
// 宿題を終わらせることができない
System.out.println(-1);
}else {
System.out.println(n - s);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
8,
2,
2,
13,
13,
17,
2,
13,
13,
40,
17,
23,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
4,
13,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
154,
8
],
[
154,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
11,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
11,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
48,
54
],
[
54,
55
],
[
54,
56
],
[
48,
57
],
[
57,
58
],
[
9,
59
],
[
59,
60
],
[
9,
61
],
[
61,
62
],
[
154,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
65,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
65,
76
],
[
76,
77
],
[
76,
78
],
[
65,
79
],
[
79,
80
],
[
79,
81
],
[
65,
82
],
[
82,
83
],
[
82,
84
],
[
82,
85
],
[
65,
86
],
[
86,
87
],
[
87,
88
],
[
63,
89
],
[
89,
90
],
[
154,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
91,
95
],
[
95,
96
],
[
91,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
103,
105
],
[
97,
106
],
[
106,
107
],
[
91,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
112,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
111,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
121,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
110,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
91,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
139,
142
],
[
142,
143
],
[
91,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
148,
151
],
[
151,
152
],
[
0,
153
],
[
153,
154
],
[
153,
155
]
] |
[
"\nimport java.io.*;\nimport java.util.*;\n\npublic class Main {\n\n private static void solve(InputReader in, PrintWriter out) {\n Integer m=in.nextInt(),n=in.nextInt();\n long sum=0;\n for(int i=0;i<n;i++){\n sum+=in.nextInt();\n }\n System.out.print((m-sum>=0)?m-sum:-1);\n }\n public static void main(String args[]){\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n solve(in,out);\n out.close();\n }\n private static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public Double nextDouble() {\n return Double.parseDouble(next());\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n private static void solve(InputReader in, PrintWriter out) {\n Integer m=in.nextInt(),n=in.nextInt();\n long sum=0;\n for(int i=0;i<n;i++){\n sum+=in.nextInt();\n }\n System.out.print((m-sum>=0)?m-sum:-1);\n }\n public static void main(String args[]){\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n solve(in,out);\n out.close();\n }\n private static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public Double nextDouble() {\n return Double.parseDouble(next());\n }\n }\n}",
"Main",
"private static void solve(InputReader in, PrintWriter out) {\n Integer m=in.nextInt(),n=in.nextInt();\n long sum=0;\n for(int i=0;i<n;i++){\n sum+=in.nextInt();\n }\n System.out.print((m-sum>=0)?m-sum:-1);\n }",
"solve",
"{\n Integer m=in.nextInt(),n=in.nextInt();\n long sum=0;\n for(int i=0;i<n;i++){\n sum+=in.nextInt();\n }\n System.out.print((m-sum>=0)?m-sum:-1);\n }",
"Integer m=in.nextInt()",
"m",
"in.nextInt()",
"in.nextInt",
"in",
"n=in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"long sum=0;",
"sum",
"0",
"for(int i=0;i<n;i++){\n sum+=in.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n sum+=in.nextInt();\n }",
"{\n sum+=in.nextInt();\n }",
"sum+=in.nextInt()",
"sum",
"in.nextInt()",
"in.nextInt",
"in",
"System.out.print((m-sum>=0)?m-sum:-1)",
"System.out.print",
"System.out",
"System",
"System.out",
"(m-sum>=0)?m-sum:-1",
"(m-sum>=0)",
"m-sum",
"m",
"sum",
"0",
"m-sum",
"m",
"sum",
"-1",
"1",
"InputReader in",
"in",
"PrintWriter out",
"out",
"public static void main(String args[]){\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n solve(in,out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n solve(in,out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"InputReader in = new InputReader(inputStream);",
"in",
"new InputReader(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"solve(in,out)",
"solve",
"in",
"out",
"out.close()",
"out.close",
"out",
"String args[]",
"args",
"private static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public Double nextDouble() {\n return Double.parseDouble(next());\n }\n }",
"InputReader",
"public BufferedReader reader;",
"reader",
"public StringTokenizer tokenizer;",
"tokenizer",
"public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"InputReader",
"{\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"reader = new BufferedReader(new InputStreamReader(stream), 32768)",
"reader",
"new BufferedReader(new InputStreamReader(stream), 32768)",
"tokenizer = null",
"tokenizer",
"null",
"InputStream stream",
"stream",
"public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"next",
"{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }",
"catch (IOException e) {\n throw new RuntimeException(e);\n }",
"IOException e",
"{\n throw new RuntimeException(e);\n }",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"public int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public Double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public class Main {\n\n private static void solve(InputReader in, PrintWriter out) {\n Integer m=in.nextInt(),n=in.nextInt();\n long sum=0;\n for(int i=0;i<n;i++){\n sum+=in.nextInt();\n }\n System.out.print((m-sum>=0)?m-sum:-1);\n }\n public static void main(String args[]){\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n solve(in,out);\n out.close();\n }\n private static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public Double nextDouble() {\n return Double.parseDouble(next());\n }\n }\n}",
"public class Main {\n\n private static void solve(InputReader in, PrintWriter out) {\n Integer m=in.nextInt(),n=in.nextInt();\n long sum=0;\n for(int i=0;i<n;i++){\n sum+=in.nextInt();\n }\n System.out.print((m-sum>=0)?m-sum:-1);\n }\n public static void main(String args[]){\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n solve(in,out);\n out.close();\n }\n private static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n public Double nextDouble() {\n return Double.parseDouble(next());\n }\n }\n}",
"Main"
] |
import java.io.*;
import java.util.*;
public class Main {
private static void solve(InputReader in, PrintWriter out) {
Integer m=in.nextInt(),n=in.nextInt();
long sum=0;
for(int i=0;i<n;i++){
sum+=in.nextInt();
}
System.out.print((m-sum>=0)?m-sum:-1);
}
public static void main(String args[]){
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
solve(in,out);
out.close();
}
private static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
public Double nextDouble() {
return Double.parseDouble(next());
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
4,
18,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
64,
5
],
[
64,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
8,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
42,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
6,
61
],
[
61,
62
],
[
0,
63
],
[
63,
64
],
[
63,
65
]
] |
[
"import java.util.Scanner;\npublic class Main{\n public static void main(String[] args){\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n int x = s.nextInt();\n for(int i = 0; i < x; i++){\n n = n - s.nextInt();\n }\n if(n < 0){\n System.out.println(-1);\n } else {\n System.out.println(n);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n int x = s.nextInt();\n for(int i = 0; i < x; i++){\n n = n - s.nextInt();\n }\n if(n < 0){\n System.out.println(-1);\n } else {\n System.out.println(n);\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n int x = s.nextInt();\n for(int i = 0; i < x; i++){\n n = n - s.nextInt();\n }\n if(n < 0){\n System.out.println(-1);\n } else {\n System.out.println(n);\n }\n }",
"main",
"{\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n int x = s.nextInt();\n for(int i = 0; i < x; i++){\n n = n - s.nextInt();\n }\n if(n < 0){\n System.out.println(-1);\n } else {\n System.out.println(n);\n }\n }",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int n = s.nextInt();",
"n",
"s.nextInt()",
"s.nextInt",
"s",
"int x = s.nextInt();",
"x",
"s.nextInt()",
"s.nextInt",
"s",
"for(int i = 0; i < x; i++){\n n = n - s.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < x",
"i",
"x",
"i++",
"i++",
"i",
"{\n n = n - s.nextInt();\n }",
"{\n n = n - s.nextInt();\n }",
"n = n - s.nextInt()",
"n",
"n - s.nextInt()",
"n",
"s.nextInt()",
"s.nextInt",
"s",
"if(n < 0){\n System.out.println(-1);\n } else {\n System.out.println(n);\n }",
"n < 0",
"n",
"0",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(n);\n }",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n int x = s.nextInt();\n for(int i = 0; i < x; i++){\n n = n - s.nextInt();\n }\n if(n < 0){\n System.out.println(-1);\n } else {\n System.out.println(n);\n }\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner s = new Scanner(System.in);\n int n = s.nextInt();\n int x = s.nextInt();\n for(int i = 0; i < x; i++){\n n = n - s.nextInt();\n }\n if(n < 0){\n System.out.println(-1);\n } else {\n System.out.println(n);\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int x = s.nextInt();
for(int i = 0; i < x; i++){
n = n - s.nextInt();
}
if(n < 0){
System.out.println(-1);
} else {
System.out.println(n);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
42,
2,
40,
13,
17,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
41,
13,
2,
13,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
72,
11
],
[
72,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
14,
31
],
[
31,
32
],
[
31,
33
],
[
14,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
35,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
40,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
14,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
14,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
63,
68
],
[
12,
69
],
[
69,
70
],
[
0,
71
],
[
71,
72
],
[
71,
73
]
] |
[
"import java.util.*;\nimport java.io.*;\nimport java.lang.*;\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(); int m = sc.nextInt(); int homeworkDays = 0;\n\t\tint[] arr = new int[m];\n\t\twhile (m-- > 0) {\n\t\t\tarr[m] = sc.nextInt();\n\t\t\thomeworkDays+=arr[m];\n\t\t}\n\t\t\tint vacation = n-homeworkDays;\n\t\t\tSystem.out.println(vacation >= 0 ? vacation : \"-1\");\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"public class Main {\n\tpublic static void main (String[] args) {\n\t\tScanner sc = new Scanner (System.in);\n\t\tint n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;\n\t\tint[] arr = new int[m];\n\t\twhile (m-- > 0) {\n\t\t\tarr[m] = sc.nextInt();\n\t\t\thomeworkDays+=arr[m];\n\t\t}\n\t\t\tint vacation = n-homeworkDays;\n\t\t\tSystem.out.println(vacation >= 0 ? vacation : \"-1\");\n\t}\n}",
"Main",
"public static void main (String[] args) {\n\t\tScanner sc = new Scanner (System.in);\n\t\tint n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;\n\t\tint[] arr = new int[m];\n\t\twhile (m-- > 0) {\n\t\t\tarr[m] = sc.nextInt();\n\t\t\thomeworkDays+=arr[m];\n\t\t}\n\t\t\tint vacation = n-homeworkDays;\n\t\t\tSystem.out.println(vacation >= 0 ? vacation : \"-1\");\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner (System.in);\n\t\tint n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;\n\t\tint[] arr = new int[m];\n\t\twhile (m-- > 0) {\n\t\t\tarr[m] = sc.nextInt();\n\t\t\thomeworkDays+=arr[m];\n\t\t}\n\t\t\tint vacation = n-homeworkDays;\n\t\t\tSystem.out.println(vacation >= 0 ? vacation : \"-1\");\n\t}",
"Scanner sc = new Scanner (System.in);",
"sc",
"new Scanner (System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int homeworkDays = 0;",
"homeworkDays",
"0",
"int[] arr = new int[m];",
"arr",
"new int[m]",
"m",
"while (m-- > 0) {\n\t\t\tarr[m] = sc.nextInt();\n\t\t\thomeworkDays+=arr[m];\n\t\t}",
"m-- > 0",
"m--",
"m",
"0",
"{\n\t\t\tarr[m] = sc.nextInt();\n\t\t\thomeworkDays+=arr[m];\n\t\t}",
"arr[m] = sc.nextInt()",
"arr[m]",
"arr",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"homeworkDays+=arr[m]",
"homeworkDays",
"arr[m]",
"arr",
"m",
"int vacation = n-homeworkDays;",
"vacation",
"n-homeworkDays",
"n",
"homeworkDays",
"System.out.println(vacation >= 0 ? vacation : \"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"vacation >= 0 ? vacation : \"-1\"",
"vacation >= 0",
"vacation",
"0",
"vacation",
"\"-1\"",
"String[] args",
"args",
"public class Main {\n\tpublic static void main (String[] args) {\n\t\tScanner sc = new Scanner (System.in);\n\t\tint n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;\n\t\tint[] arr = new int[m];\n\t\twhile (m-- > 0) {\n\t\t\tarr[m] = sc.nextInt();\n\t\t\thomeworkDays+=arr[m];\n\t\t}\n\t\t\tint vacation = n-homeworkDays;\n\t\t\tSystem.out.println(vacation >= 0 ? vacation : \"-1\");\n\t}\n}",
"public class Main {\n\tpublic static void main (String[] args) {\n\t\tScanner sc = new Scanner (System.in);\n\t\tint n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;\n\t\tint[] arr = new int[m];\n\t\twhile (m-- > 0) {\n\t\t\tarr[m] = sc.nextInt();\n\t\t\thomeworkDays+=arr[m];\n\t\t}\n\t\t\tint vacation = n-homeworkDays;\n\t\t\tSystem.out.println(vacation >= 0 ? vacation : \"-1\");\n\t}\n}",
"Main"
] |
import java.util.*;
import java.io.*;
import java.lang.*;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner (System.in);
int n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;
int[] arr = new int[m];
while (m-- > 0) {
arr[m] = sc.nextInt();
homeworkDays+=arr[m];
}
int vacation = n-homeworkDays;
System.out.println(vacation >= 0 ? vacation : "-1");
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
8,
2,
13,
13,
2,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
28,
29
],
[
28,
30
],
[
0,
31
],
[
31,
32
],
[
31,
33
],
[
0,
34
],
[
34,
35
],
[
34,
36
],
[
0,
37
],
[
37,
38
],
[
37,
39
],
[
0,
40
],
[
95,
41
],
[
95,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
44,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
44,
58
],
[
58,
59
],
[
58,
60
],
[
44,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
44,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
87,
88
],
[
87,
89
],
[
83,
90
],
[
90,
91
],
[
42,
92
],
[
92,
93
],
[
0,
94
],
[
94,
95
],
[
94,
96
]
] |
[
"import java.util.Scanner;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport java.math.BigInteger;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.Iterator;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.ListIterator;\n \n public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t \n\t\t//inputs\n\t\tint n = input.nextInt();\n\t\tint m = input.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0 ; i < m ; i++)\n\t\t\tsum += input.nextInt();\n\t\t\n\t\tSystem.out.println(n >= sum ? n - sum : -1);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Set;",
"Set",
"java.util",
"import java.util.TreeSet;",
"TreeSet",
"java.util",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Collection;",
"Collection",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.HashSet;",
"HashSet",
"java.util",
"import java.util.Iterator;",
"Iterator",
"java.util",
"import java.util.LinkedList;",
"LinkedList",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.ListIterator;",
"ListIterator",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t \n\t\t//inputs\n\t\tint n = input.nextInt();\n\t\tint m = input.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0 ; i < m ; i++)\n\t\t\tsum += input.nextInt();\n\t\t\n\t\tSystem.out.println(n >= sum ? n - sum : -1);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t \n\t\t//inputs\n\t\tint n = input.nextInt();\n\t\tint m = input.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0 ; i < m ; i++)\n\t\t\tsum += input.nextInt();\n\t\t\n\t\tSystem.out.println(n >= sum ? n - sum : -1);\n\t}",
"main",
"{\n\t\tScanner input = new Scanner(System.in);\n\t \n\t\t//inputs\n\t\tint n = input.nextInt();\n\t\tint m = input.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0 ; i < m ; i++)\n\t\t\tsum += input.nextInt();\n\t\t\n\t\tSystem.out.println(n >= sum ? n - sum : -1);\n\t}",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"int n = input.nextInt();",
"n",
"input.nextInt()",
"input.nextInt",
"input",
"int m = input.nextInt();",
"m",
"input.nextInt()",
"input.nextInt",
"input",
"int sum = 0;",
"sum",
"0",
"for(int i = 0 ; i < m ; i++)\n\t\t\tsum += input.nextInt();",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"sum += input.nextInt();",
"sum += input.nextInt()",
"sum",
"input.nextInt()",
"input.nextInt",
"input",
"System.out.println(n >= sum ? n - sum : -1)",
"System.out.println",
"System.out",
"System",
"System.out",
"n >= sum ? n - sum : -1",
"n >= sum",
"n",
"sum",
"n - sum",
"n",
"sum",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t \n\t\t//inputs\n\t\tint n = input.nextInt();\n\t\tint m = input.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0 ; i < m ; i++)\n\t\t\tsum += input.nextInt();\n\t\t\n\t\tSystem.out.println(n >= sum ? n - sum : -1);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t \n\t\t//inputs\n\t\tint n = input.nextInt();\n\t\tint m = input.nextInt();\n\t\tint sum = 0;\n\t\tfor(int i = 0 ; i < m ; i++)\n\t\t\tsum += input.nextInt();\n\t\t\n\t\tSystem.out.println(n >= sum ? n - sum : -1);\n\t}\n}",
"Main"
] |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
//inputs
int n = input.nextInt();
int m = input.nextInt();
int sum = 0;
for(int i = 0 ; i < m ; i++)
sum += input.nextInt();
System.out.println(n >= sum ? n - sum : -1);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
41,
13,
13,
14,
2,
13,
17,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
60,
5
],
[
60,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
8,
40
],
[
40,
41
],
[
40,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
8,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
6,
57
],
[
57,
58
],
[
0,
59
],
[
59,
60
],
[
59,
61
]
] |
[
"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 m = sc.nextInt();\n for(int i = 0; i < m; i++) {\n n -= sc.nextInt();\n }\n int ans = n;\n if(n < 0) ans = -1;\n System.out.println(ans);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n for(int i = 0; i < m; i++) {\n n -= sc.nextInt();\n }\n int ans = n;\n if(n < 0) ans = -1;\n System.out.println(ans);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n for(int i = 0; i < m; i++) {\n n -= sc.nextInt();\n }\n int ans = n;\n if(n < 0) ans = -1;\n System.out.println(ans);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n for(int i = 0; i < m; i++) {\n n -= sc.nextInt();\n }\n int ans = n;\n if(n < 0) ans = -1;\n System.out.println(ans);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i = 0; i < m; i++) {\n n -= sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n n -= sc.nextInt();\n }",
"{\n n -= sc.nextInt();\n }",
"n -= sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int ans = n;",
"ans",
"n",
"if(n < 0) ans = -1;",
"n < 0",
"n",
"0",
"ans = -1",
"ans",
"-1",
"1",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n for(int i = 0; i < m; i++) {\n n -= sc.nextInt();\n }\n int ans = n;\n if(n < 0) ans = -1;\n System.out.println(ans);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n for(int i = 0; i < m; i++) {\n n -= sc.nextInt();\n }\n int ans = n;\n if(n < 0) ans = -1;\n System.out.println(ans);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
for(int i = 0; i < m; i++) {
n -= sc.nextInt();
}
int ans = n;
if(n < 0) ans = -1;
System.out.println(ans);
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
13,
14,
2,
13,
40,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
69,
5
],
[
69,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
46,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
46,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
6,
66
],
[
66,
67
],
[
0,
68
],
[
68,
69
],
[
68,
70
]
] |
[
"import java.util.Scanner;\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 M = scan.nextInt();\n\t\tint ans = N;\n\n\t\tfor (int i = 0; i < M; i++){\n\t\t\tint A = scan.nextInt();\n\t\t\tans -= A;\n\t\t}\n\t\tif (ans < -1){\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint M = scan.nextInt();\n\t\tint ans = N;\n\n\t\tfor (int i = 0; i < M; i++){\n\t\t\tint A = scan.nextInt();\n\t\t\tans -= A;\n\t\t}\n\t\tif (ans < -1){\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint M = scan.nextInt();\n\t\tint ans = N;\n\n\t\tfor (int i = 0; i < M; i++){\n\t\t\tint A = scan.nextInt();\n\t\t\tans -= A;\n\t\t}\n\t\tif (ans < -1){\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint M = scan.nextInt();\n\t\tint ans = N;\n\n\t\tfor (int i = 0; i < M; i++){\n\t\t\tint A = scan.nextInt();\n\t\t\tans -= A;\n\t\t}\n\t\tif (ans < -1){\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int M = scan.nextInt();",
"M",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int ans = N;",
"ans",
"N",
"for (int i = 0; i < M; i++){\n\t\t\tint A = scan.nextInt();\n\t\t\tans -= A;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tint A = scan.nextInt();\n\t\t\tans -= A;\n\t\t}",
"{\n\t\t\tint A = scan.nextInt();\n\t\t\tans -= A;\n\t\t}",
"int A = scan.nextInt();",
"A",
"scan.nextInt()",
"scan.nextInt",
"scan",
"ans -= A",
"ans",
"A",
"if (ans < -1){\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(ans);\n\t\t}",
"ans < -1",
"ans",
"-1",
"1",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(ans);\n\t\t}",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint M = scan.nextInt();\n\t\tint ans = N;\n\n\t\tfor (int i = 0; i < M; i++){\n\t\t\tint A = scan.nextInt();\n\t\t\tans -= A;\n\t\t}\n\t\tif (ans < -1){\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint N = scan.nextInt();\n\t\tint M = scan.nextInt();\n\t\tint ans = N;\n\n\t\tfor (int i = 0; i < M; i++){\n\t\t\tint A = scan.nextInt();\n\t\t\tans -= A;\n\t\t}\n\t\tif (ans < -1){\n\t\t\tSystem.out.println(-1);\n\t\t}else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
int M = scan.nextInt();
int ans = N;
for (int i = 0; i < M; i++){
int A = scan.nextInt();
ans -= A;
}
if (ans < -1){
System.out.println(-1);
}else {
System.out.println(ans);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
65,
5
],
[
65,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
40,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
43,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
6,
62
],
[
62,
63
],
[
0,
64
],
[
64,
65
],
[
64,
66
]
] |
[
"import java.util.*;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a=sc.nextInt();\n\t\tint b=sc.nextInt();\n\t\tfor(int i=0;i<b;i++) {\n\t\t\tint k =sc.nextInt();\n\t\t\ta-=k;\n\t\t}\n\t\tif(a>=0) {\n\t\t\tSystem.out.println(a);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t\n\t\t\n\t}\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a=sc.nextInt();\n\t\tint b=sc.nextInt();\n\t\tfor(int i=0;i<b;i++) {\n\t\t\tint k =sc.nextInt();\n\t\t\ta-=k;\n\t\t}\n\t\tif(a>=0) {\n\t\t\tSystem.out.println(a);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t\n\t\t\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a=sc.nextInt();\n\t\tint b=sc.nextInt();\n\t\tfor(int i=0;i<b;i++) {\n\t\t\tint k =sc.nextInt();\n\t\t\ta-=k;\n\t\t}\n\t\tif(a>=0) {\n\t\t\tSystem.out.println(a);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t\n\t\t\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a=sc.nextInt();\n\t\tint b=sc.nextInt();\n\t\tfor(int i=0;i<b;i++) {\n\t\t\tint k =sc.nextInt();\n\t\t\ta-=k;\n\t\t}\n\t\tif(a>=0) {\n\t\t\tSystem.out.println(a);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t\n\t\t\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int a=sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int b=sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=0;i<b;i++) {\n\t\t\tint k =sc.nextInt();\n\t\t\ta-=k;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<b",
"i",
"b",
"i++",
"i++",
"i",
"{\n\t\t\tint k =sc.nextInt();\n\t\t\ta-=k;\n\t\t}",
"{\n\t\t\tint k =sc.nextInt();\n\t\t\ta-=k;\n\t\t}",
"int k =sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"a-=k",
"a",
"k",
"if(a>=0) {\n\t\t\tSystem.out.println(a);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}",
"a>=0",
"a",
"0",
"{\n\t\t\tSystem.out.println(a);\n\t\t}",
"System.out.println(a)",
"System.out.println",
"System.out",
"System",
"System.out",
"a",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a=sc.nextInt();\n\t\tint b=sc.nextInt();\n\t\tfor(int i=0;i<b;i++) {\n\t\t\tint k =sc.nextInt();\n\t\t\ta-=k;\n\t\t}\n\t\tif(a>=0) {\n\t\t\tSystem.out.println(a);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t\n\t\t\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a=sc.nextInt();\n\t\tint b=sc.nextInt();\n\t\tfor(int i=0;i<b;i++) {\n\t\t\tint k =sc.nextInt();\n\t\t\ta-=k;\n\t\t}\n\t\tif(a>=0) {\n\t\t\tSystem.out.println(a);\n\t\t}else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t\n\t\t\n\t}\n\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a=sc.nextInt();
int b=sc.nextInt();
for(int i=0;i<b;i++) {
int k =sc.nextInt();
a-=k;
}
if(a>=0) {
System.out.println(a);
}else {
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
41,
13,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
17,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
74,
5
],
[
74,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
8,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
50,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
8,
68
],
[
68,
69
],
[
69,
70
],
[
6,
71
],
[
71,
72
],
[
0,
73
],
[
73,
74
],
[
73,
75
]
] |
[
"import java.util.Scanner;\n \npublic class Main {\n \n public static void main(String[] args) {\n \n Scanner scanner = new Scanner(System.in);\n \n int vacation = scanner.nextInt();\n int homeworkNumber = scanner.nextInt();\n int studyDay = 0;\n \n for (int i = 0; i < homeworkNumber; i++) {\n studyDay += scanner.nextInt();\n }\n \n int playable;\n \n playable = vacation - studyDay;\n \n if (playable >= 0) {\n \n System.out.println(playable);\n } else {\n System.out.println(\"-1\");\n }\n \n scanner.close();\n \n }\n \n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n \n public static void main(String[] args) {\n \n Scanner scanner = new Scanner(System.in);\n \n int vacation = scanner.nextInt();\n int homeworkNumber = scanner.nextInt();\n int studyDay = 0;\n \n for (int i = 0; i < homeworkNumber; i++) {\n studyDay += scanner.nextInt();\n }\n \n int playable;\n \n playable = vacation - studyDay;\n \n if (playable >= 0) {\n \n System.out.println(playable);\n } else {\n System.out.println(\"-1\");\n }\n \n scanner.close();\n \n }\n \n}",
"Main",
"public static void main(String[] args) {\n \n Scanner scanner = new Scanner(System.in);\n \n int vacation = scanner.nextInt();\n int homeworkNumber = scanner.nextInt();\n int studyDay = 0;\n \n for (int i = 0; i < homeworkNumber; i++) {\n studyDay += scanner.nextInt();\n }\n \n int playable;\n \n playable = vacation - studyDay;\n \n if (playable >= 0) {\n \n System.out.println(playable);\n } else {\n System.out.println(\"-1\");\n }\n \n scanner.close();\n \n }",
"main",
"{\n \n Scanner scanner = new Scanner(System.in);\n \n int vacation = scanner.nextInt();\n int homeworkNumber = scanner.nextInt();\n int studyDay = 0;\n \n for (int i = 0; i < homeworkNumber; i++) {\n studyDay += scanner.nextInt();\n }\n \n int playable;\n \n playable = vacation - studyDay;\n \n if (playable >= 0) {\n \n System.out.println(playable);\n } else {\n System.out.println(\"-1\");\n }\n \n scanner.close();\n \n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int vacation = scanner.nextInt();",
"vacation",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int homeworkNumber = scanner.nextInt();",
"homeworkNumber",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int studyDay = 0;",
"studyDay",
"0",
"for (int i = 0; i < homeworkNumber; i++) {\n studyDay += scanner.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < homeworkNumber",
"i",
"homeworkNumber",
"i++",
"i++",
"i",
"{\n studyDay += scanner.nextInt();\n }",
"{\n studyDay += scanner.nextInt();\n }",
"studyDay += scanner.nextInt()",
"studyDay",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int playable;",
"playable",
"playable = vacation - studyDay",
"playable",
"vacation - studyDay",
"vacation",
"studyDay",
"if (playable >= 0) {\n \n System.out.println(playable);\n } else {\n System.out.println(\"-1\");\n }",
"playable >= 0",
"playable",
"0",
"{\n \n System.out.println(playable);\n }",
"System.out.println(playable)",
"System.out.println",
"System.out",
"System",
"System.out",
"playable",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"scanner.close()",
"scanner.close",
"scanner",
"String[] args",
"args",
"public class Main {\n \n public static void main(String[] args) {\n \n Scanner scanner = new Scanner(System.in);\n \n int vacation = scanner.nextInt();\n int homeworkNumber = scanner.nextInt();\n int studyDay = 0;\n \n for (int i = 0; i < homeworkNumber; i++) {\n studyDay += scanner.nextInt();\n }\n \n int playable;\n \n playable = vacation - studyDay;\n \n if (playable >= 0) {\n \n System.out.println(playable);\n } else {\n System.out.println(\"-1\");\n }\n \n scanner.close();\n \n }\n \n}",
"public class Main {\n \n public static void main(String[] args) {\n \n Scanner scanner = new Scanner(System.in);\n \n int vacation = scanner.nextInt();\n int homeworkNumber = scanner.nextInt();\n int studyDay = 0;\n \n for (int i = 0; i < homeworkNumber; i++) {\n studyDay += scanner.nextInt();\n }\n \n int playable;\n \n playable = vacation - studyDay;\n \n if (playable >= 0) {\n \n System.out.println(playable);\n } else {\n System.out.println(\"-1\");\n }\n \n scanner.close();\n \n }\n \n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int vacation = scanner.nextInt();
int homeworkNumber = scanner.nextInt();
int studyDay = 0;
for (int i = 0; i < homeworkNumber; i++) {
studyDay += scanner.nextInt();
}
int playable;
playable = vacation - studyDay;
if (playable >= 0) {
System.out.println(playable);
} else {
System.out.println("-1");
}
scanner.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
42,
2,
40,
13,
17,
30,
41,
13,
4,
18,
13,
0,
13,
13,
41,
13,
17,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
0,
13,
2,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
69,
5
],
[
69,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
25,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
30,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
39,
41
],
[
8,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
42,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
57,
59
],
[
54,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
6,
66
],
[
66,
67
],
[
0,
68
],
[
68,
69
],
[
68,
70
]
] |
[
"\nimport java.util.*;\npublic class Main{\n \n public static void main(String []args){\n Scanner sc = new Scanner(System.in);\n int a = sc.nextInt();\n int t = sc.nextInt();\n int sum =0;\n while(t-->0){\n int b = sc.nextInt();\n sum+=b;\n \n }\n int r=0;\n if(a<sum){\n System.out.println(-1);\n }else{\n r = a-sum;\n System.out.println(r);\n }\n}}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n \n public static void main(String []args){\n Scanner sc = new Scanner(System.in);\n int a = sc.nextInt();\n int t = sc.nextInt();\n int sum =0;\n while(t-->0){\n int b = sc.nextInt();\n sum+=b;\n \n }\n int r=0;\n if(a<sum){\n System.out.println(-1);\n }else{\n r = a-sum;\n System.out.println(r);\n }\n}}",
"Main",
"public static void main(String []args){\n Scanner sc = new Scanner(System.in);\n int a = sc.nextInt();\n int t = sc.nextInt();\n int sum =0;\n while(t-->0){\n int b = sc.nextInt();\n sum+=b;\n \n }\n int r=0;\n if(a<sum){\n System.out.println(-1);\n }else{\n r = a-sum;\n System.out.println(r);\n }\n}",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int a = sc.nextInt();\n int t = sc.nextInt();\n int sum =0;\n while(t-->0){\n int b = sc.nextInt();\n sum+=b;\n \n }\n int r=0;\n if(a<sum){\n System.out.println(-1);\n }else{\n r = a-sum;\n System.out.println(r);\n }\n}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int a = sc.nextInt();",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int t = sc.nextInt();",
"t",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum =0;",
"sum",
"0",
"while(t-->0){\n int b = sc.nextInt();\n sum+=b;\n \n }",
"t-->0",
"t--",
"t",
"0",
"{\n int b = sc.nextInt();\n sum+=b;\n \n }",
"int b = sc.nextInt();",
"b",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum+=b",
"sum",
"b",
"int r=0;",
"r",
"0",
"if(a<sum){\n System.out.println(-1);\n }else{\n r = a-sum;\n System.out.println(r);\n }",
"a<sum",
"a",
"sum",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n r = a-sum;\n System.out.println(r);\n }",
"r = a-sum",
"r",
"a-sum",
"a",
"sum",
"System.out.println(r)",
"System.out.println",
"System.out",
"System",
"System.out",
"r",
"String []args",
"args",
"public class Main{\n \n public static void main(String []args){\n Scanner sc = new Scanner(System.in);\n int a = sc.nextInt();\n int t = sc.nextInt();\n int sum =0;\n while(t-->0){\n int b = sc.nextInt();\n sum+=b;\n \n }\n int r=0;\n if(a<sum){\n System.out.println(-1);\n }else{\n r = a-sum;\n System.out.println(r);\n }\n}}",
"public class Main{\n \n public static void main(String []args){\n Scanner sc = new Scanner(System.in);\n int a = sc.nextInt();\n int t = sc.nextInt();\n int sum =0;\n while(t-->0){\n int b = sc.nextInt();\n sum+=b;\n \n }\n int r=0;\n if(a<sum){\n System.out.println(-1);\n }else{\n r = a-sum;\n System.out.println(r);\n }\n}}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String []args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int t = sc.nextInt();
int sum =0;
while(t-->0){
int b = sc.nextInt();
sum+=b;
}
int r=0;
if(a<sum){
System.out.println(-1);
}else{
r = a-sum;
System.out.println(r);
}
}}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
4,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
0,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
106,
17
],
[
106,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
26,
31
],
[
20,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
37,
38
],
[
37,
39
],
[
20,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
45,
46
],
[
45,
47
],
[
20,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
50,
55
],
[
20,
56
],
[
56,
57
],
[
56,
58
],
[
20,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
59,
67
],
[
67,
68
],
[
68,
69
],
[
59,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
71,
80
],
[
80,
81
],
[
80,
82
],
[
20,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
83,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
83,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
95,
100
],
[
100,
101
],
[
100,
102
],
[
18,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString str[] = br.readLine().split(\" \");\n\n\t\tint n = Integer.parseInt(str[0]);\n\t\tint k = Integer.parseInt(str[1]);\n\n\t\tstr = br.readLine().split(\" \");\n\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tint a = Integer.parseInt(str[i]);\n\n\t\t\tsum += a;\n\t\t}\n\t\tif (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.HashMap;",
"HashMap",
"java.util",
"import java.util.Map;",
"Map",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString str[] = br.readLine().split(\" \");\n\n\t\tint n = Integer.parseInt(str[0]);\n\t\tint k = Integer.parseInt(str[1]);\n\n\t\tstr = br.readLine().split(\" \");\n\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tint a = Integer.parseInt(str[i]);\n\n\t\t\tsum += a;\n\t\t}\n\t\tif (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString str[] = br.readLine().split(\" \");\n\n\t\tint n = Integer.parseInt(str[0]);\n\t\tint k = Integer.parseInt(str[1]);\n\n\t\tstr = br.readLine().split(\" \");\n\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tint a = Integer.parseInt(str[i]);\n\n\t\t\tsum += a;\n\t\t}\n\t\tif (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString str[] = br.readLine().split(\" \");\n\n\t\tint n = Integer.parseInt(str[0]);\n\t\tint k = Integer.parseInt(str[1]);\n\n\t\tstr = br.readLine().split(\" \");\n\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tint a = Integer.parseInt(str[i]);\n\n\t\t\tsum += a;\n\t\t}\n\t\tif (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String str[] = br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int n = Integer.parseInt(str[0]);",
"n",
"Integer.parseInt(str[0])",
"Integer.parseInt",
"Integer",
"str[0]",
"str",
"0",
"int k = Integer.parseInt(str[1]);",
"k",
"Integer.parseInt(str[1])",
"Integer.parseInt",
"Integer",
"str[1]",
"str",
"1",
"str = br.readLine().split(\" \")",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"long sum = 0;",
"sum",
"0",
"for (int i = 0; i < k; i++) {\n\t\t\tint a = Integer.parseInt(str[i]);\n\n\t\t\tsum += a;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tint a = Integer.parseInt(str[i]);\n\n\t\t\tsum += a;\n\t\t}",
"{\n\t\t\tint a = Integer.parseInt(str[i]);\n\n\t\t\tsum += a;\n\t\t}",
"int a = Integer.parseInt(str[i]);",
"a",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"sum += a",
"sum",
"a",
"if (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}",
"n < sum",
"n",
"sum",
"{\n\t\t\tSystem.out.println(\"-1\");\n\t\t}",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n\t\t\tSystem.out.println(n - sum);\n\t\t}",
"System.out.println(n - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - sum",
"n",
"sum",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString str[] = br.readLine().split(\" \");\n\n\t\tint n = Integer.parseInt(str[0]);\n\t\tint k = Integer.parseInt(str[1]);\n\n\t\tstr = br.readLine().split(\" \");\n\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tint a = Integer.parseInt(str[i]);\n\n\t\t\tsum += a;\n\t\t}\n\t\tif (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n\t\tString str[] = br.readLine().split(\" \");\n\n\t\tint n = Integer.parseInt(str[0]);\n\t\tint k = Integer.parseInt(str[1]);\n\n\t\tstr = br.readLine().split(\" \");\n\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tint a = Integer.parseInt(str[i]);\n\n\t\t\tsum += a;\n\t\t}\n\t\tif (n < sum) {\n\t\t\tSystem.out.println(\"-1\");\n\t\t} else {\n\t\t\tSystem.out.println(n - sum);\n\t\t}\n\t}\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str[] = br.readLine().split(" ");
int n = Integer.parseInt(str[0]);
int k = Integer.parseInt(str[1]);
str = br.readLine().split(" ");
long sum = 0;
for (int i = 0; i < k; i++) {
int a = Integer.parseInt(str[i]);
sum += a;
}
if (n < sum) {
System.out.println("-1");
} else {
System.out.println(n - sum);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
2,
13,
13,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
0,
13,
40,
17,
4,
18,
18,
13,
13,
17,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
79,
5
],
[
79,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
41,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
49,
51
],
[
8,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
8,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
8,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
66,
72
],
[
8,
73
],
[
73,
74
],
[
74,
75
],
[
6,
76
],
[
76,
77
],
[
0,
78
],
[
78,
79
],
[
78,
80
]
] |
[
"import java.util.Scanner;\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner kbs = new Scanner(System.in);\n\t\tint n,m;\n\t\tn = kbs.nextInt();\n\t\tm = kbs.nextInt();\n\t\tint s = 0;\n\t\tfor(int i = 0;i < m;i++) {\n\t\t\tint x = kbs.nextInt();\n\t\t\ts = s + x;\n\t\t}\n\t\tn = n - s;\n\t\tif (n < 0) {\n\t\t\tn = -1;\n\t\t}\n\t\tSystem.out.printf(\"%d\", n);\n\t\tkbs.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner kbs = new Scanner(System.in);\n\t\tint n,m;\n\t\tn = kbs.nextInt();\n\t\tm = kbs.nextInt();\n\t\tint s = 0;\n\t\tfor(int i = 0;i < m;i++) {\n\t\t\tint x = kbs.nextInt();\n\t\t\ts = s + x;\n\t\t}\n\t\tn = n - s;\n\t\tif (n < 0) {\n\t\t\tn = -1;\n\t\t}\n\t\tSystem.out.printf(\"%d\", n);\n\t\tkbs.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner kbs = new Scanner(System.in);\n\t\tint n,m;\n\t\tn = kbs.nextInt();\n\t\tm = kbs.nextInt();\n\t\tint s = 0;\n\t\tfor(int i = 0;i < m;i++) {\n\t\t\tint x = kbs.nextInt();\n\t\t\ts = s + x;\n\t\t}\n\t\tn = n - s;\n\t\tif (n < 0) {\n\t\t\tn = -1;\n\t\t}\n\t\tSystem.out.printf(\"%d\", n);\n\t\tkbs.close();\n\t}",
"main",
"{\n\t\tScanner kbs = new Scanner(System.in);\n\t\tint n,m;\n\t\tn = kbs.nextInt();\n\t\tm = kbs.nextInt();\n\t\tint s = 0;\n\t\tfor(int i = 0;i < m;i++) {\n\t\t\tint x = kbs.nextInt();\n\t\t\ts = s + x;\n\t\t}\n\t\tn = n - s;\n\t\tif (n < 0) {\n\t\t\tn = -1;\n\t\t}\n\t\tSystem.out.printf(\"%d\", n);\n\t\tkbs.close();\n\t}",
"Scanner kbs = new Scanner(System.in);",
"kbs",
"new Scanner(System.in)",
"int n",
"n",
"m;",
"m",
"n = kbs.nextInt()",
"n",
"kbs.nextInt()",
"kbs.nextInt",
"kbs",
"m = kbs.nextInt()",
"m",
"kbs.nextInt()",
"kbs.nextInt",
"kbs",
"int s = 0;",
"s",
"0",
"for(int i = 0;i < m;i++) {\n\t\t\tint x = kbs.nextInt();\n\t\t\ts = s + x;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tint x = kbs.nextInt();\n\t\t\ts = s + x;\n\t\t}",
"{\n\t\t\tint x = kbs.nextInt();\n\t\t\ts = s + x;\n\t\t}",
"int x = kbs.nextInt();",
"x",
"kbs.nextInt()",
"kbs.nextInt",
"kbs",
"s = s + x",
"s",
"s + x",
"s",
"x",
"n = n - s",
"n",
"n - s",
"n",
"s",
"if (n < 0) {\n\t\t\tn = -1;\n\t\t}",
"n < 0",
"n",
"0",
"{\n\t\t\tn = -1;\n\t\t}",
"n = -1",
"n",
"-1",
"1",
"System.out.printf(\"%d\", n)",
"System.out.printf",
"System.out",
"System",
"System.out",
"\"%d\"",
"n",
"kbs.close()",
"kbs.close",
"kbs",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner kbs = new Scanner(System.in);\n\t\tint n,m;\n\t\tn = kbs.nextInt();\n\t\tm = kbs.nextInt();\n\t\tint s = 0;\n\t\tfor(int i = 0;i < m;i++) {\n\t\t\tint x = kbs.nextInt();\n\t\t\ts = s + x;\n\t\t}\n\t\tn = n - s;\n\t\tif (n < 0) {\n\t\t\tn = -1;\n\t\t}\n\t\tSystem.out.printf(\"%d\", n);\n\t\tkbs.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner kbs = new Scanner(System.in);\n\t\tint n,m;\n\t\tn = kbs.nextInt();\n\t\tm = kbs.nextInt();\n\t\tint s = 0;\n\t\tfor(int i = 0;i < m;i++) {\n\t\t\tint x = kbs.nextInt();\n\t\t\ts = s + x;\n\t\t}\n\t\tn = n - s;\n\t\tif (n < 0) {\n\t\t\tn = -1;\n\t\t}\n\t\tSystem.out.printf(\"%d\", n);\n\t\tkbs.close();\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner kbs = new Scanner(System.in);
int n,m;
n = kbs.nextInt();
m = kbs.nextInt();
int s = 0;
for(int i = 0;i < m;i++) {
int x = kbs.nextInt();
s = s + x;
}
n = n - s;
if (n < 0) {
n = -1;
}
System.out.printf("%d", n);
kbs.close();
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
28,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
46,
47
],
[
47,
48
],
[
8,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
49,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
6,
68
],
[
68,
69
]
] |
[
"import java.util.*;\n\nclass Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint N = Integer.parseInt(sc.next());\n\t\tint M = Integer.parseInt(sc.next());\n\t\t\n\t\tfor(int i=0; i<M; i++){\n\t\t\tN -= Integer.parseInt(sc.next());\n\t\t}\n\t\n\t\tif(N >= 0) {\n\t\t\tSystem.out.println(N);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t\n\t}\n\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint N = Integer.parseInt(sc.next());\n\t\tint M = Integer.parseInt(sc.next());\n\t\t\n\t\tfor(int i=0; i<M; i++){\n\t\t\tN -= Integer.parseInt(sc.next());\n\t\t}\n\t\n\t\tif(N >= 0) {\n\t\t\tSystem.out.println(N);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t\n\t}\n\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint N = Integer.parseInt(sc.next());\n\t\tint M = Integer.parseInt(sc.next());\n\t\t\n\t\tfor(int i=0; i<M; i++){\n\t\t\tN -= Integer.parseInt(sc.next());\n\t\t}\n\t\n\t\tif(N >= 0) {\n\t\t\tSystem.out.println(N);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tint N = Integer.parseInt(sc.next());\n\t\tint M = Integer.parseInt(sc.next());\n\t\t\n\t\tfor(int i=0; i<M; i++){\n\t\t\tN -= Integer.parseInt(sc.next());\n\t\t}\n\t\n\t\tif(N >= 0) {\n\t\t\tSystem.out.println(N);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\t\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = Integer.parseInt(sc.next());",
"N",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int M = Integer.parseInt(sc.next());",
"M",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"for(int i=0; i<M; i++){\n\t\t\tN -= Integer.parseInt(sc.next());\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tN -= Integer.parseInt(sc.next());\n\t\t}",
"{\n\t\t\tN -= Integer.parseInt(sc.next());\n\t\t}",
"N -= Integer.parseInt(sc.next())",
"N",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"if(N >= 0) {\n\t\t\tSystem.out.println(N);\n\t\t} else {\n\t\t\tSystem.out.println(-1);\n\t\t}",
"N >= 0",
"N",
"0",
"{\n\t\t\tSystem.out.println(N);\n\t\t}",
"System.out.println(N)",
"System.out.println",
"System.out",
"System",
"System.out",
"N",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args"
] |
import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt(sc.next());
int M = Integer.parseInt(sc.next());
for(int i=0; i<M; i++){
N -= Integer.parseInt(sc.next());
}
if(N >= 0) {
System.out.println(N);
} else {
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
4,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
78,
5
],
[
78,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
41,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
8,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
59,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
6,
75
],
[
75,
76
],
[
0,
77
],
[
77,
78
],
[
77,
79
]
] |
[
"import java.util.*;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t int n = in.nextInt();\n\t int m = in.nextInt();\n int ar[] = new int[n];\n \tint sum=0;\n \tfor(int i=0;i<m;i++){\n ar[i]=in.nextInt();\n sum+=ar[i];\n }\n \tint res = n-sum;\n \t\n if(res>=0)\n System.out.println(res);\n else\n System.out.println(\"-1\");\n \n\t}\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t int n = in.nextInt();\n\t int m = in.nextInt();\n int ar[] = new int[n];\n \tint sum=0;\n \tfor(int i=0;i<m;i++){\n ar[i]=in.nextInt();\n sum+=ar[i];\n }\n \tint res = n-sum;\n \t\n if(res>=0)\n System.out.println(res);\n else\n System.out.println(\"-1\");\n \n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t int n = in.nextInt();\n\t int m = in.nextInt();\n int ar[] = new int[n];\n \tint sum=0;\n \tfor(int i=0;i<m;i++){\n ar[i]=in.nextInt();\n sum+=ar[i];\n }\n \tint res = n-sum;\n \t\n if(res>=0)\n System.out.println(res);\n else\n System.out.println(\"-1\");\n \n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t int n = in.nextInt();\n\t int m = in.nextInt();\n int ar[] = new int[n];\n \tint sum=0;\n \tfor(int i=0;i<m;i++){\n ar[i]=in.nextInt();\n sum+=ar[i];\n }\n \tint res = n-sum;\n \t\n if(res>=0)\n System.out.println(res);\n else\n System.out.println(\"-1\");\n \n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int m = in.nextInt();",
"m",
"in.nextInt()",
"in.nextInt",
"in",
"int ar[] = new int[n];",
"ar",
"new int[n]",
"n",
"int sum=0;",
"sum",
"0",
"for(int i=0;i<m;i++){\n ar[i]=in.nextInt();\n sum+=ar[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n ar[i]=in.nextInt();\n sum+=ar[i];\n }",
"{\n ar[i]=in.nextInt();\n sum+=ar[i];\n }",
"ar[i]=in.nextInt()",
"ar[i]",
"ar",
"i",
"in.nextInt()",
"in.nextInt",
"in",
"sum+=ar[i]",
"sum",
"ar[i]",
"ar",
"i",
"int res = n-sum;",
"res",
"n-sum",
"n",
"sum",
"if(res>=0)\n System.out.println(res);\n else\n System.out.println(\"-1\");",
"res>=0",
"res",
"0",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t int n = in.nextInt();\n\t int m = in.nextInt();\n int ar[] = new int[n];\n \tint sum=0;\n \tfor(int i=0;i<m;i++){\n ar[i]=in.nextInt();\n sum+=ar[i];\n }\n \tint res = n-sum;\n \t\n if(res>=0)\n System.out.println(res);\n else\n System.out.println(\"-1\");\n \n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner in = new Scanner(System.in);\n\t int n = in.nextInt();\n\t int m = in.nextInt();\n int ar[] = new int[n];\n \tint sum=0;\n \tfor(int i=0;i<m;i++){\n ar[i]=in.nextInt();\n sum+=ar[i];\n }\n \tint res = n-sum;\n \t\n if(res>=0)\n System.out.println(res);\n else\n System.out.println(\"-1\");\n \n\t}\n\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int m = in.nextInt();
int ar[] = new int[n];
int sum=0;
for(int i=0;i<m;i++){
ar[i]=in.nextInt();
sum+=ar[i];
}
int res = n-sum;
if(res>=0)
System.out.println(res);
else
System.out.println("-1");
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
8,
2,
13,
13,
2,
13,
13,
17,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
155,
14
],
[
155,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
17,
31
],
[
31,
32
],
[
31,
33
],
[
17,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
17,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
60,
62
],
[
56,
63
],
[
15,
64
],
[
64,
65
],
[
155,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
66,
70
],
[
70,
71
],
[
66,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
66,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
81,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
91,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
80,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
66,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
66,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
120,
121
],
[
119,
122
],
[
122,
123
],
[
66,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
128,
131
],
[
131,
132
],
[
66,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
139,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
135,
152
],
[
152,
153
],
[
0,
154
],
[
154,
155
],
[
154,
156
]
] |
[
"/*\n *created by Kraken on 19-04-2020 at 17:29\n */\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n long n = sc.nextLong();\n int m = sc.nextInt();\n long sum = 0;\n for (int i = 0; i < m; i++) sum += sc.nextLong();\n System.out.println((sum <= n) ? n - sum : \"-1\");\n }\n\n static class FastReader {\n\n BufferedReader br;\n\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n long n = sc.nextLong();\n int m = sc.nextInt();\n long sum = 0;\n for (int i = 0; i < m; i++) sum += sc.nextLong();\n System.out.println((sum <= n) ? n - sum : \"-1\");\n }\n\n static class FastReader {\n\n BufferedReader br;\n\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n FastReader sc = new FastReader();\n long n = sc.nextLong();\n int m = sc.nextInt();\n long sum = 0;\n for (int i = 0; i < m; i++) sum += sc.nextLong();\n System.out.println((sum <= n) ? n - sum : \"-1\");\n }",
"main",
"{\n FastReader sc = new FastReader();\n long n = sc.nextLong();\n int m = sc.nextInt();\n long sum = 0;\n for (int i = 0; i < m; i++) sum += sc.nextLong();\n System.out.println((sum <= n) ? n - sum : \"-1\");\n }",
"FastReader sc = new FastReader();",
"sc",
"new FastReader()",
"long n = sc.nextLong();",
"n",
"sc.nextLong()",
"sc.nextLong",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum = 0;",
"sum",
"0",
"for (int i = 0; i < m; i++) sum += sc.nextLong();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"sum += sc.nextLong();",
"sum += sc.nextLong()",
"sum",
"sc.nextLong()",
"sc.nextLong",
"sc",
"System.out.println((sum <= n) ? n - sum : \"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"(sum <= n) ? n - sum : \"-1\"",
"(sum <= n)",
"sum",
"n",
"n - sum",
"n",
"sum",
"\"-1\"",
"String[] args",
"args",
"static class FastReader {\n\n BufferedReader br;\n\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"FastReader",
"{\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"nextLine",
"{\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main {\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n long n = sc.nextLong();\n int m = sc.nextInt();\n long sum = 0;\n for (int i = 0; i < m; i++) sum += sc.nextLong();\n System.out.println((sum <= n) ? n - sum : \"-1\");\n }\n\n static class FastReader {\n\n BufferedReader br;\n\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n long n = sc.nextLong();\n int m = sc.nextInt();\n long sum = 0;\n for (int i = 0; i < m; i++) sum += sc.nextLong();\n System.out.println((sum <= n) ? n - sum : \"-1\");\n }\n\n static class FastReader {\n\n BufferedReader br;\n\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n}",
"Main"
] |
/*
*created by Kraken on 19-04-2020 at 17:29
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
FastReader sc = new FastReader();
long n = sc.nextLong();
int m = sc.nextInt();
long sum = 0;
for (int i = 0; i < m; i++) sum += sc.nextLong();
System.out.println((sum <= n) ? n - sum : "-1");
}
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
}
catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
}
catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
8,
2,
13,
13,
40,
17,
2,
13,
13,
23,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
106,
17
],
[
106,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
23,
25
],
[
20,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
28,
30
],
[
20,
31
],
[
31,
32
],
[
31,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
20,
37
],
[
37,
38
],
[
37,
39
],
[
20,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
40,
44
],
[
40,
45
],
[
20,
46
],
[
46,
47
],
[
47,
48
],
[
18,
49
],
[
49,
50
],
[
106,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
55,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
66,
67
],
[
66,
68
],
[
55,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
69,
77
],
[
77,
78
],
[
78,
79
],
[
69,
80
],
[
81,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
55,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
90,
96
],
[
96,
97
],
[
96,
98
],
[
53,
99
],
[
99,
100
],
[
53,
101
],
[
101,
102
],
[
53,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] |
[
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.Scanner;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n *\n * @author silviase\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BHomework solver = new BHomework();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BHomework {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n int acc = 0;\n for (int i = 0; i < m; i++) {\n acc += in.nextInt();\n }\n out.println(n < acc ? -1 : n - acc);\n }\n\n }\n}\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BHomework solver = new BHomework();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BHomework {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n int acc = 0;\n for (int i = 0; i < m; i++) {\n acc += in.nextInt();\n }\n out.println(n < acc ? -1 : n - acc);\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BHomework solver = new BHomework();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BHomework solver = new BHomework();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"Scanner in = new Scanner(inputStream);",
"in",
"new Scanner(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"BHomework solver = new BHomework();",
"solver",
"new BHomework()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class BHomework {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n int acc = 0;\n for (int i = 0; i < m; i++) {\n acc += in.nextInt();\n }\n out.println(n < acc ? -1 : n - acc);\n }\n\n }",
"BHomework",
"public void solve(int testNumber, Scanner in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n int acc = 0;\n for (int i = 0; i < m; i++) {\n acc += in.nextInt();\n }\n out.println(n < acc ? -1 : n - acc);\n }",
"solve",
"{\n int n = in.nextInt();\n int m = in.nextInt();\n int acc = 0;\n for (int i = 0; i < m; i++) {\n acc += in.nextInt();\n }\n out.println(n < acc ? -1 : n - acc);\n }",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int m = in.nextInt();",
"m",
"in.nextInt()",
"in.nextInt",
"in",
"int acc = 0;",
"acc",
"0",
"for (int i = 0; i < m; i++) {\n acc += in.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n acc += in.nextInt();\n }",
"{\n acc += in.nextInt();\n }",
"acc += in.nextInt()",
"acc",
"in.nextInt()",
"in.nextInt",
"in",
"out.println(n < acc ? -1 : n - acc)",
"out.println",
"out",
"n < acc ? -1 : n - acc",
"n < acc",
"n",
"acc",
"-1",
"1",
"n - acc",
"n",
"acc",
"int testNumber",
"testNumber",
"Scanner in",
"in",
"PrintWriter out",
"out",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BHomework solver = new BHomework();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BHomework {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n int acc = 0;\n for (int i = 0; i < m; i++) {\n acc += in.nextInt();\n }\n out.println(n < acc ? -1 : n - acc);\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n Scanner in = new Scanner(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BHomework solver = new BHomework();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BHomework {\n public void solve(int testNumber, Scanner in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n int acc = 0;\n for (int i = 0; i < m; i++) {\n acc += in.nextInt();\n }\n out.println(n < acc ? -1 : n - acc);\n }\n\n }\n}",
"Main"
] |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author silviase
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
Scanner in = new Scanner(inputStream);
PrintWriter out = new PrintWriter(outputStream);
BHomework solver = new BHomework();
solver.solve(1, in, out);
out.close();
}
static class BHomework {
public void solve(int testNumber, Scanner in, PrintWriter out) {
int n = in.nextInt();
int m = in.nextInt();
int acc = 0;
for (int i = 0; i < m; i++) {
acc += in.nextInt();
}
out.println(n < acc ? -1 : n - acc);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
73,
11
],
[
73,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
14,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
14,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
49,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
67,
69
],
[
12,
70
],
[
70,
71
],
[
0,
72
],
[
72,
73
],
[
72,
74
]
] |
[
"import java.util.Arrays;\nimport java.util.Comparator;\nimport java.util.Scanner;\n\n\npublic class Main {\n\t\n\n\t\n\t\n\tpublic static void main(String[] args) {\n\n\t\t\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint n = s.nextInt();\n\t\tint m = s.nextInt();\n\t\t\n\t\tint sum=0;\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tsum+=s.nextInt();\n\t\t}\n\t\tif(sum>n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\t\n\t}\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Comparator;",
"Comparator",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\t\n\n\t\n\t\n\tpublic static void main(String[] args) {\n\n\t\t\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint n = s.nextInt();\n\t\tint m = s.nextInt();\n\t\t\n\t\tint sum=0;\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tsum+=s.nextInt();\n\t\t}\n\t\tif(sum>n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\t\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\t\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint n = s.nextInt();\n\t\tint m = s.nextInt();\n\t\t\n\t\tint sum=0;\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tsum+=s.nextInt();\n\t\t}\n\t\tif(sum>n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\t\n\t}",
"main",
"{\n\n\t\t\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint n = s.nextInt();\n\t\tint m = s.nextInt();\n\t\t\n\t\tint sum=0;\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tsum+=s.nextInt();\n\t\t}\n\t\tif(sum>n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\t\n\t}",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int n = s.nextInt();",
"n",
"s.nextInt()",
"s.nextInt",
"s",
"int m = s.nextInt();",
"m",
"s.nextInt()",
"s.nextInt",
"s",
"int sum=0;",
"sum",
"0",
"for(int i=0;i<m;i++) {\n\t\t\tsum+=s.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tsum+=s.nextInt();\n\t\t}",
"{\n\t\t\tsum+=s.nextInt();\n\t\t}",
"sum+=s.nextInt()",
"sum",
"s.nextInt()",
"s.nextInt",
"s",
"if(sum>n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}",
"sum>n",
"sum",
"n",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(n-sum);\n\t\t}",
"System.out.println(n-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum",
"n",
"sum",
"String[] args",
"args",
"public class Main {\n\t\n\n\t\n\t\n\tpublic static void main(String[] args) {\n\n\t\t\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint n = s.nextInt();\n\t\tint m = s.nextInt();\n\t\t\n\t\tint sum=0;\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tsum+=s.nextInt();\n\t\t}\n\t\tif(sum>n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\t\n\t}\n}",
"public class Main {\n\t\n\n\t\n\t\n\tpublic static void main(String[] args) {\n\n\t\t\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint n = s.nextInt();\n\t\tint m = s.nextInt();\n\t\t\n\t\tint sum=0;\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tsum+=s.nextInt();\n\t\t}\n\t\tif(sum>n) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(n-sum);\n\t\t}\n\t\t\n\t}\n}",
"Main"
] |
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int m = s.nextInt();
int sum=0;
for(int i=0;i<m;i++) {
sum+=s.nextInt();
}
if(sum>n) {
System.out.println(-1);
}
else {
System.out.println(n-sum);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
13,
8,
2,
13,
13,
2,
13,
13,
40,
17,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
116,
8
],
[
116,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
11,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
44,
49
],
[
11,
50
],
[
50,
51
],
[
50,
52
],
[
11,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
74,
75
],
[
74,
76
],
[
11,
77
],
[
77,
78
],
[
77,
79
],
[
11,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
80,
88
],
[
88,
89
],
[
89,
90
],
[
80,
91
],
[
92,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
11,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
101,
105
],
[
105,
106
],
[
105,
107
],
[
101,
108
],
[
108,
109
],
[
11,
110
],
[
110,
111
],
[
111,
112
],
[
9,
113
],
[
113,
114
],
[
0,
115
],
[
115,
116
],
[
115,
117
]
] |
[
"import java.util.*;\nimport java.io.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n \n String[] input1 = br.readLine().split(\" \");\n int n = Integer.parseInt(input1[0]);\n int m = Integer.parseInt(input1[1]);\n \n String[] input2 = br.readLine().split(\" \");\n int[] cost = new int[m];\n \n for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n }\n \n int totalCost = 0;\n \n for(int i = 0; i < m; i++){\n totalCost += cost[i];\n }\n \n out.println(n >= totalCost ? n - totalCost : -1);\n out.close();\n \n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n \n String[] input1 = br.readLine().split(\" \");\n int n = Integer.parseInt(input1[0]);\n int m = Integer.parseInt(input1[1]);\n \n String[] input2 = br.readLine().split(\" \");\n int[] cost = new int[m];\n \n for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n }\n \n int totalCost = 0;\n \n for(int i = 0; i < m; i++){\n totalCost += cost[i];\n }\n \n out.println(n >= totalCost ? n - totalCost : -1);\n out.close();\n \n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n \n String[] input1 = br.readLine().split(\" \");\n int n = Integer.parseInt(input1[0]);\n int m = Integer.parseInt(input1[1]);\n \n String[] input2 = br.readLine().split(\" \");\n int[] cost = new int[m];\n \n for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n }\n \n int totalCost = 0;\n \n for(int i = 0; i < m; i++){\n totalCost += cost[i];\n }\n \n out.println(n >= totalCost ? n - totalCost : -1);\n out.close();\n \n }",
"main",
"{\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n \n String[] input1 = br.readLine().split(\" \");\n int n = Integer.parseInt(input1[0]);\n int m = Integer.parseInt(input1[1]);\n \n String[] input2 = br.readLine().split(\" \");\n int[] cost = new int[m];\n \n for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n }\n \n int totalCost = 0;\n \n for(int i = 0; i < m; i++){\n totalCost += cost[i];\n }\n \n out.println(n >= totalCost ? n - totalCost : -1);\n out.close();\n \n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));",
"out",
"new PrintWriter(new OutputStreamWriter(System.out))",
"String[] input1 = br.readLine().split(\" \");",
"input1",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int n = Integer.parseInt(input1[0]);",
"n",
"Integer.parseInt(input1[0])",
"Integer.parseInt",
"Integer",
"input1[0]",
"input1",
"0",
"int m = Integer.parseInt(input1[1]);",
"m",
"Integer.parseInt(input1[1])",
"Integer.parseInt",
"Integer",
"input1[1]",
"input1",
"1",
"String[] input2 = br.readLine().split(\" \");",
"input2",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int[] cost = new int[m];",
"cost",
"new int[m]",
"m",
"for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n cost[i] = Integer.parseInt(input2[i]);\n }",
"{\n cost[i] = Integer.parseInt(input2[i]);\n }",
"cost[i] = Integer.parseInt(input2[i])",
"cost[i]",
"cost",
"i",
"Integer.parseInt(input2[i])",
"Integer.parseInt",
"Integer",
"input2[i]",
"input2",
"i",
"int totalCost = 0;",
"totalCost",
"0",
"for(int i = 0; i < m; i++){\n totalCost += cost[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n totalCost += cost[i];\n }",
"{\n totalCost += cost[i];\n }",
"totalCost += cost[i]",
"totalCost",
"cost[i]",
"cost",
"i",
"out.println(n >= totalCost ? n - totalCost : -1)",
"out.println",
"out",
"n >= totalCost ? n - totalCost : -1",
"n >= totalCost",
"n",
"totalCost",
"n - totalCost",
"n",
"totalCost",
"-1",
"1",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n \n String[] input1 = br.readLine().split(\" \");\n int n = Integer.parseInt(input1[0]);\n int m = Integer.parseInt(input1[1]);\n \n String[] input2 = br.readLine().split(\" \");\n int[] cost = new int[m];\n \n for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n }\n \n int totalCost = 0;\n \n for(int i = 0; i < m; i++){\n totalCost += cost[i];\n }\n \n out.println(n >= totalCost ? n - totalCost : -1);\n out.close();\n \n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\n \n String[] input1 = br.readLine().split(\" \");\n int n = Integer.parseInt(input1[0]);\n int m = Integer.parseInt(input1[1]);\n \n String[] input2 = br.readLine().split(\" \");\n int[] cost = new int[m];\n \n for(int i = 0; i < m; i++){\n cost[i] = Integer.parseInt(input2[i]);\n }\n \n int totalCost = 0;\n \n for(int i = 0; i < m; i++){\n totalCost += cost[i];\n }\n \n out.println(n >= totalCost ? n - totalCost : -1);\n out.close();\n \n }\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
String[] input1 = br.readLine().split(" ");
int n = Integer.parseInt(input1[0]);
int m = Integer.parseInt(input1[1]);
String[] input2 = br.readLine().split(" ");
int[] cost = new int[m];
for(int i = 0; i < m; i++){
cost[i] = Integer.parseInt(input2[i]);
}
int totalCost = 0;
for(int i = 0; i < m; i++){
totalCost += cost[i];
}
out.println(n >= totalCost ? n - totalCost : -1);
out.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
66,
5
],
[
66,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
43,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
6,
63
],
[
63,
64
],
[
0,
65
],
[
65,
66
],
[
65,
67
]
] |
[
"import java.util.Scanner;\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 m = sc.nextInt();\n \n // 配列\n int a = 0;\n for(int i=0;i<m;i++){\n a += sc.nextInt();\n }\n \n if(a > n){\n System.out.println(\"-1\");\n } else {\n System.out.println(n - a);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n \n // 配列\n int a = 0;\n for(int i=0;i<m;i++){\n a += sc.nextInt();\n }\n \n if(a > n){\n System.out.println(\"-1\");\n } else {\n System.out.println(n - a);\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n \n // 配列\n int a = 0;\n for(int i=0;i<m;i++){\n a += sc.nextInt();\n }\n \n if(a > n){\n System.out.println(\"-1\");\n } else {\n System.out.println(n - a);\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n \n // 配列\n int a = 0;\n for(int i=0;i<m;i++){\n a += sc.nextInt();\n }\n \n if(a > n){\n System.out.println(\"-1\");\n } else {\n System.out.println(n - a);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int a = 0;",
"a",
"0",
"for(int i=0;i<m;i++){\n a += sc.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n a += sc.nextInt();\n }",
"{\n a += sc.nextInt();\n }",
"a += sc.nextInt()",
"a",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if(a > n){\n System.out.println(\"-1\");\n } else {\n System.out.println(n - a);\n }",
"a > n",
"a",
"n",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(n - a);\n }",
"System.out.println(n - a)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - a",
"n",
"a",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n \n // 配列\n int a = 0;\n for(int i=0;i<m;i++){\n a += sc.nextInt();\n }\n \n if(a > n){\n System.out.println(\"-1\");\n } else {\n System.out.println(n - a);\n }\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n \n // 配列\n int a = 0;\n for(int i=0;i<m;i++){\n a += sc.nextInt();\n }\n \n if(a > n){\n System.out.println(\"-1\");\n } else {\n System.out.println(n - a);\n }\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
// 配列
int a = 0;
for(int i=0;i<m;i++){
a += sc.nextInt();
}
if(a > n){
System.out.println("-1");
} else {
System.out.println(n - a);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
17,
28,
13,
13,
30,
0,
13,
13,
4,
18,
18,
13,
13,
8,
2,
13,
13,
40,
17,
2,
13,
13,
29,
23,
13,
6,
13,
41,
13,
2,
17,
17,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
13,
0,
13,
0,
13,
17,
12,
13,
30,
0,
13,
20,
0,
13,
20,
13,
0,
13,
0,
13,
17,
23,
13,
12,
13,
30,
14,
2,
13,
13,
4,
13,
29,
18,
13,
40,
13,
12,
13,
30,
14,
2,
13,
17,
29,
4,
18,
13,
12,
13,
30,
0,
13,
4,
18,
13,
13,
0,
13,
17,
13,
14,
2,
13,
40,
17,
0,
18,
13,
17,
40,
17,
12,
13,
30,
41,
13,
4,
13,
42,
4,
18,
13,
13,
30,
0,
13,
4,
13,
29,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
18,
13,
13,
30,
0,
13,
4,
13,
41,
13,
20,
4,
18,
13,
13,
0,
13,
4,
13,
42,
40,
4,
18,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
2,
13,
17,
30,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
13,
17,
0,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
510,
8
],
[
510,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
27,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
34,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
11,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
46,
52
],
[
52,
53
],
[
52,
54
],
[
11,
55
],
[
9,
56
],
[
56,
57
],
[
510,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
58,
65
],
[
65,
66
],
[
58,
67
],
[
67,
68
],
[
58,
69
],
[
69,
70
],
[
58,
71
],
[
71,
72
],
[
58,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
79,
80
],
[
79,
81
],
[
75,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
58,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
94,
96
],
[
90,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
100,
102
],
[
88,
103
],
[
103,
104
],
[
58,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
112,
113
],
[
107,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
58,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
121,
127
],
[
127,
128
],
[
128,
129
],
[
58,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
135,
139
],
[
139,
140
],
[
139,
141
],
[
135,
142
],
[
132,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
143,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
152,
153
],
[
58,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
156,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
162,
165
],
[
161,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
169,
170
],
[
156,
171
],
[
171,
172
],
[
58,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
175,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
181,
184
],
[
180,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
175,
190
],
[
190,
191
],
[
190,
192
],
[
175,
193
],
[
193,
194
],
[
194,
195
],
[
193,
196
],
[
175,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
175,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
204,
205
],
[
203,
206
],
[
201,
207
],
[
207,
208
],
[
208,
209
],
[
209,
210
],
[
208,
211
],
[
207,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
175,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
58,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
223,
224
],
[
223,
225
],
[
222,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
222,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
230,
234
],
[
234,
235
],
[
234,
236
],
[
236,
237
],
[
222,
238
],
[
238,
239
],
[
238,
240
],
[
240,
241
],
[
240,
242
],
[
222,
243
],
[
243,
244
],
[
243,
245
],
[
245,
246
],
[
245,
247
],
[
247,
248
],
[
222,
249
],
[
249,
250
],
[
250,
251
],
[
251,
252
],
[
252,
253
],
[
252,
254
],
[
254,
255
],
[
251,
256
],
[
250,
257
],
[
257,
258
],
[
257,
259
],
[
249,
260
],
[
260,
261
],
[
261,
262
],
[
261,
263
],
[
263,
264
],
[
264,
265
],
[
265,
266
],
[
265,
267
],
[
264,
268
],
[
263,
269
],
[
222,
270
],
[
270,
271
],
[
270,
272
],
[
272,
273
],
[
273,
274
],
[
222,
275
],
[
275,
276
],
[
58,
277
],
[
277,
278
],
[
277,
279
],
[
279,
280
],
[
280,
281
],
[
280,
282
],
[
279,
283
],
[
283,
284
],
[
283,
285
],
[
285,
286
],
[
279,
287
],
[
287,
288
],
[
288,
289
],
[
288,
290
],
[
287,
291
],
[
291,
292
],
[
291,
293
],
[
293,
294
],
[
279,
295
],
[
295,
296
],
[
295,
297
],
[
297,
298
],
[
297,
299
],
[
279,
300
],
[
300,
301
],
[
300,
302
],
[
302,
303
],
[
302,
304
],
[
304,
305
],
[
279,
306
],
[
306,
307
],
[
307,
308
],
[
308,
309
],
[
309,
310
],
[
309,
311
],
[
311,
312
],
[
308,
313
],
[
307,
314
],
[
314,
315
],
[
314,
316
],
[
306,
317
],
[
317,
318
],
[
318,
319
],
[
318,
320
],
[
320,
321
],
[
321,
322
],
[
322,
323
],
[
322,
324
],
[
321,
325
],
[
320,
326
],
[
279,
327
],
[
327,
328
],
[
327,
329
],
[
329,
330
],
[
330,
331
],
[
279,
332
],
[
332,
333
],
[
58,
334
],
[
334,
335
],
[
334,
336
],
[
336,
337
],
[
337,
338
],
[
337,
339
],
[
336,
340
],
[
340,
341
],
[
340,
342
],
[
336,
343
],
[
343,
344
],
[
343,
345
],
[
345,
346
],
[
336,
347
],
[
347,
348
],
[
348,
349
],
[
348,
350
],
[
347,
351
],
[
351,
352
],
[
351,
353
],
[
353,
354
],
[
336,
355
],
[
355,
356
],
[
355,
357
],
[
357,
358
],
[
357,
359
],
[
336,
360
],
[
360,
361
],
[
360,
362
],
[
362,
363
],
[
362,
364
],
[
364,
365
],
[
336,
366
],
[
366,
367
],
[
367,
368
],
[
368,
369
],
[
369,
370
],
[
369,
371
],
[
371,
372
],
[
368,
373
],
[
367,
374
],
[
374,
375
],
[
374,
376
],
[
366,
377
],
[
377,
378
],
[
378,
379
],
[
378,
380
],
[
380,
381
],
[
381,
382
],
[
382,
383
],
[
382,
384
],
[
381,
385
],
[
380,
386
],
[
336,
387
],
[
387,
388
],
[
388,
389
],
[
388,
390
],
[
387,
391
],
[
391,
392
],
[
392,
393
],
[
393,
394
],
[
394,
395
],
[
395,
396
],
[
395,
397
],
[
397,
398
],
[
394,
399
],
[
393,
400
],
[
400,
401
],
[
400,
402
],
[
392,
403
],
[
403,
404
],
[
404,
405
],
[
404,
406
],
[
406,
407
],
[
407,
408
],
[
407,
409
],
[
406,
410
],
[
410,
411
],
[
410,
412
],
[
336,
413
],
[
413,
414
],
[
413,
415
],
[
415,
416
],
[
416,
417
],
[
336,
418
],
[
418,
419
],
[
58,
420
],
[
420,
421
],
[
420,
422
],
[
422,
423
],
[
423,
424
],
[
423,
425
],
[
422,
427
],
[
427,
428
],
[
428,
429
],
[
429,
430
],
[
429,
431
],
[
427,
432
],
[
432,
433
],
[
432,
434
],
[
427,
435
],
[
435,
436
],
[
436,
437
],
[
427,
438
],
[
439,
439
],
[
439,
440
],
[
440,
441
],
[
441,
442
],
[
441,
443
],
[
440,
444
],
[
444,
445
],
[
422,
446
],
[
446,
447
],
[
420,
448
],
[
448,
449
],
[
58,
450
],
[
450,
451
],
[
450,
452
],
[
452,
453
],
[
453,
454
],
[
453,
455
],
[
452,
457
],
[
457,
458
],
[
458,
459
],
[
459,
460
],
[
459,
461
],
[
457,
462
],
[
462,
463
],
[
462,
464
],
[
457,
465
],
[
465,
466
],
[
466,
467
],
[
457,
468
],
[
469,
469
],
[
469,
470
],
[
470,
471
],
[
471,
472
],
[
471,
473
],
[
470,
474
],
[
474,
475
],
[
452,
476
],
[
476,
477
],
[
450,
478
],
[
478,
479
],
[
58,
480
],
[
480,
481
],
[
480,
482
],
[
482,
483
],
[
483,
484
],
[
483,
485
],
[
482,
487
],
[
487,
488
],
[
488,
489
],
[
489,
490
],
[
489,
491
],
[
487,
492
],
[
492,
493
],
[
492,
494
],
[
487,
495
],
[
495,
496
],
[
496,
497
],
[
487,
498
],
[
498,
499
],
[
499,
500
],
[
500,
501
],
[
500,
502
],
[
499,
503
],
[
503,
504
],
[
482,
505
],
[
505,
506
],
[
480,
507
],
[
507,
508
],
[
0,
509
],
[
509,
510
],
[
509,
511
]
] |
[
"import java.io.*;\n// import java.math.*;\nimport java.util.*;\n// import java.util.Map.*;\n// import java.util.stream.*;\n\npublic class Main {\n public static void main (String[] args) throws IOException {\n FastScanner sc = new FastScanner();\n final int N = sc.nextInt();\n final int M = sc.nextInt();\n int[] A = sc.intArray (M);\n int accum = 0;\n for (int Ai : A)\n accum += Ai;\n System.out.println (N < accum ? -1 : N - accum);\n return;\n }\n\n // FastScanner start\n static class FastScanner {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public FastScanner() {\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner (String file_name) throws IOException {\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n public char nextChar() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }\n\n public String nextString() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }\n\n public int[] intArray (int n) throws IOException {\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long[] longArray (int n) throws IOException {\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public double[] doubleArray (int n) throws IOException {\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }\n }\n // FastScanner end\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main (String[] args) throws IOException {\n FastScanner sc = new FastScanner();\n final int N = sc.nextInt();\n final int M = sc.nextInt();\n int[] A = sc.intArray (M);\n int accum = 0;\n for (int Ai : A)\n accum += Ai;\n System.out.println (N < accum ? -1 : N - accum);\n return;\n }\n\n // FastScanner start\n static class FastScanner {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public FastScanner() {\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner (String file_name) throws IOException {\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n public char nextChar() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }\n\n public String nextString() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }\n\n public int[] intArray (int n) throws IOException {\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long[] longArray (int n) throws IOException {\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public double[] doubleArray (int n) throws IOException {\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }\n }\n // FastScanner end\n}",
"Main",
"public static void main (String[] args) throws IOException {\n FastScanner sc = new FastScanner();\n final int N = sc.nextInt();\n final int M = sc.nextInt();\n int[] A = sc.intArray (M);\n int accum = 0;\n for (int Ai : A)\n accum += Ai;\n System.out.println (N < accum ? -1 : N - accum);\n return;\n }",
"main",
"{\n FastScanner sc = new FastScanner();\n final int N = sc.nextInt();\n final int M = sc.nextInt();\n int[] A = sc.intArray (M);\n int accum = 0;\n for (int Ai : A)\n accum += Ai;\n System.out.println (N < accum ? -1 : N - accum);\n return;\n }",
"FastScanner sc = new FastScanner();",
"sc",
"new FastScanner()",
"final int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"final int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = sc.intArray (M);",
"A",
"sc.intArray (M)",
"sc.intArray",
"sc",
"M",
"int accum = 0;",
"accum",
"0",
"for (int Ai : A)\n accum += Ai;",
"int Ai",
"A",
"accum += Ai;",
"accum += Ai",
"accum",
"Ai",
"System.out.println (N < accum ? -1 : N - accum)",
"System.out.println",
"System.out",
"System",
"System.out",
"N < accum ? -1 : N - accum",
"N < accum",
"N",
"accum",
"-1",
"1",
"N - accum",
"N",
"accum",
"return;",
"String[] args",
"args",
"static class FastScanner {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public FastScanner() {\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner (String file_name) throws IOException {\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n public char nextChar() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }\n\n public String nextString() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }\n\n public int[] intArray (int n) throws IOException {\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long[] longArray (int n) throws IOException {\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public double[] doubleArray (int n) throws IOException {\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }\n }",
"FastScanner",
"final private int BUFFER_SIZE = 1 << 16;",
"BUFFER_SIZE",
"1 << 16",
"1",
"16",
"private DataInputStream din;",
"din",
"private byte[] buffer;",
"buffer",
"private int bufferPointer",
"bufferPointer",
"bytesRead;",
"bytesRead",
"public FastScanner() {\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"FastScanner",
"{\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"din = new DataInputStream (System.in)",
"din",
"new DataInputStream (System.in)",
"buffer = new byte[BUFFER_SIZE]",
"buffer",
"new byte[BUFFER_SIZE]",
"BUFFER_SIZE",
"bufferPointer = bytesRead = 0",
"bufferPointer",
"bytesRead = 0",
"bytesRead",
"0",
"public FastScanner (String file_name) throws IOException {\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"FastScanner",
"{\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"din = new DataInputStream (new FileInputStream (file_name))",
"din",
"new DataInputStream (new FileInputStream (file_name))",
"buffer = new byte[BUFFER_SIZE]",
"buffer",
"new byte[BUFFER_SIZE]",
"BUFFER_SIZE",
"bufferPointer = bytesRead = 0",
"bufferPointer",
"bytesRead = 0",
"bytesRead",
"0",
"String file_name",
"file_name",
"private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }",
"read",
"{\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }",
"if (bufferPointer == bytesRead)\n fillBuffer();",
"bufferPointer == bytesRead",
"bufferPointer",
"bytesRead",
"fillBuffer()",
"fillBuffer",
"return buffer[bufferPointer++];",
"buffer[bufferPointer++]",
"buffer",
"bufferPointer++",
"bufferPointer",
"public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }",
"close",
"{\n if (din == null)\n return;\n din.close();\n }",
"if (din == null)\n return;",
"din == null",
"din",
"null",
"return;",
"din.close()",
"din.close",
"din",
"private void fillBuffer() throws IOException {\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }",
"fillBuffer",
"{\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }",
"bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE)",
"bytesRead",
"din.read (buffer, bufferPointer = 0, BUFFER_SIZE)",
"din.read",
"din",
"buffer",
"bufferPointer = 0",
"bufferPointer",
"0",
"BUFFER_SIZE",
"if (bytesRead == -1)\n buffer[0] = -1;",
"bytesRead == -1",
"bytesRead",
"-1",
"1",
"buffer[0] = -1",
"buffer[0]",
"buffer",
"0",
"-1",
"1",
"public char nextChar() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }",
"nextChar",
"{\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }",
"byte c = read();",
"c",
"read()",
"read",
"while (Character.isWhitespace (c)) {\n c = read();\n }",
"Character.isWhitespace (c)",
"Character.isWhitespace",
"Character",
"c",
"{\n c = read();\n }",
"c = read()",
"c",
"read()",
"read",
"return (char)c;",
"(char)c",
"public String nextString() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }",
"nextString",
"{\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }",
"byte c = read();",
"c",
"read()",
"read",
"while (Character.isWhitespace (c)) {\n c = read();\n }",
"Character.isWhitespace (c)",
"Character.isWhitespace",
"Character",
"c",
"{\n c = read();\n }",
"c = read()",
"c",
"read()",
"read",
"StringBuilder builder = new StringBuilder();",
"builder",
"new StringBuilder()",
"builder.append ((char)c)",
"builder.append",
"builder",
"(char)c",
"c = read()",
"c",
"read()",
"read",
"while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }",
"!Character.isWhitespace (c)",
"Character.isWhitespace (c)",
"Character.isWhitespace",
"Character",
"c",
"{\n builder.append ((char)c);\n c = read();\n }",
"builder.append ((char)c)",
"builder.append",
"builder",
"(char)c",
"c = read()",
"c",
"read()",
"read",
"return builder.toString();",
"builder.toString()",
"builder.toString",
"builder",
"public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }",
"nextInt",
"{\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }",
"int ret = 0;",
"ret",
"0",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ')\n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg)\n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret = ret * 10 + c - '0';\n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (neg)\n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }",
"nextLong",
"{\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }",
"long ret = 0;",
"ret",
"0",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ')\n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg)\n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret = ret * 10 + c - '0';\n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (neg)\n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }",
"nextDouble",
"{\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }",
"double ret = 0",
"ret",
"0",
"div = 1;",
"div",
"1",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ')\n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg)\n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret = ret * 10 + c - '0';\n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }",
"c == '.'",
"c",
"'.'",
"{\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }",
"while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret += (c - '0') / (div *= 10);\n }",
"ret += (c - '0') / (div *= 10)",
"ret",
"(c - '0') / (div *= 10)",
"(c - '0')",
"c",
"'0'",
"(div *= 10)",
"div",
"10",
"if (neg)\n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public int[] intArray (int n) throws IOException {\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }",
"intArray",
"{\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }",
"int arr[] = new int[n];",
"arr",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = nextInt();\n }",
"{\n arr[i] = nextInt();\n }",
"arr[i] = nextInt()",
"arr[i]",
"arr",
"i",
"nextInt()",
"nextInt",
"return arr;",
"arr",
"int n",
"n",
"public long[] longArray (int n) throws IOException {\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }",
"longArray",
"{\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }",
"long arr[] = new long[n];",
"arr",
"new long[n]",
"n",
"for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = nextLong();\n }",
"{\n arr[i] = nextLong();\n }",
"arr[i] = nextLong()",
"arr[i]",
"arr",
"i",
"nextLong()",
"nextLong",
"return arr;",
"arr",
"int n",
"n",
"public double[] doubleArray (int n) throws IOException {\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }",
"doubleArray",
"{\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }",
"double arr[] = new double[n];",
"arr",
"new double[n]",
"n",
"for (int i = 0; i < n; i++)\n arr[i] = nextDouble();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"arr[i] = nextDouble();",
"arr[i] = nextDouble()",
"arr[i]",
"arr",
"i",
"nextDouble()",
"nextDouble",
"return arr;",
"arr",
"int n",
"n",
"public class Main {\n public static void main (String[] args) throws IOException {\n FastScanner sc = new FastScanner();\n final int N = sc.nextInt();\n final int M = sc.nextInt();\n int[] A = sc.intArray (M);\n int accum = 0;\n for (int Ai : A)\n accum += Ai;\n System.out.println (N < accum ? -1 : N - accum);\n return;\n }\n\n // FastScanner start\n static class FastScanner {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public FastScanner() {\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner (String file_name) throws IOException {\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n public char nextChar() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }\n\n public String nextString() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }\n\n public int[] intArray (int n) throws IOException {\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long[] longArray (int n) throws IOException {\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public double[] doubleArray (int n) throws IOException {\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }\n }\n // FastScanner end\n}",
"public class Main {\n public static void main (String[] args) throws IOException {\n FastScanner sc = new FastScanner();\n final int N = sc.nextInt();\n final int M = sc.nextInt();\n int[] A = sc.intArray (M);\n int accum = 0;\n for (int Ai : A)\n accum += Ai;\n System.out.println (N < accum ? -1 : N - accum);\n return;\n }\n\n // FastScanner start\n static class FastScanner {\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public FastScanner() {\n din = new DataInputStream (System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public FastScanner (String file_name) throws IOException {\n din = new DataInputStream (new FileInputStream (file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n private byte read() throws IOException {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException {\n if (din == null)\n return;\n din.close();\n }\n\n private void fillBuffer() throws IOException {\n bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n public char nextChar() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n return (char)c;\n }\n\n public String nextString() throws IOException {\n byte c = read();\n while (Character.isWhitespace (c)) {\n c = read();\n }\n StringBuilder builder = new StringBuilder();\n builder.append ((char)c);\n c = read();\n while (!Character.isWhitespace (c)) {\n builder.append ((char)c);\n c = read();\n }\n return builder.toString();\n }\n\n public int nextInt() throws IOException {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n if (c == '.') {\n while ((c = read()) >= '0' && c <= '9') {\n ret += (c - '0') / (div *= 10);\n }\n }\n if (neg)\n return -ret;\n return ret;\n }\n\n public int[] intArray (int n) throws IOException {\n int arr[] = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextInt();\n }\n return arr;\n }\n\n public long[] longArray (int n) throws IOException {\n long arr[] = new long[n];\n for (int i = 0; i < n; i++) {\n arr[i] = nextLong();\n }\n return arr;\n }\n\n public double[] doubleArray (int n) throws IOException {\n double arr[] = new double[n];\n for (int i = 0; i < n; i++)\n arr[i] = nextDouble();\n return arr;\n }\n }\n // FastScanner end\n}",
"Main"
] |
import java.io.*;
// import java.math.*;
import java.util.*;
// import java.util.Map.*;
// import java.util.stream.*;
public class Main {
public static void main (String[] args) throws IOException {
FastScanner sc = new FastScanner();
final int N = sc.nextInt();
final int M = sc.nextInt();
int[] A = sc.intArray (M);
int accum = 0;
for (int Ai : A)
accum += Ai;
System.out.println (N < accum ? -1 : N - accum);
return;
}
// FastScanner start
static class FastScanner {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public FastScanner() {
din = new DataInputStream (System.in);
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
public FastScanner (String file_name) throws IOException {
din = new DataInputStream (new FileInputStream (file_name));
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
private byte read() throws IOException {
if (bufferPointer == bytesRead)
fillBuffer();
return buffer[bufferPointer++];
}
public void close() throws IOException {
if (din == null)
return;
din.close();
}
private void fillBuffer() throws IOException {
bytesRead = din.read (buffer, bufferPointer = 0, BUFFER_SIZE);
if (bytesRead == -1)
buffer[0] = -1;
}
public char nextChar() throws IOException {
byte c = read();
while (Character.isWhitespace (c)) {
c = read();
}
return (char)c;
}
public String nextString() throws IOException {
byte c = read();
while (Character.isWhitespace (c)) {
c = read();
}
StringBuilder builder = new StringBuilder();
builder.append ((char)c);
c = read();
while (!Character.isWhitespace (c)) {
builder.append ((char)c);
c = read();
}
return builder.toString();
}
public int nextInt() throws IOException {
int ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
public long nextLong() throws IOException {
long ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
public double nextDouble() throws IOException {
double ret = 0, div = 1;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (c == '.') {
while ((c = read()) >= '0' && c <= '9') {
ret += (c - '0') / (div *= 10);
}
}
if (neg)
return -ret;
return ret;
}
public int[] intArray (int n) throws IOException {
int arr[] = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = nextInt();
}
return arr;
}
public long[] longArray (int n) throws IOException {
long arr[] = new long[n];
for (int i = 0; i < n; i++) {
arr[i] = nextLong();
}
return arr;
}
public double[] doubleArray (int n) throws IOException {
double arr[] = new double[n];
for (int i = 0; i < n; i++)
arr[i] = nextDouble();
return arr;
}
}
// FastScanner end
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
75,
11
],
[
75,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
14,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
14,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
14,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
53,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
12,
72
],
[
72,
73
],
[
0,
74
],
[
74,
75
],
[
74,
76
]
] |
[
"import java.util.*;\nimport java.lang.*;\nimport java.io.*;\n\npublic final class Main\n{\n public static void main (String[] args) throws java.lang.Exception {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int m = in.nextInt();\n int sum = 0;\n for(int i =0; i< m; i++)\n sum += in.nextInt();\n int re = n- sum;\n if(re<0){\n System.out.println(-1);\n }else {\n System.out.println(re);\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public final class Main\n{\n public static void main (String[] args) throws java.lang.Exception {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int m = in.nextInt();\n int sum = 0;\n for(int i =0; i< m; i++)\n sum += in.nextInt();\n int re = n- sum;\n if(re<0){\n System.out.println(-1);\n }else {\n System.out.println(re);\n }\n }\n}",
"Main",
"public static void main (String[] args) throws java.lang.Exception {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int m = in.nextInt();\n int sum = 0;\n for(int i =0; i< m; i++)\n sum += in.nextInt();\n int re = n- sum;\n if(re<0){\n System.out.println(-1);\n }else {\n System.out.println(re);\n }\n }",
"main",
"{\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int m = in.nextInt();\n int sum = 0;\n for(int i =0; i< m; i++)\n sum += in.nextInt();\n int re = n- sum;\n if(re<0){\n System.out.println(-1);\n }else {\n System.out.println(re);\n }\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int m = in.nextInt();",
"m",
"in.nextInt()",
"in.nextInt",
"in",
"int sum = 0;",
"sum",
"0",
"for(int i =0; i< m; i++)\n sum += in.nextInt();",
"int i =0;",
"int i =0;",
"i",
"0",
"i< m",
"i",
"m",
"i++",
"i++",
"i",
"sum += in.nextInt();",
"sum += in.nextInt()",
"sum",
"in.nextInt()",
"in.nextInt",
"in",
"int re = n- sum;",
"re",
"n- sum",
"n",
"sum",
"if(re<0){\n System.out.println(-1);\n }else {\n System.out.println(re);\n }",
"re<0",
"re",
"0",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(re);\n }",
"System.out.println(re)",
"System.out.println",
"System.out",
"System",
"System.out",
"re",
"String[] args",
"args",
"public final class Main\n{\n public static void main (String[] args) throws java.lang.Exception {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int m = in.nextInt();\n int sum = 0;\n for(int i =0; i< m; i++)\n sum += in.nextInt();\n int re = n- sum;\n if(re<0){\n System.out.println(-1);\n }else {\n System.out.println(re);\n }\n }\n}",
"public final class Main\n{\n public static void main (String[] args) throws java.lang.Exception {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int m = in.nextInt();\n int sum = 0;\n for(int i =0; i< m; i++)\n sum += in.nextInt();\n int re = n- sum;\n if(re<0){\n System.out.println(-1);\n }else {\n System.out.println(re);\n }\n }\n}",
"Main"
] |
import java.util.*;
import java.lang.*;
import java.io.*;
public final class Main
{
public static void main (String[] args) throws java.lang.Exception {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int m = in.nextInt();
int sum = 0;
for(int i =0; i< m; i++)
sum += in.nextInt();
int re = n- sum;
if(re<0){
System.out.println(-1);
}else {
System.out.println(re);
}
}
}
|
[
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,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
2,
13,
13,
40,
17,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
0,
18,
36,
13,
17,
23,
13,
12,
13,
30,
14,
2,
13,
13,
30,
0,
13,
17,
38,
5,
13,
30,
37,
20,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
29,
17,
29,
17,
12,
13,
30,
14,
4,
13,
29,
18,
13,
40,
13,
29,
40,
17,
12,
13,
30,
29,
40,
2,
2,
13,
17,
2,
13,
17,
23,
13,
12,
13,
30,
42,
2,
4,
13,
4,
13,
18,
13,
13,
40,
13,
12,
13,
30,
4,
13,
29,
4,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
20,
41,
13,
4,
13,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
2,
2,
2,
13,
17,
13,
17,
0,
13,
4,
13,
29,
8,
13,
40,
13,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
41,
13,
17,
42,
40,
4,
13,
13,
30,
14,
2,
2,
13,
17,
2,
13,
17,
37,
20,
0,
13,
2,
2,
2,
13,
17,
13,
17,
0,
13,
4,
13,
29,
8,
13,
40,
13,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
4,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
481,
20
],
[
481,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
27,
29
],
[
23,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
23,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
23,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
23,
46
],
[
46,
47
],
[
46,
48
],
[
23,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
56,
58
],
[
49,
59
],
[
59,
60
],
[
60,
61
],
[
49,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
23,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
74,
80
],
[
80,
81
],
[
21,
82
],
[
82,
83
],
[
481,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
84,
88
],
[
88,
89
],
[
88,
90
],
[
84,
92
],
[
92,
93
],
[
84,
94
],
[
94,
95
],
[
84,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
98,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
96,
113
],
[
113,
114
],
[
84,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
126,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
122,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
143,
144
],
[
117,
145
],
[
145,
146
],
[
84,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
150,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
150,
158
],
[
158,
159
],
[
159,
160
],
[
84,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
170,
171
],
[
170,
172
],
[
161,
173
],
[
173,
174
],
[
84,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
178,
179
],
[
179,
180
],
[
180,
181
],
[
179,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
184,
186
],
[
178,
187
],
[
187,
188
],
[
84,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
192,
193
],
[
191,
194
],
[
194,
195
],
[
195,
196
],
[
84,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
200,
204
],
[
204,
205
],
[
199,
206
],
[
206,
207
],
[
206,
208
],
[
199,
209
],
[
209,
210
],
[
209,
211
],
[
211,
212
],
[
199,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
215,
217
],
[
213,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
219,
222
],
[
218,
223
],
[
223,
224
],
[
223,
225
],
[
225,
226
],
[
199,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
84,
231
],
[
231,
232
],
[
231,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
236,
237
],
[
234,
238
],
[
238,
239
],
[
233,
240
],
[
240,
241
],
[
240,
242
],
[
242,
243
],
[
233,
244
],
[
244,
245
],
[
245,
246
],
[
245,
247
],
[
244,
248
],
[
248,
249
],
[
248,
250
],
[
250,
251
],
[
233,
252
],
[
252,
253
],
[
252,
254
],
[
233,
255
],
[
255,
256
],
[
256,
257
],
[
256,
258
],
[
255,
259
],
[
259,
260
],
[
260,
261
],
[
260,
262
],
[
259,
263
],
[
263,
264
],
[
263,
265
],
[
265,
266
],
[
233,
267
],
[
267,
268
],
[
267,
269
],
[
233,
270
],
[
270,
271
],
[
271,
272
],
[
272,
273
],
[
272,
274
],
[
270,
275
],
[
275,
276
],
[
276,
277
],
[
277,
278
],
[
278,
279
],
[
278,
280
],
[
277,
281
],
[
281,
282
],
[
281,
283
],
[
276,
284
],
[
284,
285
],
[
275,
286
],
[
286,
287
],
[
286,
288
],
[
288,
289
],
[
289,
290
],
[
290,
291
],
[
290,
292
],
[
289,
293
],
[
288,
294
],
[
275,
295
],
[
295,
296
],
[
295,
297
],
[
297,
298
],
[
233,
299
],
[
299,
300
],
[
300,
301
],
[
300,
302
],
[
302,
303
],
[
300,
304
],
[
84,
305
],
[
305,
306
],
[
305,
307
],
[
307,
308
],
[
308,
309
],
[
309,
310
],
[
310,
311
],
[
308,
312
],
[
312,
313
],
[
307,
314
],
[
314,
315
],
[
314,
316
],
[
316,
317
],
[
307,
318
],
[
318,
319
],
[
319,
320
],
[
319,
321
],
[
318,
322
],
[
322,
323
],
[
322,
324
],
[
324,
325
],
[
307,
326
],
[
326,
327
],
[
326,
328
],
[
307,
329
],
[
329,
330
],
[
330,
331
],
[
330,
332
],
[
329,
333
],
[
333,
334
],
[
334,
335
],
[
334,
336
],
[
333,
337
],
[
337,
338
],
[
337,
339
],
[
339,
340
],
[
307,
341
],
[
341,
342
],
[
341,
343
],
[
307,
344
],
[
344,
345
],
[
345,
346
],
[
346,
347
],
[
346,
348
],
[
344,
349
],
[
349,
350
],
[
350,
351
],
[
351,
352
],
[
352,
353
],
[
352,
354
],
[
351,
355
],
[
355,
356
],
[
355,
357
],
[
350,
358
],
[
358,
359
],
[
349,
360
],
[
360,
361
],
[
360,
362
],
[
362,
363
],
[
363,
364
],
[
364,
365
],
[
364,
366
],
[
363,
367
],
[
362,
368
],
[
349,
369
],
[
369,
370
],
[
369,
371
],
[
371,
372
],
[
307,
373
],
[
373,
374
],
[
374,
375
],
[
374,
376
],
[
376,
377
],
[
374,
378
],
[
84,
379
],
[
379,
380
],
[
379,
381
],
[
381,
382
],
[
382,
383
],
[
383,
384
],
[
384,
385
],
[
383,
386
],
[
386,
387
],
[
84,
388
],
[
388,
389
],
[
388,
390
],
[
390,
391
],
[
391,
392
],
[
391,
393
],
[
390,
395
],
[
395,
396
],
[
396,
397
],
[
397,
398
],
[
397,
399
],
[
395,
400
],
[
400,
401
],
[
400,
402
],
[
395,
403
],
[
403,
404
],
[
404,
405
],
[
395,
406
],
[
406,
407
],
[
407,
408
],
[
408,
409
],
[
408,
410
],
[
407,
411
],
[
411,
412
],
[
390,
413
],
[
413,
414
],
[
388,
415
],
[
415,
416
],
[
84,
417
],
[
417,
418
],
[
417,
419
],
[
419,
420
],
[
420,
421
],
[
420,
422
],
[
419,
424
],
[
424,
425
],
[
425,
426
],
[
426,
427
],
[
426,
428
],
[
424,
429
],
[
429,
430
],
[
429,
431
],
[
424,
432
],
[
432,
433
],
[
433,
434
],
[
424,
435
],
[
435,
436
],
[
436,
437
],
[
437,
438
],
[
437,
439
],
[
436,
440
],
[
440,
441
],
[
419,
442
],
[
442,
443
],
[
417,
444
],
[
444,
445
],
[
84,
446
],
[
446,
447
],
[
446,
448
],
[
448,
449
],
[
449,
450
],
[
449,
451
],
[
448,
454
],
[
454,
455
],
[
455,
456
],
[
456,
457
],
[
456,
458
],
[
454,
459
],
[
459,
460
],
[
459,
461
],
[
454,
462
],
[
462,
463
],
[
463,
464
],
[
454,
465
],
[
465,
466
],
[
466,
467
],
[
467,
468
],
[
467,
469
],
[
466,
470
],
[
470,
471
],
[
471,
472
],
[
472,
473
],
[
448,
474
],
[
474,
475
],
[
446,
476
],
[
476,
477
],
[
446,
478
],
[
478,
479
],
[
0,
480
],
[
480,
481
],
[
480,
482
]
] |
[
"import java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.math.BigDecimal;\nimport java.math.RoundingMode;\nimport java.util.*;\n\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tInputReader sc=new InputReader(System.in);\n\t\tint N=sc.nextInt();\n\t\tint M=sc.nextInt();\n\t\tint[] A=sc.nextIntArray(M);\n\t\tint sum=0;\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tsum+=A[i];\n\t\t}\n\t\tSystem.out.println(Math.max(N-sum,-1));\n\t}\n\t\n\tstatic class InputReader { \n\t\tprivate InputStream in;\n\t\tprivate byte[] buffer = new byte[1024];\n\t\tprivate int curbuf;\n\t\tprivate int lenbuf;\n\t\tpublic InputReader(InputStream in) {\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}\n \n\t\tpublic boolean hasNextByte() {\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n \n\t\tprivate int readByte() {\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n \n\t\tprivate boolean isSpaceChar(int c) {\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}\n \n\t\tprivate void skip() {\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}\n \n\t\tpublic boolean hasNext() {\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}\n \n\t\tpublic String next() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}\n \n\t\tpublic int nextInt() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic long nextLong() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic int[] nextIntArray(int n) {\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic long[] nextLongArray(int n) {\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic char[][] nextCharMap(int n, int m) {\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}\n\t}\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.math.RoundingMode;",
"RoundingMode",
"java.math",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tInputReader sc=new InputReader(System.in);\n\t\tint N=sc.nextInt();\n\t\tint M=sc.nextInt();\n\t\tint[] A=sc.nextIntArray(M);\n\t\tint sum=0;\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tsum+=A[i];\n\t\t}\n\t\tSystem.out.println(Math.max(N-sum,-1));\n\t}\n\t\n\tstatic class InputReader { \n\t\tprivate InputStream in;\n\t\tprivate byte[] buffer = new byte[1024];\n\t\tprivate int curbuf;\n\t\tprivate int lenbuf;\n\t\tpublic InputReader(InputStream in) {\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}\n \n\t\tpublic boolean hasNextByte() {\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n \n\t\tprivate int readByte() {\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n \n\t\tprivate boolean isSpaceChar(int c) {\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}\n \n\t\tprivate void skip() {\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}\n \n\t\tpublic boolean hasNext() {\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}\n \n\t\tpublic String next() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}\n \n\t\tpublic int nextInt() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic long nextLong() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic int[] nextIntArray(int n) {\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic long[] nextLongArray(int n) {\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic char[][] nextCharMap(int n, int m) {\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tInputReader sc=new InputReader(System.in);\n\t\tint N=sc.nextInt();\n\t\tint M=sc.nextInt();\n\t\tint[] A=sc.nextIntArray(M);\n\t\tint sum=0;\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tsum+=A[i];\n\t\t}\n\t\tSystem.out.println(Math.max(N-sum,-1));\n\t}",
"main",
"{\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tInputReader sc=new InputReader(System.in);\n\t\tint N=sc.nextInt();\n\t\tint M=sc.nextInt();\n\t\tint[] A=sc.nextIntArray(M);\n\t\tint sum=0;\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tsum+=A[i];\n\t\t}\n\t\tSystem.out.println(Math.max(N-sum,-1));\n\t}",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"InputReader sc=new InputReader(System.in);",
"sc",
"new InputReader(System.in)",
"int N=sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M=sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A=sc.nextIntArray(M);",
"A",
"sc.nextIntArray(M)",
"sc.nextIntArray",
"sc",
"M",
"int sum=0;",
"sum",
"0",
"for (int i = 0; i < A.length; i++) {\n\t\t\tsum+=A[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < A.length",
"i",
"A.length",
"A",
"A.length",
"i++",
"i++",
"i",
"{\n\t\t\tsum+=A[i];\n\t\t}",
"{\n\t\t\tsum+=A[i];\n\t\t}",
"sum+=A[i]",
"sum",
"A[i]",
"A",
"i",
"System.out.println(Math.max(N-sum,-1))",
"System.out.println",
"System.out",
"System",
"System.out",
"Math.max(N-sum,-1)",
"Math.max",
"Math",
"N-sum",
"N",
"sum",
"-1",
"1",
"String[] args",
"args",
"static class InputReader { \n\t\tprivate InputStream in;\n\t\tprivate byte[] buffer = new byte[1024];\n\t\tprivate int curbuf;\n\t\tprivate int lenbuf;\n\t\tpublic InputReader(InputStream in) {\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}\n \n\t\tpublic boolean hasNextByte() {\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n \n\t\tprivate int readByte() {\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n \n\t\tprivate boolean isSpaceChar(int c) {\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}\n \n\t\tprivate void skip() {\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}\n \n\t\tpublic boolean hasNext() {\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}\n \n\t\tpublic String next() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}\n \n\t\tpublic int nextInt() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic long nextLong() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic int[] nextIntArray(int n) {\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic long[] nextLongArray(int n) {\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic char[][] nextCharMap(int n, int m) {\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}\n\t}",
"InputReader",
"private InputStream in;",
"in",
"private byte[] buffer = new byte[1024];",
"buffer",
"new byte[1024]",
"1024",
"private int curbuf;",
"curbuf",
"private int lenbuf;",
"lenbuf",
"public InputReader(InputStream in) {\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}",
"InputReader",
"{\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}",
"this.in = in",
"this.in",
"this",
"this.in",
"in",
"this.curbuf = this.lenbuf = 0",
"this.curbuf",
"this",
"this.curbuf",
"this.lenbuf = 0",
"this.lenbuf",
"this",
"this.lenbuf",
"0",
"InputStream in",
"in",
"public boolean hasNextByte() {\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}",
"hasNextByte",
"{\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}",
"if (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}",
"curbuf >= lenbuf",
"curbuf",
"lenbuf",
"{\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}",
"curbuf = 0",
"curbuf",
"0",
"try {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}",
"catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}",
"IOException e",
"{\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t}",
"lenbuf = in.read(buffer)",
"lenbuf",
"in.read(buffer)",
"in.read",
"in",
"buffer",
"if (lenbuf <= 0)\n\t\t\t\t\treturn false;",
"lenbuf <= 0",
"lenbuf",
"0",
"return false;",
"false",
"return true;",
"true",
"private int readByte() {\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}",
"readByte",
"{\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}",
"if (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;",
"hasNextByte()",
"hasNextByte",
"return buffer[curbuf++];",
"buffer[curbuf++]",
"buffer",
"curbuf++",
"curbuf",
"return -1;",
"-1",
"1",
"private boolean isSpaceChar(int c) {\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}",
"isSpaceChar",
"{\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}",
"return !(c >= 33 && c <= 126);",
"!(c >= 33 && c <= 126)",
"(c >= 33 && c <= 126)",
"c >= 33",
"c",
"33",
"c <= 126",
"c",
"126",
"int c",
"c",
"private void skip() {\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}",
"skip",
"{\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}",
"while (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;",
"hasNextByte() && isSpaceChar(buffer[curbuf])",
"hasNextByte()",
"hasNextByte",
"isSpaceChar(buffer[curbuf])",
"isSpaceChar",
"buffer[curbuf]",
"buffer",
"curbuf",
"curbuf++",
"curbuf",
"public boolean hasNext() {\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}",
"hasNext",
"{\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}",
"skip()",
"skip",
"return hasNextByte();",
"hasNextByte()",
"hasNextByte",
"public String next() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}",
"next",
"{\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}",
"if (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"while (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}",
"!isSpaceChar(b)",
"isSpaceChar(b)",
"isSpaceChar",
"b",
"{\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}",
"sb.appendCodePoint(b)",
"sb.appendCodePoint",
"sb",
"b",
"b = readByte()",
"b",
"readByte()",
"readByte",
"return sb.toString();",
"sb.toString()",
"sb.toString",
"sb",
"public int nextInt() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}",
"nextInt",
"{\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}",
"if (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"int c = readByte();",
"c",
"readByte()",
"readByte",
"while (isSpaceChar(c))\n\t\t\t\tc = readByte();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = readByte()",
"c",
"readByte()",
"readByte",
"boolean minus = false;",
"minus",
"false",
"if (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}",
"c == '-'",
"c",
"'-'",
"{\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}",
"minus = true",
"minus",
"true",
"c = readByte()",
"c",
"readByte()",
"readByte",
"int res = 0;",
"res",
"0",
"do {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t}",
"if (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res = res * 10 + c - '0'",
"res",
"res * 10 + c - '0'",
"res * 10 + c",
"res * 10",
"res",
"10",
"c",
"'0'",
"c = readByte()",
"c",
"readByte()",
"readByte",
"return (minus) ? -res : res;",
"(minus) ? -res : res",
"(minus)",
"-res",
"res",
"res",
"public long nextLong() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}",
"nextLong",
"{\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}",
"if (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"int c = readByte();",
"c",
"readByte()",
"readByte",
"while (isSpaceChar(c))\n\t\t\t\tc = readByte();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = readByte()",
"c",
"readByte()",
"readByte",
"boolean minus = false;",
"minus",
"false",
"if (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}",
"c == '-'",
"c",
"'-'",
"{\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}",
"minus = true",
"minus",
"true",
"c = readByte()",
"c",
"readByte()",
"readByte",
"long res = 0;",
"res",
"0",
"do {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t}",
"if (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res = res * 10 + c - '0'",
"res",
"res * 10 + c - '0'",
"res * 10 + c",
"res * 10",
"res",
"10",
"c",
"'0'",
"c = readByte()",
"c",
"readByte()",
"readByte",
"return (minus) ? -res : res;",
"(minus) ? -res : res",
"(minus)",
"-res",
"res",
"res",
"public double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}",
"nextDouble",
"{\n\t\t\treturn Double.parseDouble(next());\n\t\t}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public int[] nextIntArray(int n) {\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}",
"nextIntArray",
"{\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = nextInt();",
"a[i] = nextInt()",
"a[i]",
"a",
"i",
"nextInt()",
"nextInt",
"return a;",
"a",
"int n",
"n",
"public long[] nextLongArray(int n) {\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}",
"nextLongArray",
"{\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = nextLong();",
"a[i] = nextLong()",
"a[i]",
"a",
"i",
"nextLong()",
"nextLong",
"return a;",
"a",
"int n",
"n",
"public char[][] nextCharMap(int n, int m) {\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}",
"nextCharMap",
"{\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}",
"char[][] map = new char[n][m];",
"map",
"new char[n][m]",
"n",
"m",
"for (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"map[i] = next().toCharArray();",
"map[i] = next().toCharArray()",
"map[i]",
"map",
"i",
"next().toCharArray()",
"next().toCharArray",
"next()",
"next",
"return map;",
"map",
"int n",
"n",
"int m",
"m",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tInputReader sc=new InputReader(System.in);\n\t\tint N=sc.nextInt();\n\t\tint M=sc.nextInt();\n\t\tint[] A=sc.nextIntArray(M);\n\t\tint sum=0;\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tsum+=A[i];\n\t\t}\n\t\tSystem.out.println(Math.max(N-sum,-1));\n\t}\n\t\n\tstatic class InputReader { \n\t\tprivate InputStream in;\n\t\tprivate byte[] buffer = new byte[1024];\n\t\tprivate int curbuf;\n\t\tprivate int lenbuf;\n\t\tpublic InputReader(InputStream in) {\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}\n \n\t\tpublic boolean hasNextByte() {\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n \n\t\tprivate int readByte() {\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n \n\t\tprivate boolean isSpaceChar(int c) {\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}\n \n\t\tprivate void skip() {\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}\n \n\t\tpublic boolean hasNext() {\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}\n \n\t\tpublic String next() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}\n \n\t\tpublic int nextInt() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic long nextLong() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic int[] nextIntArray(int n) {\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic long[] nextLongArray(int n) {\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic char[][] nextCharMap(int n, int m) {\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tPrintWriter out = new PrintWriter(System.out);\n\t\tInputReader sc=new InputReader(System.in);\n\t\tint N=sc.nextInt();\n\t\tint M=sc.nextInt();\n\t\tint[] A=sc.nextIntArray(M);\n\t\tint sum=0;\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tsum+=A[i];\n\t\t}\n\t\tSystem.out.println(Math.max(N-sum,-1));\n\t}\n\t\n\tstatic class InputReader { \n\t\tprivate InputStream in;\n\t\tprivate byte[] buffer = new byte[1024];\n\t\tprivate int curbuf;\n\t\tprivate int lenbuf;\n\t\tpublic InputReader(InputStream in) {\n\t\t\tthis.in = in;\n\t\t\tthis.curbuf = this.lenbuf = 0;\n\t\t}\n \n\t\tpublic boolean hasNextByte() {\n\t\t\tif (curbuf >= lenbuf) {\n\t\t\t\tcurbuf = 0;\n\t\t\t\ttry {\n\t\t\t\t\tlenbuf = in.read(buffer);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\t}\n\t\t\t\tif (lenbuf <= 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n \n\t\tprivate int readByte() {\n\t\t\tif (hasNextByte())\n\t\t\t\treturn buffer[curbuf++];\n\t\t\telse\n\t\t\t\treturn -1;\n\t\t}\n \n\t\tprivate boolean isSpaceChar(int c) {\n\t\t\treturn !(c >= 33 && c <= 126);\n\t\t}\n \n\t\tprivate void skip() {\n\t\t\twhile (hasNextByte() && isSpaceChar(buffer[curbuf]))\n\t\t\t\tcurbuf++;\n\t\t}\n \n\t\tpublic boolean hasNext() {\n\t\t\tskip();\n\t\t\treturn hasNextByte();\n\t\t}\n \n\t\tpublic String next() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tint b = readByte();\n\t\t\twhile (!isSpaceChar(b)) {\n\t\t\t\tsb.appendCodePoint(b);\n\t\t\t\tb = readByte();\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}\n \n\t\tpublic int nextInt() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tint res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic long nextLong() {\n\t\t\tif (!hasNext())\n\t\t\t\tthrow new NoSuchElementException();\n\t\t\tint c = readByte();\n\t\t\twhile (isSpaceChar(c))\n\t\t\t\tc = readByte();\n\t\t\tboolean minus = false;\n\t\t\tif (c == '-') {\n\t\t\t\tminus = true;\n\t\t\t\tc = readByte();\n\t\t\t}\n\t\t\tlong res = 0;\n\t\t\tdo {\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tthrow new InputMismatchException();\n\t\t\t\tres = res * 10 + c - '0';\n\t\t\t\tc = readByte();\n\t\t\t} while (!isSpaceChar(c));\n\t\t\treturn (minus) ? -res : res;\n\t\t}\n \n\t\tpublic double nextDouble() {\n\t\t\treturn Double.parseDouble(next());\n\t\t}\n \n\t\tpublic int[] nextIntArray(int n) {\n\t\t\tint[] a = new int[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextInt();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic long[] nextLongArray(int n) {\n\t\t\tlong[] a = new long[n];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\ta[i] = nextLong();\n\t\t\treturn a;\n\t\t}\n \n\t\tpublic char[][] nextCharMap(int n, int m) {\n\t\t\tchar[][] map = new char[n][m];\n\t\t\tfor (int i = 0; i < n; i++)\n\t\t\t\tmap[i] = next().toCharArray();\n\t\t\treturn map;\n\t\t}\n\t}\n}",
"Main"
] |
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
public class Main {
public static void main(String[] args){
PrintWriter out = new PrintWriter(System.out);
InputReader sc=new InputReader(System.in);
int N=sc.nextInt();
int M=sc.nextInt();
int[] A=sc.nextIntArray(M);
int sum=0;
for (int i = 0; i < A.length; i++) {
sum+=A[i];
}
System.out.println(Math.max(N-sum,-1));
}
static class InputReader {
private InputStream in;
private byte[] buffer = new byte[1024];
private int curbuf;
private int lenbuf;
public InputReader(InputStream in) {
this.in = in;
this.curbuf = this.lenbuf = 0;
}
public boolean hasNextByte() {
if (curbuf >= lenbuf) {
curbuf = 0;
try {
lenbuf = in.read(buffer);
} catch (IOException e) {
throw new InputMismatchException();
}
if (lenbuf <= 0)
return false;
}
return true;
}
private int readByte() {
if (hasNextByte())
return buffer[curbuf++];
else
return -1;
}
private boolean isSpaceChar(int c) {
return !(c >= 33 && c <= 126);
}
private void skip() {
while (hasNextByte() && isSpaceChar(buffer[curbuf]))
curbuf++;
}
public boolean hasNext() {
skip();
return hasNextByte();
}
public String next() {
if (!hasNext())
throw new NoSuchElementException();
StringBuilder sb = new StringBuilder();
int b = readByte();
while (!isSpaceChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public int nextInt() {
if (!hasNext())
throw new NoSuchElementException();
int c = readByte();
while (isSpaceChar(c))
c = readByte();
boolean minus = false;
if (c == '-') {
minus = true;
c = readByte();
}
int res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res = res * 10 + c - '0';
c = readByte();
} while (!isSpaceChar(c));
return (minus) ? -res : res;
}
public long nextLong() {
if (!hasNext())
throw new NoSuchElementException();
int c = readByte();
while (isSpaceChar(c))
c = readByte();
boolean minus = false;
if (c == '-') {
minus = true;
c = readByte();
}
long res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res = res * 10 + c - '0';
c = readByte();
} while (!isSpaceChar(c));
return (minus) ? -res : res;
}
public double nextDouble() {
return Double.parseDouble(next());
}
public int[] nextIntArray(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++)
a[i] = nextInt();
return a;
}
public long[] nextLongArray(int n) {
long[] a = new long[n];
for (int i = 0; i < n; i++)
a[i] = nextLong();
return a;
}
public char[][] nextCharMap(int n, int m) {
char[][] map = new char[n][m];
for (int i = 0; i < n; i++)
map[i] = next().toCharArray();
return map;
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
40,
17,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
70,
8
],
[
70,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
11,
28
],
[
28,
29
],
[
28,
30
],
[
11,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
11,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
48,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
9,
67
],
[
67,
68
],
[
0,
69
],
[
69,
70
],
[
69,
71
]
] |
[
"import java.util.HashMap;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n HashMap<String,Integer> hash = new HashMap<>();\n int n = sc.nextInt();\n int m = sc.nextInt();\n long work = 0;\n for (int i=0;i<m;i++)work+=sc.nextInt();\n if (n<work)System.out.println(-1);\n else System.out.println(n-work);\n }\n}",
"import java.util.HashMap;",
"HashMap",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n HashMap<String,Integer> hash = new HashMap<>();\n int n = sc.nextInt();\n int m = sc.nextInt();\n long work = 0;\n for (int i=0;i<m;i++)work+=sc.nextInt();\n if (n<work)System.out.println(-1);\n else System.out.println(n-work);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n HashMap<String,Integer> hash = new HashMap<>();\n int n = sc.nextInt();\n int m = sc.nextInt();\n long work = 0;\n for (int i=0;i<m;i++)work+=sc.nextInt();\n if (n<work)System.out.println(-1);\n else System.out.println(n-work);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n HashMap<String,Integer> hash = new HashMap<>();\n int n = sc.nextInt();\n int m = sc.nextInt();\n long work = 0;\n for (int i=0;i<m;i++)work+=sc.nextInt();\n if (n<work)System.out.println(-1);\n else System.out.println(n-work);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"HashMap<String,Integer> hash = new HashMap<>();",
"hash",
"new HashMap<>()",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long work = 0;",
"work",
"0",
"for (int i=0;i<m;i++)work+=sc.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"work+=sc.nextInt();",
"work+=sc.nextInt()",
"work",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if (n<work)System.out.println(-1);\n else System.out.println(n-work);",
"n<work",
"n",
"work",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.out.println(n-work)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-work",
"n",
"work",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n HashMap<String,Integer> hash = new HashMap<>();\n int n = sc.nextInt();\n int m = sc.nextInt();\n long work = 0;\n for (int i=0;i<m;i++)work+=sc.nextInt();\n if (n<work)System.out.println(-1);\n else System.out.println(n-work);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n HashMap<String,Integer> hash = new HashMap<>();\n int n = sc.nextInt();\n int m = sc.nextInt();\n long work = 0;\n for (int i=0;i<m;i++)work+=sc.nextInt();\n if (n<work)System.out.println(-1);\n else System.out.println(n-work);\n }\n}",
"Main"
] |
import java.util.HashMap;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
HashMap<String,Integer> hash = new HashMap<>();
int n = sc.nextInt();
int m = sc.nextInt();
long work = 0;
for (int i=0;i<m;i++)work+=sc.nextInt();
if (n<work)System.out.println(-1);
else System.out.println(n-work);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
13,
17,
30,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
85,
5
],
[
85,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
8,
46
],
[
46,
47
],
[
46,
48
],
[
8,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
8,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
6,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
] |
[
"import java.util.Scanner;\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 m = scan.nextInt();\n\t\tint[] array = new int[m];\n\t\tfor(int i = 0; i < m; i++){\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tint asobi = n;\n\t\tfor(int i = 0; i < m; i++){\n\t\t\tasobi -= array[i];\n\t\t}\n\t\tif(asobi < 0){\n\t\t\tasobi = -1;\n\t\t}\n\t\tSystem.out.println(asobi);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] array = new int[m];\n\t\tfor(int i = 0; i < m; i++){\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tint asobi = n;\n\t\tfor(int i = 0; i < m; i++){\n\t\t\tasobi -= array[i];\n\t\t}\n\t\tif(asobi < 0){\n\t\t\tasobi = -1;\n\t\t}\n\t\tSystem.out.println(asobi);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] array = new int[m];\n\t\tfor(int i = 0; i < m; i++){\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tint asobi = n;\n\t\tfor(int i = 0; i < m; i++){\n\t\t\tasobi -= array[i];\n\t\t}\n\t\tif(asobi < 0){\n\t\t\tasobi = -1;\n\t\t}\n\t\tSystem.out.println(asobi);\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] array = new int[m];\n\t\tfor(int i = 0; i < m; i++){\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tint asobi = n;\n\t\tfor(int i = 0; i < m; i++){\n\t\t\tasobi -= array[i];\n\t\t}\n\t\tif(asobi < 0){\n\t\t\tasobi = -1;\n\t\t}\n\t\tSystem.out.println(asobi);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int m = scan.nextInt();",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] array = new int[m];",
"array",
"new int[m]",
"m",
"for(int i = 0; i < m; i++){\n\t\t\tarray[i] = scan.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tarray[i] = scan.nextInt();\n\t\t}",
"{\n\t\t\tarray[i] = scan.nextInt();\n\t\t}",
"array[i] = scan.nextInt()",
"array[i]",
"array",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int asobi = n;",
"asobi",
"n",
"for(int i = 0; i < m; i++){\n\t\t\tasobi -= array[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tasobi -= array[i];\n\t\t}",
"{\n\t\t\tasobi -= array[i];\n\t\t}",
"asobi -= array[i]",
"asobi",
"array[i]",
"array",
"i",
"if(asobi < 0){\n\t\t\tasobi = -1;\n\t\t}",
"asobi < 0",
"asobi",
"0",
"{\n\t\t\tasobi = -1;\n\t\t}",
"asobi = -1",
"asobi",
"-1",
"1",
"System.out.println(asobi)",
"System.out.println",
"System.out",
"System",
"System.out",
"asobi",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] array = new int[m];\n\t\tfor(int i = 0; i < m; i++){\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tint asobi = n;\n\t\tfor(int i = 0; i < m; i++){\n\t\t\tasobi -= array[i];\n\t\t}\n\t\tif(asobi < 0){\n\t\t\tasobi = -1;\n\t\t}\n\t\tSystem.out.println(asobi);\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint m = scan.nextInt();\n\t\tint[] array = new int[m];\n\t\tfor(int i = 0; i < m; i++){\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tint asobi = n;\n\t\tfor(int i = 0; i < m; i++){\n\t\t\tasobi -= array[i];\n\t\t}\n\t\tif(asobi < 0){\n\t\t\tasobi = -1;\n\t\t}\n\t\tSystem.out.println(asobi);\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
int[] array = new int[m];
for(int i = 0; i < m; i++){
array[i] = scan.nextInt();
}
int asobi = n;
for(int i = 0; i < m; i++){
asobi -= array[i];
}
if(asobi < 0){
asobi = -1;
}
System.out.println(asobi);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
18,
13,
13,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
40,
17,
2,
13,
13,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
298,
14
],
[
298,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
17,
24
],
[
24,
25
],
[
24,
26
],
[
17,
27
],
[
27,
28
],
[
27,
29
],
[
17,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
30,
38
],
[
38,
39
],
[
39,
40
],
[
30,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
42,
45
],
[
42,
46
],
[
42,
47
],
[
17,
48
],
[
48,
49
],
[
49,
50
],
[
15,
51
],
[
51,
52
],
[
298,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
59,
69
],
[
69,
70
],
[
70,
71
],
[
59,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
79,
80
],
[
79,
81
],
[
73,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
84,
86
],
[
73,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
87,
91
],
[
91,
92
],
[
91,
93
],
[
73,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
53,
99
],
[
99,
100
],
[
298,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
107,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
107,
117
],
[
117,
118
],
[
118,
119
],
[
107,
120
],
[
121,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
127,
129
],
[
121,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
121,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
139,
140
],
[
139,
141
],
[
121,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
142,
146
],
[
101,
147
],
[
147,
148
],
[
298,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
151,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
153,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
162,
163
],
[
153,
164
],
[
164,
165
],
[
164,
166
],
[
153,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
167,
172
],
[
172,
173
],
[
172,
174
],
[
167,
175
],
[
175,
176
],
[
176,
177
],
[
167,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
182,
183
],
[
153,
184
],
[
184,
185
],
[
185,
186
],
[
184,
187
],
[
187,
188
],
[
188,
189
],
[
187,
190
],
[
190,
191
],
[
187,
192
],
[
192,
193
],
[
192,
194
],
[
151,
195
],
[
195,
196
],
[
151,
197
],
[
197,
198
],
[
151,
199
],
[
199,
200
],
[
298,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
201,
205
],
[
205,
206
],
[
201,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
201,
213
],
[
213,
214
],
[
213,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
213,
219
],
[
219,
220
],
[
201,
221
],
[
221,
222
],
[
221,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
225,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
224,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
235,
237
],
[
237,
238
],
[
238,
239
],
[
239,
240
],
[
234,
241
],
[
241,
242
],
[
242,
243
],
[
242,
244
],
[
223,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
201,
249
],
[
249,
250
],
[
249,
251
],
[
251,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
253,
256
],
[
256,
257
],
[
201,
258
],
[
258,
259
],
[
258,
260
],
[
260,
261
],
[
261,
262
],
[
262,
263
],
[
263,
264
],
[
262,
265
],
[
265,
266
],
[
201,
267
],
[
267,
268
],
[
267,
269
],
[
269,
270
],
[
270,
271
],
[
271,
272
],
[
272,
273
],
[
271,
274
],
[
274,
275
],
[
201,
276
],
[
276,
277
],
[
276,
278
],
[
278,
279
],
[
279,
280
],
[
279,
281
],
[
278,
282
],
[
282,
283
],
[
283,
284
],
[
283,
285
],
[
285,
286
],
[
286,
287
],
[
287,
288
],
[
282,
289
],
[
289,
290
],
[
290,
291
],
[
290,
292
],
[
292,
293
],
[
293,
294
],
[
278,
295
],
[
295,
296
],
[
0,
297
],
[
297,
298
],
[
297,
299
]
] |
[
"\nimport java.io.*;\nimport java.util.Random;\nimport java.util.StringTokenizer;\nimport java.util.TreeSet;\n\npublic class Main {\n //Solution by Sathvik Kuthuru\n public static void main(String[] args) {\n FastReader scan = new FastReader();\n PrintWriter out = new PrintWriter(System.out);\n Task solver = new Task();\n int t = 1;\n for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);\n out.close();\n }\n\n static class Task {\n\n public void solve(int testNumber, FastReader scan, PrintWriter out) {\n int n = scan.nextInt(), m = scan.nextInt(), a = 0;\n for(int i = 0; i < m; i++) a += scan.nextInt();\n out.println(Math.max(-1, n - a));\n }\n }\n\n static void shuffle(int[] a) {\n Random get = new Random();\n for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }\n\n static void shuffle(long[] a) {\n Random get = new Random();\n for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n long temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n public FastReader(String s) throws FileNotFoundException {\n br = new BufferedReader(new FileReader(new File(s)));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.Random;",
"Random",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"import java.util.TreeSet;",
"TreeSet",
"java.util",
"public class Main {\n //Solution by Sathvik Kuthuru\n public static void main(String[] args) {\n FastReader scan = new FastReader();\n PrintWriter out = new PrintWriter(System.out);\n Task solver = new Task();\n int t = 1;\n for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);\n out.close();\n }\n\n static class Task {\n\n public void solve(int testNumber, FastReader scan, PrintWriter out) {\n int n = scan.nextInt(), m = scan.nextInt(), a = 0;\n for(int i = 0; i < m; i++) a += scan.nextInt();\n out.println(Math.max(-1, n - a));\n }\n }\n\n static void shuffle(int[] a) {\n Random get = new Random();\n for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }\n\n static void shuffle(long[] a) {\n Random get = new Random();\n for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n long temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n public FastReader(String s) throws FileNotFoundException {\n br = new BufferedReader(new FileReader(new File(s)));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n}",
"Main",
"//Solution by Sathvik Kuthuru\n public static void main(String[] args) {\n FastReader scan = new FastReader();\n PrintWriter out = new PrintWriter(System.out);\n Task solver = new Task();\n int t = 1;\n for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);\n out.close();\n }",
"main",
"{\n FastReader scan = new FastReader();\n PrintWriter out = new PrintWriter(System.out);\n Task solver = new Task();\n int t = 1;\n for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);\n out.close();\n }",
"FastReader scan = new FastReader();",
"scan",
"new FastReader()",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"Task solver = new Task();",
"solver",
"new Task()",
"int t = 1;",
"t",
"1",
"for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);",
"int tt = 1;",
"int tt = 1;",
"tt",
"1",
"tt <= t",
"tt",
"t",
"tt++",
"tt++",
"tt",
"solver.solve(tt, scan, out);",
"solver.solve(tt, scan, out)",
"solver.solve",
"solver",
"tt",
"scan",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static void shuffle(int[] a) {\n Random get = new Random();\n for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }",
"shuffle",
"{\n Random get = new Random();\n for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }",
"Random get = new Random();",
"get",
"new Random()",
"for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n int r = get.nextInt(a.length);\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }",
"{\n int r = get.nextInt(a.length);\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }",
"int r = get.nextInt(a.length);",
"r",
"get.nextInt(a.length)",
"get.nextInt",
"get",
"a.length",
"a",
"a.length",
"int temp = a[i];",
"temp",
"a[i]",
"a",
"i",
"a[i] = a[r]",
"a[i]",
"a",
"i",
"a[r]",
"a",
"r",
"a[r] = temp",
"a[r]",
"a",
"r",
"temp",
"int[] a",
"a",
"static void shuffle(long[] a) {\n Random get = new Random();\n for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n long temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }",
"shuffle",
"{\n Random get = new Random();\n for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n long temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }",
"Random get = new Random();",
"get",
"new Random()",
"for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n long temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"{\n int r = get.nextInt(a.length);\n long temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }",
"{\n int r = get.nextInt(a.length);\n long temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }",
"int r = get.nextInt(a.length);",
"r",
"get.nextInt(a.length)",
"get.nextInt",
"get",
"a.length",
"a",
"a.length",
"long temp = a[i];",
"temp",
"a[i]",
"a",
"i",
"a[i] = a[r]",
"a[i]",
"a",
"i",
"a[r]",
"a",
"r",
"a[r] = temp",
"a[r]",
"a",
"r",
"temp",
"long[] a",
"a",
"static class Task {\n\n public void solve(int testNumber, FastReader scan, PrintWriter out) {\n int n = scan.nextInt(), m = scan.nextInt(), a = 0;\n for(int i = 0; i < m; i++) a += scan.nextInt();\n out.println(Math.max(-1, n - a));\n }\n }",
"Task",
"public void solve(int testNumber, FastReader scan, PrintWriter out) {\n int n = scan.nextInt(), m = scan.nextInt(), a = 0;\n for(int i = 0; i < m; i++) a += scan.nextInt();\n out.println(Math.max(-1, n - a));\n }",
"solve",
"{\n int n = scan.nextInt(), m = scan.nextInt(), a = 0;\n for(int i = 0; i < m; i++) a += scan.nextInt();\n out.println(Math.max(-1, n - a));\n }",
"int n = scan.nextInt()",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"m = scan.nextInt()",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"a = 0;",
"a",
"0",
"for(int i = 0; i < m; i++) a += scan.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"a += scan.nextInt();",
"a += scan.nextInt()",
"a",
"scan.nextInt()",
"scan.nextInt",
"scan",
"out.println(Math.max(-1, n - a))",
"out.println",
"out",
"Math.max(-1, n - a)",
"Math.max",
"Math",
"-1",
"1",
"n - a",
"n",
"a",
"int testNumber",
"testNumber",
"FastReader scan",
"scan",
"PrintWriter out",
"out",
"static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n public FastReader(String s) throws FileNotFoundException {\n br = new BufferedReader(new FileReader(new File(s)));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"FastReader",
"{\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"public FastReader(String s) throws FileNotFoundException {\n br = new BufferedReader(new FileReader(new File(s)));\n }",
"FastReader",
"{\n br = new BufferedReader(new FileReader(new File(s)));\n }",
"br = new BufferedReader(new FileReader(new File(s)))",
"br",
"new BufferedReader(new FileReader(new File(s)))",
"String s",
"s",
"String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong() {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble() {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"nextLine",
"{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main {\n //Solution by Sathvik Kuthuru\n public static void main(String[] args) {\n FastReader scan = new FastReader();\n PrintWriter out = new PrintWriter(System.out);\n Task solver = new Task();\n int t = 1;\n for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);\n out.close();\n }\n\n static class Task {\n\n public void solve(int testNumber, FastReader scan, PrintWriter out) {\n int n = scan.nextInt(), m = scan.nextInt(), a = 0;\n for(int i = 0; i < m; i++) a += scan.nextInt();\n out.println(Math.max(-1, n - a));\n }\n }\n\n static void shuffle(int[] a) {\n Random get = new Random();\n for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }\n\n static void shuffle(long[] a) {\n Random get = new Random();\n for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n long temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n public FastReader(String s) throws FileNotFoundException {\n br = new BufferedReader(new FileReader(new File(s)));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n}",
"public class Main {\n //Solution by Sathvik Kuthuru\n public static void main(String[] args) {\n FastReader scan = new FastReader();\n PrintWriter out = new PrintWriter(System.out);\n Task solver = new Task();\n int t = 1;\n for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);\n out.close();\n }\n\n static class Task {\n\n public void solve(int testNumber, FastReader scan, PrintWriter out) {\n int n = scan.nextInt(), m = scan.nextInt(), a = 0;\n for(int i = 0; i < m; i++) a += scan.nextInt();\n out.println(Math.max(-1, n - a));\n }\n }\n\n static void shuffle(int[] a) {\n Random get = new Random();\n for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }\n\n static void shuffle(long[] a) {\n Random get = new Random();\n for (int i = 0; i < a.length; i++) {\n int r = get.nextInt(a.length);\n long temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }\n\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n public FastReader() {\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n public FastReader(String s) throws FileNotFoundException {\n br = new BufferedReader(new FileReader(new File(s)));\n }\n\n String next() {\n while (st == null || !st.hasMoreElements()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return str;\n }\n }\n\n}",
"Main"
] |
import java.io.*;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeSet;
public class Main {
//Solution by Sathvik Kuthuru
public static void main(String[] args) {
FastReader scan = new FastReader();
PrintWriter out = new PrintWriter(System.out);
Task solver = new Task();
int t = 1;
for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);
out.close();
}
static class Task {
public void solve(int testNumber, FastReader scan, PrintWriter out) {
int n = scan.nextInt(), m = scan.nextInt(), a = 0;
for(int i = 0; i < m; i++) a += scan.nextInt();
out.println(Math.max(-1, n - a));
}
}
static void shuffle(int[] a) {
Random get = new Random();
for (int i = 0; i < a.length; i++) {
int r = get.nextInt(a.length);
int temp = a[i];
a[i] = a[r];
a[r] = temp;
}
}
static void shuffle(long[] a) {
Random get = new Random();
for (int i = 0; i < a.length; i++) {
int r = get.nextInt(a.length);
long temp = a[i];
a[i] = a[r];
a[r] = temp;
}
}
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
public FastReader(String s) throws FileNotFoundException {
br = new BufferedReader(new FileReader(new File(s)));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
75,
5
],
[
75,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
41,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
54,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
6,
72
],
[
72,
73
],
[
0,
74
],
[
74,
75
],
[
74,
76
]
] |
[
"import java.util.Scanner;\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 M = sc.nextInt();\n\t\tint sum = 0;\n\t\tint x[] = new int[M];\n\t\tfor(int i = 0;i<M;i++){\n\t\t\tx[i] =sc.nextInt();\n\t\t\tsum+=x[i];\n\t\t}\n\t\tif(N<sum)\n\t\t\tSystem.out.println(\"-1\");\n\t\telse\n\t\tSystem.out.println(N-sum);\n\t\t\t\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint sum = 0;\n\t\tint x[] = new int[M];\n\t\tfor(int i = 0;i<M;i++){\n\t\t\tx[i] =sc.nextInt();\n\t\t\tsum+=x[i];\n\t\t}\n\t\tif(N<sum)\n\t\t\tSystem.out.println(\"-1\");\n\t\telse\n\t\tSystem.out.println(N-sum);\n\t\t\t\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint sum = 0;\n\t\tint x[] = new int[M];\n\t\tfor(int i = 0;i<M;i++){\n\t\t\tx[i] =sc.nextInt();\n\t\t\tsum+=x[i];\n\t\t}\n\t\tif(N<sum)\n\t\t\tSystem.out.println(\"-1\");\n\t\telse\n\t\tSystem.out.println(N-sum);\n\t\t\t\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint sum = 0;\n\t\tint x[] = new int[M];\n\t\tfor(int i = 0;i<M;i++){\n\t\t\tx[i] =sc.nextInt();\n\t\t\tsum+=x[i];\n\t\t}\n\t\tif(N<sum)\n\t\t\tSystem.out.println(\"-1\");\n\t\telse\n\t\tSystem.out.println(N-sum);\n\t\t\t\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"int x[] = new int[M];",
"x",
"new int[M]",
"M",
"for(int i = 0;i<M;i++){\n\t\t\tx[i] =sc.nextInt();\n\t\t\tsum+=x[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tx[i] =sc.nextInt();\n\t\t\tsum+=x[i];\n\t\t}",
"{\n\t\t\tx[i] =sc.nextInt();\n\t\t\tsum+=x[i];\n\t\t}",
"x[i] =sc.nextInt()",
"x[i]",
"x",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum+=x[i]",
"sum",
"x[i]",
"x",
"i",
"if(N<sum)\n\t\t\tSystem.out.println(\"-1\");\n\t\telse\n\t\tSystem.out.println(N-sum);",
"N<sum",
"N",
"sum",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"System.out.println(N-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"N-sum",
"N",
"sum",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint sum = 0;\n\t\tint x[] = new int[M];\n\t\tfor(int i = 0;i<M;i++){\n\t\t\tx[i] =sc.nextInt();\n\t\t\tsum+=x[i];\n\t\t}\n\t\tif(N<sum)\n\t\t\tSystem.out.println(\"-1\");\n\t\telse\n\t\tSystem.out.println(N-sum);\n\t\t\t\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tint sum = 0;\n\t\tint x[] = new int[M];\n\t\tfor(int i = 0;i<M;i++){\n\t\t\tx[i] =sc.nextInt();\n\t\t\tsum+=x[i];\n\t\t}\n\t\tif(N<sum)\n\t\t\tSystem.out.println(\"-1\");\n\t\telse\n\t\tSystem.out.println(N-sum);\n\t\t\t\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int sum = 0;
int x[] = new int[M];
for(int i = 0;i<M;i++){
x[i] =sc.nextInt();
sum+=x[i];
}
if(N<sum)
System.out.println("-1");
else
System.out.println(N-sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
17,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
75,
5
],
[
75,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
41,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
54,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
6,
72
],
[
72,
73
],
[
0,
74
],
[
74,
75
],
[
74,
76
]
] |
[
"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 m = sc.nextInt();\n int[] days = new int[m];\n int sum = 0;\n for (int i = 0; i < m; i++) {\n days[i] = sc.nextInt();\n sum += days[i];\n }\n if (n < sum) System.out.println(\"-1\");\n else System.out.println(n - sum);\n \n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] days = new int[m];\n int sum = 0;\n for (int i = 0; i < m; i++) {\n days[i] = sc.nextInt();\n sum += days[i];\n }\n if (n < sum) System.out.println(\"-1\");\n else System.out.println(n - sum);\n \n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] days = new int[m];\n int sum = 0;\n for (int i = 0; i < m; i++) {\n days[i] = sc.nextInt();\n sum += days[i];\n }\n if (n < sum) System.out.println(\"-1\");\n else System.out.println(n - sum);\n \n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] days = new int[m];\n int sum = 0;\n for (int i = 0; i < m; i++) {\n days[i] = sc.nextInt();\n sum += days[i];\n }\n if (n < sum) System.out.println(\"-1\");\n else System.out.println(n - sum);\n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] days = new int[m];",
"days",
"new int[m]",
"m",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < m; i++) {\n days[i] = sc.nextInt();\n sum += days[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n days[i] = sc.nextInt();\n sum += days[i];\n }",
"{\n days[i] = sc.nextInt();\n sum += days[i];\n }",
"days[i] = sc.nextInt()",
"days[i]",
"days",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum += days[i]",
"sum",
"days[i]",
"days",
"i",
"if (n < sum) System.out.println(\"-1\");\n else System.out.println(n - sum);",
"n < sum",
"n",
"sum",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"System.out.println(n - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - sum",
"n",
"sum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] days = new int[m];\n int sum = 0;\n for (int i = 0; i < m; i++) {\n days[i] = sc.nextInt();\n sum += days[i];\n }\n if (n < sum) System.out.println(\"-1\");\n else System.out.println(n - sum);\n \n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int[] days = new int[m];\n int sum = 0;\n for (int i = 0; i < m; i++) {\n days[i] = sc.nextInt();\n sum += days[i];\n }\n if (n < sum) System.out.println(\"-1\");\n else System.out.println(n - sum);\n \n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] days = new int[m];
int sum = 0;
for (int i = 0; i < m; i++) {
days[i] = sc.nextInt();
sum += days[i];
}
if (n < sum) System.out.println("-1");
else System.out.println(n - sum);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
18,
13,
2,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
58,
5
],
[
58,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
8,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
50,
52
],
[
47,
53
],
[
53,
54
],
[
6,
55
],
[
55,
56
],
[
0,
57
],
[
57,
58
],
[
57,
59
]
] |
[
"import java.util.Scanner;\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n long n=sc.nextInt(),m=sc.nextInt();\n long sum=0;\n for(long i=0;i<m;i++)sum+=sc.nextLong();\n System.out.println(Math.max(n-sum, -1));\n \n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n long n=sc.nextInt(),m=sc.nextInt();\n long sum=0;\n for(long i=0;i<m;i++)sum+=sc.nextLong();\n System.out.println(Math.max(n-sum, -1));\n \n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n long n=sc.nextInt(),m=sc.nextInt();\n long sum=0;\n for(long i=0;i<m;i++)sum+=sc.nextLong();\n System.out.println(Math.max(n-sum, -1));\n \n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n long n=sc.nextInt(),m=sc.nextInt();\n long sum=0;\n for(long i=0;i<m;i++)sum+=sc.nextLong();\n System.out.println(Math.max(n-sum, -1));\n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"long n=sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"m=sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum=0;",
"sum",
"0",
"for(long i=0;i<m;i++)sum+=sc.nextLong();",
"long i=0;",
"long i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"sum+=sc.nextLong();",
"sum+=sc.nextLong()",
"sum",
"sc.nextLong()",
"sc.nextLong",
"sc",
"System.out.println(Math.max(n-sum, -1))",
"System.out.println",
"System.out",
"System",
"System.out",
"Math.max(n-sum, -1)",
"Math.max",
"Math",
"n-sum",
"n",
"sum",
"-1",
"1",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n long n=sc.nextInt(),m=sc.nextInt();\n long sum=0;\n for(long i=0;i<m;i++)sum+=sc.nextLong();\n System.out.println(Math.max(n-sum, -1));\n \n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n long n=sc.nextInt(),m=sc.nextInt();\n long sum=0;\n for(long i=0;i<m;i++)sum+=sc.nextLong();\n System.out.println(Math.max(n-sum, -1));\n \n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long n=sc.nextInt(),m=sc.nextInt();
long sum=0;
for(long i=0;i<m;i++)sum+=sc.nextLong();
System.out.println(Math.max(n-sum, -1));
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
41,
13,
8,
2,
2,
13,
13,
17,
2,
13,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
64,
5
],
[
64,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
8,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
44,
50
],
[
50,
51
],
[
50,
52
],
[
44,
53
],
[
53,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
6,
61
],
[
61,
62
],
[
0,
63
],
[
63,
64
],
[
63,
65
]
] |
[
"import java.util.*;\npublic class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n for (int i=0;i<m;i++) sum+=sc.nextInt();\n int result = (n-sum>=0)?n-sum:-1;\n System.out.println(result);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n for (int i=0;i<m;i++) sum+=sc.nextInt();\n int result = (n-sum>=0)?n-sum:-1;\n System.out.println(result);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n for (int i=0;i<m;i++) sum+=sc.nextInt();\n int result = (n-sum>=0)?n-sum:-1;\n System.out.println(result);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n for (int i=0;i<m;i++) sum+=sc.nextInt();\n int result = (n-sum>=0)?n-sum:-1;\n System.out.println(result);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i=0;i<m;i++) sum+=sc.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"sum+=sc.nextInt();",
"sum+=sc.nextInt()",
"sum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int result = (n-sum>=0)?n-sum:-1;",
"result",
"(n-sum>=0)?n-sum:-1",
"(n-sum>=0)",
"n-sum",
"n",
"sum",
"0",
"n-sum",
"n",
"sum",
"-1",
"1",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n for (int i=0;i<m;i++) sum+=sc.nextInt();\n int result = (n-sum>=0)?n-sum:-1;\n System.out.println(result);\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int sum = 0;\n for (int i=0;i<m;i++) sum+=sc.nextInt();\n int result = (n-sum>=0)?n-sum:-1;\n System.out.println(result);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int sum = 0;
for (int i=0;i<m;i++) sum+=sc.nextInt();
int result = (n-sum>=0)?n-sum:-1;
System.out.println(result);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
3,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
12,
13,
30,
41,
13,
17,
42,
2,
13,
17,
30,
4,
13,
40,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
118,
11
],
[
118,
12
],
[
12,
13
],
[
12,
14
],
[
118,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
17,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
17,
28
],
[
28,
29
],
[
28,
30
],
[
17,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
17,
52
],
[
52,
53
],
[
52,
54
],
[
17,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
67,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
17,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
79,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
97,
98
],
[
97,
99
],
[
118,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
113,
114
],
[
100,
115
],
[
115,
116
],
[
0,
117
],
[
117,
118
],
[
117,
119
]
] |
[
"/* package codechef; // don't place package name! */\n\nimport java.util.*;\nimport java.lang.*;\nimport java.io.*;\n\n\n\n/* Name of the class has to be \"Main\" only if the class is public. */\npublic class Main\n \n \n{\n static Scanner in = new Scanner(System.in);\n \n public static void solve()\n {\n int n=in.nextInt(),m=in.nextInt();\n int[] a = new int[m];\n for(int i=0;i<m;i++)\n {\n a[i]=in.nextInt();\n }\n \n int sum=0;\n \n for(int i=0;i<m;i++)\n {\n sum+=a[i];\n \n if(sum>n)\n {\n break;\n }\n \n }\n \n if(sum>n)\n {\n System.out.println(-1);\n }\n else\n {\n System.out.println(n-sum);\n }\n \n }\n \n\n \n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\t\n\t\tint t=1;\n\t\t//in.nextLine();\n\t\t\n\t\twhile(t>0)\n\t\t{\n\t\t \n\t\t solve();\n\t\t t--;\n\t\t}\n\t\t\n\t\t\n\t\n\t//\tSystem.out.println(x);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.lang.*;",
"lang.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main\n \n \n{\n static Scanner in = new Scanner(System.in);\n \n public static void solve()\n {\n int n=in.nextInt(),m=in.nextInt();\n int[] a = new int[m];\n for(int i=0;i<m;i++)\n {\n a[i]=in.nextInt();\n }\n \n int sum=0;\n \n for(int i=0;i<m;i++)\n {\n sum+=a[i];\n \n if(sum>n)\n {\n break;\n }\n \n }\n \n if(sum>n)\n {\n System.out.println(-1);\n }\n else\n {\n System.out.println(n-sum);\n }\n \n }\n \n\n \n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\t\n\t\tint t=1;\n\t\t//in.nextLine();\n\t\t\n\t\twhile(t>0)\n\t\t{\n\t\t \n\t\t solve();\n\t\t t--;\n\t\t}\n\t\t\n\t\t\n\t\n\t//\tSystem.out.println(x);\n\t}\n}",
"Main",
"static Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"public static void solve()\n {\n int n=in.nextInt(),m=in.nextInt();\n int[] a = new int[m];\n for(int i=0;i<m;i++)\n {\n a[i]=in.nextInt();\n }\n \n int sum=0;\n \n for(int i=0;i<m;i++)\n {\n sum+=a[i];\n \n if(sum>n)\n {\n break;\n }\n \n }\n \n if(sum>n)\n {\n System.out.println(-1);\n }\n else\n {\n System.out.println(n-sum);\n }\n \n }",
"solve",
"{\n int n=in.nextInt(),m=in.nextInt();\n int[] a = new int[m];\n for(int i=0;i<m;i++)\n {\n a[i]=in.nextInt();\n }\n \n int sum=0;\n \n for(int i=0;i<m;i++)\n {\n sum+=a[i];\n \n if(sum>n)\n {\n break;\n }\n \n }\n \n if(sum>n)\n {\n System.out.println(-1);\n }\n else\n {\n System.out.println(n-sum);\n }\n \n }",
"int n=in.nextInt()",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"m=in.nextInt();",
"m",
"in.nextInt()",
"in.nextInt",
"in",
"int[] a = new int[m];",
"a",
"new int[m]",
"m",
"for(int i=0;i<m;i++)\n {\n a[i]=in.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n a[i]=in.nextInt();\n }",
"{\n a[i]=in.nextInt();\n }",
"a[i]=in.nextInt()",
"a[i]",
"a",
"i",
"in.nextInt()",
"in.nextInt",
"in",
"int sum=0;",
"sum",
"0",
"for(int i=0;i<m;i++)\n {\n sum+=a[i];\n \n if(sum>n)\n {\n break;\n }\n \n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n sum+=a[i];\n \n if(sum>n)\n {\n break;\n }\n \n }",
"{\n sum+=a[i];\n \n if(sum>n)\n {\n break;\n }\n \n }",
"sum+=a[i]",
"sum",
"a[i]",
"a",
"i",
"if(sum>n)\n {\n break;\n }",
"sum>n",
"sum",
"n",
"{\n break;\n }",
"break;",
"if(sum>n)\n {\n System.out.println(-1);\n }\n else\n {\n System.out.println(n-sum);\n }",
"sum>n",
"sum",
"n",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(n-sum);\n }",
"System.out.println(n-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum",
"n",
"sum",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\t\n\t\tint t=1;\n\t\t//in.nextLine();\n\t\t\n\t\twhile(t>0)\n\t\t{\n\t\t \n\t\t solve();\n\t\t t--;\n\t\t}\n\t\t\n\t\t\n\t\n\t//\tSystem.out.println(x);\n\t}",
"main",
"{\n\t\t// your code goes here\n\t\t\n\t\tint t=1;\n\t\t//in.nextLine();\n\t\t\n\t\twhile(t>0)\n\t\t{\n\t\t \n\t\t solve();\n\t\t t--;\n\t\t}\n\t\t\n\t\t\n\t\n\t//\tSystem.out.println(x);\n\t}",
"int t=1;",
"t",
"1",
"while(t>0)\n\t\t{\n\t\t \n\t\t solve();\n\t\t t--;\n\t\t}",
"t>0",
"t",
"0",
"{\n\t\t \n\t\t solve();\n\t\t t--;\n\t\t}",
"solve()",
"solve",
"t--",
"t",
"String[] args",
"args",
"public class Main\n \n \n{\n static Scanner in = new Scanner(System.in);\n \n public static void solve()\n {\n int n=in.nextInt(),m=in.nextInt();\n int[] a = new int[m];\n for(int i=0;i<m;i++)\n {\n a[i]=in.nextInt();\n }\n \n int sum=0;\n \n for(int i=0;i<m;i++)\n {\n sum+=a[i];\n \n if(sum>n)\n {\n break;\n }\n \n }\n \n if(sum>n)\n {\n System.out.println(-1);\n }\n else\n {\n System.out.println(n-sum);\n }\n \n }\n \n\n \n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\t\n\t\tint t=1;\n\t\t//in.nextLine();\n\t\t\n\t\twhile(t>0)\n\t\t{\n\t\t \n\t\t solve();\n\t\t t--;\n\t\t}\n\t\t\n\t\t\n\t\n\t//\tSystem.out.println(x);\n\t}\n}",
"public class Main\n \n \n{\n static Scanner in = new Scanner(System.in);\n \n public static void solve()\n {\n int n=in.nextInt(),m=in.nextInt();\n int[] a = new int[m];\n for(int i=0;i<m;i++)\n {\n a[i]=in.nextInt();\n }\n \n int sum=0;\n \n for(int i=0;i<m;i++)\n {\n sum+=a[i];\n \n if(sum>n)\n {\n break;\n }\n \n }\n \n if(sum>n)\n {\n System.out.println(-1);\n }\n else\n {\n System.out.println(n-sum);\n }\n \n }\n \n\n \n\tpublic static void main (String[] args) throws java.lang.Exception\n\t{\n\t\t// your code goes here\n\t\t\n\t\tint t=1;\n\t\t//in.nextLine();\n\t\t\n\t\twhile(t>0)\n\t\t{\n\t\t \n\t\t solve();\n\t\t t--;\n\t\t}\n\t\t\n\t\t\n\t\n\t//\tSystem.out.println(x);\n\t}\n}",
"Main"
] |
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
static Scanner in = new Scanner(System.in);
public static void solve()
{
int n=in.nextInt(),m=in.nextInt();
int[] a = new int[m];
for(int i=0;i<m;i++)
{
a[i]=in.nextInt();
}
int sum=0;
for(int i=0;i<m;i++)
{
sum+=a[i];
if(sum>n)
{
break;
}
}
if(sum>n)
{
System.out.println(-1);
}
else
{
System.out.println(n-sum);
}
}
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
int t=1;
//in.nextLine();
while(t>0)
{
solve();
t--;
}
// System.out.println(x);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
40,
17,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
83,
5
],
[
83,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
8,
46
],
[
46,
47
],
[
46,
48
],
[
8,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
6,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n @SuppressWarnings(\"resource\")\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int [] a = new int[m];\n for (int i = 0 ; i < m ; i++) {\n a[i] = sc.nextInt();\n }\n int sum = 0;\n for (int i = 0 ; i < m ; i++) {\n sum += a[i];\n }\n System.out.println(Math.max(-1, n - sum));\n }\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n @SuppressWarnings(\"resource\")\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int [] a = new int[m];\n for (int i = 0 ; i < m ; i++) {\n a[i] = sc.nextInt();\n }\n int sum = 0;\n for (int i = 0 ; i < m ; i++) {\n sum += a[i];\n }\n System.out.println(Math.max(-1, n - sum));\n }\n\n}",
"Main",
"public static void main(String[] args) {\n @SuppressWarnings(\"resource\")\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int [] a = new int[m];\n for (int i = 0 ; i < m ; i++) {\n a[i] = sc.nextInt();\n }\n int sum = 0;\n for (int i = 0 ; i < m ; i++) {\n sum += a[i];\n }\n System.out.println(Math.max(-1, n - sum));\n }",
"main",
"{\n @SuppressWarnings(\"resource\")\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int [] a = new int[m];\n for (int i = 0 ; i < m ; i++) {\n a[i] = sc.nextInt();\n }\n int sum = 0;\n for (int i = 0 ; i < m ; i++) {\n sum += a[i];\n }\n System.out.println(Math.max(-1, n - sum));\n }",
"@SuppressWarnings(\"resource\")\n Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int [] a = new int[m];",
"a",
"new int[m]",
"m",
"for (int i = 0 ; i < m ; i++) {\n a[i] = sc.nextInt();\n }",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n a[i] = sc.nextInt();\n }",
"{\n a[i] = sc.nextInt();\n }",
"a[i] = sc.nextInt()",
"a[i]",
"a",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i = 0 ; i < m ; i++) {\n sum += a[i];\n }",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n sum += a[i];\n }",
"{\n sum += a[i];\n }",
"sum += a[i]",
"sum",
"a[i]",
"a",
"i",
"System.out.println(Math.max(-1, n - sum))",
"System.out.println",
"System.out",
"System",
"System.out",
"Math.max(-1, n - sum)",
"Math.max",
"Math",
"-1",
"1",
"n - sum",
"n",
"sum",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n @SuppressWarnings(\"resource\")\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int [] a = new int[m];\n for (int i = 0 ; i < m ; i++) {\n a[i] = sc.nextInt();\n }\n int sum = 0;\n for (int i = 0 ; i < m ; i++) {\n sum += a[i];\n }\n System.out.println(Math.max(-1, n - sum));\n }\n\n}",
"public class Main {\n\n public static void main(String[] args) {\n @SuppressWarnings(\"resource\")\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int [] a = new int[m];\n for (int i = 0 ; i < m ; i++) {\n a[i] = sc.nextInt();\n }\n int sum = 0;\n for (int i = 0 ; i < m ; i++) {\n sum += a[i];\n }\n System.out.println(Math.max(-1, n - sum));\n }\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int [] a = new int[m];
for (int i = 0 ; i < m ; i++) {
a[i] = sc.nextInt();
}
int sum = 0;
for (int i = 0 ; i < m ; i++) {
sum += a[i];
}
System.out.println(Math.max(-1, n - sum));
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
4,
13,
18,
13,
13,
18,
13,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
4,
18,
13,
2,
13,
13,
4,
18,
13,
40,
17,
23,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
82,
11
],
[
82,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
17,
19
],
[
15,
20
],
[
20,
21
],
[
20,
22
],
[
12,
23
],
[
23,
24
],
[
82,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
27,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
27,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
27,
41
],
[
41,
42
],
[
41,
43
],
[
27,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
56,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
27,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
69,
70
],
[
69,
71
],
[
62,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
75,
76
],
[
25,
77
],
[
77,
78
],
[
25,
79
],
[
79,
80
],
[
0,
81
],
[
81,
82
],
[
81,
83
]
] |
[
"\nimport java.io.InputStream;\nimport java.io.PrintStream;\nimport java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }\n\n static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n int M = scan.nextInt();\n int need = 0;\n\n for(int i = 0; i < M; i++) {\n need += scan.nextInt();\n }\n\n if(N >= need)\n os.println(N-need);\n else\n os.println(-1);\n }\n\n}",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintStream;",
"PrintStream",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }\n\n static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n int M = scan.nextInt();\n int need = 0;\n\n for(int i = 0; i < M; i++) {\n need += scan.nextInt();\n }\n\n if(N >= need)\n os.println(N-need);\n else\n os.println(-1);\n }\n\n}",
"Main",
"public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }",
"main",
"{\n solve(System.in, System.out);\n }",
"solve(System.in, System.out)",
"solve",
"System.in",
"System",
"System.in",
"System.out",
"System",
"System.out",
"String[] args",
"args",
"static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n int M = scan.nextInt();\n int need = 0;\n\n for(int i = 0; i < M; i++) {\n need += scan.nextInt();\n }\n\n if(N >= need)\n os.println(N-need);\n else\n os.println(-1);\n }",
"solve",
"{\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n int M = scan.nextInt();\n int need = 0;\n\n for(int i = 0; i < M; i++) {\n need += scan.nextInt();\n }\n\n if(N >= need)\n os.println(N-need);\n else\n os.println(-1);\n }",
"Scanner scan = new Scanner(is);",
"scan",
"new Scanner(is)",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int M = scan.nextInt();",
"M",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int need = 0;",
"need",
"0",
"for(int i = 0; i < M; i++) {\n need += scan.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n need += scan.nextInt();\n }",
"{\n need += scan.nextInt();\n }",
"need += scan.nextInt()",
"need",
"scan.nextInt()",
"scan.nextInt",
"scan",
"if(N >= need)\n os.println(N-need);\n else\n os.println(-1);",
"N >= need",
"N",
"need",
"os.println(N-need)",
"os.println",
"os",
"N-need",
"N",
"need",
"os.println(-1)",
"os.println",
"os",
"-1",
"1",
"InputStream is",
"is",
"PrintStream os",
"os",
"public class Main {\n public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }\n\n static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n int M = scan.nextInt();\n int need = 0;\n\n for(int i = 0; i < M; i++) {\n need += scan.nextInt();\n }\n\n if(N >= need)\n os.println(N-need);\n else\n os.println(-1);\n }\n\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n solve(System.in, System.out);\n }\n\n static void solve(InputStream is, PrintStream os) {\n // Your code here!\n Scanner scan = new Scanner(is);\n int N = scan.nextInt();\n int M = scan.nextInt();\n int need = 0;\n\n for(int i = 0; i < M; i++) {\n need += scan.nextInt();\n }\n\n if(N >= need)\n os.println(N-need);\n else\n os.println(-1);\n }\n\n}",
"Main"
] |
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
solve(System.in, System.out);
}
static void solve(InputStream is, PrintStream os) {
// Your code here!
Scanner scan = new Scanner(is);
int N = scan.nextInt();
int M = scan.nextInt();
int need = 0;
for(int i = 0; i < M; i++) {
need += scan.nextInt();
}
if(N >= need)
os.println(N-need);
else
os.println(-1);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
17,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
28,
13,
13,
30,
30,
0,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
106,
5
],
[
106,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
41,
46
],
[
8,
47
],
[
47,
48
],
[
47,
49
],
[
8,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
71,
73
],
[
8,
74
],
[
74,
75
],
[
74,
76
],
[
74,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
8,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
87,
92
],
[
92,
93
],
[
92,
94
],
[
82,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
6,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString[] temp = scanner.nextLine().split(\" \");\n\t\tint n = Integer.parseInt(temp[0]);\n\t\tint m = Integer.parseInt(temp[1]);\n\t\tint sum = 0;\n\t\tString[] tempList = scanner.nextLine().split(\" \");\n\t\tint[] list = new int[m];\n\t\tfor(int i= 0; i < m; i++) {\n\t\t\tlist[i] = Integer.parseInt(tempList[i]);\n\t\t}\n\n\t\tfor(int value : list) {\n\t\t\tsum += value;\n\t\t}\n\n\t\tif(sum <= n) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else{\n\t\t\tSystem.out.println( -1);\n\t\t}\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString[] temp = scanner.nextLine().split(\" \");\n\t\tint n = Integer.parseInt(temp[0]);\n\t\tint m = Integer.parseInt(temp[1]);\n\t\tint sum = 0;\n\t\tString[] tempList = scanner.nextLine().split(\" \");\n\t\tint[] list = new int[m];\n\t\tfor(int i= 0; i < m; i++) {\n\t\t\tlist[i] = Integer.parseInt(tempList[i]);\n\t\t}\n\n\t\tfor(int value : list) {\n\t\t\tsum += value;\n\t\t}\n\n\t\tif(sum <= n) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else{\n\t\t\tSystem.out.println( -1);\n\t\t}\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString[] temp = scanner.nextLine().split(\" \");\n\t\tint n = Integer.parseInt(temp[0]);\n\t\tint m = Integer.parseInt(temp[1]);\n\t\tint sum = 0;\n\t\tString[] tempList = scanner.nextLine().split(\" \");\n\t\tint[] list = new int[m];\n\t\tfor(int i= 0; i < m; i++) {\n\t\t\tlist[i] = Integer.parseInt(tempList[i]);\n\t\t}\n\n\t\tfor(int value : list) {\n\t\t\tsum += value;\n\t\t}\n\n\t\tif(sum <= n) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else{\n\t\t\tSystem.out.println( -1);\n\t\t}\n\n\t}",
"main",
"{\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString[] temp = scanner.nextLine().split(\" \");\n\t\tint n = Integer.parseInt(temp[0]);\n\t\tint m = Integer.parseInt(temp[1]);\n\t\tint sum = 0;\n\t\tString[] tempList = scanner.nextLine().split(\" \");\n\t\tint[] list = new int[m];\n\t\tfor(int i= 0; i < m; i++) {\n\t\t\tlist[i] = Integer.parseInt(tempList[i]);\n\t\t}\n\n\t\tfor(int value : list) {\n\t\t\tsum += value;\n\t\t}\n\n\t\tif(sum <= n) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else{\n\t\t\tSystem.out.println( -1);\n\t\t}\n\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"String[] temp = scanner.nextLine().split(\" \");",
"temp",
"scanner.nextLine().split(\" \")",
"scanner.nextLine().split",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"\" \"",
"int n = Integer.parseInt(temp[0]);",
"n",
"Integer.parseInt(temp[0])",
"Integer.parseInt",
"Integer",
"temp[0]",
"temp",
"0",
"int m = Integer.parseInt(temp[1]);",
"m",
"Integer.parseInt(temp[1])",
"Integer.parseInt",
"Integer",
"temp[1]",
"temp",
"1",
"int sum = 0;",
"sum",
"0",
"String[] tempList = scanner.nextLine().split(\" \");",
"tempList",
"scanner.nextLine().split(\" \")",
"scanner.nextLine().split",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"\" \"",
"int[] list = new int[m];",
"list",
"new int[m]",
"m",
"for(int i= 0; i < m; i++) {\n\t\t\tlist[i] = Integer.parseInt(tempList[i]);\n\t\t}",
"int i= 0;",
"int i= 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\tlist[i] = Integer.parseInt(tempList[i]);\n\t\t}",
"{\n\t\t\tlist[i] = Integer.parseInt(tempList[i]);\n\t\t}",
"list[i] = Integer.parseInt(tempList[i])",
"list[i]",
"list",
"i",
"Integer.parseInt(tempList[i])",
"Integer.parseInt",
"Integer",
"tempList[i]",
"tempList",
"i",
"for(int value : list) {\n\t\t\tsum += value;\n\t\t}",
"int value",
"list",
"{\n\t\t\tsum += value;\n\t\t}",
"{\n\t\t\tsum += value;\n\t\t}",
"sum += value",
"sum",
"value",
"if(sum <= n) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else{\n\t\t\tSystem.out.println( -1);\n\t\t}",
"sum <= n",
"sum",
"n",
"{\n\t\t\tSystem.out.println(n - sum);\n\t\t}",
"System.out.println(n - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - sum",
"n",
"sum",
"{\n\t\t\tSystem.out.println( -1);\n\t\t}",
"System.out.println( -1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString[] temp = scanner.nextLine().split(\" \");\n\t\tint n = Integer.parseInt(temp[0]);\n\t\tint m = Integer.parseInt(temp[1]);\n\t\tint sum = 0;\n\t\tString[] tempList = scanner.nextLine().split(\" \");\n\t\tint[] list = new int[m];\n\t\tfor(int i= 0; i < m; i++) {\n\t\t\tlist[i] = Integer.parseInt(tempList[i]);\n\t\t}\n\n\t\tfor(int value : list) {\n\t\t\tsum += value;\n\t\t}\n\n\t\tif(sum <= n) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else{\n\t\t\tSystem.out.println( -1);\n\t\t}\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString[] temp = scanner.nextLine().split(\" \");\n\t\tint n = Integer.parseInt(temp[0]);\n\t\tint m = Integer.parseInt(temp[1]);\n\t\tint sum = 0;\n\t\tString[] tempList = scanner.nextLine().split(\" \");\n\t\tint[] list = new int[m];\n\t\tfor(int i= 0; i < m; i++) {\n\t\t\tlist[i] = Integer.parseInt(tempList[i]);\n\t\t}\n\n\t\tfor(int value : list) {\n\t\t\tsum += value;\n\t\t}\n\n\t\tif(sum <= n) {\n\t\t\tSystem.out.println(n - sum);\n\t\t}else{\n\t\t\tSystem.out.println( -1);\n\t\t}\n\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String[] temp = scanner.nextLine().split(" ");
int n = Integer.parseInt(temp[0]);
int m = Integer.parseInt(temp[1]);
int sum = 0;
String[] tempList = scanner.nextLine().split(" ");
int[] list = new int[m];
for(int i= 0; i < m; i++) {
list[i] = Integer.parseInt(tempList[i]);
}
for(int value : list) {
sum += value;
}
if(sum <= n) {
System.out.println(n - sum);
}else{
System.out.println( -1);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
17,
28,
13,
4,
18,
4,
18,
13,
17,
30,
30,
0,
13,
4,
18,
13,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
86,
11
],
[
86,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
31,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
14,
42
],
[
42,
43
],
[
42,
44
],
[
14,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
47,
52
],
[
45,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
14,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
61,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
61,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
12,
83
],
[
83,
84
],
[
0,
85
],
[
85,
86
],
[
85,
87
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\n\n/**\n * 高橋君の夏休みは\n * N\n * 日間です。\n *\n * 夏休みの宿題が\n * M\n * 個出されており、\n * i\n * 番目の宿題をやるには\n * A\n * i\n * 日間かかります。\n *\n * 複数の宿題を同じ日にやることはできず、また、宿題をやる日には遊ぶことができません。\n * 夏休み中に全ての宿題を終わらせるとき、最大何日間遊ぶことができますか?\n * ただし、夏休み中に全ての宿題を終わらせることができないときは、かわりに -1 を出力してください。\n */\npublic class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String tmp[] = br.readLine().split(\" \");\n int N = Integer.valueOf(tmp[0]);\n int M = Integer.valueOf(tmp[1]);\n\n int sum = 0;\n for (String A: br.readLine().split(\" \")) {\n sum += Integer.valueOf(A);\n }\n\n if (N - sum >= 0) {\n System.out.println(N - sum);\n } else {\n System.out.println(\"-1\");\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String tmp[] = br.readLine().split(\" \");\n int N = Integer.valueOf(tmp[0]);\n int M = Integer.valueOf(tmp[1]);\n\n int sum = 0;\n for (String A: br.readLine().split(\" \")) {\n sum += Integer.valueOf(A);\n }\n\n if (N - sum >= 0) {\n System.out.println(N - sum);\n } else {\n System.out.println(\"-1\");\n }\n }\n}",
"Main",
"public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String tmp[] = br.readLine().split(\" \");\n int N = Integer.valueOf(tmp[0]);\n int M = Integer.valueOf(tmp[1]);\n\n int sum = 0;\n for (String A: br.readLine().split(\" \")) {\n sum += Integer.valueOf(A);\n }\n\n if (N - sum >= 0) {\n System.out.println(N - sum);\n } else {\n System.out.println(\"-1\");\n }\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String tmp[] = br.readLine().split(\" \");\n int N = Integer.valueOf(tmp[0]);\n int M = Integer.valueOf(tmp[1]);\n\n int sum = 0;\n for (String A: br.readLine().split(\" \")) {\n sum += Integer.valueOf(A);\n }\n\n if (N - sum >= 0) {\n System.out.println(N - sum);\n } else {\n System.out.println(\"-1\");\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String tmp[] = br.readLine().split(\" \");",
"tmp",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int N = Integer.valueOf(tmp[0]);",
"N",
"Integer.valueOf(tmp[0])",
"Integer.valueOf",
"Integer",
"tmp[0]",
"tmp",
"0",
"int M = Integer.valueOf(tmp[1]);",
"M",
"Integer.valueOf(tmp[1])",
"Integer.valueOf",
"Integer",
"tmp[1]",
"tmp",
"1",
"int sum = 0;",
"sum",
"0",
"for (String A: br.readLine().split(\" \")) {\n sum += Integer.valueOf(A);\n }",
"String A",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"{\n sum += Integer.valueOf(A);\n }",
"{\n sum += Integer.valueOf(A);\n }",
"sum += Integer.valueOf(A)",
"sum",
"Integer.valueOf(A)",
"Integer.valueOf",
"Integer",
"A",
"if (N - sum >= 0) {\n System.out.println(N - sum);\n } else {\n System.out.println(\"-1\");\n }",
"N - sum >= 0",
"N - sum",
"N",
"sum",
"0",
"{\n System.out.println(N - sum);\n }",
"System.out.println(N - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"N - sum",
"N",
"sum",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"String args[]",
"args",
"public class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String tmp[] = br.readLine().split(\" \");\n int N = Integer.valueOf(tmp[0]);\n int M = Integer.valueOf(tmp[1]);\n\n int sum = 0;\n for (String A: br.readLine().split(\" \")) {\n sum += Integer.valueOf(A);\n }\n\n if (N - sum >= 0) {\n System.out.println(N - sum);\n } else {\n System.out.println(\"-1\");\n }\n }\n}",
"public class Main {\n\n public static void main(String args[]) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String tmp[] = br.readLine().split(\" \");\n int N = Integer.valueOf(tmp[0]);\n int M = Integer.valueOf(tmp[1]);\n\n int sum = 0;\n for (String A: br.readLine().split(\" \")) {\n sum += Integer.valueOf(A);\n }\n\n if (N - sum >= 0) {\n System.out.println(N - sum);\n } else {\n System.out.println(\"-1\");\n }\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* 高橋君の夏休みは
* N
* 日間です。
*
* 夏休みの宿題が
* M
* 個出されており、
* i
* 番目の宿題をやるには
* A
* i
* 日間かかります。
*
* 複数の宿題を同じ日にやることはできず、また、宿題をやる日には遊ぶことができません。
* 夏休み中に全ての宿題を終わらせるとき、最大何日間遊ぶことができますか?
* ただし、夏休み中に全ての宿題を終わらせることができないときは、かわりに -1 を出力してください。
*/
public class Main {
public static void main(String args[]) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String tmp[] = br.readLine().split(" ");
int N = Integer.valueOf(tmp[0]);
int M = Integer.valueOf(tmp[1]);
int sum = 0;
for (String A: br.readLine().split(" ")) {
sum += Integer.valueOf(A);
}
if (N - sum >= 0) {
System.out.println(N - sum);
} else {
System.out.println("-1");
}
}
}
|
[
7,
6,
12,
13,
30,
14,
2,
18,
13,
13,
18,
13,
13,
29,
17,
14,
2,
18,
13,
13,
18,
13,
13,
29,
17,
29,
40,
17,
23,
13,
23,
13,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
41,
13,
17,
12,
13,
30,
41,
13,
17,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
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,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
2,
13,
13,
14,
2,
13,
17,
30,
29,
17,
41,
13,
2,
4,
13,
13,
2,
13,
17,
13,
14,
2,
2,
13,
17,
17,
29,
2,
2,
13,
13,
13,
29,
2,
2,
2,
13,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
40,
13,
14,
4,
18,
13,
2,
13,
13,
30,
0,
13,
4,
18,
13,
2,
13,
13,
14,
4,
18,
13,
13,
30,
4,
18,
13,
13,
2,
4,
18,
13,
13,
17,
30,
4,
18,
13,
13,
17,
29,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
42,
2,
2,
13,
17,
17,
30,
4,
18,
13,
17,
0,
13,
17,
11,
1,
41,
13,
17,
2,
2,
13,
13,
13,
1,
0,
13,
17,
30,
30,
42,
2,
2,
13,
13,
17,
30,
4,
18,
13,
13,
0,
13,
13,
14,
2,
13,
17,
30,
4,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
13,
41,
13,
17,
41,
13,
17,
14,
2,
13,
17,
29,
17,
42,
2,
13,
17,
30,
41,
13,
2,
13,
13,
41,
13,
13,
0,
13,
2,
13,
13,
0,
13,
13,
0,
13,
13,
0,
13,
2,
13,
2,
13,
13,
0,
13,
13,
14,
2,
13,
17,
0,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
11,
1,
41,
13,
17,
2,
2,
13,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
17,
30,
14,
2,
2,
13,
13,
13,
30,
0,
13,
17,
4,
18,
13,
13,
30,
4,
18,
13,
13,
4,
18,
13,
2,
13,
13,
0,
13,
17,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
11,
1,
41,
13,
17,
2,
2,
13,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
17,
30,
14,
2,
2,
13,
13,
13,
30,
0,
13,
17,
30,
0,
13,
17,
29,
13,
23,
13,
12,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
17,
14,
2,
13,
13,
30,
3,
29,
13,
23,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
20,
23,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
2,
13,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
17,
30,
29,
17,
29,
17,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
2,
3
],
[
2,
4
],
[
4,
5
],
[
5,
6
],
[
6,
7
],
[
7,
8
],
[
7,
9
],
[
6,
10
],
[
10,
11
],
[
10,
12
],
[
5,
13
],
[
13,
14
],
[
5,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
20,
22
],
[
15,
23
],
[
23,
24
],
[
15,
25
],
[
25,
26
],
[
26,
27
],
[
2,
28
],
[
28,
29
],
[
2,
30
],
[
30,
31
],
[
0,
32
],
[
32,
33
],
[
32,
34
],
[
0,
35
],
[
35,
36
],
[
35,
37
],
[
0,
38
],
[
689,
39
],
[
689,
40
],
[
40,
41
],
[
40,
42
],
[
689,
43
],
[
43,
44
],
[
689,
45
],
[
45,
46
],
[
45,
47
],
[
689,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
54,
55
],
[
54,
56
],
[
50,
57
],
[
57,
58
],
[
57,
59
],
[
50,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
50,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
50,
70
],
[
70,
71
],
[
70,
72
],
[
50,
74
],
[
74,
75
],
[
74,
76
],
[
50,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
95,
96
],
[
89,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
50,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
107,
112
],
[
102,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
119,
120
],
[
119,
121
],
[
50,
122
],
[
122,
123
],
[
123,
124
],
[
48,
125
],
[
125,
126
],
[
689,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
129,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
143,
144
],
[
144,
145
],
[
129,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
149,
152
],
[
152,
153
],
[
152,
154
],
[
148,
155
],
[
129,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
156,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
163,
167
],
[
156,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
170,
174
],
[
169,
175
],
[
127,
176
],
[
176,
177
],
[
127,
178
],
[
178,
179
],
[
689,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
183,
185
],
[
182,
186
],
[
186,
187
],
[
186,
188
],
[
182,
189
],
[
189,
190
],
[
189,
191
],
[
182,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
192,
197
],
[
197,
198
],
[
197,
199
],
[
192,
200
],
[
200,
201
],
[
201,
202
],
[
192,
203
],
[
204,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
207,
208
],
[
207,
209
],
[
204,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
210,
214
],
[
214,
215
],
[
215,
216
],
[
204,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
218,
221
],
[
221,
222
],
[
221,
223
],
[
217,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
227,
228
],
[
228,
229
],
[
227,
230
],
[
230,
231
],
[
230,
232
],
[
204,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
234,
237
],
[
233,
238
],
[
238,
239
],
[
239,
240
],
[
240,
241
],
[
239,
242
],
[
239,
243
],
[
243,
244
],
[
244,
245
],
[
245,
246
],
[
244,
247
],
[
243,
248
],
[
233,
249
],
[
249,
250
],
[
250,
251
],
[
251,
252
],
[
250,
253
],
[
250,
254
],
[
182,
255
],
[
255,
256
],
[
180,
257
],
[
257,
258
],
[
180,
259
],
[
259,
260
],
[
180,
261
],
[
261,
262
],
[
689,
263
],
[
263,
264
],
[
263,
265
],
[
265,
266
],
[
266,
267
],
[
266,
268
],
[
265,
269
],
[
269,
270
],
[
270,
271
],
[
271,
272
],
[
271,
273
],
[
270,
274
],
[
269,
275
],
[
275,
276
],
[
276,
277
],
[
277,
278
],
[
276,
279
],
[
275,
280
],
[
280,
281
],
[
280,
282
],
[
265,
283
],
[
283,
284
],
[
284,
285
],
[
285,
286
],
[
285,
287
],
[
283,
288
],
[
288,
289
],
[
289,
290
],
[
289,
291
],
[
288,
292
],
[
283,
293
],
[
293,
294
],
[
294,
295
],
[
294,
296
],
[
283,
297
],
[
298,
298
],
[
298,
299
],
[
299,
300
],
[
300,
301
],
[
301,
302
],
[
301,
303
],
[
300,
304
],
[
299,
305
],
[
305,
306
],
[
306,
307
],
[
307,
308
],
[
306,
309
],
[
305,
310
],
[
310,
311
],
[
310,
312
],
[
265,
313
],
[
313,
314
],
[
314,
315
],
[
314,
316
],
[
313,
317
],
[
317,
318
],
[
318,
319
],
[
319,
320
],
[
318,
321
],
[
265,
322
],
[
322,
323
],
[
263,
324
],
[
324,
325
],
[
689,
326
],
[
326,
327
],
[
326,
328
],
[
328,
329
],
[
329,
330
],
[
329,
331
],
[
328,
332
],
[
332,
333
],
[
332,
334
],
[
328,
335
],
[
335,
336
],
[
335,
337
],
[
328,
338
],
[
338,
339
],
[
339,
340
],
[
339,
341
],
[
338,
342
],
[
342,
343
],
[
328,
344
],
[
344,
345
],
[
345,
346
],
[
345,
347
],
[
344,
348
],
[
348,
349
],
[
349,
350
],
[
349,
351
],
[
351,
352
],
[
351,
353
],
[
348,
354
],
[
354,
355
],
[
354,
356
],
[
348,
357
],
[
357,
358
],
[
357,
359
],
[
359,
360
],
[
359,
361
],
[
348,
362
],
[
362,
363
],
[
362,
364
],
[
348,
365
],
[
365,
366
],
[
365,
367
],
[
348,
368
],
[
368,
369
],
[
368,
370
],
[
370,
371
],
[
370,
372
],
[
372,
373
],
[
372,
374
],
[
348,
375
],
[
375,
376
],
[
375,
377
],
[
328,
378
],
[
378,
379
],
[
379,
380
],
[
379,
381
],
[
378,
382
],
[
382,
383
],
[
382,
384
],
[
328,
385
],
[
385,
386
],
[
326,
387
],
[
387,
388
],
[
326,
389
],
[
389,
390
],
[
689,
391
],
[
391,
392
],
[
391,
393
],
[
393,
394
],
[
394,
395
],
[
394,
396
],
[
393,
397
],
[
397,
398
],
[
397,
399
],
[
393,
400
],
[
400,
401
],
[
401,
402
],
[
402,
403
],
[
402,
404
],
[
400,
405
],
[
405,
406
],
[
406,
407
],
[
406,
408
],
[
405,
409
],
[
400,
410
],
[
410,
411
],
[
411,
412
],
[
400,
413
],
[
414,
414
],
[
414,
415
],
[
415,
416
],
[
416,
417
],
[
417,
418
],
[
417,
419
],
[
416,
420
],
[
415,
421
],
[
421,
422
],
[
422,
423
],
[
423,
424
],
[
424,
425
],
[
424,
426
],
[
423,
427
],
[
422,
428
],
[
428,
429
],
[
429,
430
],
[
429,
431
],
[
428,
432
],
[
432,
433
],
[
433,
434
],
[
432,
435
],
[
422,
436
],
[
436,
437
],
[
437,
438
],
[
438,
439
],
[
437,
440
],
[
436,
441
],
[
441,
442
],
[
442,
443
],
[
441,
444
],
[
444,
445
],
[
444,
446
],
[
436,
447
],
[
447,
448
],
[
447,
449
],
[
393,
450
],
[
450,
451
],
[
391,
452
],
[
452,
453
],
[
689,
454
],
[
454,
455
],
[
454,
456
],
[
456,
457
],
[
457,
458
],
[
457,
459
],
[
456,
460
],
[
460,
461
],
[
460,
462
],
[
456,
463
],
[
463,
464
],
[
464,
465
],
[
465,
466
],
[
465,
467
],
[
463,
468
],
[
468,
469
],
[
469,
470
],
[
469,
471
],
[
468,
472
],
[
463,
473
],
[
473,
474
],
[
474,
475
],
[
463,
476
],
[
477,
477
],
[
477,
478
],
[
478,
479
],
[
479,
480
],
[
480,
481
],
[
480,
482
],
[
479,
483
],
[
478,
484
],
[
484,
485
],
[
485,
486
],
[
486,
487
],
[
487,
488
],
[
487,
489
],
[
486,
490
],
[
485,
491
],
[
491,
492
],
[
492,
493
],
[
492,
494
],
[
485,
495
],
[
495,
496
],
[
496,
497
],
[
496,
498
],
[
456,
499
],
[
499,
500
],
[
454,
501
],
[
501,
502
],
[
689,
503
],
[
503,
504
],
[
503,
505
],
[
505,
506
],
[
506,
507
],
[
506,
508
],
[
505,
509
],
[
509,
510
],
[
510,
511
],
[
511,
512
],
[
511,
513
],
[
509,
514
],
[
514,
515
],
[
514,
516
],
[
509,
517
],
[
517,
518
],
[
518,
519
],
[
509,
520
],
[
521,
521
],
[
521,
522
],
[
522,
523
],
[
522,
524
],
[
521,
525
],
[
525,
526
],
[
526,
527
],
[
526,
528
],
[
525,
529
],
[
529,
530
],
[
505,
531
],
[
531,
532
],
[
503,
533
],
[
533,
534
],
[
503,
535
],
[
535,
536
],
[
689,
537
],
[
537,
538
],
[
537,
539
],
[
539,
540
],
[
540,
541
],
[
541,
542
],
[
540,
543
],
[
540,
544
],
[
537,
545
],
[
545,
546
],
[
537,
547
],
[
547,
548
],
[
689,
549
],
[
549,
550
],
[
549,
551
],
[
551,
552
],
[
552,
553
],
[
553,
554
],
[
554,
555
],
[
554,
556
],
[
552,
557
],
[
557,
558
],
[
558,
559
],
[
558,
560
],
[
557,
561
],
[
552,
562
],
[
562,
563
],
[
563,
564
],
[
552,
565
],
[
566,
566
],
[
566,
567
],
[
567,
568
],
[
568,
569
],
[
569,
570
],
[
569,
571
],
[
568,
572
],
[
567,
573
],
[
573,
574
],
[
574,
575
],
[
551,
576
],
[
576,
577
],
[
549,
578
],
[
578,
579
],
[
689,
580
],
[
580,
581
],
[
580,
582
],
[
582,
583
],
[
583,
584
],
[
584,
585
],
[
584,
586
],
[
583,
587
],
[
587,
588
],
[
582,
589
],
[
589,
590
],
[
590,
591
],
[
590,
592
],
[
590,
593
],
[
593,
594
],
[
593,
595
],
[
580,
596
],
[
596,
597
],
[
580,
598
],
[
598,
599
],
[
0,
600
],
[
600,
601
],
[
600,
602
],
[
602,
603
],
[
600,
604
],
[
604,
605
],
[
600,
606
],
[
606,
607
],
[
606,
608
],
[
608,
609
],
[
609,
610
],
[
609,
611
],
[
600,
612
],
[
612,
613
],
[
612,
614
],
[
614,
615
],
[
615,
616
],
[
616,
617
],
[
617,
618
],
[
617,
619
],
[
616,
620
],
[
620,
621
],
[
621,
622
],
[
622,
623
],
[
615,
624
],
[
624,
625
],
[
625,
626
],
[
626,
627
],
[
626,
628
],
[
628,
629
],
[
629,
630
],
[
630,
631
],
[
625,
632
],
[
632,
633
],
[
633,
634
],
[
633,
635
],
[
614,
636
],
[
636,
637
],
[
637,
638
],
[
638,
639
],
[
600,
640
],
[
640,
641
],
[
640,
642
],
[
642,
643
],
[
643,
644
],
[
644,
645
],
[
645,
646
],
[
644,
647
],
[
647,
648
],
[
600,
649
],
[
649,
650
],
[
649,
651
],
[
651,
652
],
[
652,
653
],
[
653,
654
],
[
654,
655
],
[
653,
656
],
[
656,
657
],
[
600,
658
],
[
658,
659
],
[
658,
660
],
[
660,
661
],
[
661,
662
],
[
662,
663
],
[
663,
664
],
[
662,
665
],
[
665,
666
],
[
600,
667
],
[
667,
668
],
[
667,
669
],
[
669,
670
],
[
670,
671
],
[
670,
672
],
[
669,
673
],
[
673,
674
],
[
674,
675
],
[
674,
676
],
[
676,
677
],
[
677,
678
],
[
678,
679
],
[
673,
680
],
[
680,
681
],
[
681,
682
],
[
681,
683
],
[
683,
684
],
[
684,
685
],
[
669,
686
],
[
686,
687
],
[
0,
688
],
[
688,
689
],
[
688,
690
]
] |
[
"import java.util.*;\nimport java.io.*;\n\n\n\npublic class Main{\n static long m=998244353l; //line 156 modInverse\n static boolean[] vis; //line 74 and 91 hasElement ans pth_fnd\n public static void main(String[] args) throws IOException{\n // long sttm=System.currentTimeMillis();\n int MAX=1000000007;\n FastReader sc=new FastReader();\n OutputStream out=new BufferedOutputStream(System.out);\n int n=sc.nextInt(),m=sc.nextInt();\n int[] a=new int[m];\n int sum=0;\n for(int i=0;i<m;i++){\n a[i]=sc.nextInt();\n sum+=a[i];\n }\n if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }\n out.flush();\n }\n\n static int MOD=1000000007;\n public static int pow(int n,int k){ //n-pow(k)\n if(k==1){\n return n%MOD;\n }\n if(k==0){\n return 1;\n }\n int val=pow(n,k/2)%MOD;\n if(k%2==0)return (val*val)%MOD;\n else return (val*val*n)%MOD;\n }\n\n\n public static long cnt_sum_k_subar(long[] a,int n,int k){\n HashMap<Long,Long> map=new HashMap<Long,Long>();\n long ret=0;\n long cur_sum=0;\n for(int i=0;i<n;i++){\n cur_sum+=a[i];\n if(cur_sum==k){\n ret++;\n }\n if(map.containsKey(cur_sum-k)){\n ret+=map.get(cur_sum-k);\n }\n if(map.containsKey(cur_sum)){\n map.put(cur_sum, map.get(cur_sum)+1);\n }\n else{\n map.put(cur_sum, (long)1);\n }\n }\n return ret;\n }\n\n\n\n public static ArrayList<Integer> lcm(int num){\n ArrayList<Integer> arrl=new ArrayList<Integer>();\n while(num%2==0){\n arrl.add(2);\n num/=2;\n }\n for(int i=3;i*i<=num;i+=2){\n while(num%i==0){\n arrl.add(i);\n num/=i;\n }\n }\n if(num>2){\n arrl.add(num);\n }\n return arrl;\n }\n\n\n static long modInverse(long a,long m) \n { \n long m0 = m; \n long y = 0l, x = 1l; \n \n if (m == 1) \n return 0l; \n \n while (a > 1) \n { \n \n long q = a / m; \n \n long t = m; \n \n m = a % m; \n a = t; \n t = y; \n \n y = x - q * y; \n x = t; \n } \n if (x < 0) \n x += m0; \n \n return x; \n } \n\n\n public static TreeSet<Long> arr_fact(long num){\n TreeSet<Long> arr=new TreeSet<Long>();\n int cnt=0;\n for(long i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n arr.add(i);\n }\n else{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }\n }\n }\n return arr;\n }\n\n\n\n public static int num_fact(int num){\n ArrayList<Integer> arr=new ArrayList<Integer>();\n int cnt=0;\n for(int i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n }\n else{\n cnt+=2;\n }\n }\n }\n return cnt;\n }\n\n\n public static long cal(int k,int x){\n long val=1;\n\n for(int i=0;i<k;i++){\n val*=2;\n if(val>x){\n break;\n }\n }\n return val;\n }\n\n public static void sort_inc(int[][] arr,int col){ //change dimention if req\n Arrays.sort(arr, new Comparator<int[]>() {\n public int compare(final int[] entry1,final int[] entry2) { \n if (entry1[col] > entry2[col]) //this is for inc\n return 1; \n else if(entry1[col]==entry2[col])\n return 0;\n else\n return -1; \n }\n });\n }\n\n\n public static boolean prime(int n){\n for(int i=2;i*i<=n;i++){\n if(n%i==0){\n return false;\n }\n }\n return true;\n }\n\n\n static long gcd(long a, long b) \n\t{ \n\tif (b == 0) \n\t\treturn a; \n\treturn gcd(b, a % b); \n\t} \n}\n\n\nclass FastReader{ \n BufferedReader br; \n StringTokenizer st; \n\n public FastReader(){ \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next(){ \n while (st == null || !st.hasMoreElements()){ \n try{ \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e){ \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt(){ \n return Integer.parseInt(next()); \n } \n \n long nextLong(){ \n return Long.parseLong(next()); \n }\n \n double nextDouble(){ \n return Double.parseDouble(next()); \n }\n \n String nextLine(){ \n String str = \"\"; \n try{ \n str = br.readLine(); \n }\n catch (IOException e){ \n e.printStackTrace(); \n }\n return str; \n }\n}",
"Comparator<int[]>() {\n public int compare(final int[] entry1,final int[] entry2) { \n if (entry1[col] > entry2[col]) //this is for inc\n return 1; \n else if(entry1[col]==entry2[col])\n return 0;\n else\n return -1; \n }\n }",
"public int compare(final int[] entry1,final int[] entry2) { \n if (entry1[col] > entry2[col]) //this is for inc\n return 1; \n else if(entry1[col]==entry2[col])\n return 0;\n else\n return -1; \n }",
"compare",
"{ \n if (entry1[col] > entry2[col]) //this is for inc\n return 1; \n else if(entry1[col]==entry2[col])\n return 0;\n else\n return -1; \n }",
"if (entry1[col] > entry2[col]) //this is for inc\n return 1; \n else if(entry1[col]==entry2[col])\n return 0;\n else\n return -1;",
"entry1[col] > entry2[col]",
"entry1[col]",
"entry1",
"col",
"entry2[col]",
"entry2",
"col",
"return 1;",
"1",
"if(entry1[col]==entry2[col])\n return 0;\n else\n return -1;",
"entry1[col]==entry2[col]",
"entry1[col]",
"entry1",
"col",
"entry2[col]",
"entry2",
"col",
"return 0;",
"0",
"return -1;",
"-1",
"1",
"final int[] entry1",
"entry1",
"final int[] entry2",
"entry2",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main{\n static long m=998244353l; //line 156 modInverse\n static boolean[] vis; //line 74 and 91 hasElement ans pth_fnd\n public static void main(String[] args) throws IOException{\n // long sttm=System.currentTimeMillis();\n int MAX=1000000007;\n FastReader sc=new FastReader();\n OutputStream out=new BufferedOutputStream(System.out);\n int n=sc.nextInt(),m=sc.nextInt();\n int[] a=new int[m];\n int sum=0;\n for(int i=0;i<m;i++){\n a[i]=sc.nextInt();\n sum+=a[i];\n }\n if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }\n out.flush();\n }\n\n static int MOD=1000000007;\n public static int pow(int n,int k){ //n-pow(k)\n if(k==1){\n return n%MOD;\n }\n if(k==0){\n return 1;\n }\n int val=pow(n,k/2)%MOD;\n if(k%2==0)return (val*val)%MOD;\n else return (val*val*n)%MOD;\n }\n\n\n public static long cnt_sum_k_subar(long[] a,int n,int k){\n HashMap<Long,Long> map=new HashMap<Long,Long>();\n long ret=0;\n long cur_sum=0;\n for(int i=0;i<n;i++){\n cur_sum+=a[i];\n if(cur_sum==k){\n ret++;\n }\n if(map.containsKey(cur_sum-k)){\n ret+=map.get(cur_sum-k);\n }\n if(map.containsKey(cur_sum)){\n map.put(cur_sum, map.get(cur_sum)+1);\n }\n else{\n map.put(cur_sum, (long)1);\n }\n }\n return ret;\n }\n\n\n\n public static ArrayList<Integer> lcm(int num){\n ArrayList<Integer> arrl=new ArrayList<Integer>();\n while(num%2==0){\n arrl.add(2);\n num/=2;\n }\n for(int i=3;i*i<=num;i+=2){\n while(num%i==0){\n arrl.add(i);\n num/=i;\n }\n }\n if(num>2){\n arrl.add(num);\n }\n return arrl;\n }\n\n\n static long modInverse(long a,long m) \n { \n long m0 = m; \n long y = 0l, x = 1l; \n \n if (m == 1) \n return 0l; \n \n while (a > 1) \n { \n \n long q = a / m; \n \n long t = m; \n \n m = a % m; \n a = t; \n t = y; \n \n y = x - q * y; \n x = t; \n } \n if (x < 0) \n x += m0; \n \n return x; \n } \n\n\n public static TreeSet<Long> arr_fact(long num){\n TreeSet<Long> arr=new TreeSet<Long>();\n int cnt=0;\n for(long i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n arr.add(i);\n }\n else{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }\n }\n }\n return arr;\n }\n\n\n\n public static int num_fact(int num){\n ArrayList<Integer> arr=new ArrayList<Integer>();\n int cnt=0;\n for(int i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n }\n else{\n cnt+=2;\n }\n }\n }\n return cnt;\n }\n\n\n public static long cal(int k,int x){\n long val=1;\n\n for(int i=0;i<k;i++){\n val*=2;\n if(val>x){\n break;\n }\n }\n return val;\n }\n\n public static void sort_inc(int[][] arr,int col){ //change dimention if req\n Arrays.sort(arr, new Comparator<int[]>() {\n public int compare(final int[] entry1,final int[] entry2) { \n if (entry1[col] > entry2[col]) //this is for inc\n return 1; \n else if(entry1[col]==entry2[col])\n return 0;\n else\n return -1; \n }\n });\n }\n\n\n public static boolean prime(int n){\n for(int i=2;i*i<=n;i++){\n if(n%i==0){\n return false;\n }\n }\n return true;\n }\n\n\n static long gcd(long a, long b) \n\t{ \n\tif (b == 0) \n\t\treturn a; \n\treturn gcd(b, a % b); \n\t} \n}",
"Main",
"static long m=998244353l; //line 156 modInverse",
"m",
"998244353l",
"static boolean[] vis; //line 74 and 91 hasElement ans pth_fnd",
"vis",
"static int MOD=1000000007;",
"MOD",
"1000000007",
"public static void main(String[] args) throws IOException{\n // long sttm=System.currentTimeMillis();\n int MAX=1000000007;\n FastReader sc=new FastReader();\n OutputStream out=new BufferedOutputStream(System.out);\n int n=sc.nextInt(),m=sc.nextInt();\n int[] a=new int[m];\n int sum=0;\n for(int i=0;i<m;i++){\n a[i]=sc.nextInt();\n sum+=a[i];\n }\n if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }\n out.flush();\n }",
"main",
"{\n // long sttm=System.currentTimeMillis();\n int MAX=1000000007;\n FastReader sc=new FastReader();\n OutputStream out=new BufferedOutputStream(System.out);\n int n=sc.nextInt(),m=sc.nextInt();\n int[] a=new int[m];\n int sum=0;\n for(int i=0;i<m;i++){\n a[i]=sc.nextInt();\n sum+=a[i];\n }\n if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }\n out.flush();\n }",
"int MAX=1000000007;",
"MAX",
"1000000007",
"FastReader sc=new FastReader();",
"sc",
"new FastReader()",
"OutputStream out=new BufferedOutputStream(System.out);",
"out",
"new BufferedOutputStream(System.out)",
"int n=sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"m=sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] a=new int[m];",
"a",
"new int[m]",
"m",
"int sum=0;",
"sum",
"0",
"for(int i=0;i<m;i++){\n a[i]=sc.nextInt();\n sum+=a[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n a[i]=sc.nextInt();\n sum+=a[i];\n }",
"{\n a[i]=sc.nextInt();\n sum+=a[i];\n }",
"a[i]=sc.nextInt()",
"a[i]",
"a",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sum+=a[i]",
"sum",
"a[i]",
"a",
"i",
"if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }",
"sum>n",
"sum",
"n",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(n-sum);\n }",
"System.out.println(n-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum",
"n",
"sum",
"out.flush()",
"out.flush",
"out",
"String[] args",
"args",
"public static int pow(int n,int k){ //n-pow(k)\n if(k==1){\n return n%MOD;\n }\n if(k==0){\n return 1;\n }\n int val=pow(n,k/2)%MOD;\n if(k%2==0)return (val*val)%MOD;\n else return (val*val*n)%MOD;\n }",
"pow",
"{ //n-pow(k)\n if(k==1){\n return n%MOD;\n }\n if(k==0){\n return 1;\n }\n int val=pow(n,k/2)%MOD;\n if(k%2==0)return (val*val)%MOD;\n else return (val*val*n)%MOD;\n }",
"if(k==1){\n return n%MOD;\n }",
"k==1",
"k",
"1",
"{\n return n%MOD;\n }",
"return n%MOD;",
"n%MOD",
"n",
"MOD",
"if(k==0){\n return 1;\n }",
"k==0",
"k",
"0",
"{\n return 1;\n }",
"return 1;",
"1",
"int val=pow(n,k/2)%MOD;",
"val",
"pow(n,k/2)%MOD",
"pow(n,k/2)",
"pow",
"n",
"k/2",
"k",
"2",
"MOD",
"if(k%2==0)return (val*val)%MOD;\n else return (val*val*n)%MOD;",
"k%2==0",
"k%2",
"k",
"2",
"0",
"return (val*val)%MOD;",
"(val*val)%MOD",
"(val*val)",
"val",
"val",
"MOD",
"return (val*val*n)%MOD;",
"(val*val*n)%MOD",
"(val*val*n)",
"val*val*n",
"val",
"val",
"n",
"MOD",
"int n",
"n",
"int k",
"k",
"public static long cnt_sum_k_subar(long[] a,int n,int k){\n HashMap<Long,Long> map=new HashMap<Long,Long>();\n long ret=0;\n long cur_sum=0;\n for(int i=0;i<n;i++){\n cur_sum+=a[i];\n if(cur_sum==k){\n ret++;\n }\n if(map.containsKey(cur_sum-k)){\n ret+=map.get(cur_sum-k);\n }\n if(map.containsKey(cur_sum)){\n map.put(cur_sum, map.get(cur_sum)+1);\n }\n else{\n map.put(cur_sum, (long)1);\n }\n }\n return ret;\n }",
"cnt_sum_k_subar",
"{\n HashMap<Long,Long> map=new HashMap<Long,Long>();\n long ret=0;\n long cur_sum=0;\n for(int i=0;i<n;i++){\n cur_sum+=a[i];\n if(cur_sum==k){\n ret++;\n }\n if(map.containsKey(cur_sum-k)){\n ret+=map.get(cur_sum-k);\n }\n if(map.containsKey(cur_sum)){\n map.put(cur_sum, map.get(cur_sum)+1);\n }\n else{\n map.put(cur_sum, (long)1);\n }\n }\n return ret;\n }",
"HashMap<Long,Long> map=new HashMap<Long,Long>();",
"map",
"new HashMap<Long,Long>()",
"long ret=0;",
"ret",
"0",
"long cur_sum=0;",
"cur_sum",
"0",
"for(int i=0;i<n;i++){\n cur_sum+=a[i];\n if(cur_sum==k){\n ret++;\n }\n if(map.containsKey(cur_sum-k)){\n ret+=map.get(cur_sum-k);\n }\n if(map.containsKey(cur_sum)){\n map.put(cur_sum, map.get(cur_sum)+1);\n }\n else{\n map.put(cur_sum, (long)1);\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n cur_sum+=a[i];\n if(cur_sum==k){\n ret++;\n }\n if(map.containsKey(cur_sum-k)){\n ret+=map.get(cur_sum-k);\n }\n if(map.containsKey(cur_sum)){\n map.put(cur_sum, map.get(cur_sum)+1);\n }\n else{\n map.put(cur_sum, (long)1);\n }\n }",
"{\n cur_sum+=a[i];\n if(cur_sum==k){\n ret++;\n }\n if(map.containsKey(cur_sum-k)){\n ret+=map.get(cur_sum-k);\n }\n if(map.containsKey(cur_sum)){\n map.put(cur_sum, map.get(cur_sum)+1);\n }\n else{\n map.put(cur_sum, (long)1);\n }\n }",
"cur_sum+=a[i]",
"cur_sum",
"a[i]",
"a",
"i",
"if(cur_sum==k){\n ret++;\n }",
"cur_sum==k",
"cur_sum",
"k",
"{\n ret++;\n }",
"ret++",
"ret",
"if(map.containsKey(cur_sum-k)){\n ret+=map.get(cur_sum-k);\n }",
"map.containsKey(cur_sum-k)",
"map.containsKey",
"map",
"cur_sum-k",
"cur_sum",
"k",
"{\n ret+=map.get(cur_sum-k);\n }",
"ret+=map.get(cur_sum-k)",
"ret",
"map.get(cur_sum-k)",
"map.get",
"map",
"cur_sum-k",
"cur_sum",
"k",
"if(map.containsKey(cur_sum)){\n map.put(cur_sum, map.get(cur_sum)+1);\n }\n else{\n map.put(cur_sum, (long)1);\n }",
"map.containsKey(cur_sum)",
"map.containsKey",
"map",
"cur_sum",
"{\n map.put(cur_sum, map.get(cur_sum)+1);\n }",
"map.put(cur_sum, map.get(cur_sum)+1)",
"map.put",
"map",
"cur_sum",
"map.get(cur_sum)+1",
"map.get(cur_sum)",
"map.get",
"map",
"cur_sum",
"1",
"{\n map.put(cur_sum, (long)1);\n }",
"map.put(cur_sum, (long)1)",
"map.put",
"map",
"cur_sum",
"(long)1",
"return ret;",
"ret",
"long[] a",
"a",
"int n",
"n",
"int k",
"k",
"public static ArrayList<Integer> lcm(int num){\n ArrayList<Integer> arrl=new ArrayList<Integer>();\n while(num%2==0){\n arrl.add(2);\n num/=2;\n }\n for(int i=3;i*i<=num;i+=2){\n while(num%i==0){\n arrl.add(i);\n num/=i;\n }\n }\n if(num>2){\n arrl.add(num);\n }\n return arrl;\n }",
"lcm",
"{\n ArrayList<Integer> arrl=new ArrayList<Integer>();\n while(num%2==0){\n arrl.add(2);\n num/=2;\n }\n for(int i=3;i*i<=num;i+=2){\n while(num%i==0){\n arrl.add(i);\n num/=i;\n }\n }\n if(num>2){\n arrl.add(num);\n }\n return arrl;\n }",
"ArrayList<Integer> arrl=new ArrayList<Integer>();",
"arrl",
"new ArrayList<Integer>()",
"while(num%2==0){\n arrl.add(2);\n num/=2;\n }",
"num%2==0",
"num%2",
"num",
"2",
"0",
"{\n arrl.add(2);\n num/=2;\n }",
"arrl.add(2)",
"arrl.add",
"arrl",
"2",
"num/=2",
"num",
"2",
"for(int i=3;i*i<=num;i+=2){\n while(num%i==0){\n arrl.add(i);\n num/=i;\n }\n }",
"int i=3;",
"int i=3;",
"i",
"3",
"i*i<=num",
"i*i",
"i",
"i",
"num",
"i+=2",
"i+=2",
"i",
"2",
"{\n while(num%i==0){\n arrl.add(i);\n num/=i;\n }\n }",
"{\n while(num%i==0){\n arrl.add(i);\n num/=i;\n }\n }",
"while(num%i==0){\n arrl.add(i);\n num/=i;\n }",
"num%i==0",
"num%i",
"num",
"i",
"0",
"{\n arrl.add(i);\n num/=i;\n }",
"arrl.add(i)",
"arrl.add",
"arrl",
"i",
"num/=i",
"num",
"i",
"if(num>2){\n arrl.add(num);\n }",
"num>2",
"num",
"2",
"{\n arrl.add(num);\n }",
"arrl.add(num)",
"arrl.add",
"arrl",
"num",
"return arrl;",
"arrl",
"int num",
"num",
"static long modInverse(long a,long m) \n { \n long m0 = m; \n long y = 0l, x = 1l; \n \n if (m == 1) \n return 0l; \n \n while (a > 1) \n { \n \n long q = a / m; \n \n long t = m; \n \n m = a % m; \n a = t; \n t = y; \n \n y = x - q * y; \n x = t; \n } \n if (x < 0) \n x += m0; \n \n return x; \n }",
"modInverse",
"{ \n long m0 = m; \n long y = 0l, x = 1l; \n \n if (m == 1) \n return 0l; \n \n while (a > 1) \n { \n \n long q = a / m; \n \n long t = m; \n \n m = a % m; \n a = t; \n t = y; \n \n y = x - q * y; \n x = t; \n } \n if (x < 0) \n x += m0; \n \n return x; \n }",
"long m0 = m;",
"m0",
"m",
"long y = 0l",
"y",
"0l",
"x = 1l;",
"x",
"1l",
"if (m == 1) \n return 0l;",
"m == 1",
"m",
"1",
"return 0l;",
"0l",
"while (a > 1) \n { \n \n long q = a / m; \n \n long t = m; \n \n m = a % m; \n a = t; \n t = y; \n \n y = x - q * y; \n x = t; \n }",
"a > 1",
"a",
"1",
"{ \n \n long q = a / m; \n \n long t = m; \n \n m = a % m; \n a = t; \n t = y; \n \n y = x - q * y; \n x = t; \n }",
"long q = a / m;",
"q",
"a / m",
"a",
"m",
"long t = m;",
"t",
"m",
"m = a % m",
"m",
"a % m",
"a",
"m",
"a = t",
"a",
"t",
"t = y",
"t",
"y",
"y = x - q * y",
"y",
"x - q * y",
"x",
"q * y",
"q",
"y",
"x = t",
"x",
"t",
"if (x < 0) \n x += m0;",
"x < 0",
"x",
"0",
"x += m0",
"x",
"m0",
"return x;",
"x",
"long a",
"a",
"long m",
"m",
"public static TreeSet<Long> arr_fact(long num){\n TreeSet<Long> arr=new TreeSet<Long>();\n int cnt=0;\n for(long i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n arr.add(i);\n }\n else{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }\n }\n }\n return arr;\n }",
"arr_fact",
"{\n TreeSet<Long> arr=new TreeSet<Long>();\n int cnt=0;\n for(long i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n arr.add(i);\n }\n else{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }\n }\n }\n return arr;\n }",
"TreeSet<Long> arr=new TreeSet<Long>();",
"arr",
"new TreeSet<Long>()",
"int cnt=0;",
"cnt",
"0",
"for(long i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n arr.add(i);\n }\n else{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }\n }\n }",
"long i=1;",
"long i=1;",
"i",
"1",
"i*i<=num",
"i*i",
"i",
"i",
"num",
"i++",
"i++",
"i",
"{\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n arr.add(i);\n }\n else{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }\n }\n }",
"{\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n arr.add(i);\n }\n else{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }\n }\n }",
"if(num%i==0){\n if(i*i==num){\n cnt+=1;\n arr.add(i);\n }\n else{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }\n }",
"num%i==0",
"num%i",
"num",
"i",
"0",
"{\n if(i*i==num){\n cnt+=1;\n arr.add(i);\n }\n else{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }\n }",
"if(i*i==num){\n cnt+=1;\n arr.add(i);\n }\n else{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }",
"i*i==num",
"i*i",
"i",
"i",
"num",
"{\n cnt+=1;\n arr.add(i);\n }",
"cnt+=1",
"cnt",
"1",
"arr.add(i)",
"arr.add",
"arr",
"i",
"{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }",
"arr.add(i)",
"arr.add",
"arr",
"i",
"arr.add(num/i)",
"arr.add",
"arr",
"num/i",
"num",
"i",
"cnt+=2",
"cnt",
"2",
"return arr;",
"arr",
"long num",
"num",
"public static int num_fact(int num){\n ArrayList<Integer> arr=new ArrayList<Integer>();\n int cnt=0;\n for(int i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n }\n else{\n cnt+=2;\n }\n }\n }\n return cnt;\n }",
"num_fact",
"{\n ArrayList<Integer> arr=new ArrayList<Integer>();\n int cnt=0;\n for(int i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n }\n else{\n cnt+=2;\n }\n }\n }\n return cnt;\n }",
"ArrayList<Integer> arr=new ArrayList<Integer>();",
"arr",
"new ArrayList<Integer>()",
"int cnt=0;",
"cnt",
"0",
"for(int i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n }\n else{\n cnt+=2;\n }\n }\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i*i<=num",
"i*i",
"i",
"i",
"num",
"i++",
"i++",
"i",
"{\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n }\n else{\n cnt+=2;\n }\n }\n }",
"{\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n }\n else{\n cnt+=2;\n }\n }\n }",
"if(num%i==0){\n if(i*i==num){\n cnt+=1;\n }\n else{\n cnt+=2;\n }\n }",
"num%i==0",
"num%i",
"num",
"i",
"0",
"{\n if(i*i==num){\n cnt+=1;\n }\n else{\n cnt+=2;\n }\n }",
"if(i*i==num){\n cnt+=1;\n }\n else{\n cnt+=2;\n }",
"i*i==num",
"i*i",
"i",
"i",
"num",
"{\n cnt+=1;\n }",
"cnt+=1",
"cnt",
"1",
"{\n cnt+=2;\n }",
"cnt+=2",
"cnt",
"2",
"return cnt;",
"cnt",
"int num",
"num",
"public static long cal(int k,int x){\n long val=1;\n\n for(int i=0;i<k;i++){\n val*=2;\n if(val>x){\n break;\n }\n }\n return val;\n }",
"cal",
"{\n long val=1;\n\n for(int i=0;i<k;i++){\n val*=2;\n if(val>x){\n break;\n }\n }\n return val;\n }",
"long val=1;",
"val",
"1",
"for(int i=0;i<k;i++){\n val*=2;\n if(val>x){\n break;\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n val*=2;\n if(val>x){\n break;\n }\n }",
"{\n val*=2;\n if(val>x){\n break;\n }\n }",
"val*=2",
"val",
"2",
"if(val>x){\n break;\n }",
"val>x",
"val",
"x",
"{\n break;\n }",
"break;",
"return val;",
"val",
"int k",
"k",
"int x",
"x",
"public static void sort_inc(int[][] arr,int col){ //change dimention if req\n Arrays.sort(arr, new Comparator<int[]>() {\n public int compare(final int[] entry1,final int[] entry2) { \n if (entry1[col] > entry2[col]) //this is for inc\n return 1; \n else if(entry1[col]==entry2[col])\n return 0;\n else\n return -1; \n }\n });\n }",
"sort_inc",
"{ //change dimention if req\n Arrays.sort(arr, new Comparator<int[]>() {\n public int compare(final int[] entry1,final int[] entry2) { \n if (entry1[col] > entry2[col]) //this is for inc\n return 1; \n else if(entry1[col]==entry2[col])\n return 0;\n else\n return -1; \n }\n });\n }",
"Arrays.sort(arr, new Comparator<int[]>() {\n public int compare(final int[] entry1,final int[] entry2) { \n if (entry1[col] > entry2[col]) //this is for inc\n return 1; \n else if(entry1[col]==entry2[col])\n return 0;\n else\n return -1; \n }\n })",
"Arrays.sort",
"Arrays",
"arr",
"new Comparator<int[]>() {\n public int compare(final int[] entry1,final int[] entry2) { \n if (entry1[col] > entry2[col]) //this is for inc\n return 1; \n else if(entry1[col]==entry2[col])\n return 0;\n else\n return -1; \n }\n }",
"int[][] arr",
"arr",
"int col",
"col",
"public static boolean prime(int n){\n for(int i=2;i*i<=n;i++){\n if(n%i==0){\n return false;\n }\n }\n return true;\n }",
"prime",
"{\n for(int i=2;i*i<=n;i++){\n if(n%i==0){\n return false;\n }\n }\n return true;\n }",
"for(int i=2;i*i<=n;i++){\n if(n%i==0){\n return false;\n }\n }",
"int i=2;",
"int i=2;",
"i",
"2",
"i*i<=n",
"i*i",
"i",
"i",
"n",
"i++",
"i++",
"i",
"{\n if(n%i==0){\n return false;\n }\n }",
"{\n if(n%i==0){\n return false;\n }\n }",
"if(n%i==0){\n return false;\n }",
"n%i==0",
"n%i",
"n",
"i",
"0",
"{\n return false;\n }",
"return false;",
"false",
"return true;",
"true",
"int n",
"n",
"static long gcd(long a, long b) \n\t{ \n\tif (b == 0) \n\t\treturn a; \n\treturn gcd(b, a % b); \n\t}",
"gcd",
"{ \n\tif (b == 0) \n\t\treturn a; \n\treturn gcd(b, a % b); \n\t}",
"if (b == 0) \n\t\treturn a;",
"b == 0",
"b",
"0",
"return a;",
"a",
"return gcd(b, a % b);",
"gcd(b, a % b)",
"gcd",
"b",
"a % b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"class FastReader{ \n BufferedReader br; \n StringTokenizer st; \n\n public FastReader(){ \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n } \n \n String next(){ \n while (st == null || !st.hasMoreElements()){ \n try{ \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e){ \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n } \n \n int nextInt(){ \n return Integer.parseInt(next()); \n } \n \n long nextLong(){ \n return Long.parseLong(next()); \n }\n \n double nextDouble(){ \n return Double.parseDouble(next()); \n }\n \n String nextLine(){ \n String str = \"\"; \n try{ \n str = br.readLine(); \n }\n catch (IOException e){ \n e.printStackTrace(); \n }\n return str; \n }\n}",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"public FastReader(){ \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n }",
"FastReader",
"{ \n br = new BufferedReader(new\n InputStreamReader(System.in)); \n }",
"br = new BufferedReader(new\n InputStreamReader(System.in))",
"br",
"new BufferedReader(new\n InputStreamReader(System.in))",
"String next(){ \n while (st == null || !st.hasMoreElements()){ \n try{ \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e){ \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n }",
"next",
"{ \n while (st == null || !st.hasMoreElements()){ \n try{ \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e){ \n e.printStackTrace(); \n } \n } \n return st.nextToken(); \n }",
"while (st == null || !st.hasMoreElements()){ \n try{ \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e){ \n e.printStackTrace(); \n } \n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{ \n try{ \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e){ \n e.printStackTrace(); \n } \n }",
"try{ \n st = new StringTokenizer(br.readLine()); \n } \n catch (IOException e){ \n e.printStackTrace(); \n }",
"catch (IOException e){ \n e.printStackTrace(); \n }",
"IOException e",
"{ \n e.printStackTrace(); \n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{ \n st = new StringTokenizer(br.readLine()); \n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"int nextInt(){ \n return Integer.parseInt(next()); \n }",
"nextInt",
"{ \n return Integer.parseInt(next()); \n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"long nextLong(){ \n return Long.parseLong(next()); \n }",
"nextLong",
"{ \n return Long.parseLong(next()); \n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"double nextDouble(){ \n return Double.parseDouble(next()); \n }",
"nextDouble",
"{ \n return Double.parseDouble(next()); \n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"String nextLine(){ \n String str = \"\"; \n try{ \n str = br.readLine(); \n }\n catch (IOException e){ \n e.printStackTrace(); \n }\n return str; \n }",
"nextLine",
"{ \n String str = \"\"; \n try{ \n str = br.readLine(); \n }\n catch (IOException e){ \n e.printStackTrace(); \n }\n return str; \n }",
"String str = \"\";",
"str",
"\"\"",
"try{ \n str = br.readLine(); \n }\n catch (IOException e){ \n e.printStackTrace(); \n }",
"catch (IOException e){ \n e.printStackTrace(); \n }",
"IOException e",
"{ \n e.printStackTrace(); \n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{ \n str = br.readLine(); \n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"public class Main{\n static long m=998244353l; //line 156 modInverse\n static boolean[] vis; //line 74 and 91 hasElement ans pth_fnd\n public static void main(String[] args) throws IOException{\n // long sttm=System.currentTimeMillis();\n int MAX=1000000007;\n FastReader sc=new FastReader();\n OutputStream out=new BufferedOutputStream(System.out);\n int n=sc.nextInt(),m=sc.nextInt();\n int[] a=new int[m];\n int sum=0;\n for(int i=0;i<m;i++){\n a[i]=sc.nextInt();\n sum+=a[i];\n }\n if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }\n out.flush();\n }\n\n static int MOD=1000000007;\n public static int pow(int n,int k){ //n-pow(k)\n if(k==1){\n return n%MOD;\n }\n if(k==0){\n return 1;\n }\n int val=pow(n,k/2)%MOD;\n if(k%2==0)return (val*val)%MOD;\n else return (val*val*n)%MOD;\n }\n\n\n public static long cnt_sum_k_subar(long[] a,int n,int k){\n HashMap<Long,Long> map=new HashMap<Long,Long>();\n long ret=0;\n long cur_sum=0;\n for(int i=0;i<n;i++){\n cur_sum+=a[i];\n if(cur_sum==k){\n ret++;\n }\n if(map.containsKey(cur_sum-k)){\n ret+=map.get(cur_sum-k);\n }\n if(map.containsKey(cur_sum)){\n map.put(cur_sum, map.get(cur_sum)+1);\n }\n else{\n map.put(cur_sum, (long)1);\n }\n }\n return ret;\n }\n\n\n\n public static ArrayList<Integer> lcm(int num){\n ArrayList<Integer> arrl=new ArrayList<Integer>();\n while(num%2==0){\n arrl.add(2);\n num/=2;\n }\n for(int i=3;i*i<=num;i+=2){\n while(num%i==0){\n arrl.add(i);\n num/=i;\n }\n }\n if(num>2){\n arrl.add(num);\n }\n return arrl;\n }\n\n\n static long modInverse(long a,long m) \n { \n long m0 = m; \n long y = 0l, x = 1l; \n \n if (m == 1) \n return 0l; \n \n while (a > 1) \n { \n \n long q = a / m; \n \n long t = m; \n \n m = a % m; \n a = t; \n t = y; \n \n y = x - q * y; \n x = t; \n } \n if (x < 0) \n x += m0; \n \n return x; \n } \n\n\n public static TreeSet<Long> arr_fact(long num){\n TreeSet<Long> arr=new TreeSet<Long>();\n int cnt=0;\n for(long i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n arr.add(i);\n }\n else{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }\n }\n }\n return arr;\n }\n\n\n\n public static int num_fact(int num){\n ArrayList<Integer> arr=new ArrayList<Integer>();\n int cnt=0;\n for(int i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n }\n else{\n cnt+=2;\n }\n }\n }\n return cnt;\n }\n\n\n public static long cal(int k,int x){\n long val=1;\n\n for(int i=0;i<k;i++){\n val*=2;\n if(val>x){\n break;\n }\n }\n return val;\n }\n\n public static void sort_inc(int[][] arr,int col){ //change dimention if req\n Arrays.sort(arr, new Comparator<int[]>() {\n public int compare(final int[] entry1,final int[] entry2) { \n if (entry1[col] > entry2[col]) //this is for inc\n return 1; \n else if(entry1[col]==entry2[col])\n return 0;\n else\n return -1; \n }\n });\n }\n\n\n public static boolean prime(int n){\n for(int i=2;i*i<=n;i++){\n if(n%i==0){\n return false;\n }\n }\n return true;\n }\n\n\n static long gcd(long a, long b) \n\t{ \n\tif (b == 0) \n\t\treturn a; \n\treturn gcd(b, a % b); \n\t} \n}",
"public class Main{\n static long m=998244353l; //line 156 modInverse\n static boolean[] vis; //line 74 and 91 hasElement ans pth_fnd\n public static void main(String[] args) throws IOException{\n // long sttm=System.currentTimeMillis();\n int MAX=1000000007;\n FastReader sc=new FastReader();\n OutputStream out=new BufferedOutputStream(System.out);\n int n=sc.nextInt(),m=sc.nextInt();\n int[] a=new int[m];\n int sum=0;\n for(int i=0;i<m;i++){\n a[i]=sc.nextInt();\n sum+=a[i];\n }\n if(sum>n){\n System.out.println(\"-1\");\n }\n else{\n System.out.println(n-sum);\n }\n out.flush();\n }\n\n static int MOD=1000000007;\n public static int pow(int n,int k){ //n-pow(k)\n if(k==1){\n return n%MOD;\n }\n if(k==0){\n return 1;\n }\n int val=pow(n,k/2)%MOD;\n if(k%2==0)return (val*val)%MOD;\n else return (val*val*n)%MOD;\n }\n\n\n public static long cnt_sum_k_subar(long[] a,int n,int k){\n HashMap<Long,Long> map=new HashMap<Long,Long>();\n long ret=0;\n long cur_sum=0;\n for(int i=0;i<n;i++){\n cur_sum+=a[i];\n if(cur_sum==k){\n ret++;\n }\n if(map.containsKey(cur_sum-k)){\n ret+=map.get(cur_sum-k);\n }\n if(map.containsKey(cur_sum)){\n map.put(cur_sum, map.get(cur_sum)+1);\n }\n else{\n map.put(cur_sum, (long)1);\n }\n }\n return ret;\n }\n\n\n\n public static ArrayList<Integer> lcm(int num){\n ArrayList<Integer> arrl=new ArrayList<Integer>();\n while(num%2==0){\n arrl.add(2);\n num/=2;\n }\n for(int i=3;i*i<=num;i+=2){\n while(num%i==0){\n arrl.add(i);\n num/=i;\n }\n }\n if(num>2){\n arrl.add(num);\n }\n return arrl;\n }\n\n\n static long modInverse(long a,long m) \n { \n long m0 = m; \n long y = 0l, x = 1l; \n \n if (m == 1) \n return 0l; \n \n while (a > 1) \n { \n \n long q = a / m; \n \n long t = m; \n \n m = a % m; \n a = t; \n t = y; \n \n y = x - q * y; \n x = t; \n } \n if (x < 0) \n x += m0; \n \n return x; \n } \n\n\n public static TreeSet<Long> arr_fact(long num){\n TreeSet<Long> arr=new TreeSet<Long>();\n int cnt=0;\n for(long i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n arr.add(i);\n }\n else{\n arr.add(i);arr.add(num/i);\n cnt+=2;\n }\n }\n }\n return arr;\n }\n\n\n\n public static int num_fact(int num){\n ArrayList<Integer> arr=new ArrayList<Integer>();\n int cnt=0;\n for(int i=1;i*i<=num;i++){\n if(num%i==0){\n if(i*i==num){\n cnt+=1;\n }\n else{\n cnt+=2;\n }\n }\n }\n return cnt;\n }\n\n\n public static long cal(int k,int x){\n long val=1;\n\n for(int i=0;i<k;i++){\n val*=2;\n if(val>x){\n break;\n }\n }\n return val;\n }\n\n public static void sort_inc(int[][] arr,int col){ //change dimention if req\n Arrays.sort(arr, new Comparator<int[]>() {\n public int compare(final int[] entry1,final int[] entry2) { \n if (entry1[col] > entry2[col]) //this is for inc\n return 1; \n else if(entry1[col]==entry2[col])\n return 0;\n else\n return -1; \n }\n });\n }\n\n\n public static boolean prime(int n){\n for(int i=2;i*i<=n;i++){\n if(n%i==0){\n return false;\n }\n }\n return true;\n }\n\n\n static long gcd(long a, long b) \n\t{ \n\tif (b == 0) \n\t\treturn a; \n\treturn gcd(b, a % b); \n\t} \n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main{
static long m=998244353l; //line 156 modInverse
static boolean[] vis; //line 74 and 91 hasElement ans pth_fnd
public static void main(String[] args) throws IOException{
// long sttm=System.currentTimeMillis();
int MAX=1000000007;
FastReader sc=new FastReader();
OutputStream out=new BufferedOutputStream(System.out);
int n=sc.nextInt(),m=sc.nextInt();
int[] a=new int[m];
int sum=0;
for(int i=0;i<m;i++){
a[i]=sc.nextInt();
sum+=a[i];
}
if(sum>n){
System.out.println("-1");
}
else{
System.out.println(n-sum);
}
out.flush();
}
static int MOD=1000000007;
public static int pow(int n,int k){ //n-pow(k)
if(k==1){
return n%MOD;
}
if(k==0){
return 1;
}
int val=pow(n,k/2)%MOD;
if(k%2==0)return (val*val)%MOD;
else return (val*val*n)%MOD;
}
public static long cnt_sum_k_subar(long[] a,int n,int k){
HashMap<Long,Long> map=new HashMap<Long,Long>();
long ret=0;
long cur_sum=0;
for(int i=0;i<n;i++){
cur_sum+=a[i];
if(cur_sum==k){
ret++;
}
if(map.containsKey(cur_sum-k)){
ret+=map.get(cur_sum-k);
}
if(map.containsKey(cur_sum)){
map.put(cur_sum, map.get(cur_sum)+1);
}
else{
map.put(cur_sum, (long)1);
}
}
return ret;
}
public static ArrayList<Integer> lcm(int num){
ArrayList<Integer> arrl=new ArrayList<Integer>();
while(num%2==0){
arrl.add(2);
num/=2;
}
for(int i=3;i*i<=num;i+=2){
while(num%i==0){
arrl.add(i);
num/=i;
}
}
if(num>2){
arrl.add(num);
}
return arrl;
}
static long modInverse(long a,long m)
{
long m0 = m;
long y = 0l, x = 1l;
if (m == 1)
return 0l;
while (a > 1)
{
long q = a / m;
long t = m;
m = a % m;
a = t;
t = y;
y = x - q * y;
x = t;
}
if (x < 0)
x += m0;
return x;
}
public static TreeSet<Long> arr_fact(long num){
TreeSet<Long> arr=new TreeSet<Long>();
int cnt=0;
for(long i=1;i*i<=num;i++){
if(num%i==0){
if(i*i==num){
cnt+=1;
arr.add(i);
}
else{
arr.add(i);arr.add(num/i);
cnt+=2;
}
}
}
return arr;
}
public static int num_fact(int num){
ArrayList<Integer> arr=new ArrayList<Integer>();
int cnt=0;
for(int i=1;i*i<=num;i++){
if(num%i==0){
if(i*i==num){
cnt+=1;
}
else{
cnt+=2;
}
}
}
return cnt;
}
public static long cal(int k,int x){
long val=1;
for(int i=0;i<k;i++){
val*=2;
if(val>x){
break;
}
}
return val;
}
public static void sort_inc(int[][] arr,int col){ //change dimention if req
Arrays.sort(arr, new Comparator<int[]>() {
public int compare(final int[] entry1,final int[] entry2) {
if (entry1[col] > entry2[col]) //this is for inc
return 1;
else if(entry1[col]==entry2[col])
return 0;
else
return -1;
}
});
}
public static boolean prime(int n){
for(int i=2;i*i<=n;i++){
if(n%i==0){
return false;
}
}
return true;
}
static long gcd(long a, long b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
}
class FastReader{
BufferedReader br;
StringTokenizer st;
public FastReader(){
br = new BufferedReader(new
InputStreamReader(System.in));
}
String next(){
while (st == null || !st.hasMoreElements()){
try{
st = new StringTokenizer(br.readLine());
}
catch (IOException e){
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt(){
return Integer.parseInt(next());
}
long nextLong(){
return Long.parseLong(next());
}
double nextDouble(){
return Double.parseDouble(next());
}
String nextLine(){
String str = "";
try{
str = br.readLine();
}
catch (IOException e){
e.printStackTrace();
}
return str;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
91,
5
],
[
91,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
8,
46
],
[
46,
47
],
[
46,
48
],
[
8,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
67,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
85,
87
],
[
6,
88
],
[
88,
89
],
[
0,
90
],
[
90,
91
],
[
90,
92
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\n\t\tScanner sc = new Scanner(System.in);\n \n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint a[]=new int[m];\n\t\t\n\t\tfor(int i=0;i<m;i++) {\n\t\t a[i]=sc.nextInt();\n\t\t}\n\t\tint s=0;\n\t\tfor(int i=0;i<m;i++) {\n\t\t\ts+=a[i];\n\t\t}\n\t\tif(s>n){\n\t\tSystem.out.println(-1);\n\t\t}else{\n\t\tSystem.out.println(n-s);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\n\t\tScanner sc = new Scanner(System.in);\n \n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint a[]=new int[m];\n\t\t\n\t\tfor(int i=0;i<m;i++) {\n\t\t a[i]=sc.nextInt();\n\t\t}\n\t\tint s=0;\n\t\tfor(int i=0;i<m;i++) {\n\t\t\ts+=a[i];\n\t\t}\n\t\tif(s>n){\n\t\tSystem.out.println(-1);\n\t\t}else{\n\t\tSystem.out.println(n-s);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\n\t\tScanner sc = new Scanner(System.in);\n \n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint a[]=new int[m];\n\t\t\n\t\tfor(int i=0;i<m;i++) {\n\t\t a[i]=sc.nextInt();\n\t\t}\n\t\tint s=0;\n\t\tfor(int i=0;i<m;i++) {\n\t\t\ts+=a[i];\n\t\t}\n\t\tif(s>n){\n\t\tSystem.out.println(-1);\n\t\t}else{\n\t\tSystem.out.println(n-s);\n\t\t}\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\n\t\tScanner sc = new Scanner(System.in);\n \n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint a[]=new int[m];\n\t\t\n\t\tfor(int i=0;i<m;i++) {\n\t\t a[i]=sc.nextInt();\n\t\t}\n\t\tint s=0;\n\t\tfor(int i=0;i<m;i++) {\n\t\t\ts+=a[i];\n\t\t}\n\t\tif(s>n){\n\t\tSystem.out.println(-1);\n\t\t}else{\n\t\tSystem.out.println(n-s);\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int a[]=new int[m];",
"a",
"new int[m]",
"m",
"for(int i=0;i<m;i++) {\n\t\t a[i]=sc.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t a[i]=sc.nextInt();\n\t\t}",
"{\n\t\t a[i]=sc.nextInt();\n\t\t}",
"a[i]=sc.nextInt()",
"a[i]",
"a",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int s=0;",
"s",
"0",
"for(int i=0;i<m;i++) {\n\t\t\ts+=a[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n\t\t\ts+=a[i];\n\t\t}",
"{\n\t\t\ts+=a[i];\n\t\t}",
"s+=a[i]",
"s",
"a[i]",
"a",
"i",
"if(s>n){\n\t\tSystem.out.println(-1);\n\t\t}else{\n\t\tSystem.out.println(n-s);\n\t\t}",
"s>n",
"s",
"n",
"{\n\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\tSystem.out.println(n-s);\n\t\t}",
"System.out.println(n-s)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-s",
"n",
"s",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\n\t\tScanner sc = new Scanner(System.in);\n \n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint a[]=new int[m];\n\t\t\n\t\tfor(int i=0;i<m;i++) {\n\t\t a[i]=sc.nextInt();\n\t\t}\n\t\tint s=0;\n\t\tfor(int i=0;i<m;i++) {\n\t\t\ts+=a[i];\n\t\t}\n\t\tif(s>n){\n\t\tSystem.out.println(-1);\n\t\t}else{\n\t\tSystem.out.println(n-s);\n\t\t}\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\n\t\tScanner sc = new Scanner(System.in);\n \n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint a[]=new int[m];\n\t\t\n\t\tfor(int i=0;i<m;i++) {\n\t\t a[i]=sc.nextInt();\n\t\t}\n\t\tint s=0;\n\t\tfor(int i=0;i<m;i++) {\n\t\t\ts+=a[i];\n\t\t}\n\t\tif(s>n){\n\t\tSystem.out.println(-1);\n\t\t}else{\n\t\tSystem.out.println(n-s);\n\t\t}\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int a[]=new int[m];
for(int i=0;i<m;i++) {
a[i]=sc.nextInt();
}
int s=0;
for(int i=0;i<m;i++) {
s+=a[i];
}
if(s>n){
System.out.println(-1);
}else{
System.out.println(n-s);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
8,
2,
13,
17,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
59,
5
],
[
59,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
8,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
49,
54
],
[
54,
55
],
[
6,
56
],
[
56,
57
],
[
0,
58
],
[
58,
59
],
[
58,
60
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int M = sc.nextInt();\n int N = sc.nextInt();\n int[] A = new int[N];\n\n for (int i = 0; i < N; i++) {\n M -= sc.nextInt();\n }\n\n System.out.println(M >= 0 ? M : -1);\n \n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int M = sc.nextInt();\n int N = sc.nextInt();\n int[] A = new int[N];\n\n for (int i = 0; i < N; i++) {\n M -= sc.nextInt();\n }\n\n System.out.println(M >= 0 ? M : -1);\n \n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int M = sc.nextInt();\n int N = sc.nextInt();\n int[] A = new int[N];\n\n for (int i = 0; i < N; i++) {\n M -= sc.nextInt();\n }\n\n System.out.println(M >= 0 ? M : -1);\n \n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int M = sc.nextInt();\n int N = sc.nextInt();\n int[] A = new int[N];\n\n for (int i = 0; i < N; i++) {\n M -= sc.nextInt();\n }\n\n System.out.println(M >= 0 ? M : -1);\n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = new int[N];",
"A",
"new int[N]",
"N",
"for (int i = 0; i < N; i++) {\n M -= sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n M -= sc.nextInt();\n }",
"{\n M -= sc.nextInt();\n }",
"M -= sc.nextInt()",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.println(M >= 0 ? M : -1)",
"System.out.println",
"System.out",
"System",
"System.out",
"M >= 0 ? M : -1",
"M >= 0",
"M",
"0",
"M",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int M = sc.nextInt();\n int N = sc.nextInt();\n int[] A = new int[N];\n\n for (int i = 0; i < N; i++) {\n M -= sc.nextInt();\n }\n\n System.out.println(M >= 0 ? M : -1);\n \n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int M = sc.nextInt();\n int N = sc.nextInt();\n int[] A = new int[N];\n\n for (int i = 0; i < N; i++) {\n M -= sc.nextInt();\n }\n\n System.out.println(M >= 0 ? M : -1);\n \n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int M = sc.nextInt();
int N = sc.nextInt();
int[] A = new int[N];
for (int i = 0; i < N; i++) {
M -= sc.nextInt();
}
System.out.println(M >= 0 ? M : -1);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
29,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
73,
5
],
[
73,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
8,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
6,
70
],
[
70,
71
],
[
0,
72
],
[
72,
73
],
[
72,
74
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t\tif (sum > N) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 結果の出力\n\t\tSystem.out.println(N - sum);\n\n\t\tsc.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t\tif (sum > N) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 結果の出力\n\t\tSystem.out.println(N - sum);\n\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t\tif (sum > N) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 結果の出力\n\t\tSystem.out.println(N - sum);\n\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t\tif (sum > N) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 結果の出力\n\t\tSystem.out.println(N - sum);\n\n\t\tsc.close();\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long sum = 0;",
"sum",
"0",
"for (int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t\tif (sum > N) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tsum += sc.nextInt();\n\t\t\tif (sum > N) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"{\n\t\t\tsum += sc.nextInt();\n\t\t\tif (sum > N) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"sum += sc.nextInt()",
"sum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if (sum > N) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}",
"sum > N",
"sum",
"N",
"{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"sc.close()",
"sc.close",
"sc",
"return;",
"System.out.println(N - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"N - sum",
"N",
"sum",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t\tif (sum > N) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 結果の出力\n\t\tSystem.out.println(N - sum);\n\n\t\tsc.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 入力値の取得\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tlong sum = 0;\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tsum += sc.nextInt();\n\t\t\tif (sum > N) {\n\t\t\t\tSystem.out.println(-1);\n\t\t\t\tsc.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 結果の出力\n\t\tSystem.out.println(N - sum);\n\n\t\tsc.close();\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// 入力値の取得
int N = sc.nextInt();
int M = sc.nextInt();
long sum = 0;
for (int i = 0; i < M; i++) {
sum += sc.nextInt();
if (sum > N) {
System.out.println(-1);
sc.close();
return;
}
}
// 結果の出力
System.out.println(N - sum);
sc.close();
}
}
|
[
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,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
4,
18,
13,
4,
18,
18,
13,
13,
8,
2,
13,
13,
2,
13,
13,
40,
17,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
23,
27
],
[
27,
28
],
[
27,
29
],
[
23,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
23,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
23,
40
],
[
40,
41
],
[
40,
42
],
[
23,
44
],
[
44,
45
],
[
44,
46
],
[
23,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
47,
55
],
[
55,
56
],
[
56,
57
],
[
47,
58
],
[
59,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
23,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
76,
78
],
[
72,
79
],
[
79,
80
],
[
21,
81
],
[
81,
82
],
[
19,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
83,
87
],
[
87,
88
],
[
83,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
95,
96
],
[
95,
97
],
[
89,
98
],
[
98,
99
],
[
83,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
103,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
117,
118
],
[
113,
119
],
[
119,
120
],
[
120,
121
],
[
120,
122
],
[
102,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
83,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
131,
134
],
[
134,
135
]
] |
[
"\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.util.StringTokenizer;\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\n\n\nclass Main{\n public static void main(String[] args) {\n InputReader in = new InputReader(System.in);\n PrintWriter out = new PrintWriter(System.out);\n\n int N = in.nextInt();\n int M = in.nextInt();\n int[] arr = new int[M];\n int sum = 0;\n for (int i = 0; i < M; i++) {\n //arr[i] = in.nextInt();\n sum = sum + in.nextInt();\n }\n\n System.out.println((sum <= N )?((N-sum)):(-1));\n\n\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"class Main{\n public static void main(String[] args) {\n InputReader in = new InputReader(System.in);\n PrintWriter out = new PrintWriter(System.out);\n\n int N = in.nextInt();\n int M = in.nextInt();\n int[] arr = new int[M];\n int sum = 0;\n for (int i = 0; i < M; i++) {\n //arr[i] = in.nextInt();\n sum = sum + in.nextInt();\n }\n\n System.out.println((sum <= N )?((N-sum)):(-1));\n\n\n }\n\n static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputReader in = new InputReader(System.in);\n PrintWriter out = new PrintWriter(System.out);\n\n int N = in.nextInt();\n int M = in.nextInt();\n int[] arr = new int[M];\n int sum = 0;\n for (int i = 0; i < M; i++) {\n //arr[i] = in.nextInt();\n sum = sum + in.nextInt();\n }\n\n System.out.println((sum <= N )?((N-sum)):(-1));\n\n\n }",
"main",
"{\n InputReader in = new InputReader(System.in);\n PrintWriter out = new PrintWriter(System.out);\n\n int N = in.nextInt();\n int M = in.nextInt();\n int[] arr = new int[M];\n int sum = 0;\n for (int i = 0; i < M; i++) {\n //arr[i] = in.nextInt();\n sum = sum + in.nextInt();\n }\n\n System.out.println((sum <= N )?((N-sum)):(-1));\n\n\n }",
"InputReader in = new InputReader(System.in);",
"in",
"new InputReader(System.in)",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"int N = in.nextInt();",
"N",
"in.nextInt()",
"in.nextInt",
"in",
"int M = in.nextInt();",
"M",
"in.nextInt()",
"in.nextInt",
"in",
"int[] arr = new int[M];",
"arr",
"new int[M]",
"M",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < M; i++) {\n //arr[i] = in.nextInt();\n sum = sum + in.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n //arr[i] = in.nextInt();\n sum = sum + in.nextInt();\n }",
"{\n //arr[i] = in.nextInt();\n sum = sum + in.nextInt();\n }",
"sum = sum + in.nextInt()",
"sum",
"sum + in.nextInt()",
"sum",
"in.nextInt()",
"in.nextInt",
"in",
"System.out.println((sum <= N )?((N-sum)):(-1))",
"System.out.println",
"System.out",
"System",
"System.out",
"(sum <= N )?((N-sum)):(-1)",
"(sum <= N )",
"sum",
"N",
"((N-sum))",
"N",
"sum",
"(-1)",
"1",
"String[] args",
"args",
"static class InputReader {\n public BufferedReader reader;\n public StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n }",
"InputReader",
"public BufferedReader reader;",
"reader",
"public StringTokenizer tokenizer;",
"tokenizer",
"public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"InputReader",
"{\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\n tokenizer = null;\n }",
"reader = new BufferedReader(new InputStreamReader(stream), 32768)",
"reader",
"new BufferedReader(new InputStreamReader(stream), 32768)",
"tokenizer = null",
"tokenizer",
"null",
"InputStream stream",
"stream",
"public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"next",
"{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }",
"catch (IOException e) {\n throw new RuntimeException(e);\n }",
"IOException e",
"{\n throw new RuntimeException(e);\n }",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n tokenizer = new StringTokenizer(reader.readLine());\n }",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"public int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next"
] |
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
class Main{
public static void main(String[] args) {
InputReader in = new InputReader(System.in);
PrintWriter out = new PrintWriter(System.out);
int N = in.nextInt();
int M = in.nextInt();
int[] arr = new int[M];
int sum = 0;
for (int i = 0; i < M; i++) {
//arr[i] = in.nextInt();
sum = sum + in.nextInt();
}
System.out.println((sum <= N )?((N-sum)):(-1));
}
static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
8,
2,
13,
13,
40,
17,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
59,
5
],
[
59,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
8,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
42,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
47,
53
],
[
53,
54
],
[
53,
55
],
[
6,
56
],
[
56,
57
],
[
0,
58
],
[
58,
59
],
[
58,
60
]
] |
[
"import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt(), m = in.nextInt();\n\t\tint s = 0;\n\t\tfor (int i = 0; i < m; i++) s += in.nextInt();\n\t\tSystem.out.println(s>n? -1 : n-s);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt(), m = in.nextInt();\n\t\tint s = 0;\n\t\tfor (int i = 0; i < m; i++) s += in.nextInt();\n\t\tSystem.out.println(s>n? -1 : n-s);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt(), m = in.nextInt();\n\t\tint s = 0;\n\t\tfor (int i = 0; i < m; i++) s += in.nextInt();\n\t\tSystem.out.println(s>n? -1 : n-s);\n\t}",
"main",
"{\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt(), m = in.nextInt();\n\t\tint s = 0;\n\t\tfor (int i = 0; i < m; i++) s += in.nextInt();\n\t\tSystem.out.println(s>n? -1 : n-s);\n\t}",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int n = in.nextInt()",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"m = in.nextInt();",
"m",
"in.nextInt()",
"in.nextInt",
"in",
"int s = 0;",
"s",
"0",
"for (int i = 0; i < m; i++) s += in.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"s += in.nextInt();",
"s += in.nextInt()",
"s",
"in.nextInt()",
"in.nextInt",
"in",
"System.out.println(s>n? -1 : n-s)",
"System.out.println",
"System.out",
"System",
"System.out",
"s>n? -1 : n-s",
"s>n",
"s",
"n",
"-1",
"1",
"n-s",
"n",
"s",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt(), m = in.nextInt();\n\t\tint s = 0;\n\t\tfor (int i = 0; i < m; i++) s += in.nextInt();\n\t\tSystem.out.println(s>n? -1 : n-s);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tint n = in.nextInt(), m = in.nextInt();\n\t\tint s = 0;\n\t\tfor (int i = 0; i < m; i++) s += in.nextInt();\n\t\tSystem.out.println(s>n? -1 : n-s);\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt(), m = in.nextInt();
int s = 0;
for (int i = 0; i < m; i++) s += in.nextInt();
System.out.println(s>n? -1 : n-s);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
14,
2,
13,
13,
30,
0,
13,
2,
13,
13,
30,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
95,
5
],
[
95,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
38,
43
],
[
8,
44
],
[
44,
45
],
[
44,
46
],
[
8,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
68,
70
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
78,
80
],
[
71,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
8,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
6,
92
],
[
92,
93
],
[
0,
94
],
[
94,
95
],
[
94,
96
]
] |
[
"import java.util.Scanner;\npublic class Main{\n public static void main(String[] args){\n Scanner scn = new Scanner(System.in);\n String[] NM = (scn.nextLine()).split(\" \");\n int N = Integer.valueOf(NM[0]);\n int M = Integer.valueOf(NM[1]);\n String[] Am = (scn.nextLine()).split(\" \");\n int sum = 0;\n int result = 0;\n for(int i=0;i<M;i++){\n sum += Integer.valueOf(Am[i]);\n }\n if(sum <= N){\n result = N -sum;\n }else{\n result = -1;\n }\n System.out.println(result);\n\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner scn = new Scanner(System.in);\n String[] NM = (scn.nextLine()).split(\" \");\n int N = Integer.valueOf(NM[0]);\n int M = Integer.valueOf(NM[1]);\n String[] Am = (scn.nextLine()).split(\" \");\n int sum = 0;\n int result = 0;\n for(int i=0;i<M;i++){\n sum += Integer.valueOf(Am[i]);\n }\n if(sum <= N){\n result = N -sum;\n }else{\n result = -1;\n }\n System.out.println(result);\n\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scn = new Scanner(System.in);\n String[] NM = (scn.nextLine()).split(\" \");\n int N = Integer.valueOf(NM[0]);\n int M = Integer.valueOf(NM[1]);\n String[] Am = (scn.nextLine()).split(\" \");\n int sum = 0;\n int result = 0;\n for(int i=0;i<M;i++){\n sum += Integer.valueOf(Am[i]);\n }\n if(sum <= N){\n result = N -sum;\n }else{\n result = -1;\n }\n System.out.println(result);\n\n }",
"main",
"{\n Scanner scn = new Scanner(System.in);\n String[] NM = (scn.nextLine()).split(\" \");\n int N = Integer.valueOf(NM[0]);\n int M = Integer.valueOf(NM[1]);\n String[] Am = (scn.nextLine()).split(\" \");\n int sum = 0;\n int result = 0;\n for(int i=0;i<M;i++){\n sum += Integer.valueOf(Am[i]);\n }\n if(sum <= N){\n result = N -sum;\n }else{\n result = -1;\n }\n System.out.println(result);\n\n }",
"Scanner scn = new Scanner(System.in);",
"scn",
"new Scanner(System.in)",
"String[] NM = (scn.nextLine()).split(\" \");",
"NM",
"(scn.nextLine()).split(\" \")",
"(scn.nextLine()).split",
"(scn.nextLine())",
"scn.nextLine",
"scn",
"\" \"",
"int N = Integer.valueOf(NM[0]);",
"N",
"Integer.valueOf(NM[0])",
"Integer.valueOf",
"Integer",
"NM[0]",
"NM",
"0",
"int M = Integer.valueOf(NM[1]);",
"M",
"Integer.valueOf(NM[1])",
"Integer.valueOf",
"Integer",
"NM[1]",
"NM",
"1",
"String[] Am = (scn.nextLine()).split(\" \");",
"Am",
"(scn.nextLine()).split(\" \")",
"(scn.nextLine()).split",
"(scn.nextLine())",
"scn.nextLine",
"scn",
"\" \"",
"int sum = 0;",
"sum",
"0",
"int result = 0;",
"result",
"0",
"for(int i=0;i<M;i++){\n sum += Integer.valueOf(Am[i]);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n sum += Integer.valueOf(Am[i]);\n }",
"{\n sum += Integer.valueOf(Am[i]);\n }",
"sum += Integer.valueOf(Am[i])",
"sum",
"Integer.valueOf(Am[i])",
"Integer.valueOf",
"Integer",
"Am[i]",
"Am",
"i",
"if(sum <= N){\n result = N -sum;\n }else{\n result = -1;\n }",
"sum <= N",
"sum",
"N",
"{\n result = N -sum;\n }",
"result = N -sum",
"result",
"N -sum",
"N",
"sum",
"{\n result = -1;\n }",
"result = -1",
"result",
"-1",
"1",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner scn = new Scanner(System.in);\n String[] NM = (scn.nextLine()).split(\" \");\n int N = Integer.valueOf(NM[0]);\n int M = Integer.valueOf(NM[1]);\n String[] Am = (scn.nextLine()).split(\" \");\n int sum = 0;\n int result = 0;\n for(int i=0;i<M;i++){\n sum += Integer.valueOf(Am[i]);\n }\n if(sum <= N){\n result = N -sum;\n }else{\n result = -1;\n }\n System.out.println(result);\n\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner scn = new Scanner(System.in);\n String[] NM = (scn.nextLine()).split(\" \");\n int N = Integer.valueOf(NM[0]);\n int M = Integer.valueOf(NM[1]);\n String[] Am = (scn.nextLine()).split(\" \");\n int sum = 0;\n int result = 0;\n for(int i=0;i<M;i++){\n sum += Integer.valueOf(Am[i]);\n }\n if(sum <= N){\n result = N -sum;\n }else{\n result = -1;\n }\n System.out.println(result);\n\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scn = new Scanner(System.in);
String[] NM = (scn.nextLine()).split(" ");
int N = Integer.valueOf(NM[0]);
int M = Integer.valueOf(NM[1]);
String[] Am = (scn.nextLine()).split(" ");
int sum = 0;
int result = 0;
for(int i=0;i<M;i++){
sum += Integer.valueOf(Am[i]);
}
if(sum <= N){
result = N -sum;
}else{
result = -1;
}
System.out.println(result);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
18,
4,
18,
13,
17,
17,
41,
13,
4,
18,
13,
18,
4,
18,
13,
17,
17,
41,
13,
4,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
13,
2,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
96,
11
],
[
96,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
33,
38
],
[
14,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
44,
49
],
[
14,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
14,
56
],
[
56,
57
],
[
56,
58
],
[
14,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
59,
67
],
[
67,
68
],
[
68,
69
],
[
59,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
77,
79
],
[
14,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
88,
89
],
[
88,
90
],
[
85,
91
],
[
91,
92
],
[
12,
93
],
[
93,
94
],
[
0,
95
],
[
95,
96
],
[
95,
97
]
] |
[
"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\tString line1 = br.readLine();\n\t\tString line2 = br.readLine();\n\t\tint days = Integer.parseInt(line1.split(\" \")[0]);\n\t\tint homeworks = Integer.parseInt(line1.split(\" \")[1]);\n\t\tString[] costs = line2.split(\" \");\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < homeworks; i++) {\n\t\t\tsum += Integer.parseInt(costs[i]);\n\t\t}\n\t\tSystem.out.println(Math.max(days - sum, -1));\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line1 = br.readLine();\n\t\tString line2 = br.readLine();\n\t\tint days = Integer.parseInt(line1.split(\" \")[0]);\n\t\tint homeworks = Integer.parseInt(line1.split(\" \")[1]);\n\t\tString[] costs = line2.split(\" \");\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < homeworks; i++) {\n\t\t\tsum += Integer.parseInt(costs[i]);\n\t\t}\n\t\tSystem.out.println(Math.max(days - sum, -1));\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line1 = br.readLine();\n\t\tString line2 = br.readLine();\n\t\tint days = Integer.parseInt(line1.split(\" \")[0]);\n\t\tint homeworks = Integer.parseInt(line1.split(\" \")[1]);\n\t\tString[] costs = line2.split(\" \");\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < homeworks; i++) {\n\t\t\tsum += Integer.parseInt(costs[i]);\n\t\t}\n\t\tSystem.out.println(Math.max(days - sum, -1));\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line1 = br.readLine();\n\t\tString line2 = br.readLine();\n\t\tint days = Integer.parseInt(line1.split(\" \")[0]);\n\t\tint homeworks = Integer.parseInt(line1.split(\" \")[1]);\n\t\tString[] costs = line2.split(\" \");\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < homeworks; i++) {\n\t\t\tsum += Integer.parseInt(costs[i]);\n\t\t}\n\t\tSystem.out.println(Math.max(days - sum, -1));\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String line1 = br.readLine();",
"line1",
"br.readLine()",
"br.readLine",
"br",
"String line2 = br.readLine();",
"line2",
"br.readLine()",
"br.readLine",
"br",
"int days = Integer.parseInt(line1.split(\" \")[0]);",
"days",
"Integer.parseInt(line1.split(\" \")[0])",
"Integer.parseInt",
"Integer",
"line1.split(\" \")[0]",
"line1.split(\" \")",
"line1.split",
"line1",
"\" \"",
"0",
"int homeworks = Integer.parseInt(line1.split(\" \")[1]);",
"homeworks",
"Integer.parseInt(line1.split(\" \")[1])",
"Integer.parseInt",
"Integer",
"line1.split(\" \")[1]",
"line1.split(\" \")",
"line1.split",
"line1",
"\" \"",
"1",
"String[] costs = line2.split(\" \");",
"costs",
"line2.split(\" \")",
"line2.split",
"line2",
"\" \"",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < homeworks; i++) {\n\t\t\tsum += Integer.parseInt(costs[i]);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < homeworks",
"i",
"homeworks",
"i++",
"i++",
"i",
"{\n\t\t\tsum += Integer.parseInt(costs[i]);\n\t\t}",
"{\n\t\t\tsum += Integer.parseInt(costs[i]);\n\t\t}",
"sum += Integer.parseInt(costs[i])",
"sum",
"Integer.parseInt(costs[i])",
"Integer.parseInt",
"Integer",
"costs[i]",
"costs",
"i",
"System.out.println(Math.max(days - sum, -1))",
"System.out.println",
"System.out",
"System",
"System.out",
"Math.max(days - sum, -1)",
"Math.max",
"Math",
"days - sum",
"days",
"sum",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line1 = br.readLine();\n\t\tString line2 = br.readLine();\n\t\tint days = Integer.parseInt(line1.split(\" \")[0]);\n\t\tint homeworks = Integer.parseInt(line1.split(\" \")[1]);\n\t\tString[] costs = line2.split(\" \");\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < homeworks; i++) {\n\t\t\tsum += Integer.parseInt(costs[i]);\n\t\t}\n\t\tSystem.out.println(Math.max(days - sum, -1));\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString line1 = br.readLine();\n\t\tString line2 = br.readLine();\n\t\tint days = Integer.parseInt(line1.split(\" \")[0]);\n\t\tint homeworks = Integer.parseInt(line1.split(\" \")[1]);\n\t\tString[] costs = line2.split(\" \");\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < homeworks; i++) {\n\t\t\tsum += Integer.parseInt(costs[i]);\n\t\t}\n\t\tSystem.out.println(Math.max(days - sum, -1));\n\t}\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line1 = br.readLine();
String line2 = br.readLine();
int days = Integer.parseInt(line1.split(" ")[0]);
int homeworks = Integer.parseInt(line1.split(" ")[1]);
String[] costs = line2.split(" ");
int sum = 0;
for(int i = 0; i < homeworks; i++) {
sum += Integer.parseInt(costs[i]);
}
System.out.println(Math.max(days - sum, -1));
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
18,
13,
13,
4,
18,
18,
13,
13,
8,
2,
2,
13,
13,
17,
2,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
93,
11
],
[
93,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
20,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
31,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
14,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
44,
49
],
[
14,
50
],
[
50,
51
],
[
50,
52
],
[
14,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
71,
73
],
[
14,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
79,
85
],
[
85,
86
],
[
85,
87
],
[
79,
88
],
[
88,
89
],
[
12,
90
],
[
90,
91
],
[
0,
92
],
[
92,
93
],
[
92,
94
]
] |
[
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.IOException;\n\npublic class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n String[] str = in.readLine().split(\" \");\n int n = Integer.parseInt(str[0]);\n int m = Integer.parseInt(str[1]);\n String[] hw_days = in.readLine().split(\" \");\n int sum = 0;\n for(int i=0; i<m; i++){\n sum += Integer.parseInt(hw_days[i]);\n }\n System.out.println(n-sum >= 0?n-sum:-1);\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n String[] str = in.readLine().split(\" \");\n int n = Integer.parseInt(str[0]);\n int m = Integer.parseInt(str[1]);\n String[] hw_days = in.readLine().split(\" \");\n int sum = 0;\n for(int i=0; i<m; i++){\n sum += Integer.parseInt(hw_days[i]);\n }\n System.out.println(n-sum >= 0?n-sum:-1);\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n String[] str = in.readLine().split(\" \");\n int n = Integer.parseInt(str[0]);\n int m = Integer.parseInt(str[1]);\n String[] hw_days = in.readLine().split(\" \");\n int sum = 0;\n for(int i=0; i<m; i++){\n sum += Integer.parseInt(hw_days[i]);\n }\n System.out.println(n-sum >= 0?n-sum:-1);\n }",
"main",
"{\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n String[] str = in.readLine().split(\" \");\n int n = Integer.parseInt(str[0]);\n int m = Integer.parseInt(str[1]);\n String[] hw_days = in.readLine().split(\" \");\n int sum = 0;\n for(int i=0; i<m; i++){\n sum += Integer.parseInt(hw_days[i]);\n }\n System.out.println(n-sum >= 0?n-sum:-1);\n }",
"BufferedReader in = new BufferedReader(new InputStreamReader(System.in));",
"in",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] str = in.readLine().split(\" \");",
"str",
"in.readLine().split(\" \")",
"in.readLine().split",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"int n = Integer.parseInt(str[0]);",
"n",
"Integer.parseInt(str[0])",
"Integer.parseInt",
"Integer",
"str[0]",
"str",
"0",
"int m = Integer.parseInt(str[1]);",
"m",
"Integer.parseInt(str[1])",
"Integer.parseInt",
"Integer",
"str[1]",
"str",
"1",
"String[] hw_days = in.readLine().split(\" \");",
"hw_days",
"in.readLine().split(\" \")",
"in.readLine().split",
"in.readLine()",
"in.readLine",
"in",
"\" \"",
"int sum = 0;",
"sum",
"0",
"for(int i=0; i<m; i++){\n sum += Integer.parseInt(hw_days[i]);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n sum += Integer.parseInt(hw_days[i]);\n }",
"{\n sum += Integer.parseInt(hw_days[i]);\n }",
"sum += Integer.parseInt(hw_days[i])",
"sum",
"Integer.parseInt(hw_days[i])",
"Integer.parseInt",
"Integer",
"hw_days[i]",
"hw_days",
"i",
"System.out.println(n-sum >= 0?n-sum:-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum >= 0?n-sum:-1",
"n-sum >= 0",
"n-sum",
"n",
"sum",
"0",
"n-sum",
"n",
"sum",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n String[] str = in.readLine().split(\" \");\n int n = Integer.parseInt(str[0]);\n int m = Integer.parseInt(str[1]);\n String[] hw_days = in.readLine().split(\" \");\n int sum = 0;\n for(int i=0; i<m; i++){\n sum += Integer.parseInt(hw_days[i]);\n }\n System.out.println(n-sum >= 0?n-sum:-1);\n }\n}",
"public class Main {\n public static void main(String[] args) throws IOException {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n String[] str = in.readLine().split(\" \");\n int n = Integer.parseInt(str[0]);\n int m = Integer.parseInt(str[1]);\n String[] hw_days = in.readLine().split(\" \");\n int sum = 0;\n for(int i=0; i<m; i++){\n sum += Integer.parseInt(hw_days[i]);\n }\n System.out.println(n-sum >= 0?n-sum:-1);\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String[] str = in.readLine().split(" ");
int n = Integer.parseInt(str[0]);
int m = Integer.parseInt(str[1]);
String[] hw_days = in.readLine().split(" ");
int sum = 0;
for(int i=0; i<m; i++){
sum += Integer.parseInt(hw_days[i]);
}
System.out.println(n-sum >= 0?n-sum:-1);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
29,
4,
18,
18,
13,
13,
13,
4,
18,
13,
29,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
69,
5
],
[
69,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
8,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
8,
62
],
[
62,
63
],
[
63,
64
],
[
8,
65
],
[
6,
66
],
[
66,
67
],
[
0,
68
],
[
68,
69
],
[
68,
70
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n long n = scan.nextLong(), m = scan.nextLong();\n for(int i = 0; i < m; i++) {\n n -= scan.nextLong();\n if(n < 0) {\n System.out.println(-1);\n scan.close();\n return;\n }\n }\n System.out.println(n);\n scan.close();\n return;\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n long n = scan.nextLong(), m = scan.nextLong();\n for(int i = 0; i < m; i++) {\n n -= scan.nextLong();\n if(n < 0) {\n System.out.println(-1);\n scan.close();\n return;\n }\n }\n System.out.println(n);\n scan.close();\n return;\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n long n = scan.nextLong(), m = scan.nextLong();\n for(int i = 0; i < m; i++) {\n n -= scan.nextLong();\n if(n < 0) {\n System.out.println(-1);\n scan.close();\n return;\n }\n }\n System.out.println(n);\n scan.close();\n return;\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n\n long n = scan.nextLong(), m = scan.nextLong();\n for(int i = 0; i < m; i++) {\n n -= scan.nextLong();\n if(n < 0) {\n System.out.println(-1);\n scan.close();\n return;\n }\n }\n System.out.println(n);\n scan.close();\n return;\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"long n = scan.nextLong()",
"n",
"scan.nextLong()",
"scan.nextLong",
"scan",
"m = scan.nextLong();",
"m",
"scan.nextLong()",
"scan.nextLong",
"scan",
"for(int i = 0; i < m; i++) {\n n -= scan.nextLong();\n if(n < 0) {\n System.out.println(-1);\n scan.close();\n return;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n n -= scan.nextLong();\n if(n < 0) {\n System.out.println(-1);\n scan.close();\n return;\n }\n }",
"{\n n -= scan.nextLong();\n if(n < 0) {\n System.out.println(-1);\n scan.close();\n return;\n }\n }",
"n -= scan.nextLong()",
"n",
"scan.nextLong()",
"scan.nextLong",
"scan",
"if(n < 0) {\n System.out.println(-1);\n scan.close();\n return;\n }",
"n < 0",
"n",
"0",
"{\n System.out.println(-1);\n scan.close();\n return;\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"scan.close()",
"scan.close",
"scan",
"return;",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"scan.close()",
"scan.close",
"scan",
"return;",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n long n = scan.nextLong(), m = scan.nextLong();\n for(int i = 0; i < m; i++) {\n n -= scan.nextLong();\n if(n < 0) {\n System.out.println(-1);\n scan.close();\n return;\n }\n }\n System.out.println(n);\n scan.close();\n return;\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n long n = scan.nextLong(), m = scan.nextLong();\n for(int i = 0; i < m; i++) {\n n -= scan.nextLong();\n if(n < 0) {\n System.out.println(-1);\n scan.close();\n return;\n }\n }\n System.out.println(n);\n scan.close();\n return;\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long n = scan.nextLong(), m = scan.nextLong();
for(int i = 0; i < m; i++) {
n -= scan.nextLong();
if(n < 0) {
System.out.println(-1);
scan.close();
return;
}
}
System.out.println(n);
scan.close();
return;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
93,
5
],
[
93,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
8,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
8,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
68,
72
],
[
67,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
67,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
6,
90
],
[
90,
91
],
[
0,
92
],
[
92,
93
],
[
92,
94
]
] |
[
"import java.util.*;\npublic class Main{\n\tpublic static void main(String args[]){\n\t\t\n\t\tScanner ob = new Scanner(System.in);\n\t\tint N = ob.nextInt();\n\t\tint M = ob.nextInt();\n\t\tint R = 0;\n\n\t\tint[] array = new int[M];\n\t\tfor(int i = 0; i < M; i++){\n\t\t\tarray[i] = ob.nextInt();\n\t\t}\n\n\t\tfor(int j = 0; j < M; j++){\n\t\t\tR += array[j]; \n\t\t}\n\n\t\tif((N - R) < 0){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(N - R);\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tpublic static void main(String args[]){\n\t\t\n\t\tScanner ob = new Scanner(System.in);\n\t\tint N = ob.nextInt();\n\t\tint M = ob.nextInt();\n\t\tint R = 0;\n\n\t\tint[] array = new int[M];\n\t\tfor(int i = 0; i < M; i++){\n\t\t\tarray[i] = ob.nextInt();\n\t\t}\n\n\t\tfor(int j = 0; j < M; j++){\n\t\t\tR += array[j]; \n\t\t}\n\n\t\tif((N - R) < 0){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(N - R);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String args[]){\n\t\t\n\t\tScanner ob = new Scanner(System.in);\n\t\tint N = ob.nextInt();\n\t\tint M = ob.nextInt();\n\t\tint R = 0;\n\n\t\tint[] array = new int[M];\n\t\tfor(int i = 0; i < M; i++){\n\t\t\tarray[i] = ob.nextInt();\n\t\t}\n\n\t\tfor(int j = 0; j < M; j++){\n\t\t\tR += array[j]; \n\t\t}\n\n\t\tif((N - R) < 0){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(N - R);\n\t\t}\n\t}",
"main",
"{\n\t\t\n\t\tScanner ob = new Scanner(System.in);\n\t\tint N = ob.nextInt();\n\t\tint M = ob.nextInt();\n\t\tint R = 0;\n\n\t\tint[] array = new int[M];\n\t\tfor(int i = 0; i < M; i++){\n\t\t\tarray[i] = ob.nextInt();\n\t\t}\n\n\t\tfor(int j = 0; j < M; j++){\n\t\t\tR += array[j]; \n\t\t}\n\n\t\tif((N - R) < 0){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(N - R);\n\t\t}\n\t}",
"Scanner ob = new Scanner(System.in);",
"ob",
"new Scanner(System.in)",
"int N = ob.nextInt();",
"N",
"ob.nextInt()",
"ob.nextInt",
"ob",
"int M = ob.nextInt();",
"M",
"ob.nextInt()",
"ob.nextInt",
"ob",
"int R = 0;",
"R",
"0",
"int[] array = new int[M];",
"array",
"new int[M]",
"M",
"for(int i = 0; i < M; i++){\n\t\t\tarray[i] = ob.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tarray[i] = ob.nextInt();\n\t\t}",
"{\n\t\t\tarray[i] = ob.nextInt();\n\t\t}",
"array[i] = ob.nextInt()",
"array[i]",
"array",
"i",
"ob.nextInt()",
"ob.nextInt",
"ob",
"for(int j = 0; j < M; j++){\n\t\t\tR += array[j]; \n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < M",
"j",
"M",
"j++",
"j++",
"j",
"{\n\t\t\tR += array[j]; \n\t\t}",
"{\n\t\t\tR += array[j]; \n\t\t}",
"R += array[j]",
"R",
"array[j]",
"array",
"j",
"if((N - R) < 0){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(N - R);\n\t\t}",
"(N - R) < 0",
"(N - R)",
"N",
"R",
"0",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(N - R);\n\t\t}",
"System.out.println(N - R)",
"System.out.println",
"System.out",
"System",
"System.out",
"N - R",
"N",
"R",
"String args[]",
"args",
"public class Main{\n\tpublic static void main(String args[]){\n\t\t\n\t\tScanner ob = new Scanner(System.in);\n\t\tint N = ob.nextInt();\n\t\tint M = ob.nextInt();\n\t\tint R = 0;\n\n\t\tint[] array = new int[M];\n\t\tfor(int i = 0; i < M; i++){\n\t\t\tarray[i] = ob.nextInt();\n\t\t}\n\n\t\tfor(int j = 0; j < M; j++){\n\t\t\tR += array[j]; \n\t\t}\n\n\t\tif((N - R) < 0){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(N - R);\n\t\t}\n\t}\n}",
"public class Main{\n\tpublic static void main(String args[]){\n\t\t\n\t\tScanner ob = new Scanner(System.in);\n\t\tint N = ob.nextInt();\n\t\tint M = ob.nextInt();\n\t\tint R = 0;\n\n\t\tint[] array = new int[M];\n\t\tfor(int i = 0; i < M; i++){\n\t\t\tarray[i] = ob.nextInt();\n\t\t}\n\n\t\tfor(int j = 0; j < M; j++){\n\t\t\tR += array[j]; \n\t\t}\n\n\t\tif((N - R) < 0){\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(N - R);\n\t\t}\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner ob = new Scanner(System.in);
int N = ob.nextInt();
int M = ob.nextInt();
int R = 0;
int[] array = new int[M];
for(int i = 0; i < M; i++){
array[i] = ob.nextInt();
}
for(int j = 0; j < M; j++){
R += array[j];
}
if((N - R) < 0){
System.out.println(-1);
}
else{
System.out.println(N - R);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
41,
13,
40,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
18,
13,
13,
14,
2,
13,
13,
0,
13,
2,
13,
13,
14,
2,
13,
13,
0,
13,
17,
0,
13,
40,
17,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
87,
5
],
[
87,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
8,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
45,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
8,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
58,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
71,
73
],
[
67,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
8,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
6,
84
],
[
84,
85
],
[
0,
86
],
[
86,
87
],
[
86,
88
]
] |
[
"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 m = sc.nextInt();\n int a[] = new int[m];\n int s=0;\n int v=-1;\n for(int i=0;i<m;i++)\n {\n a[i]=sc.nextInt();\n s+=a[i];\n }\n if(n>s)\n v=n-s;\n else if(n==s)\n v=0;\n else\n v=-1;\n System.out.println(v);\n \n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main\n{\n public static void main(String args[])\n {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int a[] = new int[m];\n int s=0;\n int v=-1;\n for(int i=0;i<m;i++)\n {\n a[i]=sc.nextInt();\n s+=a[i];\n }\n if(n>s)\n v=n-s;\n else if(n==s)\n v=0;\n else\n v=-1;\n System.out.println(v);\n \n }\n}",
"Main",
"public static void main(String args[])\n {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int a[] = new int[m];\n int s=0;\n int v=-1;\n for(int i=0;i<m;i++)\n {\n a[i]=sc.nextInt();\n s+=a[i];\n }\n if(n>s)\n v=n-s;\n else if(n==s)\n v=0;\n else\n v=-1;\n System.out.println(v);\n \n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int a[] = new int[m];\n int s=0;\n int v=-1;\n for(int i=0;i<m;i++)\n {\n a[i]=sc.nextInt();\n s+=a[i];\n }\n if(n>s)\n v=n-s;\n else if(n==s)\n v=0;\n else\n v=-1;\n System.out.println(v);\n \n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int a[] = new int[m];",
"a",
"new int[m]",
"m",
"int s=0;",
"s",
"0",
"int v=-1;",
"v",
"-1",
"1",
"for(int i=0;i<m;i++)\n {\n a[i]=sc.nextInt();\n s+=a[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n a[i]=sc.nextInt();\n s+=a[i];\n }",
"{\n a[i]=sc.nextInt();\n s+=a[i];\n }",
"a[i]=sc.nextInt()",
"a[i]",
"a",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"s+=a[i]",
"s",
"a[i]",
"a",
"i",
"if(n>s)\n v=n-s;\n else if(n==s)\n v=0;\n else\n v=-1;",
"n>s",
"n",
"s",
"v=n-s",
"v",
"n-s",
"n",
"s",
"if(n==s)\n v=0;\n else\n v=-1;",
"n==s",
"n",
"s",
"v=0",
"v",
"0",
"v=-1",
"v",
"-1",
"1",
"System.out.println(v)",
"System.out.println",
"System.out",
"System",
"System.out",
"v",
"String args[]",
"args",
"public class Main\n{\n public static void main(String args[])\n {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int a[] = new int[m];\n int s=0;\n int v=-1;\n for(int i=0;i<m;i++)\n {\n a[i]=sc.nextInt();\n s+=a[i];\n }\n if(n>s)\n v=n-s;\n else if(n==s)\n v=0;\n else\n v=-1;\n System.out.println(v);\n \n }\n}",
"public class Main\n{\n public static void main(String args[])\n {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int a[] = new int[m];\n int s=0;\n int v=-1;\n for(int i=0;i<m;i++)\n {\n a[i]=sc.nextInt();\n s+=a[i];\n }\n if(n>s)\n v=n-s;\n else if(n==s)\n v=0;\n else\n v=-1;\n System.out.println(v);\n \n }\n}",
"Main"
] |
import java.util.*;
public class Main
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int a[] = new int[m];
int s=0;
int v=-1;
for(int i=0;i<m;i++)
{
a[i]=sc.nextInt();
s+=a[i];
}
if(n>s)
v=n-s;
else if(n==s)
v=0;
else
v=-1;
System.out.println(v);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
17,
28,
13,
13,
30,
30,
41,
13,
4,
18,
13,
13,
0,
13,
2,
13,
13,
14,
2,
2,
13,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
81,
5
],
[
81,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
14,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
30,
35
],
[
8,
36
],
[
36,
37
],
[
36,
38
],
[
8,
39
],
[
39,
40
],
[
39,
41
],
[
39,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
43,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
55,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
75,
77
],
[
6,
78
],
[
78,
79
],
[
0,
80
],
[
80,
81
],
[
80,
82
]
] |
[
"//package beg_163;\n\nimport java.util.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner s = new Scanner(System.in);\n\t\tString[] a = s.nextLine().split(\" \");\n\t\t\n\t\tint b = Integer.parseInt(a[0]);\n\t\t\n\t\tString[] list = s.nextLine().split(\" \");\n\t\tint count=0;\n\t\tfor (String i: list) {\n\t\t\tint k = Integer.parseInt(i);\n\t\t\tcount=count+k;\n\t\t}\n\t\tif (b-count<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(b-count);\n\t\t}\n\t}\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner s = new Scanner(System.in);\n\t\tString[] a = s.nextLine().split(\" \");\n\t\t\n\t\tint b = Integer.parseInt(a[0]);\n\t\t\n\t\tString[] list = s.nextLine().split(\" \");\n\t\tint count=0;\n\t\tfor (String i: list) {\n\t\t\tint k = Integer.parseInt(i);\n\t\t\tcount=count+k;\n\t\t}\n\t\tif (b-count<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(b-count);\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner s = new Scanner(System.in);\n\t\tString[] a = s.nextLine().split(\" \");\n\t\t\n\t\tint b = Integer.parseInt(a[0]);\n\t\t\n\t\tString[] list = s.nextLine().split(\" \");\n\t\tint count=0;\n\t\tfor (String i: list) {\n\t\t\tint k = Integer.parseInt(i);\n\t\t\tcount=count+k;\n\t\t}\n\t\tif (b-count<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(b-count);\n\t\t}\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner s = new Scanner(System.in);\n\t\tString[] a = s.nextLine().split(\" \");\n\t\t\n\t\tint b = Integer.parseInt(a[0]);\n\t\t\n\t\tString[] list = s.nextLine().split(\" \");\n\t\tint count=0;\n\t\tfor (String i: list) {\n\t\t\tint k = Integer.parseInt(i);\n\t\t\tcount=count+k;\n\t\t}\n\t\tif (b-count<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(b-count);\n\t\t}\n\t}",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"String[] a = s.nextLine().split(\" \");",
"a",
"s.nextLine().split(\" \")",
"s.nextLine().split",
"s.nextLine()",
"s.nextLine",
"s",
"\" \"",
"int b = Integer.parseInt(a[0]);",
"b",
"Integer.parseInt(a[0])",
"Integer.parseInt",
"Integer",
"a[0]",
"a",
"0",
"String[] list = s.nextLine().split(\" \");",
"list",
"s.nextLine().split(\" \")",
"s.nextLine().split",
"s.nextLine()",
"s.nextLine",
"s",
"\" \"",
"int count=0;",
"count",
"0",
"for (String i: list) {\n\t\t\tint k = Integer.parseInt(i);\n\t\t\tcount=count+k;\n\t\t}",
"String i",
"list",
"{\n\t\t\tint k = Integer.parseInt(i);\n\t\t\tcount=count+k;\n\t\t}",
"{\n\t\t\tint k = Integer.parseInt(i);\n\t\t\tcount=count+k;\n\t\t}",
"int k = Integer.parseInt(i);",
"k",
"Integer.parseInt(i)",
"Integer.parseInt",
"Integer",
"i",
"count=count+k",
"count",
"count+k",
"count",
"k",
"if (b-count<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(b-count);\n\t\t}",
"b-count<0",
"b-count",
"b",
"count",
"0",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(b-count);\n\t\t}",
"System.out.println(b-count)",
"System.out.println",
"System.out",
"System",
"System.out",
"b-count",
"b",
"count",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner s = new Scanner(System.in);\n\t\tString[] a = s.nextLine().split(\" \");\n\t\t\n\t\tint b = Integer.parseInt(a[0]);\n\t\t\n\t\tString[] list = s.nextLine().split(\" \");\n\t\tint count=0;\n\t\tfor (String i: list) {\n\t\t\tint k = Integer.parseInt(i);\n\t\t\tcount=count+k;\n\t\t}\n\t\tif (b-count<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(b-count);\n\t\t}\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner s = new Scanner(System.in);\n\t\tString[] a = s.nextLine().split(\" \");\n\t\t\n\t\tint b = Integer.parseInt(a[0]);\n\t\t\n\t\tString[] list = s.nextLine().split(\" \");\n\t\tint count=0;\n\t\tfor (String i: list) {\n\t\t\tint k = Integer.parseInt(i);\n\t\t\tcount=count+k;\n\t\t}\n\t\tif (b-count<0) {\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(b-count);\n\t\t}\n\t}\n\n}",
"Main"
] |
//package beg_163;
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s = new Scanner(System.in);
String[] a = s.nextLine().split(" ");
int b = Integer.parseInt(a[0]);
String[] list = s.nextLine().split(" ");
int count=0;
for (String i: list) {
int k = Integer.parseInt(i);
count=count+k;
}
if (b-count<0) {
System.out.println(-1);
}
else {
System.out.println(b-count);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
2,
13,
13,
40,
17,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
68,
5
],
[
68,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
43,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
43,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
6,
65
],
[
65,
66
],
[
0,
67
],
[
67,
68
],
[
67,
69
]
] |
[
"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 m=scan.nextInt();\n\n long cnt=0;\n for(int i=0;i<m;i++){\n cnt+=scan.nextLong();\n }\n if(n-cnt>-1) System.out.println(n-cnt);\n else System.out.println(-1);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n int n=scan.nextInt();\n int m=scan.nextInt();\n\n long cnt=0;\n for(int i=0;i<m;i++){\n cnt+=scan.nextLong();\n }\n if(n-cnt>-1) System.out.println(n-cnt);\n else System.out.println(-1);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n int n=scan.nextInt();\n int m=scan.nextInt();\n\n long cnt=0;\n for(int i=0;i<m;i++){\n cnt+=scan.nextLong();\n }\n if(n-cnt>-1) System.out.println(n-cnt);\n else System.out.println(-1);\n }",
"main",
"{\n Scanner scan=new Scanner(System.in);\n int n=scan.nextInt();\n int m=scan.nextInt();\n\n long cnt=0;\n for(int i=0;i<m;i++){\n cnt+=scan.nextLong();\n }\n if(n-cnt>-1) System.out.println(n-cnt);\n else System.out.println(-1);\n }",
"Scanner scan=new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n=scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int m=scan.nextInt();",
"m",
"scan.nextInt()",
"scan.nextInt",
"scan",
"long cnt=0;",
"cnt",
"0",
"for(int i=0;i<m;i++){\n cnt+=scan.nextLong();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n cnt+=scan.nextLong();\n }",
"{\n cnt+=scan.nextLong();\n }",
"cnt+=scan.nextLong()",
"cnt",
"scan.nextLong()",
"scan.nextLong",
"scan",
"if(n-cnt>-1) System.out.println(n-cnt);\n else System.out.println(-1);",
"n-cnt>-1",
"n-cnt",
"n",
"cnt",
"-1",
"1",
"System.out.println(n-cnt)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-cnt",
"n",
"cnt",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n int n=scan.nextInt();\n int m=scan.nextInt();\n\n long cnt=0;\n for(int i=0;i<m;i++){\n cnt+=scan.nextLong();\n }\n if(n-cnt>-1) System.out.println(n-cnt);\n else System.out.println(-1);\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner scan=new Scanner(System.in);\n int n=scan.nextInt();\n int m=scan.nextInt();\n\n long cnt=0;\n for(int i=0;i<m;i++){\n cnt+=scan.nextLong();\n }\n if(n-cnt>-1) System.out.println(n-cnt);\n else System.out.println(-1);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan=new Scanner(System.in);
int n=scan.nextInt();
int m=scan.nextInt();
long cnt=0;
for(int i=0;i<m;i++){
cnt+=scan.nextLong();
}
if(n-cnt>-1) System.out.println(n-cnt);
else System.out.println(-1);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
8,
2,
13,
13,
40,
17,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
69,
11
],
[
69,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
14,
28
],
[
28,
29
],
[
29,
30
],
[
14,
31
],
[
31,
32
],
[
31,
33
],
[
14,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
14,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
57,
61
],
[
61,
62
],
[
57,
63
],
[
63,
64
],
[
63,
65
],
[
12,
66
],
[
66,
67
],
[
0,
68
],
[
68,
69
],
[
68,
70
]
] |
[
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n final int s = in.nextInt();\n final int n = in.nextInt();\n in.nextLine();\n int total = 0;\n for (int i = 0; i < n; i++) {\n total += in.nextInt();\n }\n System.out.println(total > s ? -1 : s - total);\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n final int s = in.nextInt();\n final int n = in.nextInt();\n in.nextLine();\n int total = 0;\n for (int i = 0; i < n; i++) {\n total += in.nextInt();\n }\n System.out.println(total > s ? -1 : s - total);\n }\n}",
"Main",
"public static void main(String[] args) {\n final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n final int s = in.nextInt();\n final int n = in.nextInt();\n in.nextLine();\n int total = 0;\n for (int i = 0; i < n; i++) {\n total += in.nextInt();\n }\n System.out.println(total > s ? -1 : s - total);\n }",
"main",
"{\n final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n final int s = in.nextInt();\n final int n = in.nextInt();\n in.nextLine();\n int total = 0;\n for (int i = 0; i < n; i++) {\n total += in.nextInt();\n }\n System.out.println(total > s ? -1 : s - total);\n }",
"final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));",
"in",
"new Scanner(new BufferedReader(new InputStreamReader(System.in)))",
"final int s = in.nextInt();",
"s",
"in.nextInt()",
"in.nextInt",
"in",
"final int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"in.nextLine()",
"in.nextLine",
"in",
"int total = 0;",
"total",
"0",
"for (int i = 0; i < n; i++) {\n total += in.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n total += in.nextInt();\n }",
"{\n total += in.nextInt();\n }",
"total += in.nextInt()",
"total",
"in.nextInt()",
"in.nextInt",
"in",
"System.out.println(total > s ? -1 : s - total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total > s ? -1 : s - total",
"total > s",
"total",
"s",
"-1",
"1",
"s - total",
"s",
"total",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n final int s = in.nextInt();\n final int n = in.nextInt();\n in.nextLine();\n int total = 0;\n for (int i = 0; i < n; i++) {\n total += in.nextInt();\n }\n System.out.println(total > s ? -1 : s - total);\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n final int s = in.nextInt();\n final int n = in.nextInt();\n in.nextLine();\n int total = 0;\n for (int i = 0; i < n; i++) {\n total += in.nextInt();\n }\n System.out.println(total > s ? -1 : s - total);\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
final int s = in.nextInt();
final int n = in.nextInt();
in.nextLine();
int total = 0;
for (int i = 0; i < n; i++) {
total += in.nextInt();
}
System.out.println(total > s ? -1 : s - total);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
42,
2,
13,
13,
30,
0,
13,
4,
18,
13,
40,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
66,
5
],
[
66,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
8,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
28,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
32,
38
],
[
38,
39
],
[
8,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
45,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
57,
62
],
[
6,
63
],
[
63,
64
],
[
0,
65
],
[
65,
66
],
[
65,
67
]
] |
[
"import java.util.*;\npublic class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 休みの総数\n int vacation = sc.nextInt();\n\n // 宿題の数\n int homework = sc.nextInt();\n\n int count = 0;\n int totalDays = 0;\n while (count < homework) {\n // かかる日数\n totalDays += sc.nextInt();\n count++;\n }\n int result = vacation - totalDays;\n if (result >= 0) {\n\t System.out.println(result);\n } else {\n\t System.out.println(\"-1\");\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 休みの総数\n int vacation = sc.nextInt();\n\n // 宿題の数\n int homework = sc.nextInt();\n\n int count = 0;\n int totalDays = 0;\n while (count < homework) {\n // かかる日数\n totalDays += sc.nextInt();\n count++;\n }\n int result = vacation - totalDays;\n if (result >= 0) {\n\t System.out.println(result);\n } else {\n\t System.out.println(\"-1\");\n }\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 休みの総数\n int vacation = sc.nextInt();\n\n // 宿題の数\n int homework = sc.nextInt();\n\n int count = 0;\n int totalDays = 0;\n while (count < homework) {\n // かかる日数\n totalDays += sc.nextInt();\n count++;\n }\n int result = vacation - totalDays;\n if (result >= 0) {\n\t System.out.println(result);\n } else {\n\t System.out.println(\"-1\");\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n \n // 休みの総数\n int vacation = sc.nextInt();\n\n // 宿題の数\n int homework = sc.nextInt();\n\n int count = 0;\n int totalDays = 0;\n while (count < homework) {\n // かかる日数\n totalDays += sc.nextInt();\n count++;\n }\n int result = vacation - totalDays;\n if (result >= 0) {\n\t System.out.println(result);\n } else {\n\t System.out.println(\"-1\");\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int vacation = sc.nextInt();",
"vacation",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int homework = sc.nextInt();",
"homework",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int count = 0;",
"count",
"0",
"int totalDays = 0;",
"totalDays",
"0",
"while (count < homework) {\n // かかる日数\n totalDays += sc.nextInt();\n count++;\n }",
"count < homework",
"count",
"homework",
"{\n // かかる日数\n totalDays += sc.nextInt();\n count++;\n }",
"totalDays += sc.nextInt()",
"totalDays",
"sc.nextInt()",
"sc.nextInt",
"sc",
"count++",
"count",
"int result = vacation - totalDays;",
"result",
"vacation - totalDays",
"vacation",
"totalDays",
"if (result >= 0) {\n\t System.out.println(result);\n } else {\n\t System.out.println(\"-1\");\n }",
"result >= 0",
"result",
"0",
"{\n\t System.out.println(result);\n }",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"{\n\t System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 休みの総数\n int vacation = sc.nextInt();\n\n // 宿題の数\n int homework = sc.nextInt();\n\n int count = 0;\n int totalDays = 0;\n while (count < homework) {\n // かかる日数\n totalDays += sc.nextInt();\n count++;\n }\n int result = vacation - totalDays;\n if (result >= 0) {\n\t System.out.println(result);\n } else {\n\t System.out.println(\"-1\");\n }\n }\n}",
"public class Main {\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n \n // 休みの総数\n int vacation = sc.nextInt();\n\n // 宿題の数\n int homework = sc.nextInt();\n\n int count = 0;\n int totalDays = 0;\n while (count < homework) {\n // かかる日数\n totalDays += sc.nextInt();\n count++;\n }\n int result = vacation - totalDays;\n if (result >= 0) {\n\t System.out.println(result);\n } else {\n\t System.out.println(\"-1\");\n }\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
// 休みの総数
int vacation = sc.nextInt();
// 宿題の数
int homework = sc.nextInt();
int count = 0;
int totalDays = 0;
while (count < homework) {
// かかる日数
totalDays += sc.nextInt();
count++;
}
int result = vacation - totalDays;
if (result >= 0) {
System.out.println(result);
} else {
System.out.println("-1");
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
19,
20
],
[
8,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
8,
26
],
[
26,
27
],
[
26,
28
],
[
8,
30
],
[
30,
31
],
[
30,
32
],
[
8,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
33,
41
],
[
41,
42
],
[
42,
43
],
[
33,
44
],
[
45,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
8,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
83,
84
],
[
73,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
86,
91
],
[
6,
92
],
[
92,
93
]
] |
[
"import java.util.Scanner;\nclass Main {\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n , m;\n n = sc.nextInt();\n m = sc.nextInt();\n int[] A = new int[m];\n int i = 0;\n for(i=0 ; i < m ; i++){\n A[i] = sc.nextInt();\n }\n for(i = 0; i < m; i++){\n n = n - A[i];\n }\n if(n < 0){\n System.out.println(-1);\n }else{\n System.out.println(n);\n }\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n , m;\n n = sc.nextInt();\n m = sc.nextInt();\n int[] A = new int[m];\n int i = 0;\n for(i=0 ; i < m ; i++){\n A[i] = sc.nextInt();\n }\n for(i = 0; i < m; i++){\n n = n - A[i];\n }\n if(n < 0){\n System.out.println(-1);\n }else{\n System.out.println(n);\n }\n }\n}",
"Main",
"public static void main(String args[]){\n Scanner sc = new Scanner(System.in);\n int n , m;\n n = sc.nextInt();\n m = sc.nextInt();\n int[] A = new int[m];\n int i = 0;\n for(i=0 ; i < m ; i++){\n A[i] = sc.nextInt();\n }\n for(i = 0; i < m; i++){\n n = n - A[i];\n }\n if(n < 0){\n System.out.println(-1);\n }else{\n System.out.println(n);\n }\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n , m;\n n = sc.nextInt();\n m = sc.nextInt();\n int[] A = new int[m];\n int i = 0;\n for(i=0 ; i < m ; i++){\n A[i] = sc.nextInt();\n }\n for(i = 0; i < m; i++){\n n = n - A[i];\n }\n if(n < 0){\n System.out.println(-1);\n }else{\n System.out.println(n);\n }\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n",
"n",
"m;",
"m",
"n = sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"m = sc.nextInt()",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = new int[m];",
"A",
"new int[m]",
"m",
"int i = 0;",
"i",
"0",
"for(i=0 ; i < m ; i++){\n A[i] = sc.nextInt();\n }",
"i=0 ;",
"i=0",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n A[i] = sc.nextInt();\n }",
"{\n A[i] = sc.nextInt();\n }",
"A[i] = sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(i = 0; i < m; i++){\n n = n - A[i];\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"{\n n = n - A[i];\n }",
"{\n n = n - A[i];\n }",
"n = n - A[i]",
"n",
"n - A[i]",
"n",
"A[i]",
"A",
"i",
"if(n < 0){\n System.out.println(-1);\n }else{\n System.out.println(n);\n }",
"n < 0",
"n",
"0",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(n);\n }",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"String args[]",
"args"
] |
import java.util.Scanner;
class Main {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int n , m;
n = sc.nextInt();
m = sc.nextInt();
int[] A = new int[m];
int i = 0;
for(i=0 ; i < m ; i++){
A[i] = sc.nextInt();
}
for(i = 0; i < m; i++){
n = n - A[i];
}
if(n < 0){
System.out.println(-1);
}else{
System.out.println(n);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
40,
17,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
37,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
48,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
59,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
6,
71
],
[
71,
72
]
] |
[
"import java.util.Scanner;\nclass Main{\npublic static void main(String[]args){\n\nScanner sc=new Scanner(System.in);\nint N=sc.nextInt();\nint M=sc.nextInt();\n\nint num=0;\n\nfor(int n=0;n<M;n++){\nint An=sc.nextInt();\nN=N-An;\n}\nif(N>=0){\nSystem.out.println(N);\n}else if(N<0){\nSystem.out.println(-1);\n}\n}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\npublic static void main(String[]args){\n\nScanner sc=new Scanner(System.in);\nint N=sc.nextInt();\nint M=sc.nextInt();\n\nint num=0;\n\nfor(int n=0;n<M;n++){\nint An=sc.nextInt();\nN=N-An;\n}\nif(N>=0){\nSystem.out.println(N);\n}else if(N<0){\nSystem.out.println(-1);\n}\n}\n}",
"Main",
"public static void main(String[]args){\n\nScanner sc=new Scanner(System.in);\nint N=sc.nextInt();\nint M=sc.nextInt();\n\nint num=0;\n\nfor(int n=0;n<M;n++){\nint An=sc.nextInt();\nN=N-An;\n}\nif(N>=0){\nSystem.out.println(N);\n}else if(N<0){\nSystem.out.println(-1);\n}\n}",
"main",
"{\n\nScanner sc=new Scanner(System.in);\nint N=sc.nextInt();\nint M=sc.nextInt();\n\nint num=0;\n\nfor(int n=0;n<M;n++){\nint An=sc.nextInt();\nN=N-An;\n}\nif(N>=0){\nSystem.out.println(N);\n}else if(N<0){\nSystem.out.println(-1);\n}\n}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N=sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M=sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int num=0;",
"num",
"0",
"for(int n=0;n<M;n++){\nint An=sc.nextInt();\nN=N-An;\n}",
"int n=0;",
"int n=0;",
"n",
"0",
"n<M",
"n",
"M",
"n++",
"n++",
"n",
"{\nint An=sc.nextInt();\nN=N-An;\n}",
"{\nint An=sc.nextInt();\nN=N-An;\n}",
"int An=sc.nextInt();",
"An",
"sc.nextInt()",
"sc.nextInt",
"sc",
"N=N-An",
"N",
"N-An",
"N",
"An",
"if(N>=0){\nSystem.out.println(N);\n}else if(N<0){\nSystem.out.println(-1);\n}",
"N>=0",
"N",
"0",
"{\nSystem.out.println(N);\n}",
"System.out.println(N)",
"System.out.println",
"System.out",
"System",
"System.out",
"N",
"if(N<0){\nSystem.out.println(-1);\n}",
"N<0",
"N",
"0",
"{\nSystem.out.println(-1);\n}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[]args",
"args"
] |
import java.util.Scanner;
class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
int N=sc.nextInt();
int M=sc.nextInt();
int num=0;
for(int n=0;n<M;n++){
int An=sc.nextInt();
N=N-An;
}
if(N>=0){
System.out.println(N);
}else if(N<0){
System.out.println(-1);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
18,
13,
13,
2,
17,
4,
18,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
4,
18,
13,
17,
41,
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,
18,
13,
13,
0,
13,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
12,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
18,
13,
13,
17,
17,
30,
40,
13,
14,
2,
13,
17,
30,
29,
17,
29,
17,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
24,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
44,
49
],
[
38,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
55,
57
],
[
38,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
63,
64
],
[
63,
65
],
[
38,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
68,
73
],
[
38,
74
],
[
74,
75
],
[
74,
76
],
[
38,
78
],
[
78,
79
],
[
78,
80
],
[
38,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
86,
87
],
[
86,
88
],
[
81,
89
],
[
89,
90
],
[
90,
91
],
[
81,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
101,
103
],
[
93,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
106,
108
],
[
38,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
114,
119
],
[
119,
120
],
[
109,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
122,
127
],
[
127,
128
],
[
127,
129
],
[
21,
130
],
[
130,
131
],
[
19,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
145,
147
],
[
138,
148
],
[
148,
149
],
[
149,
150
],
[
138,
151
],
[
152,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
154,
160
],
[
153,
161
],
[
161,
162
],
[
162,
163
],
[
134,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
169,
170
],
[
134,
171
],
[
171,
172
],
[
132,
173
],
[
173,
174
]
] |
[
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.List;\n\nclass Main {\n public static void main(String[] args){\n try{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String[] ss=br.readLine().split(\" \");\n int n=Integer.parseInt(ss[0]);\n int m=Integer.parseInt(ss[1]);\n ss=br.readLine().split(\" \");\n int[] arr=new int[m];\n long sum=0;\n for(int j=0;j<m;j++){\n arr[j]=Integer.parseInt(ss[j]);\n sum+=arr[j];\n }\n if(sum>n){\n System.out.println(-1);\n }else{\n System.out.println(n-sum);\n }\n\n\n\n }catch(Exception e){\n System.out.println(\"KKKK \"+e.getMessage());\n }\n }\n static boolean check(int[] arr){\n int odd=0;\n for(int i=0;i<arr.length;i++){\n if(arr[i]%2!=0){\n odd++;\n }\n }\n if(odd<=1){\n return true;\n }\n return false;\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.HashMap;",
"HashMap",
"java.util",
"import java.util.HashSet;",
"HashSet",
"java.util",
"import java.util.List;",
"List",
"java.util",
"class Main {\n public static void main(String[] args){\n try{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String[] ss=br.readLine().split(\" \");\n int n=Integer.parseInt(ss[0]);\n int m=Integer.parseInt(ss[1]);\n ss=br.readLine().split(\" \");\n int[] arr=new int[m];\n long sum=0;\n for(int j=0;j<m;j++){\n arr[j]=Integer.parseInt(ss[j]);\n sum+=arr[j];\n }\n if(sum>n){\n System.out.println(-1);\n }else{\n System.out.println(n-sum);\n }\n\n\n\n }catch(Exception e){\n System.out.println(\"KKKK \"+e.getMessage());\n }\n }\n static boolean check(int[] arr){\n int odd=0;\n for(int i=0;i<arr.length;i++){\n if(arr[i]%2!=0){\n odd++;\n }\n }\n if(odd<=1){\n return true;\n }\n return false;\n }\n}",
"Main",
"public static void main(String[] args){\n try{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String[] ss=br.readLine().split(\" \");\n int n=Integer.parseInt(ss[0]);\n int m=Integer.parseInt(ss[1]);\n ss=br.readLine().split(\" \");\n int[] arr=new int[m];\n long sum=0;\n for(int j=0;j<m;j++){\n arr[j]=Integer.parseInt(ss[j]);\n sum+=arr[j];\n }\n if(sum>n){\n System.out.println(-1);\n }else{\n System.out.println(n-sum);\n }\n\n\n\n }catch(Exception e){\n System.out.println(\"KKKK \"+e.getMessage());\n }\n }",
"main",
"{\n try{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String[] ss=br.readLine().split(\" \");\n int n=Integer.parseInt(ss[0]);\n int m=Integer.parseInt(ss[1]);\n ss=br.readLine().split(\" \");\n int[] arr=new int[m];\n long sum=0;\n for(int j=0;j<m;j++){\n arr[j]=Integer.parseInt(ss[j]);\n sum+=arr[j];\n }\n if(sum>n){\n System.out.println(-1);\n }else{\n System.out.println(n-sum);\n }\n\n\n\n }catch(Exception e){\n System.out.println(\"KKKK \"+e.getMessage());\n }\n }",
"try{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String[] ss=br.readLine().split(\" \");\n int n=Integer.parseInt(ss[0]);\n int m=Integer.parseInt(ss[1]);\n ss=br.readLine().split(\" \");\n int[] arr=new int[m];\n long sum=0;\n for(int j=0;j<m;j++){\n arr[j]=Integer.parseInt(ss[j]);\n sum+=arr[j];\n }\n if(sum>n){\n System.out.println(-1);\n }else{\n System.out.println(n-sum);\n }\n\n\n\n }catch(Exception e){\n System.out.println(\"KKKK \"+e.getMessage());\n }",
"catch(Exception e){\n System.out.println(\"KKKK \"+e.getMessage());\n }",
"Exception e",
"{\n System.out.println(\"KKKK \"+e.getMessage());\n }",
"System.out.println(\"KKKK \"+e.getMessage())",
"System.out.println",
"System.out",
"System",
"System.out",
"\"KKKK \"+e.getMessage()",
"\"KKKK \"",
"e.getMessage()",
"e.getMessage",
"e",
"{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n String[] ss=br.readLine().split(\" \");\n int n=Integer.parseInt(ss[0]);\n int m=Integer.parseInt(ss[1]);\n ss=br.readLine().split(\" \");\n int[] arr=new int[m];\n long sum=0;\n for(int j=0;j<m;j++){\n arr[j]=Integer.parseInt(ss[j]);\n sum+=arr[j];\n }\n if(sum>n){\n System.out.println(-1);\n }else{\n System.out.println(n-sum);\n }\n\n\n\n }",
"BufferedReader br=new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] ss=br.readLine().split(\" \");",
"ss",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int n=Integer.parseInt(ss[0]);",
"n",
"Integer.parseInt(ss[0])",
"Integer.parseInt",
"Integer",
"ss[0]",
"ss",
"0",
"int m=Integer.parseInt(ss[1]);",
"m",
"Integer.parseInt(ss[1])",
"Integer.parseInt",
"Integer",
"ss[1]",
"ss",
"1",
"ss=br.readLine().split(\" \")",
"ss",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int[] arr=new int[m];",
"arr",
"new int[m]",
"m",
"long sum=0;",
"sum",
"0",
"for(int j=0;j<m;j++){\n arr[j]=Integer.parseInt(ss[j]);\n sum+=arr[j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<m",
"j",
"m",
"j++",
"j++",
"j",
"{\n arr[j]=Integer.parseInt(ss[j]);\n sum+=arr[j];\n }",
"{\n arr[j]=Integer.parseInt(ss[j]);\n sum+=arr[j];\n }",
"arr[j]=Integer.parseInt(ss[j])",
"arr[j]",
"arr",
"j",
"Integer.parseInt(ss[j])",
"Integer.parseInt",
"Integer",
"ss[j]",
"ss",
"j",
"sum+=arr[j]",
"sum",
"arr[j]",
"arr",
"j",
"if(sum>n){\n System.out.println(-1);\n }else{\n System.out.println(n-sum);\n }",
"sum>n",
"sum",
"n",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(n-sum);\n }",
"System.out.println(n-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n-sum",
"n",
"sum",
"String[] args",
"args",
"static boolean check(int[] arr){\n int odd=0;\n for(int i=0;i<arr.length;i++){\n if(arr[i]%2!=0){\n odd++;\n }\n }\n if(odd<=1){\n return true;\n }\n return false;\n }",
"check",
"{\n int odd=0;\n for(int i=0;i<arr.length;i++){\n if(arr[i]%2!=0){\n odd++;\n }\n }\n if(odd<=1){\n return true;\n }\n return false;\n }",
"int odd=0;",
"odd",
"0",
"for(int i=0;i<arr.length;i++){\n if(arr[i]%2!=0){\n odd++;\n }\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n if(arr[i]%2!=0){\n odd++;\n }\n }",
"{\n if(arr[i]%2!=0){\n odd++;\n }\n }",
"if(arr[i]%2!=0){\n odd++;\n }",
"arr[i]%2!=0",
"arr[i]%2",
"arr[i]",
"arr",
"i",
"2",
"0",
"{\n odd++;\n }",
"odd++",
"odd",
"if(odd<=1){\n return true;\n }",
"odd<=1",
"odd",
"1",
"{\n return true;\n }",
"return true;",
"true",
"return false;",
"false",
"int[] arr",
"arr"
] |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
class Main {
public static void main(String[] args){
try{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] ss=br.readLine().split(" ");
int n=Integer.parseInt(ss[0]);
int m=Integer.parseInt(ss[1]);
ss=br.readLine().split(" ");
int[] arr=new int[m];
long sum=0;
for(int j=0;j<m;j++){
arr[j]=Integer.parseInt(ss[j]);
sum+=arr[j];
}
if(sum>n){
System.out.println(-1);
}else{
System.out.println(n-sum);
}
}catch(Exception e){
System.out.println("KKKK "+e.getMessage());
}
}
static boolean check(int[] arr){
int odd=0;
for(int i=0;i<arr.length;i++){
if(arr[i]%2!=0){
odd++;
}
}
if(odd<=1){
return true;
}
return false;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
0,
13,
2,
13,
18,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
78,
5
],
[
78,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
39,
43
],
[
43,
44
],
[
44,
45
],
[
38,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
53,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
53,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
8,
72
],
[
72,
73
],
[
73,
74
],
[
6,
75
],
[
75,
76
],
[
0,
77
],
[
77,
78
],
[
77,
79
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint M = stdIn.nextInt();\n\t\tint[] A = new int[M];\n\t\tfor(int a = 0; a < M; a++){\n\t\t\tA[a] = stdIn.nextInt();\n\t\t\tN = N - A[a];\n\t\t}\n\t\tif(N >= 0){\n\t\t\tSystem.out.println(N);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tstdIn.close();\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint M = stdIn.nextInt();\n\t\tint[] A = new int[M];\n\t\tfor(int a = 0; a < M; a++){\n\t\t\tA[a] = stdIn.nextInt();\n\t\t\tN = N - A[a];\n\t\t}\n\t\tif(N >= 0){\n\t\t\tSystem.out.println(N);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tstdIn.close();\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint M = stdIn.nextInt();\n\t\tint[] A = new int[M];\n\t\tfor(int a = 0; a < M; a++){\n\t\t\tA[a] = stdIn.nextInt();\n\t\t\tN = N - A[a];\n\t\t}\n\t\tif(N >= 0){\n\t\t\tSystem.out.println(N);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tstdIn.close();\n\t}",
"main",
"{\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint M = stdIn.nextInt();\n\t\tint[] A = new int[M];\n\t\tfor(int a = 0; a < M; a++){\n\t\t\tA[a] = stdIn.nextInt();\n\t\t\tN = N - A[a];\n\t\t}\n\t\tif(N >= 0){\n\t\t\tSystem.out.println(N);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tstdIn.close();\n\t}",
"Scanner stdIn = new Scanner(System.in);",
"stdIn",
"new Scanner(System.in)",
"int N = stdIn.nextInt();",
"N",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int M = stdIn.nextInt();",
"M",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"int[] A = new int[M];",
"A",
"new int[M]",
"M",
"for(int a = 0; a < M; a++){\n\t\t\tA[a] = stdIn.nextInt();\n\t\t\tN = N - A[a];\n\t\t}",
"int a = 0;",
"int a = 0;",
"a",
"0",
"a < M",
"a",
"M",
"a++",
"a++",
"a",
"{\n\t\t\tA[a] = stdIn.nextInt();\n\t\t\tN = N - A[a];\n\t\t}",
"{\n\t\t\tA[a] = stdIn.nextInt();\n\t\t\tN = N - A[a];\n\t\t}",
"A[a] = stdIn.nextInt()",
"A[a]",
"A",
"a",
"stdIn.nextInt()",
"stdIn.nextInt",
"stdIn",
"N = N - A[a]",
"N",
"N - A[a]",
"N",
"A[a]",
"A",
"a",
"if(N >= 0){\n\t\t\tSystem.out.println(N);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"N >= 0",
"N",
"0",
"{\n\t\t\tSystem.out.println(N);\n\t\t}",
"System.out.println(N)",
"System.out.println",
"System.out",
"System",
"System.out",
"N",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"stdIn.close()",
"stdIn.close",
"stdIn",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint M = stdIn.nextInt();\n\t\tint[] A = new int[M];\n\t\tfor(int a = 0; a < M; a++){\n\t\t\tA[a] = stdIn.nextInt();\n\t\t\tN = N - A[a];\n\t\t}\n\t\tif(N >= 0){\n\t\t\tSystem.out.println(N);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tstdIn.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner stdIn = new Scanner(System.in);\n\t\tint N = stdIn.nextInt();\n\t\tint M = stdIn.nextInt();\n\t\tint[] A = new int[M];\n\t\tfor(int a = 0; a < M; a++){\n\t\t\tA[a] = stdIn.nextInt();\n\t\t\tN = N - A[a];\n\t\t}\n\t\tif(N >= 0){\n\t\t\tSystem.out.println(N);\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(-1);\n\t\t}\n\t\tstdIn.close();\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
int N = stdIn.nextInt();
int M = stdIn.nextInt();
int[] A = new int[M];
for(int a = 0; a < M; a++){
A[a] = stdIn.nextInt();
N = N - A[a];
}
if(N >= 0){
System.out.println(N);
}
else{
System.out.println(-1);
}
stdIn.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
17,
30,
0,
13,
40,
17,
3,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
59,
5
],
[
59,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
22,
27
],
[
27,
28
],
[
27,
29
],
[
22,
30
],
[
30,
31
],
[
31,
32
],
[
22,
33
],
[
34,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
34,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
44,
49
],
[
8,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
6,
56
],
[
56,
57
],
[
0,
58
],
[
58,
59
],
[
58,
60
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int days = sc.nextInt();\n int n = sc.nextInt();\n \n for (int i = 0; i < n; i++) {\n days -= sc.nextInt();\n if (days < 0) {\n days = -1;\n break;\n }\n }\n \n System.out.println(days);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int days = sc.nextInt();\n int n = sc.nextInt();\n \n for (int i = 0; i < n; i++) {\n days -= sc.nextInt();\n if (days < 0) {\n days = -1;\n break;\n }\n }\n \n System.out.println(days);\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int days = sc.nextInt();\n int n = sc.nextInt();\n \n for (int i = 0; i < n; i++) {\n days -= sc.nextInt();\n if (days < 0) {\n days = -1;\n break;\n }\n }\n \n System.out.println(days);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int days = sc.nextInt();\n int n = sc.nextInt();\n \n for (int i = 0; i < n; i++) {\n days -= sc.nextInt();\n if (days < 0) {\n days = -1;\n break;\n }\n }\n \n System.out.println(days);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int days = sc.nextInt();",
"days",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < n; i++) {\n days -= sc.nextInt();\n if (days < 0) {\n days = -1;\n break;\n }\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n days -= sc.nextInt();\n if (days < 0) {\n days = -1;\n break;\n }\n }",
"{\n days -= sc.nextInt();\n if (days < 0) {\n days = -1;\n break;\n }\n }",
"days -= sc.nextInt()",
"days",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if (days < 0) {\n days = -1;\n break;\n }",
"days < 0",
"days",
"0",
"{\n days = -1;\n break;\n }",
"days = -1",
"days",
"-1",
"1",
"break;",
"System.out.println(days)",
"System.out.println",
"System.out",
"System",
"System.out",
"days",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int days = sc.nextInt();\n int n = sc.nextInt();\n \n for (int i = 0; i < n; i++) {\n days -= sc.nextInt();\n if (days < 0) {\n days = -1;\n break;\n }\n }\n \n System.out.println(days);\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int days = sc.nextInt();\n int n = sc.nextInt();\n \n for (int i = 0; i < n; i++) {\n days -= sc.nextInt();\n if (days < 0) {\n days = -1;\n break;\n }\n }\n \n System.out.println(days);\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int days = sc.nextInt();
int n = sc.nextInt();
for (int i = 0; i < n; i++) {
days -= sc.nextInt();
if (days < 0) {
days = -1;
break;
}
}
System.out.println(days);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
0,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
41,
13,
17,
28,
13,
13,
30,
0,
13,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
40,
17,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
98,
11
],
[
98,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
14,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
23,
26
],
[
26,
27
],
[
27,
28
],
[
14,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
35,
36
],
[
14,
37
],
[
37,
38
],
[
37,
39
],
[
14,
41
],
[
41,
42
],
[
41,
43
],
[
14,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
44,
52
],
[
52,
53
],
[
53,
54
],
[
44,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
63,
64
],
[
64,
65
],
[
14,
66
],
[
66,
67
],
[
66,
68
],
[
14,
69
],
[
69,
70
],
[
69,
71
],
[
69,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
14,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
76,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
85,
86
],
[
76,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
87,
92
],
[
92,
93
],
[
92,
94
],
[
12,
95
],
[
95,
96
],
[
0,
97
],
[
97,
98
],
[
97,
99
]
] |
[
"/*\nIf you want to aim high, aim high\nDon't let that studying and grades consume you\nJust live life young\n******************************\nIf I'm the sun, you're the moon\nBecause when I go up, you go down\n*******************************\nI'm working for the day I will surpass you\nhttps://www.a2oj.com/Ladder16.html\n*/\nimport java.util.*;\nimport java.io.*;\nimport java.math.*;\n\n public class Main\n {\n public static void main(String omkar[]) throws Exception\n {\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in)); \n StringTokenizer st = new StringTokenizer(infile.readLine());\n int M = Integer.parseInt(st.nextToken());\n int N = Integer.parseInt(st.nextToken());\n int[] arr = new int[N];\n st = new StringTokenizer(infile.readLine());\n for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());\n long sum = 0L;\n for(int x: arr)\n sum += x;\n if(sum > M)\n System.out.println(-1);\n else\n System.out.println(M-sum);\n }\n }",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main\n {\n public static void main(String omkar[]) throws Exception\n {\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in)); \n StringTokenizer st = new StringTokenizer(infile.readLine());\n int M = Integer.parseInt(st.nextToken());\n int N = Integer.parseInt(st.nextToken());\n int[] arr = new int[N];\n st = new StringTokenizer(infile.readLine());\n for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());\n long sum = 0L;\n for(int x: arr)\n sum += x;\n if(sum > M)\n System.out.println(-1);\n else\n System.out.println(M-sum);\n }\n }",
"Main",
"public static void main(String omkar[]) throws Exception\n {\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in)); \n StringTokenizer st = new StringTokenizer(infile.readLine());\n int M = Integer.parseInt(st.nextToken());\n int N = Integer.parseInt(st.nextToken());\n int[] arr = new int[N];\n st = new StringTokenizer(infile.readLine());\n for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());\n long sum = 0L;\n for(int x: arr)\n sum += x;\n if(sum > M)\n System.out.println(-1);\n else\n System.out.println(M-sum);\n }",
"main",
"{\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in)); \n StringTokenizer st = new StringTokenizer(infile.readLine());\n int M = Integer.parseInt(st.nextToken());\n int N = Integer.parseInt(st.nextToken());\n int[] arr = new int[N];\n st = new StringTokenizer(infile.readLine());\n for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());\n long sum = 0L;\n for(int x: arr)\n sum += x;\n if(sum > M)\n System.out.println(-1);\n else\n System.out.println(M-sum);\n }",
"BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));",
"infile",
"new BufferedReader(new InputStreamReader(System.in))",
"StringTokenizer st = new StringTokenizer(infile.readLine());",
"st",
"new StringTokenizer(infile.readLine())",
"int M = Integer.parseInt(st.nextToken());",
"M",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"int N = Integer.parseInt(st.nextToken());",
"N",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"int[] arr = new int[N];",
"arr",
"new int[N]",
"N",
"st = new StringTokenizer(infile.readLine())",
"st",
"new StringTokenizer(infile.readLine())",
"for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());",
"int i=0;",
"int i=0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"arr[i] = Integer.parseInt(st.nextToken());",
"arr[i] = Integer.parseInt(st.nextToken())",
"arr[i]",
"arr",
"i",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"long sum = 0L;",
"sum",
"0L",
"for(int x: arr)\n sum += x;",
"int x",
"arr",
"sum += x;",
"sum += x",
"sum",
"x",
"if(sum > M)\n System.out.println(-1);\n else\n System.out.println(M-sum);",
"sum > M",
"sum",
"M",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.out.println(M-sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"M-sum",
"M",
"sum",
"String omkar[]",
"omkar",
"public class Main\n {\n public static void main(String omkar[]) throws Exception\n {\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in)); \n StringTokenizer st = new StringTokenizer(infile.readLine());\n int M = Integer.parseInt(st.nextToken());\n int N = Integer.parseInt(st.nextToken());\n int[] arr = new int[N];\n st = new StringTokenizer(infile.readLine());\n for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());\n long sum = 0L;\n for(int x: arr)\n sum += x;\n if(sum > M)\n System.out.println(-1);\n else\n System.out.println(M-sum);\n }\n }",
"public class Main\n {\n public static void main(String omkar[]) throws Exception\n {\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in)); \n StringTokenizer st = new StringTokenizer(infile.readLine());\n int M = Integer.parseInt(st.nextToken());\n int N = Integer.parseInt(st.nextToken());\n int[] arr = new int[N];\n st = new StringTokenizer(infile.readLine());\n for(int i=0; i < N; i++)\n arr[i] = Integer.parseInt(st.nextToken());\n long sum = 0L;\n for(int x: arr)\n sum += x;\n if(sum > M)\n System.out.println(-1);\n else\n System.out.println(M-sum);\n }\n }",
"Main"
] |
/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
If I'm the sun, you're the moon
Because when I go up, you go down
*******************************
I'm working for the day I will surpass you
https://www.a2oj.com/Ladder16.html
*/
import java.util.*;
import java.io.*;
import java.math.*;
public class Main
{
public static void main(String omkar[]) throws Exception
{
BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(infile.readLine());
int M = Integer.parseInt(st.nextToken());
int N = Integer.parseInt(st.nextToken());
int[] arr = new int[N];
st = new StringTokenizer(infile.readLine());
for(int i=0; i < N; i++)
arr[i] = Integer.parseInt(st.nextToken());
long sum = 0L;
for(int x: arr)
sum += x;
if(sum > M)
System.out.println(-1);
else
System.out.println(M-sum);
}
}
|
[
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,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
13,
2,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
13,
30,
4,
18,
18,
13,
13,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
76,
5
],
[
76,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
39,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
55,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
55,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
6,
73
],
[
73,
74
],
[
0,
75
],
[
75,
76
],
[
75,
77
]
] |
[
"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 M=scan.nextInt();\n int i,sum=0;\n for(i=0;i<M;i++){\n int A=scan.nextInt();\n sum=sum+A;\n }\n int result=N-sum;\n if(result>=0){\n System.out.println(result); \n }\n else{\n System.out.println(\"-1\");\n }\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N=scan.nextInt();\n int M=scan.nextInt();\n int i,sum=0;\n for(i=0;i<M;i++){\n int A=scan.nextInt();\n sum=sum+A;\n }\n int result=N-sum;\n if(result>=0){\n System.out.println(result); \n }\n else{\n System.out.println(\"-1\");\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N=scan.nextInt();\n int M=scan.nextInt();\n int i,sum=0;\n for(i=0;i<M;i++){\n int A=scan.nextInt();\n sum=sum+A;\n }\n int result=N-sum;\n if(result>=0){\n System.out.println(result); \n }\n else{\n System.out.println(\"-1\");\n }\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int N=scan.nextInt();\n int M=scan.nextInt();\n int i,sum=0;\n for(i=0;i<M;i++){\n int A=scan.nextInt();\n sum=sum+A;\n }\n int result=N-sum;\n if(result>=0){\n System.out.println(result); \n }\n else{\n System.out.println(\"-1\");\n }\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int N=scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int M=scan.nextInt();",
"M",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int i",
"i",
"sum=0;",
"sum",
"0",
"for(i=0;i<M;i++){\n int A=scan.nextInt();\n sum=sum+A;\n }",
"i=0;",
"i=0",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n int A=scan.nextInt();\n sum=sum+A;\n }",
"{\n int A=scan.nextInt();\n sum=sum+A;\n }",
"int A=scan.nextInt();",
"A",
"scan.nextInt()",
"scan.nextInt",
"scan",
"sum=sum+A",
"sum",
"sum+A",
"sum",
"A",
"int result=N-sum;",
"result",
"N-sum",
"N",
"sum",
"if(result>=0){\n System.out.println(result); \n }\n else{\n System.out.println(\"-1\");\n }",
"result>=0",
"result",
"0",
"{\n System.out.println(result); \n }",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N=scan.nextInt();\n int M=scan.nextInt();\n int i,sum=0;\n for(i=0;i<M;i++){\n int A=scan.nextInt();\n sum=sum+A;\n }\n int result=N-sum;\n if(result>=0){\n System.out.println(result); \n }\n else{\n System.out.println(\"-1\");\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N=scan.nextInt();\n int M=scan.nextInt();\n int i,sum=0;\n for(i=0;i<M;i++){\n int A=scan.nextInt();\n sum=sum+A;\n }\n int result=N-sum;\n if(result>=0){\n System.out.println(result); \n }\n else{\n System.out.println(\"-1\");\n }\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N=scan.nextInt();
int M=scan.nextInt();
int i,sum=0;
for(i=0;i<M;i++){
int A=scan.nextInt();
sum=sum+A;
}
int result=N-sum;
if(result>=0){
System.out.println(result);
}
else{
System.out.println("-1");
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
2,
13,
13,
40,
17,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
68,
5
],
[
68,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
43,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
43,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
6,
65
],
[
65,
66
],
[
0,
67
],
[
67,
68
],
[
67,
69
]
] |
[
"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 N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tlong cnt = 0;\n\t\t\n\t\tfor(int i = 0; i<M; i++) {\n\t\t\tcnt += sc.nextLong();\n\t\t}\n\t\tif(N-cnt>-1) System.out.println(N-cnt);\n\t\telse System.out.println(-1);\n\t\t\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tlong cnt = 0;\n\t\t\n\t\tfor(int i = 0; i<M; i++) {\n\t\t\tcnt += sc.nextLong();\n\t\t}\n\t\tif(N-cnt>-1) System.out.println(N-cnt);\n\t\telse System.out.println(-1);\n\t\t\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tlong cnt = 0;\n\t\t\n\t\tfor(int i = 0; i<M; i++) {\n\t\t\tcnt += sc.nextLong();\n\t\t}\n\t\tif(N-cnt>-1) System.out.println(N-cnt);\n\t\telse System.out.println(-1);\n\t\t\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tlong cnt = 0;\n\t\t\n\t\tfor(int i = 0; i<M; i++) {\n\t\t\tcnt += sc.nextLong();\n\t\t}\n\t\tif(N-cnt>-1) System.out.println(N-cnt);\n\t\telse System.out.println(-1);\n\t\t\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int M = sc.nextInt();",
"M",
"sc.nextInt()",
"sc.nextInt",
"sc",
"long cnt = 0;",
"cnt",
"0",
"for(int i = 0; i<M; i++) {\n\t\t\tcnt += sc.nextLong();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tcnt += sc.nextLong();\n\t\t}",
"{\n\t\t\tcnt += sc.nextLong();\n\t\t}",
"cnt += sc.nextLong()",
"cnt",
"sc.nextLong()",
"sc.nextLong",
"sc",
"if(N-cnt>-1) System.out.println(N-cnt);\n\t\telse System.out.println(-1);",
"N-cnt>-1",
"N-cnt",
"N",
"cnt",
"-1",
"1",
"System.out.println(N-cnt)",
"System.out.println",
"System.out",
"System",
"System.out",
"N-cnt",
"N",
"cnt",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tlong cnt = 0;\n\t\t\n\t\tfor(int i = 0; i<M; i++) {\n\t\t\tcnt += sc.nextLong();\n\t\t}\n\t\tif(N-cnt>-1) System.out.println(N-cnt);\n\t\telse System.out.println(-1);\n\t\t\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint M = sc.nextInt();\n\t\tlong cnt = 0;\n\t\t\n\t\tfor(int i = 0; i<M; i++) {\n\t\t\tcnt += sc.nextLong();\n\t\t}\n\t\tif(N-cnt>-1) System.out.println(N-cnt);\n\t\telse System.out.println(-1);\n\t\t\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
long cnt = 0;
for(int i = 0; i<M; i++) {
cnt += sc.nextLong();
}
if(N-cnt>-1) System.out.println(N-cnt);
else System.out.println(-1);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
41,
13,
20,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
14,
2,
13,
13,
4,
18,
13,
40,
17,
4,
18,
13,
2,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
101,
8
],
[
101,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
11,
21
],
[
21,
22
],
[
21,
23
],
[
11,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
26,
29
],
[
29,
30
],
[
30,
31
],
[
11,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
37,
38
],
[
38,
39
],
[
11,
40
],
[
40,
41
],
[
40,
42
],
[
11,
43
],
[
43,
44
],
[
43,
45
],
[
11,
46
],
[
46,
47
],
[
46,
48
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
49,
54
],
[
54,
55
],
[
54,
56
],
[
49,
57
],
[
57,
58
],
[
58,
59
],
[
49,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
69,
70
],
[
61,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
11,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
84,
85
],
[
77,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
89,
90
],
[
89,
91
],
[
11,
92
],
[
92,
93
],
[
93,
94
],
[
11,
95
],
[
95,
96
],
[
96,
97
],
[
9,
98
],
[
98,
99
],
[
0,
100
],
[
100,
101
],
[
100,
102
]
] |
[
"import java.util.*;\nimport java.io.*;\npublic class Main {\n\n\tpublic static void main(String[] args) throws Exception{\n\t\tint num = 998244353;\n\n\t\t// TODO Auto-generated method stub\n \t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n \t\tPrintWriter out = new PrintWriter(System.out);\n//\t \t\tString input1 = bf.readLine().trim();\n//\t \t\tString input2 = bf.readLine().trim();\n\t \t\tStringTokenizer st = new StringTokenizer(bf.readLine());\n\t \t\tlong n = Long.parseLong(st.nextToken());\n\t \t\tlong m = Long.parseLong(st.nextToken());\n\t \t\tArrayList<Integer> array = new ArrayList<Integer>();\n\t \t\tStringTokenizer st2 = new StringTokenizer(bf.readLine());\n\t \t\tlong sum = 0;\n\t \t\tfor(int j=0;j<m;j++){\n\t \t\t\tarray.add(Integer.parseInt(st2.nextToken()));\n\t \t\t\tsum+=(long)(array.get(j));\n\t \t\t}\n\t \t\tif (sum > n)\n\t \t\t\tout.println(-1);\n\t \t\telse\n\t \t\t\tout.println(n-sum);\n \t\t\n \t\t\n \t\tout.println();\n\t \t\t\n \t\tout.close();\n \t\t\n \t\t\n \t\t\n \t}\n}\n \t\n \n//StringJoiner sj = new StringJoiner(\" \"); \n//sj.add(strings)\n//sj.toString() gives string of those stuff w spaces or whatever that sequence is\n\n \t\t\n \t\t\n \t\t\n \t\t\n\t\n\n",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) throws Exception{\n\t\tint num = 998244353;\n\n\t\t// TODO Auto-generated method stub\n \t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n \t\tPrintWriter out = new PrintWriter(System.out);\n//\t \t\tString input1 = bf.readLine().trim();\n//\t \t\tString input2 = bf.readLine().trim();\n\t \t\tStringTokenizer st = new StringTokenizer(bf.readLine());\n\t \t\tlong n = Long.parseLong(st.nextToken());\n\t \t\tlong m = Long.parseLong(st.nextToken());\n\t \t\tArrayList<Integer> array = new ArrayList<Integer>();\n\t \t\tStringTokenizer st2 = new StringTokenizer(bf.readLine());\n\t \t\tlong sum = 0;\n\t \t\tfor(int j=0;j<m;j++){\n\t \t\t\tarray.add(Integer.parseInt(st2.nextToken()));\n\t \t\t\tsum+=(long)(array.get(j));\n\t \t\t}\n\t \t\tif (sum > n)\n\t \t\t\tout.println(-1);\n\t \t\telse\n\t \t\t\tout.println(n-sum);\n \t\t\n \t\t\n \t\tout.println();\n\t \t\t\n \t\tout.close();\n \t\t\n \t\t\n \t\t\n \t}\n}",
"Main",
"public static void main(String[] args) throws Exception{\n\t\tint num = 998244353;\n\n\t\t// TODO Auto-generated method stub\n \t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n \t\tPrintWriter out = new PrintWriter(System.out);\n//\t \t\tString input1 = bf.readLine().trim();\n//\t \t\tString input2 = bf.readLine().trim();\n\t \t\tStringTokenizer st = new StringTokenizer(bf.readLine());\n\t \t\tlong n = Long.parseLong(st.nextToken());\n\t \t\tlong m = Long.parseLong(st.nextToken());\n\t \t\tArrayList<Integer> array = new ArrayList<Integer>();\n\t \t\tStringTokenizer st2 = new StringTokenizer(bf.readLine());\n\t \t\tlong sum = 0;\n\t \t\tfor(int j=0;j<m;j++){\n\t \t\t\tarray.add(Integer.parseInt(st2.nextToken()));\n\t \t\t\tsum+=(long)(array.get(j));\n\t \t\t}\n\t \t\tif (sum > n)\n\t \t\t\tout.println(-1);\n\t \t\telse\n\t \t\t\tout.println(n-sum);\n \t\t\n \t\t\n \t\tout.println();\n\t \t\t\n \t\tout.close();\n \t\t\n \t\t\n \t\t\n \t}",
"main",
"{\n\t\tint num = 998244353;\n\n\t\t// TODO Auto-generated method stub\n \t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n \t\tPrintWriter out = new PrintWriter(System.out);\n//\t \t\tString input1 = bf.readLine().trim();\n//\t \t\tString input2 = bf.readLine().trim();\n\t \t\tStringTokenizer st = new StringTokenizer(bf.readLine());\n\t \t\tlong n = Long.parseLong(st.nextToken());\n\t \t\tlong m = Long.parseLong(st.nextToken());\n\t \t\tArrayList<Integer> array = new ArrayList<Integer>();\n\t \t\tStringTokenizer st2 = new StringTokenizer(bf.readLine());\n\t \t\tlong sum = 0;\n\t \t\tfor(int j=0;j<m;j++){\n\t \t\t\tarray.add(Integer.parseInt(st2.nextToken()));\n\t \t\t\tsum+=(long)(array.get(j));\n\t \t\t}\n\t \t\tif (sum > n)\n\t \t\t\tout.println(-1);\n\t \t\telse\n\t \t\t\tout.println(n-sum);\n \t\t\n \t\t\n \t\tout.println();\n\t \t\t\n \t\tout.close();\n \t\t\n \t\t\n \t\t\n \t}",
"int num = 998244353;",
"num",
"998244353",
"BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));",
"bf",
"new BufferedReader(new InputStreamReader(System.in))",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"StringTokenizer st = new StringTokenizer(bf.readLine());",
"st",
"new StringTokenizer(bf.readLine())",
"long n = Long.parseLong(st.nextToken());",
"n",
"Long.parseLong(st.nextToken())",
"Long.parseLong",
"Long",
"st.nextToken()",
"st.nextToken",
"st",
"long m = Long.parseLong(st.nextToken());",
"m",
"Long.parseLong(st.nextToken())",
"Long.parseLong",
"Long",
"st.nextToken()",
"st.nextToken",
"st",
"ArrayList<Integer> array = new ArrayList<Integer>();",
"array",
"new ArrayList<Integer>()",
"StringTokenizer st2 = new StringTokenizer(bf.readLine());",
"st2",
"new StringTokenizer(bf.readLine())",
"long sum = 0;",
"sum",
"0",
"for(int j=0;j<m;j++){\n\t \t\t\tarray.add(Integer.parseInt(st2.nextToken()));\n\t \t\t\tsum+=(long)(array.get(j));\n\t \t\t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<m",
"j",
"m",
"j++",
"j++",
"j",
"{\n\t \t\t\tarray.add(Integer.parseInt(st2.nextToken()));\n\t \t\t\tsum+=(long)(array.get(j));\n\t \t\t}",
"{\n\t \t\t\tarray.add(Integer.parseInt(st2.nextToken()));\n\t \t\t\tsum+=(long)(array.get(j));\n\t \t\t}",
"array.add(Integer.parseInt(st2.nextToken()))",
"array.add",
"array",
"Integer.parseInt(st2.nextToken())",
"Integer.parseInt",
"Integer",
"st2.nextToken()",
"st2.nextToken",
"st2",
"sum+=(long)(array.get(j))",
"sum",
"(long)(array.get(j))",
"array.get",
"array",
"j",
"if (sum > n)\n\t \t\t\tout.println(-1);\n\t \t\telse\n\t \t\t\tout.println(n-sum);",
"sum > n",
"sum",
"n",
"out.println(-1)",
"out.println",
"out",
"-1",
"1",
"out.println(n-sum)",
"out.println",
"out",
"n-sum",
"n",
"sum",
"out.println()",
"out.println",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) throws Exception{\n\t\tint num = 998244353;\n\n\t\t// TODO Auto-generated method stub\n \t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n \t\tPrintWriter out = new PrintWriter(System.out);\n//\t \t\tString input1 = bf.readLine().trim();\n//\t \t\tString input2 = bf.readLine().trim();\n\t \t\tStringTokenizer st = new StringTokenizer(bf.readLine());\n\t \t\tlong n = Long.parseLong(st.nextToken());\n\t \t\tlong m = Long.parseLong(st.nextToken());\n\t \t\tArrayList<Integer> array = new ArrayList<Integer>();\n\t \t\tStringTokenizer st2 = new StringTokenizer(bf.readLine());\n\t \t\tlong sum = 0;\n\t \t\tfor(int j=0;j<m;j++){\n\t \t\t\tarray.add(Integer.parseInt(st2.nextToken()));\n\t \t\t\tsum+=(long)(array.get(j));\n\t \t\t}\n\t \t\tif (sum > n)\n\t \t\t\tout.println(-1);\n\t \t\telse\n\t \t\t\tout.println(n-sum);\n \t\t\n \t\t\n \t\tout.println();\n\t \t\t\n \t\tout.close();\n \t\t\n \t\t\n \t\t\n \t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) throws Exception{\n\t\tint num = 998244353;\n\n\t\t// TODO Auto-generated method stub\n \t\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\n \t\tPrintWriter out = new PrintWriter(System.out);\n//\t \t\tString input1 = bf.readLine().trim();\n//\t \t\tString input2 = bf.readLine().trim();\n\t \t\tStringTokenizer st = new StringTokenizer(bf.readLine());\n\t \t\tlong n = Long.parseLong(st.nextToken());\n\t \t\tlong m = Long.parseLong(st.nextToken());\n\t \t\tArrayList<Integer> array = new ArrayList<Integer>();\n\t \t\tStringTokenizer st2 = new StringTokenizer(bf.readLine());\n\t \t\tlong sum = 0;\n\t \t\tfor(int j=0;j<m;j++){\n\t \t\t\tarray.add(Integer.parseInt(st2.nextToken()));\n\t \t\t\tsum+=(long)(array.get(j));\n\t \t\t}\n\t \t\tif (sum > n)\n\t \t\t\tout.println(-1);\n\t \t\telse\n\t \t\t\tout.println(n-sum);\n \t\t\n \t\t\n \t\tout.println();\n\t \t\t\n \t\tout.close();\n \t\t\n \t\t\n \t\t\n \t}\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception{
int num = 998244353;
// TODO Auto-generated method stub
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
// String input1 = bf.readLine().trim();
// String input2 = bf.readLine().trim();
StringTokenizer st = new StringTokenizer(bf.readLine());
long n = Long.parseLong(st.nextToken());
long m = Long.parseLong(st.nextToken());
ArrayList<Integer> array = new ArrayList<Integer>();
StringTokenizer st2 = new StringTokenizer(bf.readLine());
long sum = 0;
for(int j=0;j<m;j++){
array.add(Integer.parseInt(st2.nextToken()));
sum+=(long)(array.get(j));
}
if (sum > n)
out.println(-1);
else
out.println(n-sum);
out.println();
out.close();
}
}
//StringJoiner sj = new StringJoiner(" ");
//sj.add(strings)
//sj.toString() gives string of those stuff w spaces or whatever that sequence is
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
0,
13,
13,
14,
2,
13,
17,
4,
18,
18,
13,
13,
13,
4,
18,
18,
13,
13,
40,
17,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
66,
5
],
[
66,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
43,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
46,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
6,
63
],
[
63,
64
],
[
0,
65
],
[
65,
66
],
[
65,
67
]
] |
[
"import java.util.Scanner;\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 m = sc.nextInt();\n int total = 0;\n for(int i =0; i<m; i++) {\n total += sc.nextInt();\n }\n n -= total;\n if(n >= 0) System.out.println(n);\n else System.out.println(-1);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int total = 0;\n for(int i =0; i<m; i++) {\n total += sc.nextInt();\n }\n n -= total;\n if(n >= 0) System.out.println(n);\n else System.out.println(-1);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int total = 0;\n for(int i =0; i<m; i++) {\n total += sc.nextInt();\n }\n n -= total;\n if(n >= 0) System.out.println(n);\n else System.out.println(-1);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int total = 0;\n for(int i =0; i<m; i++) {\n total += sc.nextInt();\n }\n n -= total;\n if(n >= 0) System.out.println(n);\n else System.out.println(-1);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int m = sc.nextInt();",
"m",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int total = 0;",
"total",
"0",
"for(int i =0; i<m; i++) {\n total += sc.nextInt();\n }",
"int i =0;",
"int i =0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"{\n total += sc.nextInt();\n }",
"{\n total += sc.nextInt();\n }",
"total += sc.nextInt()",
"total",
"sc.nextInt()",
"sc.nextInt",
"sc",
"n -= total",
"n",
"total",
"if(n >= 0) System.out.println(n);\n else System.out.println(-1);",
"n >= 0",
"n",
"0",
"System.out.println(n)",
"System.out.println",
"System.out",
"System",
"System.out",
"n",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int total = 0;\n for(int i =0; i<m; i++) {\n total += sc.nextInt();\n }\n n -= total;\n if(n >= 0) System.out.println(n);\n else System.out.println(-1);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int m = sc.nextInt();\n int total = 0;\n for(int i =0; i<m; i++) {\n total += sc.nextInt();\n }\n n -= total;\n if(n >= 0) System.out.println(n);\n else System.out.println(-1);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int total = 0;
for(int i =0; i<m; i++) {
total += sc.nextInt();
}
n -= total;
if(n >= 0) System.out.println(n);
else System.out.println(-1);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
4,
18,
18,
13,
13,
40,
17,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
74,
14
],
[
74,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
17,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
17,
31
],
[
31,
32
],
[
31,
33
],
[
17,
34
],
[
34,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
34,
39
],
[
39,
40
],
[
39,
41
],
[
34,
42
],
[
42,
43
],
[
43,
44
],
[
34,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
17,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
52,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
15,
71
],
[
71,
72
],
[
0,
73
],
[
73,
74
],
[
73,
75
]
] |
[
"import java.io.File;\nimport java.io.FileInputStream;\nimport java.io.FileNotFoundException;\nimport java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int holidays = sc.nextInt();\n int homeworks = sc.nextInt();\n\n int sum = 0;\n for (int i=0; i<homeworks; i++) {\n sum += sc.nextInt();\n }\n\n if (sum > holidays) System.out.println(-1);\n else System.out.println(holidays - sum);\n }\n}",
"import java.io.File;",
"File",
"java.io",
"import java.io.FileInputStream;",
"FileInputStream",
"java.io",
"import java.io.FileNotFoundException;",
"FileNotFoundException",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int holidays = sc.nextInt();\n int homeworks = sc.nextInt();\n\n int sum = 0;\n for (int i=0; i<homeworks; i++) {\n sum += sc.nextInt();\n }\n\n if (sum > holidays) System.out.println(-1);\n else System.out.println(holidays - sum);\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int holidays = sc.nextInt();\n int homeworks = sc.nextInt();\n\n int sum = 0;\n for (int i=0; i<homeworks; i++) {\n sum += sc.nextInt();\n }\n\n if (sum > holidays) System.out.println(-1);\n else System.out.println(holidays - sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int holidays = sc.nextInt();\n int homeworks = sc.nextInt();\n\n int sum = 0;\n for (int i=0; i<homeworks; i++) {\n sum += sc.nextInt();\n }\n\n if (sum > holidays) System.out.println(-1);\n else System.out.println(holidays - sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int holidays = sc.nextInt();",
"holidays",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int homeworks = sc.nextInt();",
"homeworks",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for (int i=0; i<homeworks; i++) {\n sum += sc.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<homeworks",
"i",
"homeworks",
"i++",
"i++",
"i",
"{\n sum += sc.nextInt();\n }",
"{\n sum += sc.nextInt();\n }",
"sum += sc.nextInt()",
"sum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if (sum > holidays) System.out.println(-1);\n else System.out.println(holidays - sum);",
"sum > holidays",
"sum",
"holidays",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.out.println(holidays - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"holidays - sum",
"holidays",
"sum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int holidays = sc.nextInt();\n int homeworks = sc.nextInt();\n\n int sum = 0;\n for (int i=0; i<homeworks; i++) {\n sum += sc.nextInt();\n }\n\n if (sum > holidays) System.out.println(-1);\n else System.out.println(holidays - sum);\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(System.in);\n int holidays = sc.nextInt();\n int homeworks = sc.nextInt();\n\n int sum = 0;\n for (int i=0; i<homeworks; i++) {\n sum += sc.nextInt();\n }\n\n if (sum > holidays) System.out.println(-1);\n else System.out.println(holidays - sum);\n }\n}",
"Main"
] |
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int holidays = sc.nextInt();
int homeworks = sc.nextInt();
int sum = 0;
for (int i=0; i<homeworks; i++) {
sum += sc.nextInt();
}
if (sum > holidays) System.out.println(-1);
else System.out.println(holidays - sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
17,
13,
13,
4,
18,
13,
23,
13,
6,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
18,
13,
13,
4,
18,
13,
8,
2,
2,
13,
13,
17,
40,
17,
2,
13,
13,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
41,
13,
41,
13,
17,
12,
13,
30,
4,
13,
20,
23,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
2,
2,
17,
13,
17,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
37,
20,
30,
41,
13,
4,
18,
13,
14,
2,
13,
17,
29,
17,
0,
13,
20,
41,
13,
4,
18,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
2,
2,
2,
17,
13,
17,
13,
29,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
25,
26
],
[
25,
27
],
[
0,
28
],
[
28,
29
],
[
28,
30
],
[
0,
31
],
[
269,
32
],
[
269,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
38,
40
],
[
35,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
35,
46
],
[
46,
47
],
[
46,
48
],
[
35,
49
],
[
49,
50
],
[
49,
51
],
[
35,
52
],
[
52,
53
],
[
52,
54
],
[
35,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
55,
59
],
[
55,
60
],
[
35,
61
],
[
61,
62
],
[
62,
63
],
[
33,
64
],
[
64,
65
],
[
269,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
70,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
70,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
70,
87
],
[
87,
88
],
[
87,
89
],
[
70,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
95,
96
],
[
95,
97
],
[
90,
98
],
[
98,
99
],
[
99,
100
],
[
90,
101
],
[
101,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
104,
106
],
[
70,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
111,
115
],
[
110,
116
],
[
116,
117
],
[
110,
118
],
[
118,
119
],
[
118,
120
],
[
68,
121
],
[
121,
122
],
[
68,
123
],
[
123,
124
],
[
68,
125
],
[
125,
126
],
[
269,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
127,
131
],
[
131,
132
],
[
127,
133
],
[
133,
134
],
[
133,
135
],
[
127,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
136,
142
],
[
142,
143
],
[
127,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
144,
150
],
[
150,
151
],
[
127,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
160,
165
],
[
166,
166
],
[
166,
167
],
[
166,
168
],
[
166,
169
],
[
154,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
171,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
170,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
183,
187
],
[
187,
188
],
[
180,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
193,
194
],
[
189,
195
],
[
195,
196
],
[
196,
197
],
[
196,
198
],
[
195,
199
],
[
199,
200
],
[
189,
201
],
[
201,
202
],
[
201,
203
],
[
154,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
207,
208
],
[
154,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
209,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
214,
219
],
[
221,
220
],
[
220,
221
],
[
221,
222
],
[
221,
223
],
[
220,
224
],
[
221,
225
],
[
154,
226
],
[
226,
227
],
[
127,
228
],
[
228,
229
],
[
228,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
232,
235
],
[
235,
236
],
[
127,
237
],
[
237,
238
],
[
237,
239
],
[
239,
240
],
[
240,
241
],
[
240,
242
],
[
239,
244
],
[
244,
245
],
[
245,
246
],
[
246,
247
],
[
246,
248
],
[
244,
249
],
[
249,
250
],
[
249,
251
],
[
251,
252
],
[
251,
253
],
[
244,
254
],
[
254,
255
],
[
255,
256
],
[
244,
257
],
[
257,
258
],
[
258,
259
],
[
259,
260
],
[
259,
261
],
[
258,
262
],
[
262,
263
],
[
239,
264
],
[
264,
265
],
[
237,
266
],
[
266,
267
],
[
0,
268
],
[
268,
269
],
[
268,
270
]
] |
[
"import java.io.OutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.PrintWriter;\nimport java.io.PrintStream;\nimport java.util.StringTokenizer;\nimport java.io.IOException;\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.io.InputStream;\n\n/**\n * Built using CHelper plug-in\n * Actual solution is at the top\n *\n * @author Eric\n */\npublic class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BHomework solver = new BHomework();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BHomework {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextArrInt(m);\n long t = 0;\n for (int i = 0; i < m; i++)\n t += a[i];\n out.println(n - t < 0 ? -1 : n - t);\n //out.print(\"Case #\"+ testNumber + \": \");\n }\n\n }\n\n static class FastReader {\n public BufferedReader br;\n public StringTokenizer st;\n String context = null;\n\n public FastReader(InputStream in) {\n this(new InputStreamReader(in));\n }\n\n public FastReader(InputStreamReader input) {\n br = new BufferedReader(input);\n }\n\n public String next() {\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nextArrInt(int n) {\n int[] a = new int[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextInt();\n return a;\n }\n\n }\n}\n",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.io.PrintStream;",
"PrintStream",
"java.io",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BHomework solver = new BHomework();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BHomework {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextArrInt(m);\n long t = 0;\n for (int i = 0; i < m; i++)\n t += a[i];\n out.println(n - t < 0 ? -1 : n - t);\n //out.print(\"Case #\"+ testNumber + \": \");\n }\n\n }\n\n static class FastReader {\n public BufferedReader br;\n public StringTokenizer st;\n String context = null;\n\n public FastReader(InputStream in) {\n this(new InputStreamReader(in));\n }\n\n public FastReader(InputStreamReader input) {\n br = new BufferedReader(input);\n }\n\n public String next() {\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nextArrInt(int n) {\n int[] a = new int[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextInt();\n return a;\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BHomework solver = new BHomework();\n solver.solve(1, in, out);\n out.close();\n }",
"main",
"{\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BHomework solver = new BHomework();\n solver.solve(1, in, out);\n out.close();\n }",
"InputStream inputStream = System.in;",
"inputStream",
"System.in",
"System",
"System.in",
"OutputStream outputStream = System.out;",
"outputStream",
"System.out",
"System",
"System.out",
"FastReader in = new FastReader(inputStream);",
"in",
"new FastReader(inputStream)",
"PrintWriter out = new PrintWriter(outputStream);",
"out",
"new PrintWriter(outputStream)",
"BHomework solver = new BHomework();",
"solver",
"new BHomework()",
"solver.solve(1, in, out)",
"solver.solve",
"solver",
"1",
"in",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class BHomework {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextArrInt(m);\n long t = 0;\n for (int i = 0; i < m; i++)\n t += a[i];\n out.println(n - t < 0 ? -1 : n - t);\n //out.print(\"Case #\"+ testNumber + \": \");\n }\n\n }",
"BHomework",
"public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextArrInt(m);\n long t = 0;\n for (int i = 0; i < m; i++)\n t += a[i];\n out.println(n - t < 0 ? -1 : n - t);\n //out.print(\"Case #\"+ testNumber + \": \");\n }",
"solve",
"{\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextArrInt(m);\n long t = 0;\n for (int i = 0; i < m; i++)\n t += a[i];\n out.println(n - t < 0 ? -1 : n - t);\n //out.print(\"Case #\"+ testNumber + \": \");\n }",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int m = in.nextInt();",
"m",
"in.nextInt()",
"in.nextInt",
"in",
"int[] a = in.nextArrInt(m);",
"a",
"in.nextArrInt(m)",
"in.nextArrInt",
"in",
"m",
"long t = 0;",
"t",
"0",
"for (int i = 0; i < m; i++)\n t += a[i];",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < m",
"i",
"m",
"i++",
"i++",
"i",
"t += a[i];",
"t += a[i]",
"t",
"a[i]",
"a",
"i",
"out.println(n - t < 0 ? -1 : n - t)",
"out.println",
"out",
"n - t < 0 ? -1 : n - t",
"n - t < 0",
"n - t",
"n",
"t",
"0",
"-1",
"1",
"n - t",
"n",
"t",
"int testNumber",
"testNumber",
"FastReader in",
"in",
"PrintWriter out",
"out",
"static class FastReader {\n public BufferedReader br;\n public StringTokenizer st;\n String context = null;\n\n public FastReader(InputStream in) {\n this(new InputStreamReader(in));\n }\n\n public FastReader(InputStreamReader input) {\n br = new BufferedReader(input);\n }\n\n public String next() {\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nextArrInt(int n) {\n int[] a = new int[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextInt();\n return a;\n }\n\n }",
"FastReader",
"public BufferedReader br;",
"br",
"public StringTokenizer st;",
"st",
"String context = null;",
"context",
"null",
"public FastReader(InputStream in) {\n this(new InputStreamReader(in));\n }",
"FastReader",
"{\n this(new InputStreamReader(in));\n }",
"this(new InputStreamReader(in))",
"this",
"new InputStreamReader(in)",
"InputStream in",
"in",
"public FastReader(InputStreamReader input) {\n br = new BufferedReader(input);\n }",
"FastReader",
"{\n br = new BufferedReader(input);\n }",
"br = new BufferedReader(input)",
"br",
"new BufferedReader(input)",
"InputStreamReader input",
"input",
"public String next() {\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }",
"next",
"{\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }",
"if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }",
"context != null",
"context",
"null",
"{\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }",
"System.err.print(\"[\" + context + \"] Wait for input ...\")",
"System.err.print",
"System.err",
"System",
"System.err",
"\"[\" + context + \"] Wait for input ...\"",
"\"[\" + context + \"] Wait for input ...\"",
"\"[\"",
"context",
"\"] Wait for input ...\"",
"while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }",
"st == null || !st.hasMoreElements()",
"st == null",
"st",
"null",
"!st.hasMoreElements()",
"st.hasMoreElements()",
"st.hasMoreElements",
"st",
"{\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }",
"try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }",
"catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }",
"IOException e",
"{\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"throw new RuntimeException(\"Could not read\");",
"new RuntimeException(\"Could not read\")",
"{\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n }",
"String s = br.readLine();",
"s",
"br.readLine()",
"br.readLine",
"br",
"if (s == null)\n return null;",
"s == null",
"s",
"null",
"return null;",
"null",
"st = new StringTokenizer(s)",
"st",
"new StringTokenizer(s)",
"String res = st.nextToken();",
"res",
"st.nextToken()",
"st.nextToken",
"st",
"if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }",
"context != null",
"context",
"null",
"{\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }",
"System.err.println(\"[\" + context + \"] ... received : \" + res)",
"System.err.println",
"System.err",
"System",
"System.err",
"\"[\" + context + \"] ... received : \" + res",
"\"] ... received : \"",
"\"[\" + context + \"] ... received : \" + res",
"\"[\"",
"context",
"\"] ... received : \"",
"res",
"return res;",
"res",
"public int nextInt() {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public int[] nextArrInt(int n) {\n int[] a = new int[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextInt();\n return a;\n }",
"nextArrInt",
"{\n int[] a = new int[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextInt();\n return a;\n }",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < a.length; i++)\n a[i] = nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a.length",
"i",
"a.length",
"a",
"a.length",
"i++",
"i++",
"i",
"a[i] = nextInt();",
"a[i] = nextInt()",
"a[i]",
"a",
"i",
"nextInt()",
"nextInt",
"return a;",
"a",
"int n",
"n",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BHomework solver = new BHomework();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BHomework {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextArrInt(m);\n long t = 0;\n for (int i = 0; i < m; i++)\n t += a[i];\n out.println(n - t < 0 ? -1 : n - t);\n //out.print(\"Case #\"+ testNumber + \": \");\n }\n\n }\n\n static class FastReader {\n public BufferedReader br;\n public StringTokenizer st;\n String context = null;\n\n public FastReader(InputStream in) {\n this(new InputStreamReader(in));\n }\n\n public FastReader(InputStreamReader input) {\n br = new BufferedReader(input);\n }\n\n public String next() {\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nextArrInt(int n) {\n int[] a = new int[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextInt();\n return a;\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n FastReader in = new FastReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n BHomework solver = new BHomework();\n solver.solve(1, in, out);\n out.close();\n }\n\n static class BHomework {\n public void solve(int testNumber, FastReader in, PrintWriter out) {\n int n = in.nextInt();\n int m = in.nextInt();\n int[] a = in.nextArrInt(m);\n long t = 0;\n for (int i = 0; i < m; i++)\n t += a[i];\n out.println(n - t < 0 ? -1 : n - t);\n //out.print(\"Case #\"+ testNumber + \": \");\n }\n\n }\n\n static class FastReader {\n public BufferedReader br;\n public StringTokenizer st;\n String context = null;\n\n public FastReader(InputStream in) {\n this(new InputStreamReader(in));\n }\n\n public FastReader(InputStreamReader input) {\n br = new BufferedReader(input);\n }\n\n public String next() {\n if (context != null) {\n System.err.print(\"[\" + context + \"] Wait for input ...\");\n }\n while (st == null || !st.hasMoreElements()) {\n try {\n String s = br.readLine();\n if (s == null)\n return null;\n st = new StringTokenizer(s);\n } catch (IOException e) {\n e.printStackTrace();\n throw new RuntimeException(\"Could not read\");\n }\n }\n String res = st.nextToken();\n if (context != null) {\n System.err.println(\"[\" + context + \"] ... received : \" + res);\n }\n return res;\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public int[] nextArrInt(int n) {\n int[] a = new int[n];\n for (int i = 0; i < a.length; i++)\n a[i] = nextInt();\n return a;\n }\n\n }\n}",
"Main"
] |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author Eric
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
FastReader in = new FastReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
BHomework solver = new BHomework();
solver.solve(1, in, out);
out.close();
}
static class BHomework {
public void solve(int testNumber, FastReader in, PrintWriter out) {
int n = in.nextInt();
int m = in.nextInt();
int[] a = in.nextArrInt(m);
long t = 0;
for (int i = 0; i < m; i++)
t += a[i];
out.println(n - t < 0 ? -1 : n - t);
//out.print("Case #"+ testNumber + ": ");
}
}
static class FastReader {
public BufferedReader br;
public StringTokenizer st;
String context = null;
public FastReader(InputStream in) {
this(new InputStreamReader(in));
}
public FastReader(InputStreamReader input) {
br = new BufferedReader(input);
}
public String next() {
if (context != null) {
System.err.print("[" + context + "] Wait for input ...");
}
while (st == null || !st.hasMoreElements()) {
try {
String s = br.readLine();
if (s == null)
return null;
st = new StringTokenizer(s);
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException("Could not read");
}
}
String res = st.nextToken();
if (context != null) {
System.err.println("[" + context + "] ... received : " + res);
}
return res;
}
public int nextInt() {
return Integer.parseInt(next());
}
public int[] nextArrInt(int n) {
int[] a = new int[n];
for (int i = 0; i < a.length; i++)
a[i] = nextInt();
return a;
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
41,
13,
41,
13,
17,
41,
13,
20,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
4,
18,
18,
13,
13,
2,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
69,
5
],
[
69,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
8,
11
],
[
11,
12
],
[
8,
13
],
[
13,
14
],
[
13,
15
],
[
8,
16
],
[
16,
17
],
[
16,
18
],
[
8,
19
],
[
19,
20
],
[
19,
21
],
[
21,
22
],
[
22,
23
],
[
8,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
8,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
29,
37
],
[
37,
38
],
[
38,
39
],
[
29,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
46,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
6,
66
],
[
66,
67
],
[
0,
68
],
[
68,
69
],
[
68,
70
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n long num, x, sum=0;\n Scanner scanner = new Scanner(System.in);\n num = scanner.nextLong();\n x = scanner.nextLong();\n //scanner.nextLine();\n for(int i=0; i<x; i++) sum += scanner.nextLong();\n if(sum > num){\n System.out.println(-1);\n }\n else System.out.println(num - sum);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n long num, x, sum=0;\n Scanner scanner = new Scanner(System.in);\n num = scanner.nextLong();\n x = scanner.nextLong();\n //scanner.nextLine();\n for(int i=0; i<x; i++) sum += scanner.nextLong();\n if(sum > num){\n System.out.println(-1);\n }\n else System.out.println(num - sum);\n }\n}",
"Main",
"public static void main(String[] args) {\n long num, x, sum=0;\n Scanner scanner = new Scanner(System.in);\n num = scanner.nextLong();\n x = scanner.nextLong();\n //scanner.nextLine();\n for(int i=0; i<x; i++) sum += scanner.nextLong();\n if(sum > num){\n System.out.println(-1);\n }\n else System.out.println(num - sum);\n }",
"main",
"{\n long num, x, sum=0;\n Scanner scanner = new Scanner(System.in);\n num = scanner.nextLong();\n x = scanner.nextLong();\n //scanner.nextLine();\n for(int i=0; i<x; i++) sum += scanner.nextLong();\n if(sum > num){\n System.out.println(-1);\n }\n else System.out.println(num - sum);\n }",
"long num",
"num",
"x",
"x",
"sum=0;",
"sum",
"0",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"num = scanner.nextLong()",
"num",
"scanner.nextLong()",
"scanner.nextLong",
"scanner",
"x = scanner.nextLong()",
"x",
"scanner.nextLong()",
"scanner.nextLong",
"scanner",
"for(int i=0; i<x; i++) sum += scanner.nextLong();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<x",
"i",
"x",
"i++",
"i++",
"i",
"sum += scanner.nextLong();",
"sum += scanner.nextLong()",
"sum",
"scanner.nextLong()",
"scanner.nextLong",
"scanner",
"if(sum > num){\n System.out.println(-1);\n }\n else System.out.println(num - sum);",
"sum > num",
"sum",
"num",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"System.out.println(num - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"num - sum",
"num",
"sum",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n long num, x, sum=0;\n Scanner scanner = new Scanner(System.in);\n num = scanner.nextLong();\n x = scanner.nextLong();\n //scanner.nextLine();\n for(int i=0; i<x; i++) sum += scanner.nextLong();\n if(sum > num){\n System.out.println(-1);\n }\n else System.out.println(num - sum);\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n long num, x, sum=0;\n Scanner scanner = new Scanner(System.in);\n num = scanner.nextLong();\n x = scanner.nextLong();\n //scanner.nextLine();\n for(int i=0; i<x; i++) sum += scanner.nextLong();\n if(sum > num){\n System.out.println(-1);\n }\n else System.out.println(num - sum);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
long num, x, sum=0;
Scanner scanner = new Scanner(System.in);
num = scanner.nextLong();
x = scanner.nextLong();
//scanner.nextLine();
for(int i=0; i<x; i++) sum += scanner.nextLong();
if(sum > num){
System.out.println(-1);
}
else System.out.println(num - sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
18,
4,
18,
13,
17,
17,
41,
13,
17,
41,
13,
4,
18,
13,
28,
13,
4,
18,
13,
17,
30,
30,
0,
13,
2,
13,
4,
18,
13,
13,
41,
13,
2,
13,
13,
14,
2,
13,
17,
30,
4,
18,
18,
13,
13,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
84,
11
],
[
84,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
29,
32
],
[
28,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
14,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
14,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
42,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
14,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
60,
62
],
[
14,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
63,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
12,
81
],
[
81,
82
],
[
0,
83
],
[
83,
84
],
[
83,
85
]
] |
[
"/*\n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the template in the editor.\n */\n\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.Scanner;\n\n/**\n *\n * @author yoovraj.shinde\n */\npublic class Main {\n public static void main(String[] args) {\n // if (true) return;\n Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n String s = in.nextLine();\n int n = Integer.parseInt(s.split(\" \")[0]);\n int act = 0;\n String tasks = in.nextLine();\n for (String t : tasks.split(\" \")) {\n act = act + Integer.parseInt(t);\n }\n int res = n - act;\n if (res < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(res);\n }\n \n }\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n // if (true) return;\n Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n String s = in.nextLine();\n int n = Integer.parseInt(s.split(\" \")[0]);\n int act = 0;\n String tasks = in.nextLine();\n for (String t : tasks.split(\" \")) {\n act = act + Integer.parseInt(t);\n }\n int res = n - act;\n if (res < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(res);\n }\n \n }\n\n}",
"Main",
"public static void main(String[] args) {\n // if (true) return;\n Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n String s = in.nextLine();\n int n = Integer.parseInt(s.split(\" \")[0]);\n int act = 0;\n String tasks = in.nextLine();\n for (String t : tasks.split(\" \")) {\n act = act + Integer.parseInt(t);\n }\n int res = n - act;\n if (res < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(res);\n }\n \n }",
"main",
"{\n // if (true) return;\n Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n String s = in.nextLine();\n int n = Integer.parseInt(s.split(\" \")[0]);\n int act = 0;\n String tasks = in.nextLine();\n for (String t : tasks.split(\" \")) {\n act = act + Integer.parseInt(t);\n }\n int res = n - act;\n if (res < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(res);\n }\n \n }",
"Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));",
"in",
"new Scanner(new BufferedReader(new InputStreamReader(System.in)))",
"String s = in.nextLine();",
"s",
"in.nextLine()",
"in.nextLine",
"in",
"int n = Integer.parseInt(s.split(\" \")[0]);",
"n",
"Integer.parseInt(s.split(\" \")[0])",
"Integer.parseInt",
"Integer",
"s.split(\" \")[0]",
"s.split(\" \")",
"s.split",
"s",
"\" \"",
"0",
"int act = 0;",
"act",
"0",
"String tasks = in.nextLine();",
"tasks",
"in.nextLine()",
"in.nextLine",
"in",
"for (String t : tasks.split(\" \")) {\n act = act + Integer.parseInt(t);\n }",
"String t",
"tasks.split(\" \")",
"tasks.split",
"tasks",
"\" \"",
"{\n act = act + Integer.parseInt(t);\n }",
"{\n act = act + Integer.parseInt(t);\n }",
"act = act + Integer.parseInt(t)",
"act",
"act + Integer.parseInt(t)",
"act",
"Integer.parseInt(t)",
"Integer.parseInt",
"Integer",
"t",
"int res = n - act;",
"res",
"n - act",
"n",
"act",
"if (res < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(res);\n }",
"res < 0",
"res",
"0",
"{\n System.out.println(\"-1\");\n }",
"System.out.println(\"-1\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"-1\"",
"{\n System.out.println(res);\n }",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n // if (true) return;\n Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n String s = in.nextLine();\n int n = Integer.parseInt(s.split(\" \")[0]);\n int act = 0;\n String tasks = in.nextLine();\n for (String t : tasks.split(\" \")) {\n act = act + Integer.parseInt(t);\n }\n int res = n - act;\n if (res < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(res);\n }\n \n }\n\n}",
"public class Main {\n public static void main(String[] args) {\n // if (true) return;\n Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\n String s = in.nextLine();\n int n = Integer.parseInt(s.split(\" \")[0]);\n int act = 0;\n String tasks = in.nextLine();\n for (String t : tasks.split(\" \")) {\n act = act + Integer.parseInt(t);\n }\n int res = n - act;\n if (res < 0) {\n System.out.println(\"-1\");\n } else {\n System.out.println(res);\n }\n \n }\n\n}",
"Main"
] |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
/**
*
* @author yoovraj.shinde
*/
public class Main {
public static void main(String[] args) {
// if (true) return;
Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
String s = in.nextLine();
int n = Integer.parseInt(s.split(" ")[0]);
int act = 0;
String tasks = in.nextLine();
for (String t : tasks.split(" ")) {
act = act + Integer.parseInt(t);
}
int res = n - act;
if (res < 0) {
System.out.println("-1");
} else {
System.out.println(res);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
18,
13,
40,
17,
2,
13,
13,
23,
13,
6,
13,
41,
13,
2,
17,
17,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
13,
0,
13,
0,
13,
17,
12,
13,
30,
0,
13,
20,
0,
13,
20,
13,
0,
13,
0,
13,
17,
23,
13,
12,
13,
30,
41,
13,
20,
17,
41,
13,
17,
41,
13,
42,
2,
0,
13,
4,
13,
40,
17,
30,
14,
2,
13,
17,
3,
0,
18,
13,
40,
13,
13,
29,
20,
12,
13,
30,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
42,
2,
13,
17,
0,
13,
4,
13,
41,
13,
2,
13,
17,
14,
13,
0,
13,
4,
13,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
2,
13,
17,
13,
17,
14,
2,
13,
17,
30,
42,
2,
2,
0,
13,
4,
13,
17,
2,
13,
17,
30,
0,
13,
2,
2,
13,
17,
0,
13,
17,
14,
13,
29,
40,
13,
29,
13,
12,
13,
30,
0,
13,
4,
18,
13,
13,
0,
13,
17,
13,
14,
2,
13,
40,
17,
0,
18,
13,
17,
40,
17,
12,
13,
30,
14,
2,
13,
13,
4,
13,
29,
18,
13,
40,
13,
12,
13,
30,
14,
2,
13,
17,
29,
4,
18,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
11,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
28,
36
],
[
36,
37
],
[
37,
38
],
[
28,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
11,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
45,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
9,
58
],
[
58,
59
],
[
0,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
64,
66
],
[
60,
67
],
[
67,
68
],
[
60,
69
],
[
69,
70
],
[
60,
71
],
[
71,
72
],
[
60,
73
],
[
73,
74
],
[
60,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
77,
81
],
[
81,
82
],
[
81,
83
],
[
77,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
87,
89
],
[
60,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
92,
96
],
[
96,
97
],
[
96,
98
],
[
92,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
102,
104
],
[
90,
105
],
[
105,
106
],
[
60,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
109,
117
],
[
117,
118
],
[
109,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
120,
125
],
[
125,
126
],
[
119,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
127,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
136,
137
],
[
133,
138
],
[
109,
139
],
[
139,
140
],
[
60,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
143,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
143,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
143,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
161,
163
],
[
143,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
143,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
172,
177
],
[
171,
178
],
[
178,
179
],
[
178,
180
],
[
170,
181
],
[
181,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
184,
190
],
[
143,
191
],
[
191,
192
],
[
191,
193
],
[
193,
194
],
[
194,
195
],
[
143,
196
],
[
196,
197
],
[
60,
198
],
[
198,
199
],
[
198,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
200,
208
],
[
208,
209
],
[
209,
210
],
[
209,
211
],
[
208,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
200,
216
],
[
216,
217
],
[
216,
218
],
[
218,
219
],
[
218,
220
],
[
200,
221
],
[
221,
222
],
[
221,
223
],
[
223,
224
],
[
223,
225
],
[
225,
226
],
[
200,
227
],
[
227,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
232,
233
],
[
229,
234
],
[
228,
235
],
[
235,
236
],
[
235,
237
],
[
227,
238
],
[
238,
239
],
[
239,
240
],
[
239,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
243,
245
],
[
242,
246
],
[
241,
247
],
[
200,
248
],
[
248,
249
],
[
248,
250
],
[
250,
251
],
[
251,
252
],
[
200,
253
],
[
253,
254
],
[
60,
255
],
[
255,
256
],
[
255,
257
],
[
257,
258
],
[
258,
259
],
[
258,
260
],
[
257,
261
],
[
261,
262
],
[
261,
263
],
[
257,
264
],
[
264,
265
],
[
264,
266
],
[
266,
267
],
[
257,
268
],
[
268,
269
],
[
269,
270
],
[
269,
271
],
[
268,
272
],
[
272,
273
],
[
272,
274
],
[
274,
275
],
[
257,
276
],
[
276,
277
],
[
276,
278
],
[
278,
279
],
[
278,
280
],
[
257,
281
],
[
281,
282
],
[
281,
283
],
[
283,
284
],
[
283,
285
],
[
285,
286
],
[
257,
287
],
[
287,
288
],
[
288,
289
],
[
289,
290
],
[
290,
291
],
[
290,
292
],
[
292,
293
],
[
289,
294
],
[
288,
295
],
[
295,
296
],
[
295,
297
],
[
287,
298
],
[
298,
299
],
[
299,
300
],
[
299,
301
],
[
301,
302
],
[
302,
303
],
[
303,
304
],
[
303,
305
],
[
302,
306
],
[
301,
307
],
[
257,
308
],
[
308,
309
],
[
309,
310
],
[
309,
311
],
[
308,
312
],
[
312,
313
],
[
313,
314
],
[
314,
315
],
[
315,
316
],
[
316,
317
],
[
316,
318
],
[
318,
319
],
[
315,
320
],
[
314,
321
],
[
321,
322
],
[
321,
323
],
[
313,
324
],
[
324,
325
],
[
325,
326
],
[
325,
327
],
[
327,
328
],
[
328,
329
],
[
328,
330
],
[
327,
331
],
[
331,
332
],
[
331,
333
],
[
257,
334
],
[
334,
335
],
[
334,
336
],
[
336,
337
],
[
337,
338
],
[
257,
339
],
[
339,
340
],
[
60,
341
],
[
341,
342
],
[
341,
343
],
[
343,
344
],
[
344,
345
],
[
344,
346
],
[
346,
347
],
[
347,
348
],
[
346,
349
],
[
346,
350
],
[
350,
351
],
[
350,
352
],
[
346,
353
],
[
343,
354
],
[
354,
355
],
[
355,
356
],
[
355,
357
],
[
357,
358
],
[
354,
359
],
[
359,
360
],
[
360,
361
],
[
360,
362
],
[
359,
363
],
[
363,
364
],
[
60,
365
],
[
365,
366
],
[
365,
367
],
[
367,
368
],
[
368,
369
],
[
369,
370
],
[
369,
371
],
[
368,
372
],
[
372,
373
],
[
367,
374
],
[
374,
375
],
[
375,
376
],
[
375,
377
],
[
377,
378
],
[
60,
379
],
[
379,
380
],
[
379,
381
],
[
381,
382
],
[
382,
383
],
[
383,
384
],
[
383,
385
],
[
382,
386
],
[
381,
387
],
[
387,
388
],
[
388,
389
]
] |
[
"import java.util.*;\nimport java.io.*;\nclass Main\n{\n public static void main(String args[])throws IOException\n {\n Reader in = new Reader();\n int n = in.nextInt();\n int m = in.nextInt();\n int sum = 0;\n for (int i=0;i<m;i++)\n sum += in.nextInt();\n System.out.println(Math.max(-1, n - sum));\n }\n}\nclass Reader\n{\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public Reader()\n {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public Reader(String file_name) throws IOException\n {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public String readLine() throws IOException\n {\n byte[] buf = new byte[64]; // line length\n int cnt = 0, c;\n while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }\n\n public int nextInt() throws IOException\n {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException\n {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException\n {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }\n\n private void fillBuffer() throws IOException\n {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n private byte read() throws IOException\n {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException\n {\n if (din == null)\n return;\n din.close();\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"class Main\n{\n public static void main(String args[])throws IOException\n {\n Reader in = new Reader();\n int n = in.nextInt();\n int m = in.nextInt();\n int sum = 0;\n for (int i=0;i<m;i++)\n sum += in.nextInt();\n System.out.println(Math.max(-1, n - sum));\n }\n}",
"Main",
"public static void main(String args[])throws IOException\n {\n Reader in = new Reader();\n int n = in.nextInt();\n int m = in.nextInt();\n int sum = 0;\n for (int i=0;i<m;i++)\n sum += in.nextInt();\n System.out.println(Math.max(-1, n - sum));\n }",
"main",
"{\n Reader in = new Reader();\n int n = in.nextInt();\n int m = in.nextInt();\n int sum = 0;\n for (int i=0;i<m;i++)\n sum += in.nextInt();\n System.out.println(Math.max(-1, n - sum));\n }",
"Reader in = new Reader();",
"in",
"new Reader()",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int m = in.nextInt();",
"m",
"in.nextInt()",
"in.nextInt",
"in",
"int sum = 0;",
"sum",
"0",
"for (int i=0;i<m;i++)\n sum += in.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<m",
"i",
"m",
"i++",
"i++",
"i",
"sum += in.nextInt();",
"sum += in.nextInt()",
"sum",
"in.nextInt()",
"in.nextInt",
"in",
"System.out.println(Math.max(-1, n - sum))",
"System.out.println",
"System.out",
"System",
"System.out",
"Math.max(-1, n - sum)",
"Math.max",
"Math",
"-1",
"1",
"n - sum",
"n",
"sum",
"String args[]",
"args",
"class Reader\n{\n final private int BUFFER_SIZE = 1 << 16;\n private DataInputStream din;\n private byte[] buffer;\n private int bufferPointer, bytesRead;\n\n public Reader()\n {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public Reader(String file_name) throws IOException\n {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }\n\n public String readLine() throws IOException\n {\n byte[] buf = new byte[64]; // line length\n int cnt = 0, c;\n while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }\n\n public int nextInt() throws IOException\n {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }\n\n public long nextLong() throws IOException\n {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }\n\n public double nextDouble() throws IOException\n {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }\n\n private void fillBuffer() throws IOException\n {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }\n\n private byte read() throws IOException\n {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }\n\n public void close() throws IOException\n {\n if (din == null)\n return;\n din.close();\n }\n}",
"Reader",
"final private int BUFFER_SIZE = 1 << 16;",
"BUFFER_SIZE",
"1 << 16",
"1",
"16",
"private DataInputStream din;",
"din",
"private byte[] buffer;",
"buffer",
"private int bufferPointer",
"bufferPointer",
"bytesRead;",
"bytesRead",
"public Reader()\n {\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"Reader",
"{\n din = new DataInputStream(System.in);\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"din = new DataInputStream(System.in)",
"din",
"new DataInputStream(System.in)",
"buffer = new byte[BUFFER_SIZE]",
"buffer",
"new byte[BUFFER_SIZE]",
"BUFFER_SIZE",
"bufferPointer = bytesRead = 0",
"bufferPointer",
"bytesRead = 0",
"bytesRead",
"0",
"public Reader(String file_name) throws IOException\n {\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"Reader",
"{\n din = new DataInputStream(new FileInputStream(file_name));\n buffer = new byte[BUFFER_SIZE];\n bufferPointer = bytesRead = 0;\n }",
"din = new DataInputStream(new FileInputStream(file_name))",
"din",
"new DataInputStream(new FileInputStream(file_name))",
"buffer = new byte[BUFFER_SIZE]",
"buffer",
"new byte[BUFFER_SIZE]",
"BUFFER_SIZE",
"bufferPointer = bytesRead = 0",
"bufferPointer",
"bytesRead = 0",
"bytesRead",
"0",
"String file_name",
"file_name",
"public String readLine() throws IOException\n {\n byte[] buf = new byte[64]; // line length\n int cnt = 0, c;\n while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }",
"readLine",
"{\n byte[] buf = new byte[64]; // line length\n int cnt = 0, c;\n while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }\n return new String(buf, 0, cnt);\n }",
"byte[] buf = new byte[64];",
"buf",
"new byte[64]",
"64",
"int cnt = 0",
"cnt",
"0",
"c;",
"c",
"while ((c = read()) != -1)\n {\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }",
"(c = read()) != -1",
"(c = read())",
"c",
"read()",
"read",
"-1",
"1",
"{\n if (c == '\\n')\n break;\n buf[cnt++] = (byte) c;\n }",
"if (c == '\\n')\n break;",
"c == '\\n'",
"c",
"'\\n'",
"break;",
"buf[cnt++] = (byte) c",
"buf[cnt++]",
"buf",
"cnt++",
"cnt",
"(byte) c",
"return new String(buf, 0, cnt);",
"new String(buf, 0, cnt)",
"public int nextInt() throws IOException\n {\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }",
"nextInt",
"{\n int ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');\n\n if (neg)\n return -ret;\n return ret;\n }",
"int ret = 0;",
"ret",
"0",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ')\n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg)\n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do\n {\n ret = ret * 10 + c - '0';\n } while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret = ret * 10 + c - '0';\n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (neg)\n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public long nextLong() throws IOException\n {\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }",
"nextLong",
"{\n long ret = 0;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n if (neg)\n return -ret;\n return ret;\n }",
"long ret = 0;",
"ret",
"0",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ')\n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg)\n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret = ret * 10 + c - '0';\n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (neg)\n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"public double nextDouble() throws IOException\n {\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }",
"nextDouble",
"{\n double ret = 0, div = 1;\n byte c = read();\n while (c <= ' ')\n c = read();\n boolean neg = (c == '-');\n if (neg)\n c = read();\n\n do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');\n\n if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }\n\n if (neg)\n return -ret;\n return ret;\n }",
"double ret = 0",
"ret",
"0",
"div = 1;",
"div",
"1",
"byte c = read();",
"c",
"read()",
"read",
"while (c <= ' ')\n c = read();",
"c <= ' '",
"c",
"' '",
"c = read()",
"c",
"read()",
"read",
"boolean neg = (c == '-');",
"neg",
"(c == '-')",
"c",
"'-'",
"if (neg)\n c = read();",
"neg",
"c = read()",
"c",
"read()",
"read",
"do {\n ret = ret * 10 + c - '0';\n }\n while ((c = read()) >= '0' && c <= '9');",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret = ret * 10 + c - '0';\n }",
"ret = ret * 10 + c - '0'",
"ret",
"ret * 10 + c - '0'",
"ret * 10 + c",
"ret * 10",
"ret",
"10",
"c",
"'0'",
"if (c == '.')\n {\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }",
"c == '.'",
"c",
"'.'",
"{\n while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }\n }",
"while ((c = read()) >= '0' && c <= '9')\n {\n ret += (c - '0') / (div *= 10);\n }",
"(c = read()) >= '0' && c <= '9'",
"(c = read()) >= '0'",
"(c = read())",
"c",
"read()",
"read",
"'0'",
"c <= '9'",
"c",
"'9'",
"{\n ret += (c - '0') / (div *= 10);\n }",
"ret += (c - '0') / (div *= 10)",
"ret",
"(c - '0') / (div *= 10)",
"(c - '0')",
"c",
"'0'",
"(div *= 10)",
"div",
"10",
"if (neg)\n return -ret;",
"neg",
"return -ret;",
"-ret",
"ret",
"return ret;",
"ret",
"private void fillBuffer() throws IOException\n {\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }",
"fillBuffer",
"{\n bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);\n if (bytesRead == -1)\n buffer[0] = -1;\n }",
"bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE)",
"bytesRead",
"din.read(buffer, bufferPointer = 0, BUFFER_SIZE)",
"din.read",
"din",
"buffer",
"bufferPointer = 0",
"bufferPointer",
"0",
"BUFFER_SIZE",
"if (bytesRead == -1)\n buffer[0] = -1;",
"bytesRead == -1",
"bytesRead",
"-1",
"1",
"buffer[0] = -1",
"buffer[0]",
"buffer",
"0",
"-1",
"1",
"private byte read() throws IOException\n {\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }",
"read",
"{\n if (bufferPointer == bytesRead)\n fillBuffer();\n return buffer[bufferPointer++];\n }",
"if (bufferPointer == bytesRead)\n fillBuffer();",
"bufferPointer == bytesRead",
"bufferPointer",
"bytesRead",
"fillBuffer()",
"fillBuffer",
"return buffer[bufferPointer++];",
"buffer[bufferPointer++]",
"buffer",
"bufferPointer++",
"bufferPointer",
"public void close() throws IOException\n {\n if (din == null)\n return;\n din.close();\n }",
"close",
"{\n if (din == null)\n return;\n din.close();\n }",
"if (din == null)\n return;",
"din == null",
"din",
"null",
"return;",
"din.close()",
"din.close",
"din"
] |
import java.util.*;
import java.io.*;
class Main
{
public static void main(String args[])throws IOException
{
Reader in = new Reader();
int n = in.nextInt();
int m = in.nextInt();
int sum = 0;
for (int i=0;i<m;i++)
sum += in.nextInt();
System.out.println(Math.max(-1, n - sum));
}
}
class Reader
{
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public Reader()
{
din = new DataInputStream(System.in);
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
public Reader(String file_name) throws IOException
{
din = new DataInputStream(new FileInputStream(file_name));
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
public String readLine() throws IOException
{
byte[] buf = new byte[64]; // line length
int cnt = 0, c;
while ((c = read()) != -1)
{
if (c == '\n')
break;
buf[cnt++] = (byte) c;
}
return new String(buf, 0, cnt);
}
public int nextInt() throws IOException
{
int ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do
{
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
public long nextLong() throws IOException
{
long ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
}
while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
public double nextDouble() throws IOException
{
double ret = 0, div = 1;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
}
while ((c = read()) >= '0' && c <= '9');
if (c == '.')
{
while ((c = read()) >= '0' && c <= '9')
{
ret += (c - '0') / (div *= 10);
}
}
if (neg)
return -ret;
return ret;
}
private void fillBuffer() throws IOException
{
bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
if (bytesRead == -1)
buffer[0] = -1;
}
private byte read() throws IOException
{
if (bufferPointer == bytesRead)
fillBuffer();
return buffer[bufferPointer++];
}
public void close() throws IOException
{
if (din == null)
return;
din.close();
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
14,
2,
13,
40,
17,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
69,
5
],
[
69,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
8,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
46,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
46,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
6,
66
],
[
66,
67
],
[
0,
68
],
[
68,
69
],
[
68,
70
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tlong N = scn.nextInt();\n\t\tint M = scn.nextInt();\n\t\tlong ans = N;\n\t\tfor(int i = 0;i<M;i++) {\n\t\t\tans -= scn.nextInt();\n\t\t}\n\t\tscn.close();\n\t\tif(ans <= -1) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tlong N = scn.nextInt();\n\t\tint M = scn.nextInt();\n\t\tlong ans = N;\n\t\tfor(int i = 0;i<M;i++) {\n\t\t\tans -= scn.nextInt();\n\t\t}\n\t\tscn.close();\n\t\tif(ans <= -1) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tlong N = scn.nextInt();\n\t\tint M = scn.nextInt();\n\t\tlong ans = N;\n\t\tfor(int i = 0;i<M;i++) {\n\t\t\tans -= scn.nextInt();\n\t\t}\n\t\tscn.close();\n\t\tif(ans <= -1) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\n\t}",
"main",
"{\n\t\tScanner scn = new Scanner(System.in);\n\t\tlong N = scn.nextInt();\n\t\tint M = scn.nextInt();\n\t\tlong ans = N;\n\t\tfor(int i = 0;i<M;i++) {\n\t\t\tans -= scn.nextInt();\n\t\t}\n\t\tscn.close();\n\t\tif(ans <= -1) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\n\t}",
"Scanner scn = new Scanner(System.in);",
"scn",
"new Scanner(System.in)",
"long N = scn.nextInt();",
"N",
"scn.nextInt()",
"scn.nextInt",
"scn",
"int M = scn.nextInt();",
"M",
"scn.nextInt()",
"scn.nextInt",
"scn",
"long ans = N;",
"ans",
"N",
"for(int i = 0;i<M;i++) {\n\t\t\tans -= scn.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<M",
"i",
"M",
"i++",
"i++",
"i",
"{\n\t\t\tans -= scn.nextInt();\n\t\t}",
"{\n\t\t\tans -= scn.nextInt();\n\t\t}",
"ans -= scn.nextInt()",
"ans",
"scn.nextInt()",
"scn.nextInt",
"scn",
"scn.close()",
"scn.close",
"scn",
"if(ans <= -1) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}",
"ans <= -1",
"ans",
"-1",
"1",
"{\n\t\t\tSystem.out.println(-1);\n\t\t}",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n\t\t\tSystem.out.println(ans);\n\t\t}",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tlong N = scn.nextInt();\n\t\tint M = scn.nextInt();\n\t\tlong ans = N;\n\t\tfor(int i = 0;i<M;i++) {\n\t\t\tans -= scn.nextInt();\n\t\t}\n\t\tscn.close();\n\t\tif(ans <= -1) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tlong N = scn.nextInt();\n\t\tint M = scn.nextInt();\n\t\tlong ans = N;\n\t\tfor(int i = 0;i<M;i++) {\n\t\t\tans -= scn.nextInt();\n\t\t}\n\t\tscn.close();\n\t\tif(ans <= -1) {\n\t\t\tSystem.out.println(-1);\n\t\t} else {\n\t\t\tSystem.out.println(ans);\n\t\t}\n\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
long N = scn.nextInt();
int M = scn.nextInt();
long ans = N;
for(int i = 0;i<M;i++) {
ans -= scn.nextInt();
}
scn.close();
if(ans <= -1) {
System.out.println(-1);
} else {
System.out.println(ans);
}
}
}
|
[
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,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
41,
13,
4,
18,
18,
13,
17,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
18,
13,
17,
17,
41,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
41,
13,
4,
18,
4,
18,
13,
13,
14,
2,
13,
13,
30,
4,
18,
18,
13,
13,
40,
17,
30,
4,
18,
18,
13,
13,
2,
13,
13,
4,
18,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
20,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
28,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
28,
38
],
[
38,
39
],
[
39,
40
],
[
28,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
43,
47
],
[
47,
48
],
[
48,
49
],
[
20,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
20,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
63,
64
],
[
63,
65
],
[
20,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
71,
72
],
[
71,
73
],
[
20,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
20,
82
],
[
82,
83
],
[
82,
84
],
[
85,
86
],
[
85,
87
],
[
20,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
95,
97
],
[
88,
98
],
[
98,
99
],
[
99,
100
],
[
88,
101
],
[
102,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
110,
112
],
[
20,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
20,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
121,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
139,
140
],
[
139,
141
],
[
20,
142
],
[
142,
143
],
[
143,
144
],
[
18,
145
],
[
145,
146
]
] |
[
"import java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Scanner;\n\nclass Main {\n public static void main(final String[] args) {\n \n Scanner scanner = new Scanner(System.in);\n String[] arr = new String[2];\n for(int i = 0;i < arr.length;i++) {\n arr[i] = scanner.nextLine();\n }\n\n String[] line1 = arr[0].split(\" \");\n\n int n = Integer.parseInt(line1[0]);\n int m = Integer.parseInt(line1[1]);\n\n String[] line2 = arr[1].split(\" \");\n\n int[] a = new int[line2.length];\n for (int i = 0; i < line2.length; i++) {\n a[i] = Integer.parseInt(line2[i]);\n }\n\n int sum = Arrays.stream(a).sum();\n\n if(sum > n){\n System.out.println(-1);\n }else{\n System.out.println(n - sum);\n }\n\n scanner.close();\n }\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(final String[] args) {\n \n Scanner scanner = new Scanner(System.in);\n String[] arr = new String[2];\n for(int i = 0;i < arr.length;i++) {\n arr[i] = scanner.nextLine();\n }\n\n String[] line1 = arr[0].split(\" \");\n\n int n = Integer.parseInt(line1[0]);\n int m = Integer.parseInt(line1[1]);\n\n String[] line2 = arr[1].split(\" \");\n\n int[] a = new int[line2.length];\n for (int i = 0; i < line2.length; i++) {\n a[i] = Integer.parseInt(line2[i]);\n }\n\n int sum = Arrays.stream(a).sum();\n\n if(sum > n){\n System.out.println(-1);\n }else{\n System.out.println(n - sum);\n }\n\n scanner.close();\n }\n}",
"Main",
"public static void main(final String[] args) {\n \n Scanner scanner = new Scanner(System.in);\n String[] arr = new String[2];\n for(int i = 0;i < arr.length;i++) {\n arr[i] = scanner.nextLine();\n }\n\n String[] line1 = arr[0].split(\" \");\n\n int n = Integer.parseInt(line1[0]);\n int m = Integer.parseInt(line1[1]);\n\n String[] line2 = arr[1].split(\" \");\n\n int[] a = new int[line2.length];\n for (int i = 0; i < line2.length; i++) {\n a[i] = Integer.parseInt(line2[i]);\n }\n\n int sum = Arrays.stream(a).sum();\n\n if(sum > n){\n System.out.println(-1);\n }else{\n System.out.println(n - sum);\n }\n\n scanner.close();\n }",
"main",
"{\n \n Scanner scanner = new Scanner(System.in);\n String[] arr = new String[2];\n for(int i = 0;i < arr.length;i++) {\n arr[i] = scanner.nextLine();\n }\n\n String[] line1 = arr[0].split(\" \");\n\n int n = Integer.parseInt(line1[0]);\n int m = Integer.parseInt(line1[1]);\n\n String[] line2 = arr[1].split(\" \");\n\n int[] a = new int[line2.length];\n for (int i = 0; i < line2.length; i++) {\n a[i] = Integer.parseInt(line2[i]);\n }\n\n int sum = Arrays.stream(a).sum();\n\n if(sum > n){\n System.out.println(-1);\n }else{\n System.out.println(n - sum);\n }\n\n scanner.close();\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"String[] arr = new String[2];",
"arr",
"new String[2]",
"2",
"for(int i = 0;i < arr.length;i++) {\n arr[i] = scanner.nextLine();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n arr[i] = scanner.nextLine();\n }",
"{\n arr[i] = scanner.nextLine();\n }",
"arr[i] = scanner.nextLine()",
"arr[i]",
"arr",
"i",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"String[] line1 = arr[0].split(\" \");",
"line1",
"arr[0].split(\" \")",
"arr[0].split",
"arr[0]",
"arr",
"0",
"\" \"",
"int n = Integer.parseInt(line1[0]);",
"n",
"Integer.parseInt(line1[0])",
"Integer.parseInt",
"Integer",
"line1[0]",
"line1",
"0",
"int m = Integer.parseInt(line1[1]);",
"m",
"Integer.parseInt(line1[1])",
"Integer.parseInt",
"Integer",
"line1[1]",
"line1",
"1",
"String[] line2 = arr[1].split(\" \");",
"line2",
"arr[1].split(\" \")",
"arr[1].split",
"arr[1]",
"arr",
"1",
"\" \"",
"int[] a = new int[line2.length];",
"a",
"new int[line2.length]",
"line2.length",
"line2",
"line2.length",
"for (int i = 0; i < line2.length; i++) {\n a[i] = Integer.parseInt(line2[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < line2.length",
"i",
"line2.length",
"line2",
"line2.length",
"i++",
"i++",
"i",
"{\n a[i] = Integer.parseInt(line2[i]);\n }",
"{\n a[i] = Integer.parseInt(line2[i]);\n }",
"a[i] = Integer.parseInt(line2[i])",
"a[i]",
"a",
"i",
"Integer.parseInt(line2[i])",
"Integer.parseInt",
"Integer",
"line2[i]",
"line2",
"i",
"int sum = Arrays.stream(a).sum();",
"sum",
"Arrays.stream(a).sum()",
"Arrays.stream(a).sum",
"Arrays.stream(a)",
"Arrays.stream",
"Arrays",
"a",
"if(sum > n){\n System.out.println(-1);\n }else{\n System.out.println(n - sum);\n }",
"sum > n",
"sum",
"n",
"{\n System.out.println(-1);\n }",
"System.out.println(-1)",
"System.out.println",
"System.out",
"System",
"System.out",
"-1",
"1",
"{\n System.out.println(n - sum);\n }",
"System.out.println(n - sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"n - sum",
"n",
"sum",
"scanner.close()",
"scanner.close",
"scanner",
"final String[] args",
"args"
] |
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
class Main {
public static void main(final String[] args) {
Scanner scanner = new Scanner(System.in);
String[] arr = new String[2];
for(int i = 0;i < arr.length;i++) {
arr[i] = scanner.nextLine();
}
String[] line1 = arr[0].split(" ");
int n = Integer.parseInt(line1[0]);
int m = Integer.parseInt(line1[1]);
String[] line2 = arr[1].split(" ");
int[] a = new int[line2.length];
for (int i = 0; i < line2.length; i++) {
a[i] = Integer.parseInt(line2[i]);
}
int sum = Arrays.stream(a).sum();
if(sum > n){
System.out.println(-1);
}else{
System.out.println(n - sum);
}
scanner.close();
}
}
|
[
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,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
6,
13,
41,
13,
18,
13,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
12,
13,
30,
14,
2,
13,
13,
30,
29,
17,
30,
0,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
29,
17,
29,
17,
12,
13,
30,
14,
4,
13,
30,
29,
18,
13,
40,
13,
30,
29,
40,
17,
12,
13,
30,
29,
2,
2,
17,
13,
2,
13,
17,
23,
13,
12,
13,
30,
42,
2,
4,
13,
40,
4,
13,
18,
13,
13,
30,
40,
13,
12,
13,
30,
4,
13,
29,
4,
13,
12,
13,
30,
14,
40,
4,
13,
30,
37,
20,
41,
13,
20,
41,
13,
4,
13,
42,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
40,
4,
13,
30,
37,
20,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
14,
2,
2,
13,
17,
2,
17,
13,
30,
37,
20,
42,
17,
30,
14,
2,
2,
17,
13,
2,
13,
17,
30,
0,
13,
17,
0,
13,
2,
13,
17,
14,
2,
2,
13,
40,
17,
40,
4,
13,
13,
30,
29,
8,
13,
40,
13,
13,
30,
37,
20,
0,
13,
4,
13,
12,
13,
30,
14,
40,
4,
13,
30,
37,
20,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
14,
2,
2,
13,
17,
2,
17,
13,
30,
37,
20,
42,
17,
30,
14,
2,
2,
17,
13,
2,
13,
17,
30,
0,
13,
17,
0,
13,
2,
13,
17,
14,
2,
2,
13,
40,
17,
40,
4,
13,
13,
30,
29,
8,
13,
40,
13,
13,
30,
37,
20,
0,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
393,
11
],
[
393,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
14,
23
],
[
23,
24
],
[
23,
25
],
[
26,
27
],
[
26,
28
],
[
14,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
29,
39
],
[
39,
40
],
[
40,
41
],
[
29,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
43,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
14,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
12,
75
],
[
75,
76
],
[
0,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
81,
83
],
[
77,
84
],
[
84,
85
],
[
84,
86
],
[
77,
88
],
[
88,
89
],
[
88,
90
],
[
77,
91
],
[
91,
92
],
[
91,
93
],
[
77,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
101,
102
],
[
102,
103
],
[
97,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
108,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
118,
119
],
[
119,
120
],
[
118,
121
],
[
104,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
126,
127
],
[
127,
128
],
[
96,
129
],
[
129,
130
],
[
77,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
134,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
77,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
152,
154
],
[
151,
155
],
[
155,
156
],
[
155,
157
],
[
147,
158
],
[
158,
159
],
[
77,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
164,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
170,
171
],
[
170,
172
],
[
163,
173
],
[
173,
174
],
[
174,
175
],
[
77,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
179,
180
],
[
178,
181
],
[
181,
182
],
[
182,
183
],
[
77,
184
],
[
184,
185
],
[
184,
186
],
[
186,
187
],
[
187,
188
],
[
188,
189
],
[
189,
190
],
[
187,
191
],
[
191,
192
],
[
192,
193
],
[
186,
194
],
[
194,
195
],
[
194,
196
],
[
186,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
186,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
201,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
206,
209
],
[
205,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
186,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
77,
218
],
[
218,
219
],
[
218,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
223,
224
],
[
221,
225
],
[
225,
226
],
[
226,
227
],
[
220,
228
],
[
228,
229
],
[
228,
230
],
[
220,
231
],
[
231,
232
],
[
231,
233
],
[
220,
234
],
[
234,
235
],
[
234,
236
],
[
236,
237
],
[
220,
238
],
[
238,
239
],
[
239,
240
],
[
239,
241
],
[
238,
242
],
[
242,
243
],
[
243,
244
],
[
243,
245
],
[
242,
246
],
[
246,
247
],
[
246,
248
],
[
248,
249
],
[
220,
250
],
[
250,
251
],
[
251,
252
],
[
252,
253
],
[
252,
254
],
[
251,
255
],
[
255,
256
],
[
255,
257
],
[
250,
258
],
[
258,
259
],
[
259,
260
],
[
220,
261
],
[
261,
262
],
[
261,
263
],
[
263,
264
],
[
264,
265
],
[
265,
266
],
[
266,
267
],
[
266,
268
],
[
265,
269
],
[
269,
270
],
[
269,
271
],
[
264,
272
],
[
272,
273
],
[
273,
274
],
[
273,
275
],
[
272,
276
],
[
276,
277
],
[
276,
278
],
[
278,
279
],
[
278,
280
],
[
264,
281
],
[
281,
282
],
[
282,
283
],
[
283,
284
],
[
283,
285
],
[
285,
286
],
[
282,
287
],
[
287,
288
],
[
288,
289
],
[
288,
290
],
[
281,
291
],
[
291,
292
],
[
292,
293
],
[
293,
294
],
[
293,
295
],
[
295,
296
],
[
293,
297
],
[
281,
298
],
[
298,
299
],
[
299,
300
],
[
263,
301
],
[
301,
302
],
[
301,
303
],
[
303,
304
],
[
77,
305
],
[
305,
306
],
[
305,
307
],
[
307,
308
],
[
308,
309
],
[
309,
310
],
[
310,
311
],
[
308,
312
],
[
312,
313
],
[
313,
314
],
[
307,
315
],
[
315,
316
],
[
315,
317
],
[
307,
318
],
[
318,
319
],
[
318,
320
],
[
307,
321
],
[
321,
322
],
[
321,
323
],
[
323,
324
],
[
307,
325
],
[
325,
326
],
[
326,
327
],
[
326,
328
],
[
325,
329
],
[
329,
330
],
[
330,
331
],
[
330,
332
],
[
329,
333
],
[
333,
334
],
[
333,
335
],
[
335,
336
],
[
307,
337
],
[
337,
338
],
[
338,
339
],
[
339,
340
],
[
339,
341
],
[
338,
342
],
[
342,
343
],
[
342,
344
],
[
337,
345
],
[
345,
346
],
[
346,
347
],
[
307,
348
],
[
348,
349
],
[
348,
350
],
[
350,
351
],
[
351,
352
],
[
352,
353
],
[
353,
354
],
[
353,
355
],
[
352,
356
],
[
356,
357
],
[
356,
358
],
[
351,
359
],
[
359,
360
],
[
360,
361
],
[
360,
362
],
[
359,
363
],
[
363,
364
],
[
363,
365
],
[
365,
366
],
[
365,
367
],
[
351,
368
],
[
368,
369
],
[
369,
370
],
[
370,
371
],
[
370,
372
],
[
372,
373
],
[
369,
374
],
[
374,
375
],
[
375,
376
],
[
375,
377
],
[
368,
378
],
[
378,
379
],
[
379,
380
],
[
380,
381
],
[
380,
382
],
[
382,
383
],
[
380,
384
],
[
368,
385
],
[
385,
386
],
[
386,
387
],
[
350,
388
],
[
388,
389
],
[
388,
390
],
[
390,
391
],
[
0,
392
],
[
392,
393
],
[
392,
394
]
] |
[
"import java.io.IOException;\nimport java.io.InputStream;\nimport java.util.NoSuchElementException;\n\npublic class Main {\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n\n int N = sc.nextInt();\n int[] A = new int[N + 1];\n\n for (int i = 0; i < N - 1; i++) {\n int num = sc.nextInt();\n A[num] += 1;\n }\n for (int i = 1; i <= N; i++) {\n System.out.println(A[i]);\n }\n\n }\n}\n\nclass FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n\n private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n } else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }\n\n private int readByte() {\n if (hasNextByte()) {\n return buffer[ptr++];\n } else {\n return -1;\n }\n }\n\n private static boolean isPrintableChar(int c) {\n return 33 <= c && c <= 126;\n }\n\n private void skipUnprintable() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) {\n ptr++;\n }\n }\n\n public boolean hasNext() {\n skipUnprintable();\n return hasNextByte();\n }\n\n public String next() {\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while (isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n\n public int nextInt() {\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n int n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n\n public long nextLong() {\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.util.NoSuchElementException;",
"NoSuchElementException",
"java.util",
"public class Main {\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n\n int N = sc.nextInt();\n int[] A = new int[N + 1];\n\n for (int i = 0; i < N - 1; i++) {\n int num = sc.nextInt();\n A[num] += 1;\n }\n for (int i = 1; i <= N; i++) {\n System.out.println(A[i]);\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n\n int N = sc.nextInt();\n int[] A = new int[N + 1];\n\n for (int i = 0; i < N - 1; i++) {\n int num = sc.nextInt();\n A[num] += 1;\n }\n for (int i = 1; i <= N; i++) {\n System.out.println(A[i]);\n }\n\n }",
"main",
"{\n FastScanner sc = new FastScanner();\n\n int N = sc.nextInt();\n int[] A = new int[N + 1];\n\n for (int i = 0; i < N - 1; i++) {\n int num = sc.nextInt();\n A[num] += 1;\n }\n for (int i = 1; i <= N; i++) {\n System.out.println(A[i]);\n }\n\n }",
"FastScanner sc = new FastScanner();",
"sc",
"new FastScanner()",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = new int[N + 1];",
"A",
"new int[N + 1]",
"N + 1",
"N",
"1",
"for (int i = 0; i < N - 1; i++) {\n int num = sc.nextInt();\n A[num] += 1;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N - 1",
"i",
"N - 1",
"N",
"1",
"i++",
"i++",
"i",
"{\n int num = sc.nextInt();\n A[num] += 1;\n }",
"{\n int num = sc.nextInt();\n A[num] += 1;\n }",
"int num = sc.nextInt();",
"num",
"sc.nextInt()",
"sc.nextInt",
"sc",
"A[num] += 1",
"A[num]",
"A",
"num",
"1",
"for (int i = 1; i <= N; i++) {\n System.out.println(A[i]);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= N",
"i",
"N",
"i++",
"i++",
"i",
"{\n System.out.println(A[i]);\n }",
"{\n System.out.println(A[i]);\n }",
"System.out.println(A[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"A[i]",
"A",
"i",
"String[] args",
"args",
"class FastScanner {\n private final InputStream in = System.in;\n private final byte[] buffer = new byte[1024];\n private int ptr = 0;\n private int buflen = 0;\n\n private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n } else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }\n\n private int readByte() {\n if (hasNextByte()) {\n return buffer[ptr++];\n } else {\n return -1;\n }\n }\n\n private static boolean isPrintableChar(int c) {\n return 33 <= c && c <= 126;\n }\n\n private void skipUnprintable() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) {\n ptr++;\n }\n }\n\n public boolean hasNext() {\n skipUnprintable();\n return hasNextByte();\n }\n\n public String next() {\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while (isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }\n\n public int nextInt() {\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n int n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n\n public long nextLong() {\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }\n}",
"FastScanner",
"private final InputStream in = System.in;",
"in",
"System.in",
"System",
"System.in",
"private final byte[] buffer = new byte[1024];",
"buffer",
"new byte[1024]",
"1024",
"private int ptr = 0;",
"ptr",
"0",
"private int buflen = 0;",
"buflen",
"0",
"private boolean hasNextByte() {\n if (ptr < buflen) {\n return true;\n } else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }",
"hasNextByte",
"{\n if (ptr < buflen) {\n return true;\n } else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }\n return true;\n }",
"if (ptr < buflen) {\n return true;\n } else {\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }",
"ptr < buflen",
"ptr",
"buflen",
"{\n return true;\n }",
"return true;",
"true",
"{\n ptr = 0;\n try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (buflen <= 0) {\n return false;\n }\n }",
"ptr = 0",
"ptr",
"0",
"try {\n buflen = in.read(buffer);\n } catch (IOException e) {\n e.printStackTrace();\n }",
"catch (IOException e) {\n e.printStackTrace();\n }",
"IOException e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n buflen = in.read(buffer);\n }",
"buflen = in.read(buffer)",
"buflen",
"in.read(buffer)",
"in.read",
"in",
"buffer",
"if (buflen <= 0) {\n return false;\n }",
"buflen <= 0",
"buflen",
"0",
"{\n return false;\n }",
"return false;",
"false",
"return true;",
"true",
"private int readByte() {\n if (hasNextByte()) {\n return buffer[ptr++];\n } else {\n return -1;\n }\n }",
"readByte",
"{\n if (hasNextByte()) {\n return buffer[ptr++];\n } else {\n return -1;\n }\n }",
"if (hasNextByte()) {\n return buffer[ptr++];\n } else {\n return -1;\n }",
"hasNextByte()",
"hasNextByte",
"{\n return buffer[ptr++];\n }",
"return buffer[ptr++];",
"buffer[ptr++]",
"buffer",
"ptr++",
"ptr",
"{\n return -1;\n }",
"return -1;",
"-1",
"1",
"private static boolean isPrintableChar(int c) {\n return 33 <= c && c <= 126;\n }",
"isPrintableChar",
"{\n return 33 <= c && c <= 126;\n }",
"return 33 <= c && c <= 126;",
"33 <= c && c <= 126",
"33 <= c",
"33",
"c",
"c <= 126",
"c",
"126",
"int c",
"c",
"private void skipUnprintable() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) {\n ptr++;\n }\n }",
"skipUnprintable",
"{\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) {\n ptr++;\n }\n }",
"while (hasNextByte() && !isPrintableChar(buffer[ptr])) {\n ptr++;\n }",
"hasNextByte() && !isPrintableChar(buffer[ptr])",
"hasNextByte()",
"hasNextByte",
"!isPrintableChar(buffer[ptr])",
"isPrintableChar(buffer[ptr])",
"isPrintableChar",
"buffer[ptr]",
"buffer",
"ptr",
"{\n ptr++;\n }",
"ptr++",
"ptr",
"public boolean hasNext() {\n skipUnprintable();\n return hasNextByte();\n }",
"hasNext",
"{\n skipUnprintable();\n return hasNextByte();\n }",
"skipUnprintable()",
"skipUnprintable",
"return hasNextByte();",
"hasNextByte()",
"hasNextByte",
"public String next() {\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while (isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }",
"next",
"{\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n StringBuilder sb = new StringBuilder();\n int b = readByte();\n while (isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }\n return sb.toString();\n }",
"if (!hasNext()) {\n throw new NoSuchElementException();\n }",
"!hasNext()",
"hasNext()",
"hasNext",
"{\n throw new NoSuchElementException();\n }",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"while (isPrintableChar(b)) {\n sb.appendCodePoint(b);\n b = readByte();\n }",
"isPrintableChar(b)",
"isPrintableChar",
"b",
"{\n sb.appendCodePoint(b);\n b = readByte();\n }",
"sb.appendCodePoint(b)",
"sb.appendCodePoint",
"sb",
"b",
"b = readByte()",
"b",
"readByte()",
"readByte",
"return sb.toString();",
"sb.toString()",
"sb.toString",
"sb",
"public int nextInt() {\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n int n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }",
"nextInt",
"{\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n int n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }",
"if (!hasNext()) {\n throw new NoSuchElementException();\n }",
"!hasNext()",
"hasNext()",
"hasNext",
"{\n throw new NoSuchElementException();\n }",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"int n = 0;",
"n",
"0",
"boolean minus = false;",
"minus",
"false",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"if (b == '-') {\n minus = true;\n b = readByte();\n }",
"b == '-'",
"b",
"'-'",
"{\n minus = true;\n b = readByte();\n }",
"minus = true",
"minus",
"true",
"b = readByte()",
"b",
"readByte()",
"readByte",
"if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }",
"b < '0' || '9' < b",
"b < '0'",
"b",
"'0'",
"'9' < b",
"'9'",
"b",
"{\n throw new NumberFormatException();\n }",
"throw new NumberFormatException();",
"new NumberFormatException()",
"while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }",
"true",
"{\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }",
"if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }",
"'0' <= b && b <= '9'",
"'0' <= b",
"'0'",
"b",
"b <= '9'",
"b",
"'9'",
"{\n n *= 10;\n n += b - '0';\n }",
"n *= 10",
"n",
"10",
"n += b - '0'",
"n",
"b - '0'",
"b",
"'0'",
"if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }",
"b == -1 || !isPrintableChar(b)",
"b == -1",
"b",
"-1",
"1",
"!isPrintableChar(b)",
"isPrintableChar(b)",
"isPrintableChar",
"b",
"{\n return minus ? -n : n;\n }",
"return minus ? -n : n;",
"minus ? -n : n",
"minus",
"-n",
"n",
"n",
"{\n throw new NumberFormatException();\n }",
"throw new NumberFormatException();",
"new NumberFormatException()",
"b = readByte()",
"b",
"readByte()",
"readByte",
"public long nextLong() {\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }",
"nextLong",
"{\n if (!hasNext()) {\n throw new NoSuchElementException();\n }\n long n = 0;\n boolean minus = false;\n int b = readByte();\n if (b == '-') {\n minus = true;\n b = readByte();\n }\n if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }\n while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }\n }",
"if (!hasNext()) {\n throw new NoSuchElementException();\n }",
"!hasNext()",
"hasNext()",
"hasNext",
"{\n throw new NoSuchElementException();\n }",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"long n = 0;",
"n",
"0",
"boolean minus = false;",
"minus",
"false",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"if (b == '-') {\n minus = true;\n b = readByte();\n }",
"b == '-'",
"b",
"'-'",
"{\n minus = true;\n b = readByte();\n }",
"minus = true",
"minus",
"true",
"b = readByte()",
"b",
"readByte()",
"readByte",
"if (b < '0' || '9' < b) {\n throw new NumberFormatException();\n }",
"b < '0' || '9' < b",
"b < '0'",
"b",
"'0'",
"'9' < b",
"'9'",
"b",
"{\n throw new NumberFormatException();\n }",
"throw new NumberFormatException();",
"new NumberFormatException()",
"while (true) {\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }",
"true",
"{\n if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }\n b = readByte();\n }",
"if ('0' <= b && b <= '9') {\n n *= 10;\n n += b - '0';\n } else if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }",
"'0' <= b && b <= '9'",
"'0' <= b",
"'0'",
"b",
"b <= '9'",
"b",
"'9'",
"{\n n *= 10;\n n += b - '0';\n }",
"n *= 10",
"n",
"10",
"n += b - '0'",
"n",
"b - '0'",
"b",
"'0'",
"if (b == -1 || !isPrintableChar(b)) {\n return minus ? -n : n;\n } else {\n throw new NumberFormatException();\n }",
"b == -1 || !isPrintableChar(b)",
"b == -1",
"b",
"-1",
"1",
"!isPrintableChar(b)",
"isPrintableChar(b)",
"isPrintableChar",
"b",
"{\n return minus ? -n : n;\n }",
"return minus ? -n : n;",
"minus ? -n : n",
"minus",
"-n",
"n",
"n",
"{\n throw new NumberFormatException();\n }",
"throw new NumberFormatException();",
"new NumberFormatException()",
"b = readByte()",
"b",
"readByte()",
"readByte",
"public class Main {\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n\n int N = sc.nextInt();\n int[] A = new int[N + 1];\n\n for (int i = 0; i < N - 1; i++) {\n int num = sc.nextInt();\n A[num] += 1;\n }\n for (int i = 1; i <= N; i++) {\n System.out.println(A[i]);\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n\n int N = sc.nextInt();\n int[] A = new int[N + 1];\n\n for (int i = 0; i < N - 1; i++) {\n int num = sc.nextInt();\n A[num] += 1;\n }\n for (int i = 1; i <= N; i++) {\n System.out.println(A[i]);\n }\n\n }\n}",
"Main"
] |
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
public class Main {
public static void main(String[] args) {
FastScanner sc = new FastScanner();
int N = sc.nextInt();
int[] A = new int[N + 1];
for (int i = 0; i < N - 1; i++) {
int num = sc.nextInt();
A[num] += 1;
}
for (int i = 1; i <= N; i++) {
System.out.println(A[i]);
}
}
}
class FastScanner {
private final InputStream in = System.in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
private boolean hasNextByte() {
if (ptr < buflen) {
return true;
} else {
ptr = 0;
try {
buflen = in.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
if (buflen <= 0) {
return false;
}
}
return true;
}
private int readByte() {
if (hasNextByte()) {
return buffer[ptr++];
} else {
return -1;
}
}
private static boolean isPrintableChar(int c) {
return 33 <= c && c <= 126;
}
private void skipUnprintable() {
while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
ptr++;
}
}
public boolean hasNext() {
skipUnprintable();
return hasNextByte();
}
public String next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
StringBuilder sb = new StringBuilder();
int b = readByte();
while (isPrintableChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public int nextInt() {
if (!hasNext()) {
throw new NoSuchElementException();
}
int n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
if (b < '0' || '9' < b) {
throw new NumberFormatException();
}
while (true) {
if ('0' <= b && b <= '9') {
n *= 10;
n += b - '0';
} else if (b == -1 || !isPrintableChar(b)) {
return minus ? -n : n;
} else {
throw new NumberFormatException();
}
b = readByte();
}
}
public long nextLong() {
if (!hasNext()) {
throw new NoSuchElementException();
}
long n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
if (b < '0' || '9' < b) {
throw new NumberFormatException();
}
while (true) {
if ('0' <= b && b <= '9') {
n *= 10;
n += b - '0';
} else if (b == -1 || !isPrintableChar(b)) {
return minus ? -n : n;
} else {
throw new NumberFormatException();
}
b = readByte();
}
}
}
|
[
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,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
18,
13,
2,
13,
17,
17,
28,
13,
13,
30,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
64,
5
],
[
64,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
28,
30
],
[
21,
31
],
[
31,
32
],
[
32,
33
],
[
21,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
35,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
44,
46
],
[
41,
47
],
[
8,
48
],
[
48,
49
],
[
48,
50
],
[
48,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
8,
58
],
[
58,
59
],
[
59,
60
],
[
6,
61
],
[
61,
62
],
[
0,
63
],
[
63,
64
],
[
63,
65
]
] |
[
"import java.util.*;\n \npublic class Main {\n \n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n \n\t\tint n = scanner.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i = 0; i < n - 1; i++) {\n\t\t\tint value = scanner.nextInt();\n\t\t\tarr[value - 1] += 1;\n\t\t}\n\t\t\n\t\tfor(int value : arr)\n\t\t\tSystem.out.println(value);\n\t\t\n \n\t\tscanner.close();\n\t}\n \n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n \n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n \n\t\tint n = scanner.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i = 0; i < n - 1; i++) {\n\t\t\tint value = scanner.nextInt();\n\t\t\tarr[value - 1] += 1;\n\t\t}\n\t\t\n\t\tfor(int value : arr)\n\t\t\tSystem.out.println(value);\n\t\t\n \n\t\tscanner.close();\n\t}\n \n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n \n\t\tint n = scanner.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i = 0; i < n - 1; i++) {\n\t\t\tint value = scanner.nextInt();\n\t\t\tarr[value - 1] += 1;\n\t\t}\n\t\t\n\t\tfor(int value : arr)\n\t\t\tSystem.out.println(value);\n\t\t\n \n\t\tscanner.close();\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n \n\t\tint n = scanner.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i = 0; i < n - 1; i++) {\n\t\t\tint value = scanner.nextInt();\n\t\t\tarr[value - 1] += 1;\n\t\t}\n\t\t\n\t\tfor(int value : arr)\n\t\t\tSystem.out.println(value);\n\t\t\n \n\t\tscanner.close();\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int n = scanner.nextInt();",
"n",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int arr[] = new int[n];",
"arr",
"new int[n]",
"n",
"for(int i = 0; i < n - 1; i++) {\n\t\t\tint value = scanner.nextInt();\n\t\t\tarr[value - 1] += 1;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tint value = scanner.nextInt();\n\t\t\tarr[value - 1] += 1;\n\t\t}",
"{\n\t\t\tint value = scanner.nextInt();\n\t\t\tarr[value - 1] += 1;\n\t\t}",
"int value = scanner.nextInt();",
"value",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"arr[value - 1] += 1",
"arr[value - 1]",
"arr",
"value - 1",
"value",
"1",
"1",
"for(int value : arr)\n\t\t\tSystem.out.println(value);",
"int value",
"arr",
"System.out.println(value);",
"System.out.println(value)",
"System.out.println",
"System.out",
"System",
"System.out",
"value",
"scanner.close()",
"scanner.close",
"scanner",
"String[] args",
"args",
"public class Main {\n \n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n \n\t\tint n = scanner.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i = 0; i < n - 1; i++) {\n\t\t\tint value = scanner.nextInt();\n\t\t\tarr[value - 1] += 1;\n\t\t}\n\t\t\n\t\tfor(int value : arr)\n\t\t\tSystem.out.println(value);\n\t\t\n \n\t\tscanner.close();\n\t}\n \n}",
"public class Main {\n \n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n \n\t\tint n = scanner.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i = 0; i < n - 1; i++) {\n\t\t\tint value = scanner.nextInt();\n\t\t\tarr[value - 1] += 1;\n\t\t}\n\t\t\n\t\tfor(int value : arr)\n\t\t\tSystem.out.println(value);\n\t\t\n \n\t\tscanner.close();\n\t}\n \n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int arr[] = new int[n];
for(int i = 0; i < n - 1; i++) {
int value = scanner.nextInt();
arr[value - 1] += 1;
}
for(int value : arr)
System.out.println(value);
scanner.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
4,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
2,
4,
18,
13,
17,
41,
13,
4,
18,
13,
13,
4,
18,
13,
13,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
4,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
104,
5
],
[
104,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
20,
24
],
[
8,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
25,
30
],
[
30,
31
],
[
30,
32
],
[
25,
33
],
[
33,
34
],
[
34,
35
],
[
25,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
38,
41
],
[
38,
42
],
[
8,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
43,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
58,
62
],
[
55,
63
],
[
63,
64
],
[
63,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
55,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
69,
73
],
[
73,
74
],
[
73,
75
],
[
8,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
76,
84
],
[
84,
85
],
[
85,
86
],
[
76,
87
],
[
88,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
8,
98
],
[
98,
99
],
[
99,
100
],
[
6,
101
],
[
101,
102
],
[
0,
103
],
[
103,
104
],
[
103,
105
]
] |
[
"import java.util.*;\npublic class Main {\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n HashMap<Integer, Integer> hashmap = new HashMap<Integer, Integer>();\n\n hashmap.put(0, 0);\n for (int i = 1; i < n; i++) {\n hashmap.put(i, 0);\n }\n for (int i = 1; i < n; i++) {\n int a = sc.nextInt() - 1;\n int old = hashmap.get(a);\n hashmap.replace(a, old + 1);\n }\n for (int i = 0; i < n; i++) {\n System.out.println(hashmap.get(i));\n }\n\n sc.close();\n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n HashMap<Integer, Integer> hashmap = new HashMap<Integer, Integer>();\n\n hashmap.put(0, 0);\n for (int i = 1; i < n; i++) {\n hashmap.put(i, 0);\n }\n for (int i = 1; i < n; i++) {\n int a = sc.nextInt() - 1;\n int old = hashmap.get(a);\n hashmap.replace(a, old + 1);\n }\n for (int i = 0; i < n; i++) {\n System.out.println(hashmap.get(i));\n }\n\n sc.close();\n\n }\n}",
"Main",
"public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n HashMap<Integer, Integer> hashmap = new HashMap<Integer, Integer>();\n\n hashmap.put(0, 0);\n for (int i = 1; i < n; i++) {\n hashmap.put(i, 0);\n }\n for (int i = 1; i < n; i++) {\n int a = sc.nextInt() - 1;\n int old = hashmap.get(a);\n hashmap.replace(a, old + 1);\n }\n for (int i = 0; i < n; i++) {\n System.out.println(hashmap.get(i));\n }\n\n sc.close();\n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n HashMap<Integer, Integer> hashmap = new HashMap<Integer, Integer>();\n\n hashmap.put(0, 0);\n for (int i = 1; i < n; i++) {\n hashmap.put(i, 0);\n }\n for (int i = 1; i < n; i++) {\n int a = sc.nextInt() - 1;\n int old = hashmap.get(a);\n hashmap.replace(a, old + 1);\n }\n for (int i = 0; i < n; i++) {\n System.out.println(hashmap.get(i));\n }\n\n sc.close();\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"HashMap<Integer, Integer> hashmap = new HashMap<Integer, Integer>();",
"hashmap",
"new HashMap<Integer, Integer>()",
"hashmap.put(0, 0)",
"hashmap.put",
"hashmap",
"0",
"0",
"for (int i = 1; i < n; i++) {\n hashmap.put(i, 0);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n hashmap.put(i, 0);\n }",
"{\n hashmap.put(i, 0);\n }",
"hashmap.put(i, 0)",
"hashmap.put",
"hashmap",
"i",
"0",
"for (int i = 1; i < n; i++) {\n int a = sc.nextInt() - 1;\n int old = hashmap.get(a);\n hashmap.replace(a, old + 1);\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n int a = sc.nextInt() - 1;\n int old = hashmap.get(a);\n hashmap.replace(a, old + 1);\n }",
"{\n int a = sc.nextInt() - 1;\n int old = hashmap.get(a);\n hashmap.replace(a, old + 1);\n }",
"int a = sc.nextInt() - 1;",
"a",
"sc.nextInt() - 1",
"sc.nextInt()",
"sc.nextInt",
"sc",
"1",
"int old = hashmap.get(a);",
"old",
"hashmap.get(a)",
"hashmap.get",
"hashmap",
"a",
"hashmap.replace(a, old + 1)",
"hashmap.replace",
"hashmap",
"a",
"old + 1",
"old",
"1",
"for (int i = 0; i < n; i++) {\n System.out.println(hashmap.get(i));\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n System.out.println(hashmap.get(i));\n }",
"{\n System.out.println(hashmap.get(i));\n }",
"System.out.println(hashmap.get(i))",
"System.out.println",
"System.out",
"System",
"System.out",
"hashmap.get(i)",
"hashmap.get",
"hashmap",
"i",
"sc.close()",
"sc.close",
"sc",
"String args[]",
"args",
"public class Main {\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n HashMap<Integer, Integer> hashmap = new HashMap<Integer, Integer>();\n\n hashmap.put(0, 0);\n for (int i = 1; i < n; i++) {\n hashmap.put(i, 0);\n }\n for (int i = 1; i < n; i++) {\n int a = sc.nextInt() - 1;\n int old = hashmap.get(a);\n hashmap.replace(a, old + 1);\n }\n for (int i = 0; i < n; i++) {\n System.out.println(hashmap.get(i));\n }\n\n sc.close();\n\n }\n}",
"public class Main {\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n HashMap<Integer, Integer> hashmap = new HashMap<Integer, Integer>();\n\n hashmap.put(0, 0);\n for (int i = 1; i < n; i++) {\n hashmap.put(i, 0);\n }\n for (int i = 1; i < n; i++) {\n int a = sc.nextInt() - 1;\n int old = hashmap.get(a);\n hashmap.replace(a, old + 1);\n }\n for (int i = 0; i < n; i++) {\n System.out.println(hashmap.get(i));\n }\n\n sc.close();\n\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
HashMap<Integer, Integer> hashmap = new HashMap<Integer, Integer>();
hashmap.put(0, 0);
for (int i = 1; i < n; i++) {
hashmap.put(i, 0);
}
for (int i = 1; i < n; i++) {
int a = sc.nextInt() - 1;
int old = hashmap.get(a);
hashmap.replace(a, old + 1);
}
for (int i = 0; i < n; i++) {
System.out.println(hashmap.get(i));
}
sc.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
20,
2,
13,
17,
4,
18,
13,
13,
17,
0,
18,
13,
17,
17,
0,
18,
13,
17,
17,
41,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
18,
13,
13,
30,
11,
1,
41,
13,
2,
13,
13,
2,
13,
13,
1,
0,
13,
13,
30,
30,
0,
18,
13,
13,
17,
29,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
30,
29,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
13,
11,
1,
41,
13,
17,
2,
2,
13,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
17,
30,
42,
2,
2,
13,
13,
17,
30,
0,
13,
13,
0,
13,
2,
13,
13,
14,
2,
13,
17,
30,
0,
13,
2,
13,
13,
29,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
2,
13,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
17,
30,
29,
17,
29,
17,
23,
13,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
13,
40,
18,
13,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
12,
13,
30,
14,
2,
2,
13,
17,
17,
30,
29,
13,
14,
2,
2,
13,
17,
17,
30,
29,
17,
14,
2,
2,
13,
17,
17,
30,
29,
2,
13,
17,
29,
17,
23,
13,
12,
13,
30,
29,
2,
4,
13,
13,
4,
13,
2,
13,
17,
23,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
13,
23,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
6,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
0,
18,
36,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
18,
36,
13,
18,
13,
13,
23,
13,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
22,
23
],
[
22,
24
],
[
0,
25
],
[
580,
26
],
[
580,
27
],
[
27,
28
],
[
27,
29
],
[
580,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
36,
37
],
[
36,
38
],
[
32,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
39,
43
],
[
32,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
32,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
32,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
32,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
60,
65
],
[
65,
66
],
[
65,
67
],
[
60,
68
],
[
68,
69
],
[
69,
70
],
[
60,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
82,
84
],
[
78,
85
],
[
85,
86
],
[
85,
87
],
[
78,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
78,
92
],
[
93,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
94,
98
],
[
32,
99
],
[
99,
100
],
[
30,
101
],
[
101,
102
],
[
580,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
110,
111
],
[
111,
112
],
[
105,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
114,
117
],
[
117,
118
],
[
117,
119
],
[
103,
120
],
[
120,
121
],
[
103,
122
],
[
122,
123
],
[
580,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
126,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
130,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
135,
139
],
[
130,
140
],
[
140,
141
],
[
141,
142
],
[
130,
143
],
[
144,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
146,
150
],
[
145,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
153,
157
],
[
152,
158
],
[
158,
159
],
[
159,
160
],
[
159,
161
],
[
151,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
164,
166
],
[
126,
167
],
[
167,
168
],
[
168,
169
],
[
168,
170
],
[
167,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
174,
176
],
[
126,
177
],
[
177,
178
],
[
124,
179
],
[
179,
180
],
[
580,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
184,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
189,
193
],
[
184,
194
],
[
194,
195
],
[
195,
196
],
[
184,
197
],
[
198,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
200,
204
],
[
199,
205
],
[
205,
206
],
[
206,
207
],
[
183,
208
],
[
208,
209
],
[
181,
210
],
[
210,
211
],
[
580,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
212,
218
],
[
218,
219
],
[
580,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
224,
228
],
[
228,
229
],
[
228,
230
],
[
228,
231
],
[
220,
232
],
[
232,
233
],
[
220,
234
],
[
234,
235
],
[
580,
236
],
[
236,
237
],
[
236,
238
],
[
238,
239
],
[
239,
240
],
[
239,
241
],
[
241,
242
],
[
238,
243
],
[
243,
244
],
[
243,
245
],
[
238,
247
],
[
247,
248
],
[
248,
249
],
[
249,
250
],
[
249,
251
],
[
247,
252
],
[
252,
253
],
[
252,
254
],
[
247,
255
],
[
255,
256
],
[
256,
257
],
[
247,
258
],
[
259,
259
],
[
259,
260
],
[
260,
261
],
[
260,
262
],
[
262,
263
],
[
259,
264
],
[
264,
265
],
[
265,
266
],
[
265,
267
],
[
267,
268
],
[
267,
269
],
[
238,
270
],
[
270,
271
],
[
271,
272
],
[
272,
273
],
[
272,
274
],
[
270,
275
],
[
275,
276
],
[
275,
277
],
[
270,
278
],
[
278,
279
],
[
279,
280
],
[
270,
281
],
[
282,
282
],
[
282,
283
],
[
283,
284
],
[
284,
285
],
[
285,
286
],
[
285,
287
],
[
283,
288
],
[
288,
289
],
[
288,
290
],
[
580,
291
],
[
291,
292
],
[
291,
293
],
[
293,
294
],
[
294,
295
],
[
295,
296
],
[
296,
297
],
[
296,
298
],
[
295,
299
],
[
294,
300
],
[
300,
301
],
[
301,
302
],
[
293,
303
],
[
303,
304
],
[
304,
305
],
[
305,
306
],
[
305,
307
],
[
304,
308
],
[
303,
309
],
[
309,
310
],
[
310,
311
],
[
293,
312
],
[
312,
313
],
[
313,
314
],
[
314,
315
],
[
314,
316
],
[
313,
317
],
[
312,
318
],
[
318,
319
],
[
319,
320
],
[
320,
321
],
[
320,
322
],
[
293,
323
],
[
323,
324
],
[
291,
325
],
[
325,
326
],
[
580,
327
],
[
327,
328
],
[
327,
329
],
[
329,
330
],
[
330,
331
],
[
331,
332
],
[
332,
333
],
[
332,
334
],
[
331,
335
],
[
335,
336
],
[
335,
337
],
[
337,
338
],
[
337,
339
],
[
327,
340
],
[
340,
341
],
[
327,
342
],
[
342,
343
],
[
580,
344
],
[
344,
345
],
[
344,
346
],
[
346,
347
],
[
347,
348
],
[
348,
349
],
[
349,
350
],
[
349,
351
],
[
347,
352
],
[
344,
353
],
[
353,
354
],
[
580,
355
],
[
355,
356
],
[
355,
357
],
[
357,
358
],
[
358,
359
],
[
359,
360
],
[
360,
361
],
[
360,
362
],
[
358,
363
],
[
355,
364
],
[
364,
365
],
[
580,
366
],
[
366,
367
],
[
366,
368
],
[
368,
369
],
[
369,
370
],
[
370,
371
],
[
371,
372
],
[
371,
373
],
[
369,
374
],
[
366,
375
],
[
375,
376
],
[
580,
377
],
[
377,
378
],
[
377,
379
],
[
379,
380
],
[
380,
381
],
[
380,
382
],
[
382,
383
],
[
382,
384
],
[
379,
385
],
[
385,
386
],
[
386,
387
],
[
386,
388
],
[
385,
389
],
[
389,
390
],
[
389,
391
],
[
379,
392
],
[
392,
393
],
[
393,
394
],
[
393,
395
],
[
392,
396
],
[
377,
397
],
[
397,
398
],
[
377,
399
],
[
399,
400
],
[
377,
401
],
[
401,
402
],
[
580,
403
],
[
403,
404
],
[
403,
405
],
[
405,
406
],
[
406,
407
],
[
407,
408
],
[
408,
409
],
[
407,
410
],
[
407,
411
],
[
403,
412
],
[
412,
413
],
[
403,
414
],
[
414,
415
],
[
580,
416
],
[
416,
417
],
[
416,
418
],
[
418,
419
],
[
419,
420
],
[
420,
421
],
[
421,
422
],
[
420,
423
],
[
420,
424
],
[
416,
425
],
[
425,
426
],
[
416,
427
],
[
427,
428
],
[
580,
429
],
[
429,
430
],
[
429,
431
],
[
431,
432
],
[
432,
433
],
[
433,
434
],
[
434,
435
],
[
433,
436
],
[
436,
437
],
[
437,
438
],
[
580,
439
],
[
439,
440
],
[
439,
441
],
[
441,
442
],
[
442,
443
],
[
443,
444
],
[
444,
445
],
[
443,
446
],
[
446,
447
],
[
447,
448
],
[
580,
449
],
[
449,
450
],
[
449,
451
],
[
451,
452
],
[
452,
453
],
[
453,
454
],
[
454,
455
],
[
453,
456
],
[
456,
457
],
[
457,
458
],
[
580,
459
],
[
459,
460
],
[
459,
461
],
[
461,
462
],
[
462,
463
],
[
463,
464
],
[
464,
465
],
[
580,
466
],
[
466,
467
],
[
466,
468
],
[
468,
469
],
[
469,
470
],
[
470,
471
],
[
471,
472
],
[
470,
473
],
[
466,
474
],
[
474,
475
],
[
580,
476
],
[
476,
477
],
[
476,
478
],
[
478,
479
],
[
476,
480
],
[
480,
481
],
[
476,
482
],
[
482,
483
],
[
482,
484
],
[
484,
485
],
[
485,
486
],
[
485,
487
],
[
482,
488
],
[
488,
489
],
[
476,
490
],
[
490,
491
],
[
490,
492
],
[
492,
493
],
[
493,
494
],
[
494,
495
],
[
495,
496
],
[
495,
497
],
[
494,
498
],
[
498,
499
],
[
499,
500
],
[
500,
501
],
[
493,
502
],
[
502,
503
],
[
503,
504
],
[
503,
505
],
[
492,
506
],
[
506,
507
],
[
507,
508
],
[
508,
509
],
[
476,
510
],
[
510,
511
],
[
510,
512
],
[
512,
513
],
[
513,
514
],
[
514,
515
],
[
515,
516
],
[
514,
517
],
[
517,
518
],
[
476,
519
],
[
519,
520
],
[
519,
521
],
[
521,
522
],
[
522,
523
],
[
523,
524
],
[
524,
525
],
[
523,
526
],
[
526,
527
],
[
476,
528
],
[
528,
529
],
[
528,
530
],
[
530,
531
],
[
531,
532
],
[
532,
533
],
[
533,
534
],
[
476,
535
],
[
535,
536
],
[
535,
537
],
[
537,
538
],
[
538,
539
],
[
539,
540
],
[
540,
541
],
[
0,
542
],
[
542,
543
],
[
542,
544
],
[
544,
545
],
[
542,
546
],
[
546,
547
],
[
542,
548
],
[
548,
549
],
[
548,
550
],
[
550,
551
],
[
551,
552
],
[
552,
553
],
[
552,
554
],
[
551,
555
],
[
550,
556
],
[
556,
557
],
[
557,
558
],
[
557,
559
],
[
556,
560
],
[
548,
561
],
[
561,
562
],
[
548,
563
],
[
563,
564
],
[
542,
565
],
[
565,
566
],
[
565,
567
],
[
567,
568
],
[
568,
569
],
[
569,
570
],
[
570,
571
],
[
570,
572
],
[
569,
573
],
[
573,
574
],
[
573,
575
],
[
565,
576
],
[
576,
577
],
[
542,
578
],
[
0,
579
],
[
579,
580
],
[
579,
581
]
] |
[
"import java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.BufferedReader;\nimport java.util.*;\nimport java.math.*;\nimport java.io.*;\nimport java.text.*;\nimport java.math.BigInteger;\n \npublic class Main\n{ \n \n //Life's a bitch\n public static boolean[] sieve(long n)\n {\n boolean[] prime = new boolean[(int)n+1];\n Arrays.fill(prime,true);\n prime[0] = false;\n prime[1] = false;\n long m = (long)Math.sqrt(n);\n for(int i=2;i<=m;i++)\n {\n if(prime[i])\n {\n for(int k=i*i;k<=n;k+=i)\n {\n prime[k] = false;\n }\n }\n }\n return prime;\n } \n \n \n static long GCD(long a,long b)\n {\n if(b==0)\n {\n return a;\n }\n return GCD(b,a%b);\n }\n \n static long CountCoPrimes(long n)\n {\n long res = n;\n for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n while(n%i==0)\n {\n n/=i;\n }\n res-=res/i;\n }\n }\n if(n>1)\n {\n res-=res/n;\n }\n return res;\n }\n \n \n \n \n \n \n static boolean prime(int n)\n {\n for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n return false;\n }\n }\n return true;\n }\n\n \n \n \n \n \n \n \n \n public static void main(String[] args) throws IOException\n {\n \n new Main().run();\n \n }\n \n \n \n static long LCM(long a,long b)\n {\n return (a*b)/GCD(a,b);\n }\n \n \n Scanner in = new Scanner(System.in);\n // static int[] arr,tree[],lev;\n void run() throws IOException\n {\n long n = nl();\n int[] a = new int[(int)n];\n for(int i=1;i<n;i++)\n {\n int ai = ni();\n a[ai-1]++;\n }\n\n for(int i=0;i<n;i++)\n {\n System.out.println(a[i]);\n }\n \n \n \n\n\n \n\n \n }\n\n\n\n\n\n \n \n\n\n\n\n \n \n \n\n\n \n\n\n\n\n \n\n \n\n \n\n \n \n\n\n \n \n\n\n \n\n \n\n \n \n \n \n \n \n \n \n \n //xor range query\n static long xor(long n)\n {\n \n if(n%4==0)\n {\n return n;\n }\n if(n%4==1)\n {\n return 1;\n }\n if(n%4==2)\n {\n return n+1;\n }\n return 0;\n }\n \n static long xor(long a,long b)\n {\n return xor(b)^xor(a-1);\n }\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n void printL(long a)\n {\n System.out.println(a);\n }\n void printS(String s)\n {\n System.out.println(s);\n }\n \n void printD(Double d)\n {\n System.out.println(d);\n }\n \n \n \n static void swap(char[] c,int a,int b)\n {\n char t = c[a];\n c[a] = c[b];\n c[b] = t;\n }\n \n static long max(long n,long m)\n {\n return Math.max(n,m);\n }\n static long min(long n,long m)\n {\n return Math.min(n,m);\n }\n \n double nd() throws IOException\n {\n return Double.parseDouble(in.next());\n }\n int ni() throws IOException\n {\n return Integer.parseInt(in.next());\n }\n \n long nl() throws IOException\n {\n return Long.parseLong(in.next());\n }\n \n String si() throws IOException\n {\n return in.next();\n }\n \n \n \n \n static long abs(long n)\n {\n return Math.abs(n);\n }\n \n static class Scanner \n {\n StringTokenizer st;\n BufferedReader br;\n \n public Scanner(InputStream s){ br = new BufferedReader(new InputStreamReader(s));}\n \n public String next() throws IOException \n {\n while (st == null || !st.hasMoreTokens()) \n {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n \n public int nextInt() throws IOException {return Integer.parseInt(next());}\n \n public long nextLong() throws IOException {return Long.parseLong(next());}\n \n public String nextLine() throws IOException {return br.readLine();}\n \n public boolean ready() throws IOException {return br.ready();}\n \n \n }\n \n \n}\n \n \n \nclass Pair implements Comparable<Pair>\n{\n int x,y;\n public Pair(int x,int y)\n {\n this.x = x;\n this.y = y;\n }\n public int compareTo(Pair o)\n {\n return this.y-o.y;\n }\n}\n",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.util.*;",
"util.*",
"java",
"import java.math.*;",
"math.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.text.*;",
"text.*",
"java",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"public class Main\n{ \n \n //Life's a bitch\n public static boolean[] sieve(long n)\n {\n boolean[] prime = new boolean[(int)n+1];\n Arrays.fill(prime,true);\n prime[0] = false;\n prime[1] = false;\n long m = (long)Math.sqrt(n);\n for(int i=2;i<=m;i++)\n {\n if(prime[i])\n {\n for(int k=i*i;k<=n;k+=i)\n {\n prime[k] = false;\n }\n }\n }\n return prime;\n } \n \n \n static long GCD(long a,long b)\n {\n if(b==0)\n {\n return a;\n }\n return GCD(b,a%b);\n }\n \n static long CountCoPrimes(long n)\n {\n long res = n;\n for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n while(n%i==0)\n {\n n/=i;\n }\n res-=res/i;\n }\n }\n if(n>1)\n {\n res-=res/n;\n }\n return res;\n }\n \n \n \n \n \n \n static boolean prime(int n)\n {\n for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n return false;\n }\n }\n return true;\n }\n\n \n \n \n \n \n \n \n \n public static void main(String[] args) throws IOException\n {\n \n new Main().run();\n \n }\n \n \n \n static long LCM(long a,long b)\n {\n return (a*b)/GCD(a,b);\n }\n \n \n Scanner in = new Scanner(System.in);\n // static int[] arr,tree[],lev;\n void run() throws IOException\n {\n long n = nl();\n int[] a = new int[(int)n];\n for(int i=1;i<n;i++)\n {\n int ai = ni();\n a[ai-1]++;\n }\n\n for(int i=0;i<n;i++)\n {\n System.out.println(a[i]);\n }\n \n \n \n\n\n \n\n \n }\n\n\n\n\n\n \n \n\n\n\n\n \n \n \n\n\n \n\n\n\n\n \n\n \n\n \n\n \n \n\n\n \n \n\n\n \n\n \n\n \n \n \n \n \n \n \n \n \n //xor range query\n static long xor(long n)\n {\n \n if(n%4==0)\n {\n return n;\n }\n if(n%4==1)\n {\n return 1;\n }\n if(n%4==2)\n {\n return n+1;\n }\n return 0;\n }\n \n static long xor(long a,long b)\n {\n return xor(b)^xor(a-1);\n }\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n void printL(long a)\n {\n System.out.println(a);\n }\n void printS(String s)\n {\n System.out.println(s);\n }\n \n void printD(Double d)\n {\n System.out.println(d);\n }\n \n \n \n static void swap(char[] c,int a,int b)\n {\n char t = c[a];\n c[a] = c[b];\n c[b] = t;\n }\n \n static long max(long n,long m)\n {\n return Math.max(n,m);\n }\n static long min(long n,long m)\n {\n return Math.min(n,m);\n }\n \n double nd() throws IOException\n {\n return Double.parseDouble(in.next());\n }\n int ni() throws IOException\n {\n return Integer.parseInt(in.next());\n }\n \n long nl() throws IOException\n {\n return Long.parseLong(in.next());\n }\n \n String si() throws IOException\n {\n return in.next();\n }\n \n \n \n \n static long abs(long n)\n {\n return Math.abs(n);\n }\n \n static class Scanner \n {\n StringTokenizer st;\n BufferedReader br;\n \n public Scanner(InputStream s){ br = new BufferedReader(new InputStreamReader(s));}\n \n public String next() throws IOException \n {\n while (st == null || !st.hasMoreTokens()) \n {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n \n public int nextInt() throws IOException {return Integer.parseInt(next());}\n \n public long nextLong() throws IOException {return Long.parseLong(next());}\n \n public String nextLine() throws IOException {return br.readLine();}\n \n public boolean ready() throws IOException {return br.ready();}\n \n \n }\n \n \n}",
"Main",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"//Life's a bitch\n public static boolean[] sieve(long n)\n {\n boolean[] prime = new boolean[(int)n+1];\n Arrays.fill(prime,true);\n prime[0] = false;\n prime[1] = false;\n long m = (long)Math.sqrt(n);\n for(int i=2;i<=m;i++)\n {\n if(prime[i])\n {\n for(int k=i*i;k<=n;k+=i)\n {\n prime[k] = false;\n }\n }\n }\n return prime;\n }",
"sieve",
"{\n boolean[] prime = new boolean[(int)n+1];\n Arrays.fill(prime,true);\n prime[0] = false;\n prime[1] = false;\n long m = (long)Math.sqrt(n);\n for(int i=2;i<=m;i++)\n {\n if(prime[i])\n {\n for(int k=i*i;k<=n;k+=i)\n {\n prime[k] = false;\n }\n }\n }\n return prime;\n }",
"boolean[] prime = new boolean[(int)n+1];",
"prime",
"new boolean[(int)n+1]",
"(int)n+1",
"(int)n",
"1",
"Arrays.fill(prime,true)",
"Arrays.fill",
"Arrays",
"prime",
"true",
"prime[0] = false",
"prime[0]",
"prime",
"0",
"false",
"prime[1] = false",
"prime[1]",
"prime",
"1",
"false",
"long m = (long)Math.sqrt(n);",
"m",
"(long)Math.sqrt(n)",
"Math.sqrt",
"Math",
"n",
"for(int i=2;i<=m;i++)\n {\n if(prime[i])\n {\n for(int k=i*i;k<=n;k+=i)\n {\n prime[k] = false;\n }\n }\n }",
"int i=2;",
"int i=2;",
"i",
"2",
"i<=m",
"i",
"m",
"i++",
"i++",
"i",
"{\n if(prime[i])\n {\n for(int k=i*i;k<=n;k+=i)\n {\n prime[k] = false;\n }\n }\n }",
"{\n if(prime[i])\n {\n for(int k=i*i;k<=n;k+=i)\n {\n prime[k] = false;\n }\n }\n }",
"if(prime[i])\n {\n for(int k=i*i;k<=n;k+=i)\n {\n prime[k] = false;\n }\n }",
"prime[i]",
"prime",
"i",
"{\n for(int k=i*i;k<=n;k+=i)\n {\n prime[k] = false;\n }\n }",
"for(int k=i*i;k<=n;k+=i)\n {\n prime[k] = false;\n }",
"int k=i*i;",
"int k=i*i;",
"k",
"i*i",
"i",
"i",
"k<=n",
"k",
"n",
"k+=i",
"k+=i",
"k",
"i",
"{\n prime[k] = false;\n }",
"{\n prime[k] = false;\n }",
"prime[k] = false",
"prime[k]",
"prime",
"k",
"false",
"return prime;",
"prime",
"long n",
"n",
"static long GCD(long a,long b)\n {\n if(b==0)\n {\n return a;\n }\n return GCD(b,a%b);\n }",
"GCD",
"{\n if(b==0)\n {\n return a;\n }\n return GCD(b,a%b);\n }",
"if(b==0)\n {\n return a;\n }",
"b==0",
"b",
"0",
"{\n return a;\n }",
"return a;",
"a",
"return GCD(b,a%b);",
"GCD(b,a%b)",
"GCD",
"b",
"a%b",
"a",
"b",
"long a",
"a",
"long b",
"b",
"static long CountCoPrimes(long n)\n {\n long res = n;\n for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n while(n%i==0)\n {\n n/=i;\n }\n res-=res/i;\n }\n }\n if(n>1)\n {\n res-=res/n;\n }\n return res;\n }",
"CountCoPrimes",
"{\n long res = n;\n for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n while(n%i==0)\n {\n n/=i;\n }\n res-=res/i;\n }\n }\n if(n>1)\n {\n res-=res/n;\n }\n return res;\n }",
"long res = n;",
"res",
"n",
"for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n while(n%i==0)\n {\n n/=i;\n }\n res-=res/i;\n }\n }",
"int i=2;",
"int i=2;",
"i",
"2",
"i*i<=n",
"i*i",
"i",
"i",
"n",
"i++",
"i++",
"i",
"{\n if(n%i==0)\n {\n while(n%i==0)\n {\n n/=i;\n }\n res-=res/i;\n }\n }",
"{\n if(n%i==0)\n {\n while(n%i==0)\n {\n n/=i;\n }\n res-=res/i;\n }\n }",
"if(n%i==0)\n {\n while(n%i==0)\n {\n n/=i;\n }\n res-=res/i;\n }",
"n%i==0",
"n%i",
"n",
"i",
"0",
"{\n while(n%i==0)\n {\n n/=i;\n }\n res-=res/i;\n }",
"while(n%i==0)\n {\n n/=i;\n }",
"n%i==0",
"n%i",
"n",
"i",
"0",
"{\n n/=i;\n }",
"n/=i",
"n",
"i",
"res-=res/i",
"res",
"res/i",
"res",
"i",
"if(n>1)\n {\n res-=res/n;\n }",
"n>1",
"n",
"1",
"{\n res-=res/n;\n }",
"res-=res/n",
"res",
"res/n",
"res",
"n",
"return res;",
"res",
"long n",
"n",
"static boolean prime(int n)\n {\n for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n return false;\n }\n }\n return true;\n }",
"prime",
"{\n for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n return false;\n }\n }\n return true;\n }",
"for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n return false;\n }\n }",
"int i=2;",
"int i=2;",
"i",
"2",
"i*i<=n",
"i*i",
"i",
"i",
"n",
"i++",
"i++",
"i",
"{\n if(n%i==0)\n {\n return false;\n }\n }",
"{\n if(n%i==0)\n {\n return false;\n }\n }",
"if(n%i==0)\n {\n return false;\n }",
"n%i==0",
"n%i",
"n",
"i",
"0",
"{\n return false;\n }",
"return false;",
"false",
"return true;",
"true",
"int n",
"n",
"public static void main(String[] args) throws IOException\n {\n \n new Main().run();\n \n }",
"main",
"{\n \n new Main().run();\n \n }",
"new Main().run()",
"new Main().run",
"new Main()",
"String[] args",
"args",
"static long LCM(long a,long b)\n {\n return (a*b)/GCD(a,b);\n }",
"LCM",
"{\n return (a*b)/GCD(a,b);\n }",
"return (a*b)/GCD(a,b);",
"(a*b)/GCD(a,b)",
"(a*b)",
"a",
"b",
"GCD(a,b)",
"GCD",
"a",
"b",
"long a",
"a",
"long b",
"b",
"// static int[] arr,tree[],lev;\n void run() throws IOException\n {\n long n = nl();\n int[] a = new int[(int)n];\n for(int i=1;i<n;i++)\n {\n int ai = ni();\n a[ai-1]++;\n }\n\n for(int i=0;i<n;i++)\n {\n System.out.println(a[i]);\n }\n \n \n \n\n\n \n\n \n }",
"run",
"{\n long n = nl();\n int[] a = new int[(int)n];\n for(int i=1;i<n;i++)\n {\n int ai = ni();\n a[ai-1]++;\n }\n\n for(int i=0;i<n;i++)\n {\n System.out.println(a[i]);\n }\n \n \n \n\n\n \n\n \n }",
"long n = nl();",
"n",
"nl()",
"nl",
"int[] a = new int[(int)n];",
"a",
"new int[(int)n]",
"(int)n",
"for(int i=1;i<n;i++)\n {\n int ai = ni();\n a[ai-1]++;\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n int ai = ni();\n a[ai-1]++;\n }",
"{\n int ai = ni();\n a[ai-1]++;\n }",
"int ai = ni();",
"ai",
"ni()",
"ni",
"a[ai-1]++",
"a[ai-1]",
"a",
"ai-1",
"ai",
"1",
"for(int i=0;i<n;i++)\n {\n System.out.println(a[i]);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n System.out.println(a[i]);\n }",
"{\n System.out.println(a[i]);\n }",
"System.out.println(a[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[i]",
"a",
"i",
"//xor range query\n static long xor(long n)\n {\n \n if(n%4==0)\n {\n return n;\n }\n if(n%4==1)\n {\n return 1;\n }\n if(n%4==2)\n {\n return n+1;\n }\n return 0;\n }",
"xor",
"{\n \n if(n%4==0)\n {\n return n;\n }\n if(n%4==1)\n {\n return 1;\n }\n if(n%4==2)\n {\n return n+1;\n }\n return 0;\n }",
"if(n%4==0)\n {\n return n;\n }",
"n%4==0",
"n%4",
"n",
"4",
"0",
"{\n return n;\n }",
"return n;",
"n",
"if(n%4==1)\n {\n return 1;\n }",
"n%4==1",
"n%4",
"n",
"4",
"1",
"{\n return 1;\n }",
"return 1;",
"1",
"if(n%4==2)\n {\n return n+1;\n }",
"n%4==2",
"n%4",
"n",
"4",
"2",
"{\n return n+1;\n }",
"return n+1;",
"n+1",
"n",
"1",
"return 0;",
"0",
"long n",
"n",
"static long xor(long a,long b)\n {\n return xor(b)^xor(a-1);\n }",
"xor",
"{\n return xor(b)^xor(a-1);\n }",
"return xor(b)^xor(a-1);",
"xor(b)^xor(a-1)",
"xor(b)",
"xor",
"b",
"xor(a-1)",
"xor",
"a-1",
"a",
"1",
"long a",
"a",
"long b",
"b",
"void printL(long a)\n {\n System.out.println(a);\n }",
"printL",
"{\n System.out.println(a);\n }",
"System.out.println(a)",
"System.out.println",
"System.out",
"System",
"System.out",
"a",
"long a",
"a",
"void printS(String s)\n {\n System.out.println(s);\n }",
"printS",
"{\n System.out.println(s);\n }",
"System.out.println(s)",
"System.out.println",
"System.out",
"System",
"System.out",
"s",
"String s",
"s",
"void printD(Double d)\n {\n System.out.println(d);\n }",
"printD",
"{\n System.out.println(d);\n }",
"System.out.println(d)",
"System.out.println",
"System.out",
"System",
"System.out",
"d",
"Double d",
"d",
"static void swap(char[] c,int a,int b)\n {\n char t = c[a];\n c[a] = c[b];\n c[b] = t;\n }",
"swap",
"{\n char t = c[a];\n c[a] = c[b];\n c[b] = t;\n }",
"char t = c[a];",
"t",
"c[a]",
"c",
"a",
"c[a] = c[b]",
"c[a]",
"c",
"a",
"c[b]",
"c",
"b",
"c[b] = t",
"c[b]",
"c",
"b",
"t",
"char[] c",
"c",
"int a",
"a",
"int b",
"b",
"static long max(long n,long m)\n {\n return Math.max(n,m);\n }",
"max",
"{\n return Math.max(n,m);\n }",
"return Math.max(n,m);",
"Math.max(n,m)",
"Math.max",
"Math",
"n",
"m",
"long n",
"n",
"long m",
"m",
"static long min(long n,long m)\n {\n return Math.min(n,m);\n }",
"min",
"{\n return Math.min(n,m);\n }",
"return Math.min(n,m);",
"Math.min(n,m)",
"Math.min",
"Math",
"n",
"m",
"long n",
"n",
"long m",
"m",
"double nd() throws IOException\n {\n return Double.parseDouble(in.next());\n }",
"nd",
"{\n return Double.parseDouble(in.next());\n }",
"return Double.parseDouble(in.next());",
"Double.parseDouble(in.next())",
"Double.parseDouble",
"Double",
"in.next()",
"in.next",
"in",
"int ni() throws IOException\n {\n return Integer.parseInt(in.next());\n }",
"ni",
"{\n return Integer.parseInt(in.next());\n }",
"return Integer.parseInt(in.next());",
"Integer.parseInt(in.next())",
"Integer.parseInt",
"Integer",
"in.next()",
"in.next",
"in",
"long nl() throws IOException\n {\n return Long.parseLong(in.next());\n }",
"nl",
"{\n return Long.parseLong(in.next());\n }",
"return Long.parseLong(in.next());",
"Long.parseLong(in.next())",
"Long.parseLong",
"Long",
"in.next()",
"in.next",
"in",
"String si() throws IOException\n {\n return in.next();\n }",
"si",
"{\n return in.next();\n }",
"return in.next();",
"in.next()",
"in.next",
"in",
"static long abs(long n)\n {\n return Math.abs(n);\n }",
"abs",
"{\n return Math.abs(n);\n }",
"return Math.abs(n);",
"Math.abs(n)",
"Math.abs",
"Math",
"n",
"long n",
"n",
"static class Scanner \n {\n StringTokenizer st;\n BufferedReader br;\n \n public Scanner(InputStream s){ br = new BufferedReader(new InputStreamReader(s));}\n \n public String next() throws IOException \n {\n while (st == null || !st.hasMoreTokens()) \n {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n \n public int nextInt() throws IOException {return Integer.parseInt(next());}\n \n public long nextLong() throws IOException {return Long.parseLong(next());}\n \n public String nextLine() throws IOException {return br.readLine();}\n \n public boolean ready() throws IOException {return br.ready();}\n \n \n }",
"Scanner",
"StringTokenizer st;",
"st",
"BufferedReader br;",
"br",
"public Scanner(InputStream s){ br = new BufferedReader(new InputStreamReader(s));}",
"Scanner",
"{ br = new BufferedReader(new InputStreamReader(s));}",
"br = new BufferedReader(new InputStreamReader(s))",
"br",
"new BufferedReader(new InputStreamReader(s))",
"InputStream s",
"s",
"public String next() throws IOException \n {\n while (st == null || !st.hasMoreTokens()) \n {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreTokens()) \n {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreTokens()) \n {\n st = new StringTokenizer(br.readLine());\n }",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"public int nextInt() throws IOException {return Integer.parseInt(next());}",
"nextInt",
"{return Integer.parseInt(next());}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public long nextLong() throws IOException {return Long.parseLong(next());}",
"nextLong",
"{return Long.parseLong(next());}",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public String nextLine() throws IOException {return br.readLine();}",
"nextLine",
"{return br.readLine();}",
"return br.readLine();",
"br.readLine()",
"br.readLine",
"br",
"public boolean ready() throws IOException {return br.ready();}",
"ready",
"{return br.ready();}",
"return br.ready();",
"br.ready()",
"br.ready",
"br",
"class Pair implements Comparable<Pair>\n{\n int x,y;\n public Pair(int x,int y)\n {\n this.x = x;\n this.y = y;\n }\n public int compareTo(Pair o)\n {\n return this.y-o.y;\n }\n}",
"Pair",
"int x",
"x",
"y;",
"y",
"public Pair(int x,int y)\n {\n this.x = x;\n this.y = y;\n }",
"Pair",
"{\n this.x = x;\n this.y = y;\n }",
"this.x = x",
"this.x",
"this",
"this.x",
"x",
"this.y = y",
"this.y",
"this",
"this.y",
"y",
"int x",
"x",
"int y",
"y",
"public int compareTo(Pair o)\n {\n return this.y-o.y;\n }",
"compareTo",
"{\n return this.y-o.y;\n }",
"return this.y-o.y;",
"this.y-o.y",
"this.y",
"this",
"this.y",
"o.y",
"o",
"o.y",
"Pair o",
"o",
"Comparable",
"public class Main\n{ \n \n //Life's a bitch\n public static boolean[] sieve(long n)\n {\n boolean[] prime = new boolean[(int)n+1];\n Arrays.fill(prime,true);\n prime[0] = false;\n prime[1] = false;\n long m = (long)Math.sqrt(n);\n for(int i=2;i<=m;i++)\n {\n if(prime[i])\n {\n for(int k=i*i;k<=n;k+=i)\n {\n prime[k] = false;\n }\n }\n }\n return prime;\n } \n \n \n static long GCD(long a,long b)\n {\n if(b==0)\n {\n return a;\n }\n return GCD(b,a%b);\n }\n \n static long CountCoPrimes(long n)\n {\n long res = n;\n for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n while(n%i==0)\n {\n n/=i;\n }\n res-=res/i;\n }\n }\n if(n>1)\n {\n res-=res/n;\n }\n return res;\n }\n \n \n \n \n \n \n static boolean prime(int n)\n {\n for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n return false;\n }\n }\n return true;\n }\n\n \n \n \n \n \n \n \n \n public static void main(String[] args) throws IOException\n {\n \n new Main().run();\n \n }\n \n \n \n static long LCM(long a,long b)\n {\n return (a*b)/GCD(a,b);\n }\n \n \n Scanner in = new Scanner(System.in);\n // static int[] arr,tree[],lev;\n void run() throws IOException\n {\n long n = nl();\n int[] a = new int[(int)n];\n for(int i=1;i<n;i++)\n {\n int ai = ni();\n a[ai-1]++;\n }\n\n for(int i=0;i<n;i++)\n {\n System.out.println(a[i]);\n }\n \n \n \n\n\n \n\n \n }\n\n\n\n\n\n \n \n\n\n\n\n \n \n \n\n\n \n\n\n\n\n \n\n \n\n \n\n \n \n\n\n \n \n\n\n \n\n \n\n \n \n \n \n \n \n \n \n \n //xor range query\n static long xor(long n)\n {\n \n if(n%4==0)\n {\n return n;\n }\n if(n%4==1)\n {\n return 1;\n }\n if(n%4==2)\n {\n return n+1;\n }\n return 0;\n }\n \n static long xor(long a,long b)\n {\n return xor(b)^xor(a-1);\n }\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n void printL(long a)\n {\n System.out.println(a);\n }\n void printS(String s)\n {\n System.out.println(s);\n }\n \n void printD(Double d)\n {\n System.out.println(d);\n }\n \n \n \n static void swap(char[] c,int a,int b)\n {\n char t = c[a];\n c[a] = c[b];\n c[b] = t;\n }\n \n static long max(long n,long m)\n {\n return Math.max(n,m);\n }\n static long min(long n,long m)\n {\n return Math.min(n,m);\n }\n \n double nd() throws IOException\n {\n return Double.parseDouble(in.next());\n }\n int ni() throws IOException\n {\n return Integer.parseInt(in.next());\n }\n \n long nl() throws IOException\n {\n return Long.parseLong(in.next());\n }\n \n String si() throws IOException\n {\n return in.next();\n }\n \n \n \n \n static long abs(long n)\n {\n return Math.abs(n);\n }\n \n static class Scanner \n {\n StringTokenizer st;\n BufferedReader br;\n \n public Scanner(InputStream s){ br = new BufferedReader(new InputStreamReader(s));}\n \n public String next() throws IOException \n {\n while (st == null || !st.hasMoreTokens()) \n {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n \n public int nextInt() throws IOException {return Integer.parseInt(next());}\n \n public long nextLong() throws IOException {return Long.parseLong(next());}\n \n public String nextLine() throws IOException {return br.readLine();}\n \n public boolean ready() throws IOException {return br.ready();}\n \n \n }\n \n \n}",
"public class Main\n{ \n \n //Life's a bitch\n public static boolean[] sieve(long n)\n {\n boolean[] prime = new boolean[(int)n+1];\n Arrays.fill(prime,true);\n prime[0] = false;\n prime[1] = false;\n long m = (long)Math.sqrt(n);\n for(int i=2;i<=m;i++)\n {\n if(prime[i])\n {\n for(int k=i*i;k<=n;k+=i)\n {\n prime[k] = false;\n }\n }\n }\n return prime;\n } \n \n \n static long GCD(long a,long b)\n {\n if(b==0)\n {\n return a;\n }\n return GCD(b,a%b);\n }\n \n static long CountCoPrimes(long n)\n {\n long res = n;\n for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n while(n%i==0)\n {\n n/=i;\n }\n res-=res/i;\n }\n }\n if(n>1)\n {\n res-=res/n;\n }\n return res;\n }\n \n \n \n \n \n \n static boolean prime(int n)\n {\n for(int i=2;i*i<=n;i++)\n {\n if(n%i==0)\n {\n return false;\n }\n }\n return true;\n }\n\n \n \n \n \n \n \n \n \n public static void main(String[] args) throws IOException\n {\n \n new Main().run();\n \n }\n \n \n \n static long LCM(long a,long b)\n {\n return (a*b)/GCD(a,b);\n }\n \n \n Scanner in = new Scanner(System.in);\n // static int[] arr,tree[],lev;\n void run() throws IOException\n {\n long n = nl();\n int[] a = new int[(int)n];\n for(int i=1;i<n;i++)\n {\n int ai = ni();\n a[ai-1]++;\n }\n\n for(int i=0;i<n;i++)\n {\n System.out.println(a[i]);\n }\n \n \n \n\n\n \n\n \n }\n\n\n\n\n\n \n \n\n\n\n\n \n \n \n\n\n \n\n\n\n\n \n\n \n\n \n\n \n \n\n\n \n \n\n\n \n\n \n\n \n \n \n \n \n \n \n \n \n //xor range query\n static long xor(long n)\n {\n \n if(n%4==0)\n {\n return n;\n }\n if(n%4==1)\n {\n return 1;\n }\n if(n%4==2)\n {\n return n+1;\n }\n return 0;\n }\n \n static long xor(long a,long b)\n {\n return xor(b)^xor(a-1);\n }\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n void printL(long a)\n {\n System.out.println(a);\n }\n void printS(String s)\n {\n System.out.println(s);\n }\n \n void printD(Double d)\n {\n System.out.println(d);\n }\n \n \n \n static void swap(char[] c,int a,int b)\n {\n char t = c[a];\n c[a] = c[b];\n c[b] = t;\n }\n \n static long max(long n,long m)\n {\n return Math.max(n,m);\n }\n static long min(long n,long m)\n {\n return Math.min(n,m);\n }\n \n double nd() throws IOException\n {\n return Double.parseDouble(in.next());\n }\n int ni() throws IOException\n {\n return Integer.parseInt(in.next());\n }\n \n long nl() throws IOException\n {\n return Long.parseLong(in.next());\n }\n \n String si() throws IOException\n {\n return in.next();\n }\n \n \n \n \n static long abs(long n)\n {\n return Math.abs(n);\n }\n \n static class Scanner \n {\n StringTokenizer st;\n BufferedReader br;\n \n public Scanner(InputStream s){ br = new BufferedReader(new InputStreamReader(s));}\n \n public String next() throws IOException \n {\n while (st == null || !st.hasMoreTokens()) \n {\n st = new StringTokenizer(br.readLine());\n }\n return st.nextToken();\n }\n \n public int nextInt() throws IOException {return Integer.parseInt(next());}\n \n public long nextLong() throws IOException {return Long.parseLong(next());}\n \n public String nextLine() throws IOException {return br.readLine();}\n \n public boolean ready() throws IOException {return br.ready();}\n \n \n }\n \n \n}",
"Main"
] |
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.*;
import java.math.*;
import java.io.*;
import java.text.*;
import java.math.BigInteger;
public class Main
{
//Life's a bitch
public static boolean[] sieve(long n)
{
boolean[] prime = new boolean[(int)n+1];
Arrays.fill(prime,true);
prime[0] = false;
prime[1] = false;
long m = (long)Math.sqrt(n);
for(int i=2;i<=m;i++)
{
if(prime[i])
{
for(int k=i*i;k<=n;k+=i)
{
prime[k] = false;
}
}
}
return prime;
}
static long GCD(long a,long b)
{
if(b==0)
{
return a;
}
return GCD(b,a%b);
}
static long CountCoPrimes(long n)
{
long res = n;
for(int i=2;i*i<=n;i++)
{
if(n%i==0)
{
while(n%i==0)
{
n/=i;
}
res-=res/i;
}
}
if(n>1)
{
res-=res/n;
}
return res;
}
static boolean prime(int n)
{
for(int i=2;i*i<=n;i++)
{
if(n%i==0)
{
return false;
}
}
return true;
}
public static void main(String[] args) throws IOException
{
new Main().run();
}
static long LCM(long a,long b)
{
return (a*b)/GCD(a,b);
}
Scanner in = new Scanner(System.in);
// static int[] arr,tree[],lev;
void run() throws IOException
{
long n = nl();
int[] a = new int[(int)n];
for(int i=1;i<n;i++)
{
int ai = ni();
a[ai-1]++;
}
for(int i=0;i<n;i++)
{
System.out.println(a[i]);
}
}
//xor range query
static long xor(long n)
{
if(n%4==0)
{
return n;
}
if(n%4==1)
{
return 1;
}
if(n%4==2)
{
return n+1;
}
return 0;
}
static long xor(long a,long b)
{
return xor(b)^xor(a-1);
}
void printL(long a)
{
System.out.println(a);
}
void printS(String s)
{
System.out.println(s);
}
void printD(Double d)
{
System.out.println(d);
}
static void swap(char[] c,int a,int b)
{
char t = c[a];
c[a] = c[b];
c[b] = t;
}
static long max(long n,long m)
{
return Math.max(n,m);
}
static long min(long n,long m)
{
return Math.min(n,m);
}
double nd() throws IOException
{
return Double.parseDouble(in.next());
}
int ni() throws IOException
{
return Integer.parseInt(in.next());
}
long nl() throws IOException
{
return Long.parseLong(in.next());
}
String si() throws IOException
{
return in.next();
}
static long abs(long n)
{
return Math.abs(n);
}
static class Scanner
{
StringTokenizer st;
BufferedReader br;
public Scanner(InputStream s){ br = new BufferedReader(new InputStreamReader(s));}
public String next() throws IOException
{
while (st == null || !st.hasMoreTokens())
{
st = new StringTokenizer(br.readLine());
}
return st.nextToken();
}
public int nextInt() throws IOException {return Integer.parseInt(next());}
public long nextLong() throws IOException {return Long.parseLong(next());}
public String nextLine() throws IOException {return br.readLine();}
public boolean ready() throws IOException {return br.ready();}
}
}
class Pair implements Comparable<Pair>
{
int x,y;
public Pair(int x,int y)
{
this.x = x;
this.y = y;
}
public int compareTo(Pair o)
{
return this.y-o.y;
}
}
|
[
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,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
2,
4,
18,
13,
17,
40,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
89,
5
],
[
89,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
8,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
39,
49
],
[
49,
50
],
[
50,
51
],
[
39,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
56,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
77,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
83,
84
],
[
83,
85
],
[
6,
86
],
[
86,
87
],
[
0,
88
],
[
88,
89
],
[
88,
90
]
] |
[
"import java.util.*;\npublic class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i = 0;i<n;i++)\n\t\t{\n\t\t\tarr[i] = 0;\n\t\t}\n\t\tfor(int i = 0;i<n-1;i++)\n\t\t{\n\t\t\tint input = sc.nextInt()-1;\n\t\t\tarr[input]++;\n\t\t}\n\t\tfor(int i = 0;i<n;i++)\n\t\t{\n\t\t\tSystem.out.println(arr[i]);\n\t\t}\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i = 0;i<n;i++)\n\t\t{\n\t\t\tarr[i] = 0;\n\t\t}\n\t\tfor(int i = 0;i<n-1;i++)\n\t\t{\n\t\t\tint input = sc.nextInt()-1;\n\t\t\tarr[input]++;\n\t\t}\n\t\tfor(int i = 0;i<n;i++)\n\t\t{\n\t\t\tSystem.out.println(arr[i]);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i = 0;i<n;i++)\n\t\t{\n\t\t\tarr[i] = 0;\n\t\t}\n\t\tfor(int i = 0;i<n-1;i++)\n\t\t{\n\t\t\tint input = sc.nextInt()-1;\n\t\t\tarr[input]++;\n\t\t}\n\t\tfor(int i = 0;i<n;i++)\n\t\t{\n\t\t\tSystem.out.println(arr[i]);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i = 0;i<n;i++)\n\t\t{\n\t\t\tarr[i] = 0;\n\t\t}\n\t\tfor(int i = 0;i<n-1;i++)\n\t\t{\n\t\t\tint input = sc.nextInt()-1;\n\t\t\tarr[input]++;\n\t\t}\n\t\tfor(int i = 0;i<n;i++)\n\t\t{\n\t\t\tSystem.out.println(arr[i]);\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] arr = new int[n];",
"arr",
"new int[n]",
"n",
"for(int i = 0;i<n;i++)\n\t\t{\n\t\t\tarr[i] = 0;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tarr[i] = 0;\n\t\t}",
"{\n\t\t\tarr[i] = 0;\n\t\t}",
"arr[i] = 0",
"arr[i]",
"arr",
"i",
"0",
"for(int i = 0;i<n-1;i++)\n\t\t{\n\t\t\tint input = sc.nextInt()-1;\n\t\t\tarr[input]++;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tint input = sc.nextInt()-1;\n\t\t\tarr[input]++;\n\t\t}",
"{\n\t\t\tint input = sc.nextInt()-1;\n\t\t\tarr[input]++;\n\t\t}",
"int input = sc.nextInt()-1;",
"input",
"sc.nextInt()-1",
"sc.nextInt()",
"sc.nextInt",
"sc",
"1",
"arr[input]++",
"arr[input]",
"arr",
"input",
"for(int i = 0;i<n;i++)\n\t\t{\n\t\t\tSystem.out.println(arr[i]);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.println(arr[i]);\n\t\t}",
"{\n\t\t\tSystem.out.println(arr[i]);\n\t\t}",
"System.out.println(arr[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"arr[i]",
"arr",
"i",
"String[] args",
"args",
"public class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i = 0;i<n;i++)\n\t\t{\n\t\t\tarr[i] = 0;\n\t\t}\n\t\tfor(int i = 0;i<n-1;i++)\n\t\t{\n\t\t\tint input = sc.nextInt()-1;\n\t\t\tarr[input]++;\n\t\t}\n\t\tfor(int i = 0;i<n;i++)\n\t\t{\n\t\t\tSystem.out.println(arr[i]);\n\t\t}\n\t}\n}",
"public class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i = 0;i<n;i++)\n\t\t{\n\t\t\tarr[i] = 0;\n\t\t}\n\t\tfor(int i = 0;i<n-1;i++)\n\t\t{\n\t\t\tint input = sc.nextInt()-1;\n\t\t\tarr[input]++;\n\t\t}\n\t\tfor(int i = 0;i<n;i++)\n\t\t{\n\t\t\tSystem.out.println(arr[i]);\n\t\t}\n\t}\n}",
"Main"
] |
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] arr = new int[n];
for(int i = 0;i<n;i++)
{
arr[i] = 0;
}
for(int i = 0;i<n-1;i++)
{
int input = sc.nextInt()-1;
arr[input]++;
}
for(int i = 0;i<n;i++)
{
System.out.println(arr[i]);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
40,
18,
13,
4,
18,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
18,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
90,
8
],
[
90,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
28,
33
],
[
11,
34
],
[
34,
35
],
[
34,
36
],
[
37,
38
],
[
37,
39
],
[
11,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
40,
50
],
[
50,
51
],
[
51,
52
],
[
40,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
60,
61
],
[
60,
62
],
[
11,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
63,
71
],
[
71,
72
],
[
72,
73
],
[
63,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
78,
79
],
[
78,
80
],
[
11,
81
],
[
81,
82
],
[
82,
83
],
[
11,
84
],
[
84,
85
],
[
85,
86
],
[
9,
87
],
[
87,
88
],
[
0,
89
],
[
89,
90
],
[
89,
91
]
] |
[
"import java.util.*;\nimport java.io.*;\npublic class Main\n{\n public static void main(String args[])throws Exception\n {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n PrintWriter pw=new PrintWriter(System.out);\n int n=Integer.parseInt(br.readLine());\n String str[]=br.readLine().split(\" \");\n int boss[]=new int[n+1];\n for(int i=0;i<n-1;i++)\n boss[Integer.parseInt(str[i])]++;\n for(int i=1;i<=n;i++)\n pw.println(boss[i]);\n pw.flush();\n pw.close();\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main\n{\n public static void main(String args[])throws Exception\n {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n PrintWriter pw=new PrintWriter(System.out);\n int n=Integer.parseInt(br.readLine());\n String str[]=br.readLine().split(\" \");\n int boss[]=new int[n+1];\n for(int i=0;i<n-1;i++)\n boss[Integer.parseInt(str[i])]++;\n for(int i=1;i<=n;i++)\n pw.println(boss[i]);\n pw.flush();\n pw.close();\n }\n}",
"Main",
"public static void main(String args[])throws Exception\n {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n PrintWriter pw=new PrintWriter(System.out);\n int n=Integer.parseInt(br.readLine());\n String str[]=br.readLine().split(\" \");\n int boss[]=new int[n+1];\n for(int i=0;i<n-1;i++)\n boss[Integer.parseInt(str[i])]++;\n for(int i=1;i<=n;i++)\n pw.println(boss[i]);\n pw.flush();\n pw.close();\n }",
"main",
"{\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n PrintWriter pw=new PrintWriter(System.out);\n int n=Integer.parseInt(br.readLine());\n String str[]=br.readLine().split(\" \");\n int boss[]=new int[n+1];\n for(int i=0;i<n-1;i++)\n boss[Integer.parseInt(str[i])]++;\n for(int i=1;i<=n;i++)\n pw.println(boss[i]);\n pw.flush();\n pw.close();\n }",
"BufferedReader br=new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"PrintWriter pw=new PrintWriter(System.out);",
"pw",
"new PrintWriter(System.out)",
"int n=Integer.parseInt(br.readLine());",
"n",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"String str[]=br.readLine().split(\" \");",
"str",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int boss[]=new int[n+1];",
"boss",
"new int[n+1]",
"n+1",
"n",
"1",
"for(int i=0;i<n-1;i++)\n boss[Integer.parseInt(str[i])]++;",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"boss[Integer.parseInt(str[i])]++;",
"boss[Integer.parseInt(str[i])]++",
"boss[Integer.parseInt(str[i])]",
"boss",
"Integer.parseInt(str[i])",
"Integer.parseInt",
"Integer",
"str[i]",
"str",
"i",
"for(int i=1;i<=n;i++)\n pw.println(boss[i]);",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=n",
"i",
"n",
"i++",
"i++",
"i",
"pw.println(boss[i]);",
"pw.println(boss[i])",
"pw.println",
"pw",
"boss[i]",
"boss",
"i",
"pw.flush()",
"pw.flush",
"pw",
"pw.close()",
"pw.close",
"pw",
"String args[]",
"args",
"public class Main\n{\n public static void main(String args[])throws Exception\n {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n PrintWriter pw=new PrintWriter(System.out);\n int n=Integer.parseInt(br.readLine());\n String str[]=br.readLine().split(\" \");\n int boss[]=new int[n+1];\n for(int i=0;i<n-1;i++)\n boss[Integer.parseInt(str[i])]++;\n for(int i=1;i<=n;i++)\n pw.println(boss[i]);\n pw.flush();\n pw.close();\n }\n}",
"public class Main\n{\n public static void main(String args[])throws Exception\n {\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\n PrintWriter pw=new PrintWriter(System.out);\n int n=Integer.parseInt(br.readLine());\n String str[]=br.readLine().split(\" \");\n int boss[]=new int[n+1];\n for(int i=0;i<n-1;i++)\n boss[Integer.parseInt(str[i])]++;\n for(int i=1;i<=n;i++)\n pw.println(boss[i]);\n pw.flush();\n pw.close();\n }\n}",
"Main"
] |
import java.util.*;
import java.io.*;
public class Main
{
public static void main(String args[])throws Exception
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw=new PrintWriter(System.out);
int n=Integer.parseInt(br.readLine());
String str[]=br.readLine().split(" ");
int boss[]=new int[n+1];
for(int i=0;i<n-1;i++)
boss[Integer.parseInt(str[i])]++;
for(int i=1;i<=n;i++)
pw.println(boss[i]);
pw.flush();
pw.close();
}
}
|
[
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,
4,
18,
13,
13,
17,
28,
13,
4,
18,
4,
18,
13,
17,
30,
30,
40,
18,
13,
2,
4,
18,
13,
13,
17,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
68,
11
],
[
68,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
14,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
30,
34
],
[
14,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
37,
42
],
[
35,
43
],
[
44,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
48,
53
],
[
14,
54
],
[
54,
55
],
[
54,
56
],
[
54,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
12,
65
],
[
65,
66
],
[
0,
67
],
[
67,
68
],
[
67,
69
]
] |
[
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\n\n/**\n * N\n * 人の社員からなる会社があり、各社員には\n * 1\n * ,\n * .\n * .\n * .\n * ,\n * N\n * の社員番号が割り当てられています。\n *\n * 社員番号\n * 1\n * の社員以外の全ての社員には、自分より社員番号が小さい直属の上司がちょうど\n * 1\n * 人います。\n *\n * X\n * さんが\n * Y\n * さんの直属の上司であるとき、\n * Y\n * さんは\n * X\n * さんの直属の部下であるといいます。\n *\n * 社員番号\n * i\n * の社員の直属の上司の社員番号が\n * A\n * i\n * であることが与えられます。各社員について直属の部下が何人いるか求めてください。\n */\npublic class Main {\n\n public static void main(String args[]) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int N = Integer.parseInt(br.readLine());\n\n int[] ans = new int[N];\n Arrays.fill(ans, 0);\n for (String An: br.readLine().split(\" \")) {\n ans[Integer.valueOf(An) - 1]++;\n }\n\n for (int i: ans) {\n System.out.println(i);\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.Arrays;",
"Arrays",
"java.util",
"public class Main {\n\n public static void main(String args[]) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int N = Integer.parseInt(br.readLine());\n\n int[] ans = new int[N];\n Arrays.fill(ans, 0);\n for (String An: br.readLine().split(\" \")) {\n ans[Integer.valueOf(An) - 1]++;\n }\n\n for (int i: ans) {\n System.out.println(i);\n }\n }\n}",
"Main",
"public static void main(String args[]) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int N = Integer.parseInt(br.readLine());\n\n int[] ans = new int[N];\n Arrays.fill(ans, 0);\n for (String An: br.readLine().split(\" \")) {\n ans[Integer.valueOf(An) - 1]++;\n }\n\n for (int i: ans) {\n System.out.println(i);\n }\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int N = Integer.parseInt(br.readLine());\n\n int[] ans = new int[N];\n Arrays.fill(ans, 0);\n for (String An: br.readLine().split(\" \")) {\n ans[Integer.valueOf(An) - 1]++;\n }\n\n for (int i: ans) {\n System.out.println(i);\n }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int N = Integer.parseInt(br.readLine());",
"N",
"Integer.parseInt(br.readLine())",
"Integer.parseInt",
"Integer",
"br.readLine()",
"br.readLine",
"br",
"int[] ans = new int[N];",
"ans",
"new int[N]",
"N",
"Arrays.fill(ans, 0)",
"Arrays.fill",
"Arrays",
"ans",
"0",
"for (String An: br.readLine().split(\" \")) {\n ans[Integer.valueOf(An) - 1]++;\n }",
"String An",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"{\n ans[Integer.valueOf(An) - 1]++;\n }",
"{\n ans[Integer.valueOf(An) - 1]++;\n }",
"ans[Integer.valueOf(An) - 1]++",
"ans[Integer.valueOf(An) - 1]",
"ans",
"Integer.valueOf(An) - 1",
"Integer.valueOf(An)",
"Integer.valueOf",
"Integer",
"An",
"1",
"for (int i: ans) {\n System.out.println(i);\n }",
"int i",
"ans",
"{\n System.out.println(i);\n }",
"{\n System.out.println(i);\n }",
"System.out.println(i)",
"System.out.println",
"System.out",
"System",
"System.out",
"i",
"String args[]",
"args",
"public class Main {\n\n public static void main(String args[]) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int N = Integer.parseInt(br.readLine());\n\n int[] ans = new int[N];\n Arrays.fill(ans, 0);\n for (String An: br.readLine().split(\" \")) {\n ans[Integer.valueOf(An) - 1]++;\n }\n\n for (int i: ans) {\n System.out.println(i);\n }\n }\n}",
"public class Main {\n\n public static void main(String args[]) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int N = Integer.parseInt(br.readLine());\n\n int[] ans = new int[N];\n Arrays.fill(ans, 0);\n for (String An: br.readLine().split(\" \")) {\n ans[Integer.valueOf(An) - 1]++;\n }\n\n for (int i: ans) {\n System.out.println(i);\n }\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
/**
* N
* 人の社員からなる会社があり、各社員には
* 1
* ,
* .
* .
* .
* ,
* N
* の社員番号が割り当てられています。
*
* 社員番号
* 1
* の社員以外の全ての社員には、自分より社員番号が小さい直属の上司がちょうど
* 1
* 人います。
*
* X
* さんが
* Y
* さんの直属の上司であるとき、
* Y
* さんは
* X
* さんの直属の部下であるといいます。
*
* 社員番号
* i
* の社員の直属の上司の社員番号が
* A
* i
* であることが与えられます。各社員について直属の部下が何人いるか求めてください。
*/
public class Main {
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
int[] ans = new int[N];
Arrays.fill(ans, 0);
for (String An: br.readLine().split(" ")) {
ans[Integer.valueOf(An) - 1]++;
}
for (int i: ans) {
System.out.println(i);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
40,
18,
13,
2,
4,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
120,
5
],
[
120,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
20,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
26,
36
],
[
36,
37
],
[
37,
38
],
[
26,
39
],
[
40,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
40,
46
],
[
46,
47
],
[
47,
48
],
[
46,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
8,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
72,
82
],
[
82,
83
],
[
83,
84
],
[
72,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
90,
95
],
[
8,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
101,
103
],
[
96,
104
],
[
104,
105
],
[
105,
106
],
[
96,
107
],
[
108,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
6,
117
],
[
117,
118
],
[
0,
119
],
[
119,
120
],
[
119,
121
]
] |
[
"import java.util.*;\n \npublic class Main { //クラス名はMain\n public static void main(String[] args) {\n //整数の入力\n List<String> list = new ArrayList<String>();\n Scanner sc = new Scanner(System.in);\n Integer Syainsu = Integer.parseInt(sc.next());\n \n //上司の社員番号\n //1番は直属の上司を持たないため-1\n List<Integer> num = new ArrayList<>();\n for (int i=0; i<Syainsu-1; i++) {\n int di = sc.nextInt();\n num.add(di);\n }\n\n int a[] = new int[Syainsu]; \n for(int i=0;i<Syainsu;i++){\n a[i] = 0;\n }\n for(int i=0;i<Syainsu-1;i++){\n a[num.get(i)-1]++;\n }\n \n for(int i=0;i<Syainsu;i++){\n\t System.out.println(a[i]);\n }\n }\n \n}",
"import java.util.*;",
"util.*",
"java",
"public class Main { //クラス名はMain\n public static void main(String[] args) {\n //整数の入力\n List<String> list = new ArrayList<String>();\n Scanner sc = new Scanner(System.in);\n Integer Syainsu = Integer.parseInt(sc.next());\n \n //上司の社員番号\n //1番は直属の上司を持たないため-1\n List<Integer> num = new ArrayList<>();\n for (int i=0; i<Syainsu-1; i++) {\n int di = sc.nextInt();\n num.add(di);\n }\n\n int a[] = new int[Syainsu]; \n for(int i=0;i<Syainsu;i++){\n a[i] = 0;\n }\n for(int i=0;i<Syainsu-1;i++){\n a[num.get(i)-1]++;\n }\n \n for(int i=0;i<Syainsu;i++){\n\t System.out.println(a[i]);\n }\n }\n \n}",
"Main",
"public static void main(String[] args) {\n //整数の入力\n List<String> list = new ArrayList<String>();\n Scanner sc = new Scanner(System.in);\n Integer Syainsu = Integer.parseInt(sc.next());\n \n //上司の社員番号\n //1番は直属の上司を持たないため-1\n List<Integer> num = new ArrayList<>();\n for (int i=0; i<Syainsu-1; i++) {\n int di = sc.nextInt();\n num.add(di);\n }\n\n int a[] = new int[Syainsu]; \n for(int i=0;i<Syainsu;i++){\n a[i] = 0;\n }\n for(int i=0;i<Syainsu-1;i++){\n a[num.get(i)-1]++;\n }\n \n for(int i=0;i<Syainsu;i++){\n\t System.out.println(a[i]);\n }\n }",
"main",
"{\n //整数の入力\n List<String> list = new ArrayList<String>();\n Scanner sc = new Scanner(System.in);\n Integer Syainsu = Integer.parseInt(sc.next());\n \n //上司の社員番号\n //1番は直属の上司を持たないため-1\n List<Integer> num = new ArrayList<>();\n for (int i=0; i<Syainsu-1; i++) {\n int di = sc.nextInt();\n num.add(di);\n }\n\n int a[] = new int[Syainsu]; \n for(int i=0;i<Syainsu;i++){\n a[i] = 0;\n }\n for(int i=0;i<Syainsu-1;i++){\n a[num.get(i)-1]++;\n }\n \n for(int i=0;i<Syainsu;i++){\n\t System.out.println(a[i]);\n }\n }",
"List<String> list = new ArrayList<String>();",
"list",
"new ArrayList<String>()",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"Integer Syainsu = Integer.parseInt(sc.next());",
"Syainsu",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"List<Integer> num = new ArrayList<>();",
"num",
"new ArrayList<>()",
"for (int i=0; i<Syainsu-1; i++) {\n int di = sc.nextInt();\n num.add(di);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<Syainsu-1",
"i",
"Syainsu-1",
"Syainsu",
"1",
"i++",
"i++",
"i",
"{\n int di = sc.nextInt();\n num.add(di);\n }",
"{\n int di = sc.nextInt();\n num.add(di);\n }",
"int di = sc.nextInt();",
"di",
"sc.nextInt()",
"sc.nextInt",
"sc",
"num.add(di)",
"num.add",
"num",
"di",
"int a[] = new int[Syainsu];",
"a",
"new int[Syainsu]",
"Syainsu",
"for(int i=0;i<Syainsu;i++){\n a[i] = 0;\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<Syainsu",
"i",
"Syainsu",
"i++",
"i++",
"i",
"{\n a[i] = 0;\n }",
"{\n a[i] = 0;\n }",
"a[i] = 0",
"a[i]",
"a",
"i",
"0",
"for(int i=0;i<Syainsu-1;i++){\n a[num.get(i)-1]++;\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<Syainsu-1",
"i",
"Syainsu-1",
"Syainsu",
"1",
"i++",
"i++",
"i",
"{\n a[num.get(i)-1]++;\n }",
"{\n a[num.get(i)-1]++;\n }",
"a[num.get(i)-1]++",
"a[num.get(i)-1]",
"a",
"num.get(i)-1",
"num.get(i)",
"num.get",
"num",
"i",
"1",
"for(int i=0;i<Syainsu;i++){\n\t System.out.println(a[i]);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<Syainsu",
"i",
"Syainsu",
"i++",
"i++",
"i",
"{\n\t System.out.println(a[i]);\n }",
"{\n\t System.out.println(a[i]);\n }",
"System.out.println(a[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"a[i]",
"a",
"i",
"String[] args",
"args",
"public class Main { //クラス名はMain\n public static void main(String[] args) {\n //整数の入力\n List<String> list = new ArrayList<String>();\n Scanner sc = new Scanner(System.in);\n Integer Syainsu = Integer.parseInt(sc.next());\n \n //上司の社員番号\n //1番は直属の上司を持たないため-1\n List<Integer> num = new ArrayList<>();\n for (int i=0; i<Syainsu-1; i++) {\n int di = sc.nextInt();\n num.add(di);\n }\n\n int a[] = new int[Syainsu]; \n for(int i=0;i<Syainsu;i++){\n a[i] = 0;\n }\n for(int i=0;i<Syainsu-1;i++){\n a[num.get(i)-1]++;\n }\n \n for(int i=0;i<Syainsu;i++){\n\t System.out.println(a[i]);\n }\n }\n \n}",
"public class Main { //クラス名はMain\n public static void main(String[] args) {\n //整数の入力\n List<String> list = new ArrayList<String>();\n Scanner sc = new Scanner(System.in);\n Integer Syainsu = Integer.parseInt(sc.next());\n \n //上司の社員番号\n //1番は直属の上司を持たないため-1\n List<Integer> num = new ArrayList<>();\n for (int i=0; i<Syainsu-1; i++) {\n int di = sc.nextInt();\n num.add(di);\n }\n\n int a[] = new int[Syainsu]; \n for(int i=0;i<Syainsu;i++){\n a[i] = 0;\n }\n for(int i=0;i<Syainsu-1;i++){\n a[num.get(i)-1]++;\n }\n \n for(int i=0;i<Syainsu;i++){\n\t System.out.println(a[i]);\n }\n }\n \n}",
"Main"
] |
import java.util.*;
public class Main { //クラス名はMain
public static void main(String[] args) {
//整数の入力
List<String> list = new ArrayList<String>();
Scanner sc = new Scanner(System.in);
Integer Syainsu = Integer.parseInt(sc.next());
//上司の社員番号
//1番は直属の上司を持たないため-1
List<Integer> num = new ArrayList<>();
for (int i=0; i<Syainsu-1; i++) {
int di = sc.nextInt();
num.add(di);
}
int a[] = new int[Syainsu];
for(int i=0;i<Syainsu;i++){
a[i] = 0;
}
for(int i=0;i<Syainsu-1;i++){
a[num.get(i)-1]++;
}
for(int i=0;i<Syainsu;i++){
System.out.println(a[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,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
40,
18,
13,
2,
13,
17,
4,
18,
13,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
64,
5
],
[
64,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
28,
30
],
[
21,
31
],
[
31,
32
],
[
32,
33
],
[
21,
34
],
[
35,
35
],
[
35,
36
],
[
36,
37
],
[
36,
38
],
[
38,
39
],
[
39,
40
],
[
35,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
44,
46
],
[
8,
47
],
[
47,
48
],
[
48,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
50,
53
],
[
54,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
6,
61
],
[
61,
62
],
[
0,
63
],
[
63,
64
],
[
63,
65
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int N = scan.nextInt();\n\n int[] buka = new int[N];\n\n for (int i = 0; i < N-1; i++) {\n \tint temp = scan.nextInt();\n \tbuka[temp-1]++;\n }\n\n scan.close();\n\n for (int output: buka) {\n \tSystem.out.println(output);\n }\n\n }\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int N = scan.nextInt();\n\n int[] buka = new int[N];\n\n for (int i = 0; i < N-1; i++) {\n \tint temp = scan.nextInt();\n \tbuka[temp-1]++;\n }\n\n scan.close();\n\n for (int output: buka) {\n \tSystem.out.println(output);\n }\n\n }\n\n}",
"Main",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int N = scan.nextInt();\n\n int[] buka = new int[N];\n\n for (int i = 0; i < N-1; i++) {\n \tint temp = scan.nextInt();\n \tbuka[temp-1]++;\n }\n\n scan.close();\n\n for (int output: buka) {\n \tSystem.out.println(output);\n }\n\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n\n int N = scan.nextInt();\n\n int[] buka = new int[N];\n\n for (int i = 0; i < N-1; i++) {\n \tint temp = scan.nextInt();\n \tbuka[temp-1]++;\n }\n\n scan.close();\n\n for (int output: buka) {\n \tSystem.out.println(output);\n }\n\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] buka = new int[N];",
"buka",
"new int[N]",
"N",
"for (int i = 0; i < N-1; i++) {\n \tint temp = scan.nextInt();\n \tbuka[temp-1]++;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N-1",
"i",
"N-1",
"N",
"1",
"i++",
"i++",
"i",
"{\n \tint temp = scan.nextInt();\n \tbuka[temp-1]++;\n }",
"{\n \tint temp = scan.nextInt();\n \tbuka[temp-1]++;\n }",
"int temp = scan.nextInt();",
"temp",
"scan.nextInt()",
"scan.nextInt",
"scan",
"buka[temp-1]++",
"buka[temp-1]",
"buka",
"temp-1",
"temp",
"1",
"scan.close()",
"scan.close",
"scan",
"for (int output: buka) {\n \tSystem.out.println(output);\n }",
"int output",
"buka",
"{\n \tSystem.out.println(output);\n }",
"{\n \tSystem.out.println(output);\n }",
"System.out.println(output)",
"System.out.println",
"System.out",
"System",
"System.out",
"output",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int N = scan.nextInt();\n\n int[] buka = new int[N];\n\n for (int i = 0; i < N-1; i++) {\n \tint temp = scan.nextInt();\n \tbuka[temp-1]++;\n }\n\n scan.close();\n\n for (int output: buka) {\n \tSystem.out.println(output);\n }\n\n }\n\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n\n int N = scan.nextInt();\n\n int[] buka = new int[N];\n\n for (int i = 0; i < N-1; i++) {\n \tint temp = scan.nextInt();\n \tbuka[temp-1]++;\n }\n\n scan.close();\n\n for (int output: buka) {\n \tSystem.out.println(output);\n }\n\n }\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
int[] buka = new int[N];
for (int i = 0; i < N-1; i++) {
int temp = scan.nextInt();
buka[temp-1]++;
}
scan.close();
for (int output: buka) {
System.out.println(output);
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
17,
38,
30,
4,
18,
13,
30,
0,
13,
20,
41,
13,
4,
13,
13,
41,
13,
4,
13,
18,
13,
17,
0,
13,
4,
13,
13,
41,
13,
20,
28,
13,
13,
30,
30,
41,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
0,
13,
17,
4,
18,
13,
13,
40,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
2,
13,
17,
14,
2,
13,
17,
30,
0,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
29,
4,
18,
4,
18,
13,
17,
23,
13,
12,
13,
30,
29,
4,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
141,
17
],
[
141,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
24,
29
],
[
29,
30
],
[
30,
31
],
[
30,
32
],
[
29,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
35,
37
],
[
29,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
42,
44
],
[
29,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
29,
50
],
[
50,
51
],
[
50,
52
],
[
29,
53
],
[
53,
54
],
[
53,
55
],
[
53,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
60,
63
],
[
57,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
57,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
72,
76
],
[
76,
77
],
[
29,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
83,
84
],
[
83,
85
],
[
78,
86
],
[
86,
87
],
[
87,
88
],
[
78,
89
],
[
90,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
99,
100
],
[
99,
101
],
[
90,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
90,
110
],
[
110,
111
],
[
111,
112
],
[
112,
113
],
[
112,
114
],
[
110,
115
],
[
18,
116
],
[
116,
117
],
[
141,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
122,
127
],
[
118,
128
],
[
128,
129
],
[
141,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
130,
138
],
[
138,
139
],
[
0,
140
],
[
140,
141
],
[
140,
142
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class Main {\n\n\tpublic static void main(String[] strArgs) throws Exception {\n\t\tBufferedReader br = null;\n\n\t\ttry {\n\t\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString[] strValues = readValues(br);\n\n\t\t\tint iEmpCount = toInt(strValues[0]);\n\n\t\t\tstrValues = readValues(br);\n\t\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\tfor (String strBossEmpNo : strValues) {\n\t\t\t\tInteger iCount = map.get(strBossEmpNo);\n\t\t\t\tif (iCount == null) {\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}\n\t\t\t\tmap.put(strBossEmpNo, ++iCount);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < iEmpCount; i++) {\n\t\t\t\tInteger iCount = map.get(String.valueOf(i + 1));\n\t\t\t\tif (iCount == null) { iCount = 0; }\n\t\t\t\tSystem.out.println(iCount);\n\t\t\t}\n\n\t\t} finally {\n\t\t\tbr.close();\n\t\t}\n\t}\n\n\tprivate static String[] readValues(BufferedReader br) throws IOException {\n\t\treturn br.readLine().split(\"\\\\s\");\n\t}\n\n\tprivate static int toInt(String str) {\n\t\treturn Integer.parseInt(str);\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.HashMap;",
"HashMap",
"java.util",
"import java.util.Map;",
"Map",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] strArgs) throws Exception {\n\t\tBufferedReader br = null;\n\n\t\ttry {\n\t\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString[] strValues = readValues(br);\n\n\t\t\tint iEmpCount = toInt(strValues[0]);\n\n\t\t\tstrValues = readValues(br);\n\t\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\tfor (String strBossEmpNo : strValues) {\n\t\t\t\tInteger iCount = map.get(strBossEmpNo);\n\t\t\t\tif (iCount == null) {\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}\n\t\t\t\tmap.put(strBossEmpNo, ++iCount);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < iEmpCount; i++) {\n\t\t\t\tInteger iCount = map.get(String.valueOf(i + 1));\n\t\t\t\tif (iCount == null) { iCount = 0; }\n\t\t\t\tSystem.out.println(iCount);\n\t\t\t}\n\n\t\t} finally {\n\t\t\tbr.close();\n\t\t}\n\t}\n\n\tprivate static String[] readValues(BufferedReader br) throws IOException {\n\t\treturn br.readLine().split(\"\\\\s\");\n\t}\n\n\tprivate static int toInt(String str) {\n\t\treturn Integer.parseInt(str);\n\t}\n}",
"Main",
"public static void main(String[] strArgs) throws Exception {\n\t\tBufferedReader br = null;\n\n\t\ttry {\n\t\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString[] strValues = readValues(br);\n\n\t\t\tint iEmpCount = toInt(strValues[0]);\n\n\t\t\tstrValues = readValues(br);\n\t\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\tfor (String strBossEmpNo : strValues) {\n\t\t\t\tInteger iCount = map.get(strBossEmpNo);\n\t\t\t\tif (iCount == null) {\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}\n\t\t\t\tmap.put(strBossEmpNo, ++iCount);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < iEmpCount; i++) {\n\t\t\t\tInteger iCount = map.get(String.valueOf(i + 1));\n\t\t\t\tif (iCount == null) { iCount = 0; }\n\t\t\t\tSystem.out.println(iCount);\n\t\t\t}\n\n\t\t} finally {\n\t\t\tbr.close();\n\t\t}\n\t}",
"main",
"{\n\t\tBufferedReader br = null;\n\n\t\ttry {\n\t\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString[] strValues = readValues(br);\n\n\t\t\tint iEmpCount = toInt(strValues[0]);\n\n\t\t\tstrValues = readValues(br);\n\t\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\tfor (String strBossEmpNo : strValues) {\n\t\t\t\tInteger iCount = map.get(strBossEmpNo);\n\t\t\t\tif (iCount == null) {\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}\n\t\t\t\tmap.put(strBossEmpNo, ++iCount);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < iEmpCount; i++) {\n\t\t\t\tInteger iCount = map.get(String.valueOf(i + 1));\n\t\t\t\tif (iCount == null) { iCount = 0; }\n\t\t\t\tSystem.out.println(iCount);\n\t\t\t}\n\n\t\t} finally {\n\t\t\tbr.close();\n\t\t}\n\t}",
"BufferedReader br = null;",
"br",
"null",
"try {\n\t\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString[] strValues = readValues(br);\n\n\t\t\tint iEmpCount = toInt(strValues[0]);\n\n\t\t\tstrValues = readValues(br);\n\t\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\tfor (String strBossEmpNo : strValues) {\n\t\t\t\tInteger iCount = map.get(strBossEmpNo);\n\t\t\t\tif (iCount == null) {\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}\n\t\t\t\tmap.put(strBossEmpNo, ++iCount);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < iEmpCount; i++) {\n\t\t\t\tInteger iCount = map.get(String.valueOf(i + 1));\n\t\t\t\tif (iCount == null) { iCount = 0; }\n\t\t\t\tSystem.out.println(iCount);\n\t\t\t}\n\n\t\t} finally {\n\t\t\tbr.close();\n\t\t}",
"{\n\t\t\tbr.close();\n\t\t}",
"br.close()",
"br.close",
"br",
"{\n\t\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString[] strValues = readValues(br);\n\n\t\t\tint iEmpCount = toInt(strValues[0]);\n\n\t\t\tstrValues = readValues(br);\n\t\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\tfor (String strBossEmpNo : strValues) {\n\t\t\t\tInteger iCount = map.get(strBossEmpNo);\n\t\t\t\tif (iCount == null) {\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}\n\t\t\t\tmap.put(strBossEmpNo, ++iCount);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < iEmpCount; i++) {\n\t\t\t\tInteger iCount = map.get(String.valueOf(i + 1));\n\t\t\t\tif (iCount == null) { iCount = 0; }\n\t\t\t\tSystem.out.println(iCount);\n\t\t\t}\n\n\t\t}",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] strValues = readValues(br);",
"strValues",
"readValues(br)",
"readValues",
"br",
"int iEmpCount = toInt(strValues[0]);",
"iEmpCount",
"toInt(strValues[0])",
"toInt",
"strValues[0]",
"strValues",
"0",
"strValues = readValues(br)",
"strValues",
"readValues(br)",
"readValues",
"br",
"Map<String, Integer> map = new HashMap<String, Integer>();",
"map",
"new HashMap<String, Integer>()",
"for (String strBossEmpNo : strValues) {\n\t\t\t\tInteger iCount = map.get(strBossEmpNo);\n\t\t\t\tif (iCount == null) {\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}\n\t\t\t\tmap.put(strBossEmpNo, ++iCount);\n\t\t\t}",
"String strBossEmpNo",
"strValues",
"{\n\t\t\t\tInteger iCount = map.get(strBossEmpNo);\n\t\t\t\tif (iCount == null) {\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}\n\t\t\t\tmap.put(strBossEmpNo, ++iCount);\n\t\t\t}",
"{\n\t\t\t\tInteger iCount = map.get(strBossEmpNo);\n\t\t\t\tif (iCount == null) {\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}\n\t\t\t\tmap.put(strBossEmpNo, ++iCount);\n\t\t\t}",
"Integer iCount = map.get(strBossEmpNo);",
"iCount",
"map.get(strBossEmpNo)",
"map.get",
"map",
"strBossEmpNo",
"if (iCount == null) {\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}",
"iCount == null",
"iCount",
"null",
"{\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}",
"iCount = 0",
"iCount",
"0",
"map.put(strBossEmpNo, ++iCount)",
"map.put",
"map",
"strBossEmpNo",
"++iCount",
"iCount",
"for (int i = 0; i < iEmpCount; i++) {\n\t\t\t\tInteger iCount = map.get(String.valueOf(i + 1));\n\t\t\t\tif (iCount == null) { iCount = 0; }\n\t\t\t\tSystem.out.println(iCount);\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < iEmpCount",
"i",
"iEmpCount",
"i++",
"i++",
"i",
"{\n\t\t\t\tInteger iCount = map.get(String.valueOf(i + 1));\n\t\t\t\tif (iCount == null) { iCount = 0; }\n\t\t\t\tSystem.out.println(iCount);\n\t\t\t}",
"{\n\t\t\t\tInteger iCount = map.get(String.valueOf(i + 1));\n\t\t\t\tif (iCount == null) { iCount = 0; }\n\t\t\t\tSystem.out.println(iCount);\n\t\t\t}",
"Integer iCount = map.get(String.valueOf(i + 1));",
"iCount",
"map.get(String.valueOf(i + 1))",
"map.get",
"map",
"String.valueOf(i + 1)",
"String.valueOf",
"String",
"i + 1",
"i",
"1",
"if (iCount == null) { iCount = 0; }",
"iCount == null",
"iCount",
"null",
"{ iCount = 0; }",
"iCount = 0",
"iCount",
"0",
"System.out.println(iCount)",
"System.out.println",
"System.out",
"System",
"System.out",
"iCount",
"String[] strArgs",
"strArgs",
"private static String[] readValues(BufferedReader br) throws IOException {\n\t\treturn br.readLine().split(\"\\\\s\");\n\t}",
"readValues",
"{\n\t\treturn br.readLine().split(\"\\\\s\");\n\t}",
"return br.readLine().split(\"\\\\s\");",
"br.readLine().split(\"\\\\s\")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\"\\\\s\"",
"BufferedReader br",
"br",
"private static int toInt(String str) {\n\t\treturn Integer.parseInt(str);\n\t}",
"toInt",
"{\n\t\treturn Integer.parseInt(str);\n\t}",
"return Integer.parseInt(str);",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"String str",
"str",
"public class Main {\n\n\tpublic static void main(String[] strArgs) throws Exception {\n\t\tBufferedReader br = null;\n\n\t\ttry {\n\t\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString[] strValues = readValues(br);\n\n\t\t\tint iEmpCount = toInt(strValues[0]);\n\n\t\t\tstrValues = readValues(br);\n\t\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\tfor (String strBossEmpNo : strValues) {\n\t\t\t\tInteger iCount = map.get(strBossEmpNo);\n\t\t\t\tif (iCount == null) {\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}\n\t\t\t\tmap.put(strBossEmpNo, ++iCount);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < iEmpCount; i++) {\n\t\t\t\tInteger iCount = map.get(String.valueOf(i + 1));\n\t\t\t\tif (iCount == null) { iCount = 0; }\n\t\t\t\tSystem.out.println(iCount);\n\t\t\t}\n\n\t\t} finally {\n\t\t\tbr.close();\n\t\t}\n\t}\n\n\tprivate static String[] readValues(BufferedReader br) throws IOException {\n\t\treturn br.readLine().split(\"\\\\s\");\n\t}\n\n\tprivate static int toInt(String str) {\n\t\treturn Integer.parseInt(str);\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] strArgs) throws Exception {\n\t\tBufferedReader br = null;\n\n\t\ttry {\n\t\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tString[] strValues = readValues(br);\n\n\t\t\tint iEmpCount = toInt(strValues[0]);\n\n\t\t\tstrValues = readValues(br);\n\t\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\tfor (String strBossEmpNo : strValues) {\n\t\t\t\tInteger iCount = map.get(strBossEmpNo);\n\t\t\t\tif (iCount == null) {\n\t\t\t\t\tiCount = 0;\n\t\t\t\t}\n\t\t\t\tmap.put(strBossEmpNo, ++iCount);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < iEmpCount; i++) {\n\t\t\t\tInteger iCount = map.get(String.valueOf(i + 1));\n\t\t\t\tif (iCount == null) { iCount = 0; }\n\t\t\t\tSystem.out.println(iCount);\n\t\t\t}\n\n\t\t} finally {\n\t\t\tbr.close();\n\t\t}\n\t}\n\n\tprivate static String[] readValues(BufferedReader br) throws IOException {\n\t\treturn br.readLine().split(\"\\\\s\");\n\t}\n\n\tprivate static int toInt(String str) {\n\t\treturn Integer.parseInt(str);\n\t}\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
public class Main {
public static void main(String[] strArgs) throws Exception {
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(System.in));
String[] strValues = readValues(br);
int iEmpCount = toInt(strValues[0]);
strValues = readValues(br);
Map<String, Integer> map = new HashMap<String, Integer>();
for (String strBossEmpNo : strValues) {
Integer iCount = map.get(strBossEmpNo);
if (iCount == null) {
iCount = 0;
}
map.put(strBossEmpNo, ++iCount);
}
for (int i = 0; i < iEmpCount; i++) {
Integer iCount = map.get(String.valueOf(i + 1));
if (iCount == null) { iCount = 0; }
System.out.println(iCount);
}
} finally {
br.close();
}
}
private static String[] readValues(BufferedReader br) throws IOException {
return br.readLine().split("\\s");
}
private static int toInt(String str) {
return Integer.parseInt(str);
}
}
|
[
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,
17,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
2,
4,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
90,
5
],
[
90,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
21,
26
],
[
26,
27
],
[
26,
28
],
[
21,
29
],
[
29,
30
],
[
30,
31
],
[
21,
32
],
[
33,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
8,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
46,
48
],
[
39,
49
],
[
49,
50
],
[
50,
51
],
[
39,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
57,
61
],
[
54,
62
],
[
8,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
63,
71
],
[
71,
72
],
[
72,
73
],
[
63,
74
],
[
75,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
8,
84
],
[
84,
85
],
[
85,
86
],
[
6,
87
],
[
87,
88
],
[
0,
89
],
[
89,
90
],
[
89,
91
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] array = new int[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tarray[0] = 0;\n\t\t}\n\n\t\tfor(int i=0; i < n - 1; i++) {\n\t\t\tarray[sc.nextInt() - 1] += 1;\n\t\t}\n\n\t\tfor(int i = 0; i < n ; i++) {\n\t\t\tSystem.out.println(array[i]);\n\t\t}\n\n\t\tsc.close();\n\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] array = new int[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tarray[0] = 0;\n\t\t}\n\n\t\tfor(int i=0; i < n - 1; i++) {\n\t\t\tarray[sc.nextInt() - 1] += 1;\n\t\t}\n\n\t\tfor(int i = 0; i < n ; i++) {\n\t\t\tSystem.out.println(array[i]);\n\t\t}\n\n\t\tsc.close();\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] array = new int[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tarray[0] = 0;\n\t\t}\n\n\t\tfor(int i=0; i < n - 1; i++) {\n\t\t\tarray[sc.nextInt() - 1] += 1;\n\t\t}\n\n\t\tfor(int i = 0; i < n ; i++) {\n\t\t\tSystem.out.println(array[i]);\n\t\t}\n\n\t\tsc.close();\n\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] array = new int[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tarray[0] = 0;\n\t\t}\n\n\t\tfor(int i=0; i < n - 1; i++) {\n\t\t\tarray[sc.nextInt() - 1] += 1;\n\t\t}\n\n\t\tfor(int i = 0; i < n ; i++) {\n\t\t\tSystem.out.println(array[i]);\n\t\t}\n\n\t\tsc.close();\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] array = new int[n];",
"array",
"new int[n]",
"n",
"for(int i = 0; i < n; i++) {\n\t\t\tarray[0] = 0;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tarray[0] = 0;\n\t\t}",
"{\n\t\t\tarray[0] = 0;\n\t\t}",
"array[0] = 0",
"array[0]",
"array",
"0",
"0",
"for(int i=0; i < n - 1; i++) {\n\t\t\tarray[sc.nextInt() - 1] += 1;\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tarray[sc.nextInt() - 1] += 1;\n\t\t}",
"{\n\t\t\tarray[sc.nextInt() - 1] += 1;\n\t\t}",
"array[sc.nextInt() - 1] += 1",
"array[sc.nextInt() - 1]",
"array",
"sc.nextInt() - 1",
"sc.nextInt()",
"sc.nextInt",
"sc",
"1",
"1",
"for(int i = 0; i < n ; i++) {\n\t\t\tSystem.out.println(array[i]);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.println(array[i]);\n\t\t}",
"{\n\t\t\tSystem.out.println(array[i]);\n\t\t}",
"System.out.println(array[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"array[i]",
"array",
"i",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] array = new int[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tarray[0] = 0;\n\t\t}\n\n\t\tfor(int i=0; i < n - 1; i++) {\n\t\t\tarray[sc.nextInt() - 1] += 1;\n\t\t}\n\n\t\tfor(int i = 0; i < n ; i++) {\n\t\t\tSystem.out.println(array[i]);\n\t\t}\n\n\t\tsc.close();\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint n = sc.nextInt();\n\n\t\tint[] array = new int[n];\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tarray[0] = 0;\n\t\t}\n\n\t\tfor(int i=0; i < n - 1; i++) {\n\t\t\tarray[sc.nextInt() - 1] += 1;\n\t\t}\n\n\t\tfor(int i = 0; i < n ; i++) {\n\t\t\tSystem.out.println(array[i]);\n\t\t}\n\n\t\tsc.close();\n\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] array = new int[n];
for(int i = 0; i < n; i++) {
array[0] = 0;
}
for(int i=0; i < n - 1; i++) {
array[sc.nextInt() - 1] += 1;
}
for(int i = 0; i < n ; i++) {
System.out.println(array[i]);
}
sc.close();
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
40,
18,
13,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
4,
18,
13,
18,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
87,
5
],
[
87,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
38,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
8,
51
],
[
51,
52
],
[
51,
53
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
54,
62
],
[
62,
63
],
[
63,
64
],
[
54,
65
],
[
66,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
72,
73
],
[
72,
74
],
[
67,
75
],
[
75,
76
],
[
76,
77
],
[
8,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
6,
84
],
[
84,
85
],
[
0,
86
],
[
86,
87
],
[
86,
88
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.next());\n int[] b = new int[n+1];\n for(int i = 2; i <= n; i++){\n int a = Integer.parseInt(sc.next());\n b[a]++;\n }\n \n StringBuilder sb = new StringBuilder();\n for(int i = 1; i <= n; i++){\n sb.append(b[i]).append(System.lineSeparator());\n }\n System.out.print(sb);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.next());\n int[] b = new int[n+1];\n for(int i = 2; i <= n; i++){\n int a = Integer.parseInt(sc.next());\n b[a]++;\n }\n \n StringBuilder sb = new StringBuilder();\n for(int i = 1; i <= n; i++){\n sb.append(b[i]).append(System.lineSeparator());\n }\n System.out.print(sb);\n }\n}",
"Main",
"public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.next());\n int[] b = new int[n+1];\n for(int i = 2; i <= n; i++){\n int a = Integer.parseInt(sc.next());\n b[a]++;\n }\n \n StringBuilder sb = new StringBuilder();\n for(int i = 1; i <= n; i++){\n sb.append(b[i]).append(System.lineSeparator());\n }\n System.out.print(sb);\n }",
"main",
"{\n \n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.next());\n int[] b = new int[n+1];\n for(int i = 2; i <= n; i++){\n int a = Integer.parseInt(sc.next());\n b[a]++;\n }\n \n StringBuilder sb = new StringBuilder();\n for(int i = 1; i <= n; i++){\n sb.append(b[i]).append(System.lineSeparator());\n }\n System.out.print(sb);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = Integer.parseInt(sc.next());",
"n",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int[] b = new int[n+1];",
"b",
"new int[n+1]",
"n+1",
"n",
"1",
"for(int i = 2; i <= n; i++){\n int a = Integer.parseInt(sc.next());\n b[a]++;\n }",
"int i = 2;",
"int i = 2;",
"i",
"2",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n int a = Integer.parseInt(sc.next());\n b[a]++;\n }",
"{\n int a = Integer.parseInt(sc.next());\n b[a]++;\n }",
"int a = Integer.parseInt(sc.next());",
"a",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"b[a]++",
"b[a]",
"b",
"a",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"for(int i = 1; i <= n; i++){\n sb.append(b[i]).append(System.lineSeparator());\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i <= n",
"i",
"n",
"i++",
"i++",
"i",
"{\n sb.append(b[i]).append(System.lineSeparator());\n }",
"{\n sb.append(b[i]).append(System.lineSeparator());\n }",
"sb.append(b[i]).append(System.lineSeparator())",
"sb.append(b[i]).append",
"sb.append(b[i])",
"sb.append",
"sb",
"b[i]",
"b",
"i",
"System.lineSeparator()",
"System.lineSeparator",
"System",
"System.out.print(sb)",
"System.out.print",
"System.out",
"System",
"System.out",
"sb",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.next());\n int[] b = new int[n+1];\n for(int i = 2; i <= n; i++){\n int a = Integer.parseInt(sc.next());\n b[a]++;\n }\n \n StringBuilder sb = new StringBuilder();\n for(int i = 1; i <= n; i++){\n sb.append(b[i]).append(System.lineSeparator());\n }\n System.out.print(sb);\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n \n Scanner sc = new Scanner(System.in);\n \n int n = Integer.parseInt(sc.next());\n int[] b = new int[n+1];\n for(int i = 2; i <= n; i++){\n int a = Integer.parseInt(sc.next());\n b[a]++;\n }\n \n StringBuilder sb = new StringBuilder();\n for(int i = 1; i <= n; i++){\n sb.append(b[i]).append(System.lineSeparator());\n }\n System.out.print(sb);\n }\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int[] b = new int[n+1];
for(int i = 2; i <= n; i++){
int a = Integer.parseInt(sc.next());
b[a]++;
}
StringBuilder sb = new StringBuilder();
for(int i = 1; i <= n; i++){
sb.append(b[i]).append(System.lineSeparator());
}
System.out.print(sb);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
41,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
40,
18,
13,
2,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
80,
8
],
[
80,
9
],
[
9,
10
],
[
9,
11
],
[
80,
12
],
[
12,
13
],
[
12,
14
],
[
80,
15
],
[
15,
16
],
[
15,
17
],
[
80,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
20,
29
],
[
29,
30
],
[
29,
31
],
[
20,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
33,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
33,
43
],
[
43,
44
],
[
44,
45
],
[
33,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
51,
55
],
[
20,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
18,
77
],
[
77,
78
],
[
0,
79
],
[
79,
80
],
[
79,
81
]
] |
[
"import java.util.*;\nimport java.math.*;\n\npublic class Main {\n static final int MOD = 1_000_000_007; // 10^9+7\n // static final int MAX = 2_147_483_646; // intの最大値\n static final int INF = 1_000_000_000; // 10^9\n static final int MAX = 10_000_000;\n\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] ary = new int[n];\n for(int i = 0;i < n-1;i++){\n ary[sc.nextInt()-1]++;\n }\n for(int i = 0;i < n;i++){\n System.out.println(ary[i]);\n }\n \n\n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"import java.math.*;",
"math.*",
"java",
"public class Main {\n static final int MOD = 1_000_000_007; // 10^9+7\n // static final int MAX = 2_147_483_646; // intの最大値\n static final int INF = 1_000_000_000; // 10^9\n static final int MAX = 10_000_000;\n\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] ary = new int[n];\n for(int i = 0;i < n-1;i++){\n ary[sc.nextInt()-1]++;\n }\n for(int i = 0;i < n;i++){\n System.out.println(ary[i]);\n }\n \n\n }\n\n}",
"Main",
"static final int MOD = 1_000_000_007; // 10^9+7",
"MOD",
"1_000_000_007",
"// static final int MAX = 2_147_483_646; // intの最大値\n static final int INF = 1_000_000_000; // 10^9",
"INF",
"1_000_000_000",
"static final int MAX = 10_000_000;",
"MAX",
"10_000_000",
"public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] ary = new int[n];\n for(int i = 0;i < n-1;i++){\n ary[sc.nextInt()-1]++;\n }\n for(int i = 0;i < n;i++){\n System.out.println(ary[i]);\n }\n \n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] ary = new int[n];\n for(int i = 0;i < n-1;i++){\n ary[sc.nextInt()-1]++;\n }\n for(int i = 0;i < n;i++){\n System.out.println(ary[i]);\n }\n \n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] ary = new int[n];",
"ary",
"new int[n]",
"n",
"for(int i = 0;i < n-1;i++){\n ary[sc.nextInt()-1]++;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n ary[sc.nextInt()-1]++;\n }",
"{\n ary[sc.nextInt()-1]++;\n }",
"ary[sc.nextInt()-1]++",
"ary[sc.nextInt()-1]",
"ary",
"sc.nextInt()-1",
"sc.nextInt()",
"sc.nextInt",
"sc",
"1",
"for(int i = 0;i < n;i++){\n System.out.println(ary[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n System.out.println(ary[i]);\n }",
"{\n System.out.println(ary[i]);\n }",
"System.out.println(ary[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"ary[i]",
"ary",
"i",
"String args[]",
"args",
"public class Main {\n static final int MOD = 1_000_000_007; // 10^9+7\n // static final int MAX = 2_147_483_646; // intの最大値\n static final int INF = 1_000_000_000; // 10^9\n static final int MAX = 10_000_000;\n\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] ary = new int[n];\n for(int i = 0;i < n-1;i++){\n ary[sc.nextInt()-1]++;\n }\n for(int i = 0;i < n;i++){\n System.out.println(ary[i]);\n }\n \n\n }\n\n}",
"public class Main {\n static final int MOD = 1_000_000_007; // 10^9+7\n // static final int MAX = 2_147_483_646; // intの最大値\n static final int INF = 1_000_000_000; // 10^9\n static final int MAX = 10_000_000;\n\n public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] ary = new int[n];\n for(int i = 0;i < n-1;i++){\n ary[sc.nextInt()-1]++;\n }\n for(int i = 0;i < n;i++){\n System.out.println(ary[i]);\n }\n \n\n }\n\n}",
"Main"
] |
import java.util.*;
import java.math.*;
public class Main {
static final int MOD = 1_000_000_007; // 10^9+7
// static final int MAX = 2_147_483_646; // intの最大値
static final int INF = 1_000_000_000; // 10^9
static final int MAX = 10_000_000;
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] ary = new int[n];
for(int i = 0;i < n-1;i++){
ary[sc.nextInt()-1]++;
}
for(int i = 0;i < n;i++){
System.out.println(ary[i]);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
14,
4,
18,
13,
13,
30,
4,
18,
13,
13,
2,
4,
18,
13,
13,
17,
30,
4,
18,
13,
13,
17,
41,
13,
4,
18,
4,
18,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
13,
13,
30,
4,
18,
18,
13,
13,
4,
18,
13,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
115,
5
],
[
115,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
38,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
44,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
50,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
54,
59
],
[
44,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
61,
65
],
[
8,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
8,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
8,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
77,
88
],
[
89,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
91,
94
],
[
90,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
90,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
106,
111
],
[
6,
112
],
[
112,
113
],
[
0,
114
],
[
114,
115
],
[
114,
116
]
] |
[
"import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint wk=0;\n\t\tint ans=0;\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tfor(int i=2;i<=N;i++){\n\t\t\twk=sc.nextInt();\n\t\t\tif (map.containsKey(wk)){\n\t\t\tmap.put(wk, map.get(wk)+1);\n\t\t\t}\n\t\t\telse{\n\t\t\tmap.put(wk, 1);\n\t\t\t}\n\t\t}\n\t\t// mapキーでソートする\n\t\tObject[] mapkey = map.keySet().toArray();\n\t\tArrays.sort(mapkey);\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tif (map.containsKey(i)){\n\t\t\tSystem.out.println(map.get(i));\n\t\t\t}\n\t\t\telse{\n\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t\t}\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint wk=0;\n\t\tint ans=0;\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tfor(int i=2;i<=N;i++){\n\t\t\twk=sc.nextInt();\n\t\t\tif (map.containsKey(wk)){\n\t\t\tmap.put(wk, map.get(wk)+1);\n\t\t\t}\n\t\t\telse{\n\t\t\tmap.put(wk, 1);\n\t\t\t}\n\t\t}\n\t\t// mapキーでソートする\n\t\tObject[] mapkey = map.keySet().toArray();\n\t\tArrays.sort(mapkey);\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tif (map.containsKey(i)){\n\t\t\tSystem.out.println(map.get(i));\n\t\t\t}\n\t\t\telse{\n\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t\t}\n }\n}",
"Main",
"public static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint wk=0;\n\t\tint ans=0;\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tfor(int i=2;i<=N;i++){\n\t\t\twk=sc.nextInt();\n\t\t\tif (map.containsKey(wk)){\n\t\t\tmap.put(wk, map.get(wk)+1);\n\t\t\t}\n\t\t\telse{\n\t\t\tmap.put(wk, 1);\n\t\t\t}\n\t\t}\n\t\t// mapキーでソートする\n\t\tObject[] mapkey = map.keySet().toArray();\n\t\tArrays.sort(mapkey);\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tif (map.containsKey(i)){\n\t\t\tSystem.out.println(map.get(i));\n\t\t\t}\n\t\t\telse{\n\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t\t}\n }",
"main",
"{\n \tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint wk=0;\n\t\tint ans=0;\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tfor(int i=2;i<=N;i++){\n\t\t\twk=sc.nextInt();\n\t\t\tif (map.containsKey(wk)){\n\t\t\tmap.put(wk, map.get(wk)+1);\n\t\t\t}\n\t\t\telse{\n\t\t\tmap.put(wk, 1);\n\t\t\t}\n\t\t}\n\t\t// mapキーでソートする\n\t\tObject[] mapkey = map.keySet().toArray();\n\t\tArrays.sort(mapkey);\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tif (map.containsKey(i)){\n\t\t\tSystem.out.println(map.get(i));\n\t\t\t}\n\t\t\telse{\n\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t\t}\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int wk=0;",
"wk",
"0",
"int ans=0;",
"ans",
"0",
"HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();",
"map",
"new HashMap<Integer, Integer>()",
"for(int i=2;i<=N;i++){\n\t\t\twk=sc.nextInt();\n\t\t\tif (map.containsKey(wk)){\n\t\t\tmap.put(wk, map.get(wk)+1);\n\t\t\t}\n\t\t\telse{\n\t\t\tmap.put(wk, 1);\n\t\t\t}\n\t\t}",
"int i=2;",
"int i=2;",
"i",
"2",
"i<=N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\twk=sc.nextInt();\n\t\t\tif (map.containsKey(wk)){\n\t\t\tmap.put(wk, map.get(wk)+1);\n\t\t\t}\n\t\t\telse{\n\t\t\tmap.put(wk, 1);\n\t\t\t}\n\t\t}",
"{\n\t\t\twk=sc.nextInt();\n\t\t\tif (map.containsKey(wk)){\n\t\t\tmap.put(wk, map.get(wk)+1);\n\t\t\t}\n\t\t\telse{\n\t\t\tmap.put(wk, 1);\n\t\t\t}\n\t\t}",
"wk=sc.nextInt()",
"wk",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if (map.containsKey(wk)){\n\t\t\tmap.put(wk, map.get(wk)+1);\n\t\t\t}\n\t\t\telse{\n\t\t\tmap.put(wk, 1);\n\t\t\t}",
"map.containsKey(wk)",
"map.containsKey",
"map",
"wk",
"{\n\t\t\tmap.put(wk, map.get(wk)+1);\n\t\t\t}",
"map.put(wk, map.get(wk)+1)",
"map.put",
"map",
"wk",
"map.get(wk)+1",
"map.get(wk)",
"map.get",
"map",
"wk",
"1",
"{\n\t\t\tmap.put(wk, 1);\n\t\t\t}",
"map.put(wk, 1)",
"map.put",
"map",
"wk",
"1",
"Object[] mapkey = map.keySet().toArray();",
"mapkey",
"map.keySet().toArray()",
"map.keySet().toArray",
"map.keySet()",
"map.keySet",
"map",
"Arrays.sort(mapkey)",
"Arrays.sort",
"Arrays",
"mapkey",
"for(int i=1;i<=N;i++){\n\t\t\tif (map.containsKey(i)){\n\t\t\tSystem.out.println(map.get(i));\n\t\t\t}\n\t\t\telse{\n\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tif (map.containsKey(i)){\n\t\t\tSystem.out.println(map.get(i));\n\t\t\t}\n\t\t\telse{\n\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t\t}",
"{\n\t\t\tif (map.containsKey(i)){\n\t\t\tSystem.out.println(map.get(i));\n\t\t\t}\n\t\t\telse{\n\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t\t}",
"if (map.containsKey(i)){\n\t\t\tSystem.out.println(map.get(i));\n\t\t\t}\n\t\t\telse{\n\t\t\tSystem.out.println(ans);\n\t\t\t}",
"map.containsKey(i)",
"map.containsKey",
"map",
"i",
"{\n\t\t\tSystem.out.println(map.get(i));\n\t\t\t}",
"System.out.println(map.get(i))",
"System.out.println",
"System.out",
"System",
"System.out",
"map.get(i)",
"map.get",
"map",
"i",
"{\n\t\t\tSystem.out.println(ans);\n\t\t\t}",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint wk=0;\n\t\tint ans=0;\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tfor(int i=2;i<=N;i++){\n\t\t\twk=sc.nextInt();\n\t\t\tif (map.containsKey(wk)){\n\t\t\tmap.put(wk, map.get(wk)+1);\n\t\t\t}\n\t\t\telse{\n\t\t\tmap.put(wk, 1);\n\t\t\t}\n\t\t}\n\t\t// mapキーでソートする\n\t\tObject[] mapkey = map.keySet().toArray();\n\t\tArrays.sort(mapkey);\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tif (map.containsKey(i)){\n\t\t\tSystem.out.println(map.get(i));\n\t\t\t}\n\t\t\telse{\n\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t\t}\n }\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint wk=0;\n\t\tint ans=0;\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tfor(int i=2;i<=N;i++){\n\t\t\twk=sc.nextInt();\n\t\t\tif (map.containsKey(wk)){\n\t\t\tmap.put(wk, map.get(wk)+1);\n\t\t\t}\n\t\t\telse{\n\t\t\tmap.put(wk, 1);\n\t\t\t}\n\t\t}\n\t\t// mapキーでソートする\n\t\tObject[] mapkey = map.keySet().toArray();\n\t\tArrays.sort(mapkey);\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tif (map.containsKey(i)){\n\t\t\tSystem.out.println(map.get(i));\n\t\t\t}\n\t\t\telse{\n\t\t\tSystem.out.println(ans);\n\t\t\t}\n\t\t\t}\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int wk=0;
int ans=0;
HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
for(int i=2;i<=N;i++){
wk=sc.nextInt();
if (map.containsKey(wk)){
map.put(wk, map.get(wk)+1);
}
else{
map.put(wk, 1);
}
}
// mapキーでソートする
Object[] mapkey = map.keySet().toArray();
Arrays.sort(mapkey);
for(int i=1;i<=N;i++){
if (map.containsKey(i)){
System.out.println(map.get(i));
}
else{
System.out.println(ans);
}
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
2,
13,
17,
2,
4,
18,
13,
2,
13,
17,
17,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
13,
23,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
10,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
9,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
16,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
26,
27
],
[
16,
28
],
[
28,
29
],
[
28,
30
],
[
16,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
43,
46
],
[
16,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
47,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
54,
56
],
[
47,
57
],
[
57,
58
],
[
58,
59
],
[
47,
60
],
[
61,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
67,
68
],
[
68,
69
],
[
61,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
73,
74
],
[
73,
75
],
[
70,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
80,
81
],
[
80,
82
],
[
76,
83
],
[
16,
84
],
[
84,
85
],
[
84,
86
],
[
84,
87
],
[
88,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
89,
94
],
[
6,
95
],
[
95,
96
]
] |
[
"import java.util.*;\n \nclass Main{\n public static void main(String[] args) {\n \n try(Scanner sc = new Scanner(System.in)){\n int n = Integer.parseInt(sc.next());\n\n ArrayList<Integer> list = new ArrayList<>(n);\n\n for(int j = 0; j < n; j++)list.add(0);\n\n for(int i = 0; i < n - 1; i++){\n int joshi = Integer.parseInt(sc.next());\n list.set(joshi - 1, list.get(joshi - 1) + 1);\n }\n\n for(int k: list){\n System.out.println(k);\n }\n\n }catch(Exception e){\n e.printStackTrace();\n } \n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String[] args) {\n \n try(Scanner sc = new Scanner(System.in)){\n int n = Integer.parseInt(sc.next());\n\n ArrayList<Integer> list = new ArrayList<>(n);\n\n for(int j = 0; j < n; j++)list.add(0);\n\n for(int i = 0; i < n - 1; i++){\n int joshi = Integer.parseInt(sc.next());\n list.set(joshi - 1, list.get(joshi - 1) + 1);\n }\n\n for(int k: list){\n System.out.println(k);\n }\n\n }catch(Exception e){\n e.printStackTrace();\n } \n }\n}",
"Main",
"public static void main(String[] args) {\n \n try(Scanner sc = new Scanner(System.in)){\n int n = Integer.parseInt(sc.next());\n\n ArrayList<Integer> list = new ArrayList<>(n);\n\n for(int j = 0; j < n; j++)list.add(0);\n\n for(int i = 0; i < n - 1; i++){\n int joshi = Integer.parseInt(sc.next());\n list.set(joshi - 1, list.get(joshi - 1) + 1);\n }\n\n for(int k: list){\n System.out.println(k);\n }\n\n }catch(Exception e){\n e.printStackTrace();\n } \n }",
"main",
"{\n \n try(Scanner sc = new Scanner(System.in)){\n int n = Integer.parseInt(sc.next());\n\n ArrayList<Integer> list = new ArrayList<>(n);\n\n for(int j = 0; j < n; j++)list.add(0);\n\n for(int i = 0; i < n - 1; i++){\n int joshi = Integer.parseInt(sc.next());\n list.set(joshi - 1, list.get(joshi - 1) + 1);\n }\n\n for(int k: list){\n System.out.println(k);\n }\n\n }catch(Exception e){\n e.printStackTrace();\n } \n }",
"try(Scanner sc = new Scanner(System.in)){\n int n = Integer.parseInt(sc.next());\n\n ArrayList<Integer> list = new ArrayList<>(n);\n\n for(int j = 0; j < n; j++)list.add(0);\n\n for(int i = 0; i < n - 1; i++){\n int joshi = Integer.parseInt(sc.next());\n list.set(joshi - 1, list.get(joshi - 1) + 1);\n }\n\n for(int k: list){\n System.out.println(k);\n }\n\n }catch(Exception e){\n e.printStackTrace();\n }",
"catch(Exception e){\n e.printStackTrace();\n }",
"Exception e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n int n = Integer.parseInt(sc.next());\n\n ArrayList<Integer> list = new ArrayList<>(n);\n\n for(int j = 0; j < n; j++)list.add(0);\n\n for(int i = 0; i < n - 1; i++){\n int joshi = Integer.parseInt(sc.next());\n list.set(joshi - 1, list.get(joshi - 1) + 1);\n }\n\n for(int k: list){\n System.out.println(k);\n }\n\n }",
"Scanner sc = new Scanner(System.in)",
"Scanner sc = new Scanner(System.in)",
"new Scanner(System.in)",
"int n = Integer.parseInt(sc.next());",
"n",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"ArrayList<Integer> list = new ArrayList<>(n);",
"list",
"new ArrayList<>(n)",
"for(int j = 0; j < n; j++)list.add(0);",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < n",
"j",
"n",
"j++",
"j++",
"j",
"list.add(0);",
"list.add(0)",
"list.add",
"list",
"0",
"for(int i = 0; i < n - 1; i++){\n int joshi = Integer.parseInt(sc.next());\n list.set(joshi - 1, list.get(joshi - 1) + 1);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"i++",
"i++",
"i",
"{\n int joshi = Integer.parseInt(sc.next());\n list.set(joshi - 1, list.get(joshi - 1) + 1);\n }",
"{\n int joshi = Integer.parseInt(sc.next());\n list.set(joshi - 1, list.get(joshi - 1) + 1);\n }",
"int joshi = Integer.parseInt(sc.next());",
"joshi",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"list.set(joshi - 1, list.get(joshi - 1) + 1)",
"list.set",
"list",
"joshi - 1",
"joshi",
"1",
"list.get(joshi - 1) + 1",
"list.get(joshi - 1)",
"list.get",
"list",
"joshi - 1",
"joshi",
"1",
"1",
"for(int k: list){\n System.out.println(k);\n }",
"int k",
"list",
"{\n System.out.println(k);\n }",
"{\n System.out.println(k);\n }",
"System.out.println(k)",
"System.out.println",
"System.out",
"System",
"System.out",
"k",
"String[] args",
"args"
] |
import java.util.*;
class Main{
public static void main(String[] args) {
try(Scanner sc = new Scanner(System.in)){
int n = Integer.parseInt(sc.next());
ArrayList<Integer> list = new ArrayList<>(n);
for(int j = 0; j < n; j++)list.add(0);
for(int i = 0; i < n - 1; i++){
int joshi = Integer.parseInt(sc.next());
list.set(joshi - 1, list.get(joshi - 1) + 1);
}
for(int k: list){
System.out.println(k);
}
}catch(Exception e){
e.printStackTrace();
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
12,
13,
30,
41,
13,
20,
0,
13,
19,
18,
13,
4,
18,
13,
23,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
0,
18,
13,
17,
0,
18,
13,
17,
17,
41,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
40,
18,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
17,
12,
13,
30,
0,
13,
20,
17,
0,
13,
17,
0,
13,
20,
12,
13,
30,
38,
30,
4,
13,
30,
4,
18,
33,
12,
13,
30,
14,
2,
13,
17,
4,
18,
13,
12,
13,
30,
14,
2,
13,
18,
13,
13,
29,
18,
13,
40,
13,
41,
13,
4,
18,
13,
42,
2,
13,
17,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
13,
17,
0,
13,
17,
29,
18,
13,
40,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
258,
20
],
[
258,
21
],
[
21,
22
],
[
258,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
25,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
25,
34
],
[
34,
35
],
[
35,
36
],
[
23,
37
],
[
37,
38
],
[
258,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
42,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
49,
55
],
[
55,
56
],
[
55,
57
],
[
58,
59
],
[
58,
60
],
[
49,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
49,
70
],
[
70,
71
],
[
70,
72
],
[
73,
74
],
[
73,
75
],
[
49,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
76,
86
],
[
86,
87
],
[
87,
88
],
[
76,
89
],
[
90,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
95,
96
],
[
96,
97
],
[
49,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
98,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
105,
107
],
[
98,
108
],
[
108,
109
],
[
109,
110
],
[
98,
111
],
[
112,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
49,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
128
],
[
119,
129
],
[
129,
130
],
[
130,
131
],
[
119,
132
],
[
133,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
134,
139
],
[
139,
140
],
[
139,
141
],
[
258,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
142,
146
],
[
146,
147
],
[
142,
148
],
[
148,
149
],
[
142,
150
],
[
150,
151
],
[
150,
152
],
[
142,
153
],
[
153,
154
],
[
153,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
160
],
[
160,
161
],
[
160,
162
],
[
155,
163
],
[
163,
164
],
[
163,
165
],
[
142,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
169,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
142,
177
],
[
177,
178
],
[
177,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
180,
184
],
[
184,
185
],
[
185,
186
],
[
142,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
193,
194
],
[
193,
195
],
[
190,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
199,
200
],
[
189,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
204,
205
],
[
189,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
213,
214
],
[
189,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
218,
219
],
[
217,
220
],
[
217,
221
],
[
189,
222
],
[
222,
223
],
[
222,
224
],
[
189,
225
],
[
225,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
142,
230
],
[
230,
231
],
[
230,
232
],
[
232,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
234,
237
],
[
237,
238
],
[
142,
239
],
[
239,
240
],
[
239,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
244,
245
],
[
243,
246
],
[
246,
247
],
[
142,
248
],
[
248,
249
],
[
248,
250
],
[
250,
251
],
[
251,
252
],
[
252,
253
],
[
253,
254
],
[
252,
255
],
[
255,
256
],
[
0,
257
],
[
257,
258
],
[
257,
259
]
] |
[
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\npublic class Main {\n\n private static Scanner sc;\n\n public static void main(String[] args) {\n Main instance = new Main();\n sc = instance.new Scanner();\n instance.solve();\n }\n\n private void solve() {\n try {\n int N = sc.nextInt();\n int[] A = new int[N+1];\n\n A[0] = A[1] = 0;\n\n int[] buka = new int[N+1];\n\n for(int i=2; i<N+1; i++) {\n A[i] = sc.nextInt();\n }\n\n for(int i=2; i<N+1; i++) {\n buka[A[i]]++;\n }\n\n for(int i=1; i<N+1; i++) {\n System.out.println(buka[i]);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n private class Scanner {\n String[] s;\n int i;\n BufferedReader br;\n String regex = \" \";\n\n public Scanner() {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n @Override\n protected void finalize() throws Throwable {\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }\n\n private void destruction() throws IOException {\n if (br != null) br.close();\n }\n\n public String next() throws IOException {\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }\n\n public int nextInt() throws NumberFormatException, IOException {\n return Integer.parseInt(next());\n }\n\n public Long nextLong() throws NumberFormatException, IOException {\n return Long.parseLong(next());\n }\n\n public Double nextDouble() throws NumberFormatException, IOException {\n return Double.parseDouble(next());\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.List;",
"List",
"java.util",
"public class Main {\n\n private static Scanner sc;\n\n public static void main(String[] args) {\n Main instance = new Main();\n sc = instance.new Scanner();\n instance.solve();\n }\n\n private void solve() {\n try {\n int N = sc.nextInt();\n int[] A = new int[N+1];\n\n A[0] = A[1] = 0;\n\n int[] buka = new int[N+1];\n\n for(int i=2; i<N+1; i++) {\n A[i] = sc.nextInt();\n }\n\n for(int i=2; i<N+1; i++) {\n buka[A[i]]++;\n }\n\n for(int i=1; i<N+1; i++) {\n System.out.println(buka[i]);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n private class Scanner {\n String[] s;\n int i;\n BufferedReader br;\n String regex = \" \";\n\n public Scanner() {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n @Override\n protected void finalize() throws Throwable {\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }\n\n private void destruction() throws IOException {\n if (br != null) br.close();\n }\n\n public String next() throws IOException {\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }\n\n public int nextInt() throws NumberFormatException, IOException {\n return Integer.parseInt(next());\n }\n\n public Long nextLong() throws NumberFormatException, IOException {\n return Long.parseLong(next());\n }\n\n public Double nextDouble() throws NumberFormatException, IOException {\n return Double.parseDouble(next());\n }\n }\n}",
"Main",
"private static Scanner sc;",
"sc",
"public static void main(String[] args) {\n Main instance = new Main();\n sc = instance.new Scanner();\n instance.solve();\n }",
"main",
"{\n Main instance = new Main();\n sc = instance.new Scanner();\n instance.solve();\n }",
"Main instance = new Main();",
"instance",
"new Main()",
"sc = instance.new Scanner()",
"sc",
"instance.new Scanner()",
"instance",
"instance",
"instance.solve()",
"instance.solve",
"instance",
"String[] args",
"args",
"private void solve() {\n try {\n int N = sc.nextInt();\n int[] A = new int[N+1];\n\n A[0] = A[1] = 0;\n\n int[] buka = new int[N+1];\n\n for(int i=2; i<N+1; i++) {\n A[i] = sc.nextInt();\n }\n\n for(int i=2; i<N+1; i++) {\n buka[A[i]]++;\n }\n\n for(int i=1; i<N+1; i++) {\n System.out.println(buka[i]);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"solve",
"{\n try {\n int N = sc.nextInt();\n int[] A = new int[N+1];\n\n A[0] = A[1] = 0;\n\n int[] buka = new int[N+1];\n\n for(int i=2; i<N+1; i++) {\n A[i] = sc.nextInt();\n }\n\n for(int i=2; i<N+1; i++) {\n buka[A[i]]++;\n }\n\n for(int i=1; i<N+1; i++) {\n System.out.println(buka[i]);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"try {\n int N = sc.nextInt();\n int[] A = new int[N+1];\n\n A[0] = A[1] = 0;\n\n int[] buka = new int[N+1];\n\n for(int i=2; i<N+1; i++) {\n A[i] = sc.nextInt();\n }\n\n for(int i=2; i<N+1; i++) {\n buka[A[i]]++;\n }\n\n for(int i=1; i<N+1; i++) {\n System.out.println(buka[i]);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }",
"catch (Exception e) {\n e.printStackTrace();\n }",
"Exception e",
"{\n e.printStackTrace();\n }",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n int N = sc.nextInt();\n int[] A = new int[N+1];\n\n A[0] = A[1] = 0;\n\n int[] buka = new int[N+1];\n\n for(int i=2; i<N+1; i++) {\n A[i] = sc.nextInt();\n }\n\n for(int i=2; i<N+1; i++) {\n buka[A[i]]++;\n }\n\n for(int i=1; i<N+1; i++) {\n System.out.println(buka[i]);\n }\n\n }",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = new int[N+1];",
"A",
"new int[N+1]",
"N+1",
"N",
"1",
"A[0] = A[1] = 0",
"A[0]",
"A",
"0",
"A[1] = 0",
"A[1]",
"A",
"1",
"0",
"int[] buka = new int[N+1];",
"buka",
"new int[N+1]",
"N+1",
"N",
"1",
"for(int i=2; i<N+1; i++) {\n A[i] = sc.nextInt();\n }",
"int i=2;",
"int i=2;",
"i",
"2",
"i<N+1",
"i",
"N+1",
"N",
"1",
"i++",
"i++",
"i",
"{\n A[i] = sc.nextInt();\n }",
"{\n A[i] = sc.nextInt();\n }",
"A[i] = sc.nextInt()",
"A[i]",
"A",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i=2; i<N+1; i++) {\n buka[A[i]]++;\n }",
"int i=2;",
"int i=2;",
"i",
"2",
"i<N+1",
"i",
"N+1",
"N",
"1",
"i++",
"i++",
"i",
"{\n buka[A[i]]++;\n }",
"{\n buka[A[i]]++;\n }",
"buka[A[i]]++",
"buka[A[i]]",
"buka",
"A[i]",
"A",
"i",
"for(int i=1; i<N+1; i++) {\n System.out.println(buka[i]);\n }",
"int i=1;",
"int i=1;",
"i",
"1",
"i<N+1",
"i",
"N+1",
"N",
"1",
"i++",
"i++",
"i",
"{\n System.out.println(buka[i]);\n }",
"{\n System.out.println(buka[i]);\n }",
"System.out.println(buka[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"buka[i]",
"buka",
"i",
"private class Scanner {\n String[] s;\n int i;\n BufferedReader br;\n String regex = \" \";\n\n public Scanner() {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n @Override\n protected void finalize() throws Throwable {\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }\n\n private void destruction() throws IOException {\n if (br != null) br.close();\n }\n\n public String next() throws IOException {\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }\n\n public int nextInt() throws NumberFormatException, IOException {\n return Integer.parseInt(next());\n }\n\n public Long nextLong() throws NumberFormatException, IOException {\n return Long.parseLong(next());\n }\n\n public Double nextDouble() throws NumberFormatException, IOException {\n return Double.parseDouble(next());\n }\n }",
"Scanner",
"String[] s;",
"s",
"int i;",
"i",
"BufferedReader br;",
"br",
"String regex = \" \";",
"regex",
"\" \"",
"public Scanner() {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"Scanner",
"{\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }",
"s = new String[0]",
"s",
"new String[0]",
"0",
"i = 0",
"i",
"0",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"@Override\n protected void finalize() throws Throwable {\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }",
"finalize",
"{\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }",
"try {\n super.finalize();\n } finally {\n destruction();\n }",
"{\n destruction();\n }",
"destruction()",
"destruction",
"{\n super.finalize();\n }",
"super.finalize()",
"super.finalize",
"super",
"private void destruction() throws IOException {\n if (br != null) br.close();\n }",
"destruction",
"{\n if (br != null) br.close();\n }",
"if (br != null) br.close();",
"br != null",
"br",
"null",
"br.close()",
"br.close",
"br",
"public String next() throws IOException {\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }",
"next",
"{\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }",
"if (i < s.length) return s[i++];",
"i < s.length",
"i",
"s.length",
"s",
"s.length",
"return s[i++];",
"s[i++]",
"s",
"i++",
"i",
"String st = br.readLine();",
"st",
"br.readLine()",
"br.readLine",
"br",
"while (st == \"\") st = br.readLine();",
"st == \"\"",
"st",
"\"\"",
"st = br.readLine()",
"st",
"br.readLine()",
"br.readLine",
"br",
"s = st.split(regex, 0)",
"s",
"st.split(regex, 0)",
"st.split",
"st",
"regex",
"0",
"i = 0",
"i",
"0",
"return s[i++];",
"s[i++]",
"s",
"i++",
"i",
"public int nextInt() throws NumberFormatException, IOException {\n return Integer.parseInt(next());\n }",
"nextInt",
"{\n return Integer.parseInt(next());\n }",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public Long nextLong() throws NumberFormatException, IOException {\n return Long.parseLong(next());\n }",
"nextLong",
"{\n return Long.parseLong(next());\n }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public Double nextDouble() throws NumberFormatException, IOException {\n return Double.parseDouble(next());\n }",
"nextDouble",
"{\n return Double.parseDouble(next());\n }",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public class Main {\n\n private static Scanner sc;\n\n public static void main(String[] args) {\n Main instance = new Main();\n sc = instance.new Scanner();\n instance.solve();\n }\n\n private void solve() {\n try {\n int N = sc.nextInt();\n int[] A = new int[N+1];\n\n A[0] = A[1] = 0;\n\n int[] buka = new int[N+1];\n\n for(int i=2; i<N+1; i++) {\n A[i] = sc.nextInt();\n }\n\n for(int i=2; i<N+1; i++) {\n buka[A[i]]++;\n }\n\n for(int i=1; i<N+1; i++) {\n System.out.println(buka[i]);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n private class Scanner {\n String[] s;\n int i;\n BufferedReader br;\n String regex = \" \";\n\n public Scanner() {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n @Override\n protected void finalize() throws Throwable {\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }\n\n private void destruction() throws IOException {\n if (br != null) br.close();\n }\n\n public String next() throws IOException {\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }\n\n public int nextInt() throws NumberFormatException, IOException {\n return Integer.parseInt(next());\n }\n\n public Long nextLong() throws NumberFormatException, IOException {\n return Long.parseLong(next());\n }\n\n public Double nextDouble() throws NumberFormatException, IOException {\n return Double.parseDouble(next());\n }\n }\n}",
"public class Main {\n\n private static Scanner sc;\n\n public static void main(String[] args) {\n Main instance = new Main();\n sc = instance.new Scanner();\n instance.solve();\n }\n\n private void solve() {\n try {\n int N = sc.nextInt();\n int[] A = new int[N+1];\n\n A[0] = A[1] = 0;\n\n int[] buka = new int[N+1];\n\n for(int i=2; i<N+1; i++) {\n A[i] = sc.nextInt();\n }\n\n for(int i=2; i<N+1; i++) {\n buka[A[i]]++;\n }\n\n for(int i=1; i<N+1; i++) {\n System.out.println(buka[i]);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n private class Scanner {\n String[] s;\n int i;\n BufferedReader br;\n String regex = \" \";\n\n public Scanner() {\n s = new String[0];\n i = 0;\n br = new BufferedReader(new InputStreamReader(System.in));\n }\n\n @Override\n protected void finalize() throws Throwable {\n try {\n super.finalize();\n } finally {\n destruction();\n }\n }\n\n private void destruction() throws IOException {\n if (br != null) br.close();\n }\n\n public String next() throws IOException {\n if (i < s.length) return s[i++];\n String st = br.readLine();\n while (st == \"\") st = br.readLine();\n s = st.split(regex, 0);\n i = 0;\n return s[i++];\n }\n\n public int nextInt() throws NumberFormatException, IOException {\n return Integer.parseInt(next());\n }\n\n public Long nextLong() throws NumberFormatException, IOException {\n return Long.parseLong(next());\n }\n\n public Double nextDouble() throws NumberFormatException, IOException {\n return Double.parseDouble(next());\n }\n }\n}",
"Main"
] |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Main {
private static Scanner sc;
public static void main(String[] args) {
Main instance = new Main();
sc = instance.new Scanner();
instance.solve();
}
private void solve() {
try {
int N = sc.nextInt();
int[] A = new int[N+1];
A[0] = A[1] = 0;
int[] buka = new int[N+1];
for(int i=2; i<N+1; i++) {
A[i] = sc.nextInt();
}
for(int i=2; i<N+1; i++) {
buka[A[i]]++;
}
for(int i=1; i<N+1; i++) {
System.out.println(buka[i]);
}
} catch (Exception e) {
e.printStackTrace();
}
}
private class Scanner {
String[] s;
int i;
BufferedReader br;
String regex = " ";
public Scanner() {
s = new String[0];
i = 0;
br = new BufferedReader(new InputStreamReader(System.in));
}
@Override
protected void finalize() throws Throwable {
try {
super.finalize();
} finally {
destruction();
}
}
private void destruction() throws IOException {
if (br != null) br.close();
}
public String next() throws IOException {
if (i < s.length) return s[i++];
String st = br.readLine();
while (st == "") st = br.readLine();
s = st.split(regex, 0);
i = 0;
return s[i++];
}
public int nextInt() throws NumberFormatException, IOException {
return Integer.parseInt(next());
}
public Long nextLong() throws NumberFormatException, IOException {
return Long.parseLong(next());
}
public Double nextDouble() throws NumberFormatException, IOException {
return Double.parseDouble(next());
}
}
}
|
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
40,
18,
13,
2,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
102,
5
],
[
102,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
27,
38
],
[
39,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
8,
45
],
[
45,
46
],
[
45,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
48,
58
],
[
58,
59
],
[
59,
60
],
[
48,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
67,
68
],
[
68,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
8,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
83,
84
],
[
83,
85
],
[
78,
86
],
[
86,
87
],
[
87,
88
],
[
78,
89
],
[
90,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
6,
99
],
[
99,
100
],
[
0,
101
],
[
101,
102
],
[
101,
103
]
] |
[
"import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] arg) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] a = new int[n-1];\n\t\tint[] count = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tcount[i] = 0;\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < n-1; i++){\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount[a[i]-1]++;\n\t\t}\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tSystem.out.println(count[i]);\n\t\t}\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] arg) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] a = new int[n-1];\n\t\tint[] count = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tcount[i] = 0;\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < n-1; i++){\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount[a[i]-1]++;\n\t\t}\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tSystem.out.println(count[i]);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] arg) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] a = new int[n-1];\n\t\tint[] count = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tcount[i] = 0;\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < n-1; i++){\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount[a[i]-1]++;\n\t\t}\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tSystem.out.println(count[i]);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] a = new int[n-1];\n\t\tint[] count = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tcount[i] = 0;\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < n-1; i++){\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount[a[i]-1]++;\n\t\t}\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tSystem.out.println(count[i]);\n\t\t}\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] a = new int[n-1];",
"a",
"new int[n-1]",
"n-1",
"n",
"1",
"int[] count = new int[n];",
"count",
"new int[n]",
"n",
"for(int i = 0; i < n; i++){\n\t\t\tcount[i] = 0;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tcount[i] = 0;\n\t\t}",
"{\n\t\t\tcount[i] = 0;\n\t\t}",
"count[i] = 0",
"count[i]",
"count",
"i",
"0",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < n-1; i++){\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount[a[i]-1]++;\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"{\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount[a[i]-1]++;\n\t\t}",
"{\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount[a[i]-1]++;\n\t\t}",
"a[i] = scan.nextInt()",
"a[i]",
"a",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"count[a[i]-1]++",
"count[a[i]-1]",
"count",
"a[i]-1",
"a[i]",
"a",
"i",
"1",
"for(int i = 0; i < n; i++){\n\t\t\tSystem.out.println(count[i]);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tSystem.out.println(count[i]);\n\t\t}",
"{\n\t\t\tSystem.out.println(count[i]);\n\t\t}",
"System.out.println(count[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"count[i]",
"count",
"i",
"String[] arg",
"arg",
"public class Main {\n\tpublic static void main(String[] arg) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] a = new int[n-1];\n\t\tint[] count = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tcount[i] = 0;\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < n-1; i++){\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount[a[i]-1]++;\n\t\t}\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tSystem.out.println(count[i]);\n\t\t}\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] arg) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint[] a = new int[n-1];\n\t\tint[] count = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tcount[i] = 0;\n\t\t}\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < n-1; i++){\n\t\t\ta[i] = scan.nextInt();\n\t\t\tcount[a[i]-1]++;\n\t\t}\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tSystem.out.println(count[i]);\n\t\t}\n\t}\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] arg) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int[] a = new int[n-1];
int[] count = new int[n];
for(int i = 0; i < n; i++){
count[i] = 0;
}
int sum = 0;
for(int i = 0; i < n-1; i++){
a[i] = scan.nextInt();
count[a[i]-1]++;
}
for(int i = 0; i < n; i++){
System.out.println(count[i]);
}
}
}
|
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
41,
13,
2,
13,
17,
2,
13,
17,
1,
40,
13,
30,
30,
40,
18,
13,
2,
18,
13,
13,
17,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
86,
5
],
[
86,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
20,
21
],
[
20,
22
],
[
8,
23
],
[
23,
24
],
[
23,
25
],
[
8,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
29,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
27,
37
],
[
37,
38
],
[
38,
39
],
[
27,
40
],
[
41,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
42,
46
],
[
46,
47
],
[
47,
48
],
[
8,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
53,
55
],
[
49,
56
],
[
56,
57
],
[
56,
58
],
[
49,
59
],
[
59,
60
],
[
60,
61
],
[
49,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
8,
72
],
[
72,
73
],
[
72,
74
],
[
72,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
6,
83
],
[
83,
84
],
[
0,
85
],
[
85,
86
],
[
85,
87
]
] |
[
"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[] joshi = new int[N-1];\n\t\tint[] buka_cnt = new int[N] ;\n\t\tfor(int i = 0;i<N-1;i++) {\n\t\t\tjoshi[i] = sc.nextInt();\n\t\t}\n\t\tfor(int i = N-2;i>=0;i--) {\n\t\t\tbuka_cnt[joshi[i]-1]++;\n\t\t}\n\t\tfor(int j :buka_cnt) {\n\t\t\tSystem.out.println(j);\n\t\t}\n\t}\n\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint[] joshi = new int[N-1];\n\t\tint[] buka_cnt = new int[N] ;\n\t\tfor(int i = 0;i<N-1;i++) {\n\t\t\tjoshi[i] = sc.nextInt();\n\t\t}\n\t\tfor(int i = N-2;i>=0;i--) {\n\t\t\tbuka_cnt[joshi[i]-1]++;\n\t\t}\n\t\tfor(int j :buka_cnt) {\n\t\t\tSystem.out.println(j);\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint[] joshi = new int[N-1];\n\t\tint[] buka_cnt = new int[N] ;\n\t\tfor(int i = 0;i<N-1;i++) {\n\t\t\tjoshi[i] = sc.nextInt();\n\t\t}\n\t\tfor(int i = N-2;i>=0;i--) {\n\t\t\tbuka_cnt[joshi[i]-1]++;\n\t\t}\n\t\tfor(int j :buka_cnt) {\n\t\t\tSystem.out.println(j);\n\t\t}\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint[] joshi = new int[N-1];\n\t\tint[] buka_cnt = new int[N] ;\n\t\tfor(int i = 0;i<N-1;i++) {\n\t\t\tjoshi[i] = sc.nextInt();\n\t\t}\n\t\tfor(int i = N-2;i>=0;i--) {\n\t\t\tbuka_cnt[joshi[i]-1]++;\n\t\t}\n\t\tfor(int j :buka_cnt) {\n\t\t\tSystem.out.println(j);\n\t\t}\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] joshi = new int[N-1];",
"joshi",
"new int[N-1]",
"N-1",
"N",
"1",
"int[] buka_cnt = new int[N] ;",
"buka_cnt",
"new int[N]",
"N",
"for(int i = 0;i<N-1;i++) {\n\t\t\tjoshi[i] = sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<N-1",
"i",
"N-1",
"N",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tjoshi[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tjoshi[i] = sc.nextInt();\n\t\t}",
"joshi[i] = sc.nextInt()",
"joshi[i]",
"joshi",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i = N-2;i>=0;i--) {\n\t\t\tbuka_cnt[joshi[i]-1]++;\n\t\t}",
"int i = N-2;",
"int i = N-2;",
"i",
"N-2",
"N",
"2",
"i>=0",
"i",
"0",
"i--",
"i--",
"i",
"{\n\t\t\tbuka_cnt[joshi[i]-1]++;\n\t\t}",
"{\n\t\t\tbuka_cnt[joshi[i]-1]++;\n\t\t}",
"buka_cnt[joshi[i]-1]++",
"buka_cnt[joshi[i]-1]",
"buka_cnt",
"joshi[i]-1",
"joshi[i]",
"joshi",
"i",
"1",
"for(int j :buka_cnt) {\n\t\t\tSystem.out.println(j);\n\t\t}",
"int j",
"buka_cnt",
"{\n\t\t\tSystem.out.println(j);\n\t\t}",
"{\n\t\t\tSystem.out.println(j);\n\t\t}",
"System.out.println(j)",
"System.out.println",
"System.out",
"System",
"System.out",
"j",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint[] joshi = new int[N-1];\n\t\tint[] buka_cnt = new int[N] ;\n\t\tfor(int i = 0;i<N-1;i++) {\n\t\t\tjoshi[i] = sc.nextInt();\n\t\t}\n\t\tfor(int i = N-2;i>=0;i--) {\n\t\t\tbuka_cnt[joshi[i]-1]++;\n\t\t}\n\t\tfor(int j :buka_cnt) {\n\t\t\tSystem.out.println(j);\n\t\t}\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint[] joshi = new int[N-1];\n\t\tint[] buka_cnt = new int[N] ;\n\t\tfor(int i = 0;i<N-1;i++) {\n\t\t\tjoshi[i] = sc.nextInt();\n\t\t}\n\t\tfor(int i = N-2;i>=0;i--) {\n\t\t\tbuka_cnt[joshi[i]-1]++;\n\t\t}\n\t\tfor(int j :buka_cnt) {\n\t\t\tSystem.out.println(j);\n\t\t}\n\t}\n\n}",
"Main"
] |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] joshi = new int[N-1];
int[] buka_cnt = new int[N] ;
for(int i = 0;i<N-1;i++) {
joshi[i] = sc.nextInt();
}
for(int i = N-2;i>=0;i--) {
buka_cnt[joshi[i]-1]++;
}
for(int j :buka_cnt) {
System.out.println(j);
}
}
}
|
[
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,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
41,
13,
20,
13,
28,
13,
13,
30,
30,
0,
18,
13,
2,
13,
17,
2,
18,
13,
2,
13,
17,
17,
28,
13,
13,
30,
30,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
97,
5
],
[
97,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
24,
29
],
[
8,
30
],
[
30,
31
],
[
30,
32
],
[
33,
34
],
[
33,
35
],
[
8,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
36,
46
],
[
46,
47
],
[
47,
48
],
[
36,
49
],
[
50,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
58,
59
],
[
58,
60
],
[
8,
61
],
[
61,
62
],
[
61,
63
],
[
8,
65
],
[
65,
66
],
[
65,
67
],
[
65,
68
],
[
69,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
70,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
76,
82
],
[
8,
83
],
[
83,
84
],
[
83,
85
],
[
83,
86
],
[
87,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
6,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
]
] |
[
"//package beg_163;\n\nimport java.util.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tString cryvgtubhi = s.nextLine();\n\t\t\n\t\tString[] l = s.nextLine().split(\" \");\n\t\tint[] list = new int[l.length];\n\t\t\n\t\tfor (int i=0;i<l.length;i++) {\n\t\t\tlist[i]=Integer.parseInt(l[i]);\n\t\t}\n\t\tint[] count = new int[a];\n\t\t\n\t\tfor (int i: list) {\n\t\t\tcount[i-1]=count[i-1]+1;\n\t\t}\n\t\t\n\t\tfor (int i: count) {\n\t\t\tSystem.out.println(i);\n\t\t}\n\t\t\n\t}\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tString cryvgtubhi = s.nextLine();\n\t\t\n\t\tString[] l = s.nextLine().split(\" \");\n\t\tint[] list = new int[l.length];\n\t\t\n\t\tfor (int i=0;i<l.length;i++) {\n\t\t\tlist[i]=Integer.parseInt(l[i]);\n\t\t}\n\t\tint[] count = new int[a];\n\t\t\n\t\tfor (int i: list) {\n\t\t\tcount[i-1]=count[i-1]+1;\n\t\t}\n\t\t\n\t\tfor (int i: count) {\n\t\t\tSystem.out.println(i);\n\t\t}\n\t\t\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tString cryvgtubhi = s.nextLine();\n\t\t\n\t\tString[] l = s.nextLine().split(\" \");\n\t\tint[] list = new int[l.length];\n\t\t\n\t\tfor (int i=0;i<l.length;i++) {\n\t\t\tlist[i]=Integer.parseInt(l[i]);\n\t\t}\n\t\tint[] count = new int[a];\n\t\t\n\t\tfor (int i: list) {\n\t\t\tcount[i-1]=count[i-1]+1;\n\t\t}\n\t\t\n\t\tfor (int i: count) {\n\t\t\tSystem.out.println(i);\n\t\t}\n\t\t\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tString cryvgtubhi = s.nextLine();\n\t\t\n\t\tString[] l = s.nextLine().split(\" \");\n\t\tint[] list = new int[l.length];\n\t\t\n\t\tfor (int i=0;i<l.length;i++) {\n\t\t\tlist[i]=Integer.parseInt(l[i]);\n\t\t}\n\t\tint[] count = new int[a];\n\t\t\n\t\tfor (int i: list) {\n\t\t\tcount[i-1]=count[i-1]+1;\n\t\t}\n\t\t\n\t\tfor (int i: count) {\n\t\t\tSystem.out.println(i);\n\t\t}\n\t\t\n\t}",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int a = s.nextInt();",
"a",
"s.nextInt()",
"s.nextInt",
"s",
"String cryvgtubhi = s.nextLine();",
"cryvgtubhi",
"s.nextLine()",
"s.nextLine",
"s",
"String[] l = s.nextLine().split(\" \");",
"l",
"s.nextLine().split(\" \")",
"s.nextLine().split",
"s.nextLine()",
"s.nextLine",
"s",
"\" \"",
"int[] list = new int[l.length];",
"list",
"new int[l.length]",
"l.length",
"l",
"l.length",
"for (int i=0;i<l.length;i++) {\n\t\t\tlist[i]=Integer.parseInt(l[i]);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<l.length",
"i",
"l.length",
"l",
"l.length",
"i++",
"i++",
"i",
"{\n\t\t\tlist[i]=Integer.parseInt(l[i]);\n\t\t}",
"{\n\t\t\tlist[i]=Integer.parseInt(l[i]);\n\t\t}",
"list[i]=Integer.parseInt(l[i])",
"list[i]",
"list",
"i",
"Integer.parseInt(l[i])",
"Integer.parseInt",
"Integer",
"l[i]",
"l",
"i",
"int[] count = new int[a];",
"count",
"new int[a]",
"a",
"for (int i: list) {\n\t\t\tcount[i-1]=count[i-1]+1;\n\t\t}",
"int i",
"list",
"{\n\t\t\tcount[i-1]=count[i-1]+1;\n\t\t}",
"{\n\t\t\tcount[i-1]=count[i-1]+1;\n\t\t}",
"count[i-1]=count[i-1]+1",
"count[i-1]",
"count",
"i-1",
"i",
"1",
"count[i-1]+1",
"count[i-1]",
"count",
"i-1",
"i",
"1",
"1",
"for (int i: count) {\n\t\t\tSystem.out.println(i);\n\t\t}",
"int i",
"count",
"{\n\t\t\tSystem.out.println(i);\n\t\t}",
"{\n\t\t\tSystem.out.println(i);\n\t\t}",
"System.out.println(i)",
"System.out.println",
"System.out",
"System",
"System.out",
"i",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tString cryvgtubhi = s.nextLine();\n\t\t\n\t\tString[] l = s.nextLine().split(\" \");\n\t\tint[] list = new int[l.length];\n\t\t\n\t\tfor (int i=0;i<l.length;i++) {\n\t\t\tlist[i]=Integer.parseInt(l[i]);\n\t\t}\n\t\tint[] count = new int[a];\n\t\t\n\t\tfor (int i: list) {\n\t\t\tcount[i-1]=count[i-1]+1;\n\t\t}\n\t\t\n\t\tfor (int i: count) {\n\t\t\tSystem.out.println(i);\n\t\t}\n\t\t\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\tString cryvgtubhi = s.nextLine();\n\t\t\n\t\tString[] l = s.nextLine().split(\" \");\n\t\tint[] list = new int[l.length];\n\t\t\n\t\tfor (int i=0;i<l.length;i++) {\n\t\t\tlist[i]=Integer.parseInt(l[i]);\n\t\t}\n\t\tint[] count = new int[a];\n\t\t\n\t\tfor (int i: list) {\n\t\t\tcount[i-1]=count[i-1]+1;\n\t\t}\n\t\t\n\t\tfor (int i: count) {\n\t\t\tSystem.out.println(i);\n\t\t}\n\t\t\n\t}\n\n}",
"Main"
] |
//package beg_163;
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s = new Scanner(System.in);
int a = s.nextInt();
String cryvgtubhi = s.nextLine();
String[] l = s.nextLine().split(" ");
int[] list = new int[l.length];
for (int i=0;i<l.length;i++) {
list[i]=Integer.parseInt(l[i]);
}
int[] count = new int[a];
for (int i: list) {
count[i-1]=count[i-1]+1;
}
for (int i: count) {
System.out.println(i);
}
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
40,
18,
13,
2,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
99,
5
],
[
99,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
23,
24
],
[
23,
25
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
33,
35
],
[
26,
36
],
[
36,
37
],
[
37,
38
],
[
26,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
8,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
61,
63
],
[
54,
64
],
[
64,
65
],
[
65,
66
],
[
54,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
8,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
81,
82
],
[
81,
83
],
[
76,
84
],
[
84,
85
],
[
85,
86
],
[
76,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
93,
94
],
[
93,
95
],
[
6,
96
],
[
96,
97
],
[
0,
98
],
[
98,
99
],
[
98,
100
]
] |
[
"import java.util.*;\n\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = Integer.parseInt(sc.next());\n\n int[] a = new int[n - 1];\n for(int i = 0; i < n - 1; i++)\n a[i] = Integer.parseInt(sc.next());\n\n \n int[] ans = new int[n];\n for(int i = 0; i < n - 1; i++)\n ans[a[i] - 1]++;\n\n \n\n for(int i = 0; i < n; i++)\n System.out.println(ans[i]);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = Integer.parseInt(sc.next());\n\n int[] a = new int[n - 1];\n for(int i = 0; i < n - 1; i++)\n a[i] = Integer.parseInt(sc.next());\n\n \n int[] ans = new int[n];\n for(int i = 0; i < n - 1; i++)\n ans[a[i] - 1]++;\n\n \n\n for(int i = 0; i < n; i++)\n System.out.println(ans[i]);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = Integer.parseInt(sc.next());\n\n int[] a = new int[n - 1];\n for(int i = 0; i < n - 1; i++)\n a[i] = Integer.parseInt(sc.next());\n\n \n int[] ans = new int[n];\n for(int i = 0; i < n - 1; i++)\n ans[a[i] - 1]++;\n\n \n\n for(int i = 0; i < n; i++)\n System.out.println(ans[i]);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int n = Integer.parseInt(sc.next());\n\n int[] a = new int[n - 1];\n for(int i = 0; i < n - 1; i++)\n a[i] = Integer.parseInt(sc.next());\n\n \n int[] ans = new int[n];\n for(int i = 0; i < n - 1; i++)\n ans[a[i] - 1]++;\n\n \n\n for(int i = 0; i < n; i++)\n System.out.println(ans[i]);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = Integer.parseInt(sc.next());",
"n",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int[] a = new int[n - 1];",
"a",
"new int[n - 1]",
"n - 1",
"n",
"1",
"for(int i = 0; i < n - 1; i++)\n a[i] = Integer.parseInt(sc.next());",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"i++",
"i++",
"i",
"a[i] = Integer.parseInt(sc.next());",
"a[i] = Integer.parseInt(sc.next())",
"a[i]",
"a",
"i",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int[] ans = new int[n];",
"ans",
"new int[n]",
"n",
"for(int i = 0; i < n - 1; i++)\n ans[a[i] - 1]++;",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"i++",
"i++",
"i",
"ans[a[i] - 1]++;",
"ans[a[i] - 1]++",
"ans[a[i] - 1]",
"ans",
"a[i] - 1",
"a[i]",
"a",
"i",
"1",
"for(int i = 0; i < n; i++)\n System.out.println(ans[i]);",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"System.out.println(ans[i]);",
"System.out.println(ans[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"ans[i]",
"ans",
"i",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = Integer.parseInt(sc.next());\n\n int[] a = new int[n - 1];\n for(int i = 0; i < n - 1; i++)\n a[i] = Integer.parseInt(sc.next());\n\n \n int[] ans = new int[n];\n for(int i = 0; i < n - 1; i++)\n ans[a[i] - 1]++;\n\n \n\n for(int i = 0; i < n; i++)\n System.out.println(ans[i]);\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n int n = Integer.parseInt(sc.next());\n\n int[] a = new int[n - 1];\n for(int i = 0; i < n - 1; i++)\n a[i] = Integer.parseInt(sc.next());\n\n \n int[] ans = new int[n];\n for(int i = 0; i < n - 1; i++)\n ans[a[i] - 1]++;\n\n \n\n for(int i = 0; i < n; i++)\n System.out.println(ans[i]);\n }\n}",
"Main"
] |
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int[] a = new int[n - 1];
for(int i = 0; i < n - 1; i++)
a[i] = Integer.parseInt(sc.next());
int[] ans = new int[n];
for(int i = 0; i < n - 1; i++)
ans[a[i] - 1]++;
for(int i = 0; i < n; i++)
System.out.println(ans[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,
2,
13,
17,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
40,
18,
13,
2,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
18,
13,
13,
18,
13,
13,
23,
13,
10,
6,
13
] |
[
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
74,
5
],
[
74,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
8,
24
],
[
24,
25
],
[
25,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
31,
33
],
[
24,
34
],
[
34,
35
],
[
35,
36
],
[
24,
37
],
[
38,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
38,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
47,
49
],
[
8,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
50,
55
],
[
55,
56
],
[
55,
57
],
[
50,
58
],
[
58,
59
],
[
59,
60
],
[
50,
61
],
[
62,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
6,
71
],
[
71,
72
],
[
0,
73
],
[
73,
74
],
[
73,
75
]
] |
[
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt(); sc.nextLine();\n\n int[] ans = new int[N];\n\n for (int i = 0; i < N-1; i++) {\n int tmp = sc.nextInt();\n ans[tmp-1]++;\n }\n\n for (int i = 0; i < N; i++) {\n System.out.println(ans[i]);\n }\n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt(); sc.nextLine();\n\n int[] ans = new int[N];\n\n for (int i = 0; i < N-1; i++) {\n int tmp = sc.nextInt();\n ans[tmp-1]++;\n }\n\n for (int i = 0; i < N; i++) {\n System.out.println(ans[i]);\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt(); sc.nextLine();\n\n int[] ans = new int[N];\n\n for (int i = 0; i < N-1; i++) {\n int tmp = sc.nextInt();\n ans[tmp-1]++;\n }\n\n for (int i = 0; i < N; i++) {\n System.out.println(ans[i]);\n }\n\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt(); sc.nextLine();\n\n int[] ans = new int[N];\n\n for (int i = 0; i < N-1; i++) {\n int tmp = sc.nextInt();\n ans[tmp-1]++;\n }\n\n for (int i = 0; i < N; i++) {\n System.out.println(ans[i]);\n }\n\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.nextLine()",
"sc.nextLine",
"sc",
"int[] ans = new int[N];",
"ans",
"new int[N]",
"N",
"for (int i = 0; i < N-1; i++) {\n int tmp = sc.nextInt();\n ans[tmp-1]++;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N-1",
"i",
"N-1",
"N",
"1",
"i++",
"i++",
"i",
"{\n int tmp = sc.nextInt();\n ans[tmp-1]++;\n }",
"{\n int tmp = sc.nextInt();\n ans[tmp-1]++;\n }",
"int tmp = sc.nextInt();",
"tmp",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ans[tmp-1]++",
"ans[tmp-1]",
"ans",
"tmp-1",
"tmp",
"1",
"for (int i = 0; i < N; i++) {\n System.out.println(ans[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n System.out.println(ans[i]);\n }",
"{\n System.out.println(ans[i]);\n }",
"System.out.println(ans[i])",
"System.out.println",
"System.out",
"System",
"System.out",
"ans[i]",
"ans",
"i",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt(); sc.nextLine();\n\n int[] ans = new int[N];\n\n for (int i = 0; i < N-1; i++) {\n int tmp = sc.nextInt();\n ans[tmp-1]++;\n }\n\n for (int i = 0; i < N; i++) {\n System.out.println(ans[i]);\n }\n\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int N = sc.nextInt(); sc.nextLine();\n\n int[] ans = new int[N];\n\n for (int i = 0; i < N-1; i++) {\n int tmp = sc.nextInt();\n ans[tmp-1]++;\n }\n\n for (int i = 0; i < N; i++) {\n System.out.println(ans[i]);\n }\n\n }\n}",
"Main"
] |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt(); sc.nextLine();
int[] ans = new int[N];
for (int i = 0; i < N-1; i++) {
int tmp = sc.nextInt();
ans[tmp-1]++;
}
for (int i = 0; i < N; i++) {
System.out.println(ans[i]);
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.