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,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
17,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
0,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
30,
11,
1,
0,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
18,
13,
13,
30,
0,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
8,
14
],
[
14,
15
],
[
8,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
8,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
8,
35
],
[
35,
36
],
[
35,
37
],
[
8,
39
],
[
39,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
39,
44
],
[
44,
45
],
[
44,
46
],
[
39,
47
],
[
47,
48
],
[
48,
49
],
[
39,
50
],
[
51,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
52,
56
],
[
56,
57
],
[
57,
58
],
[
8,
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
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
78,
80
],
[
74,
81
],
[
81,
82
],
[
81,
83
],
[
74,
84
],
[
84,
85
],
[
85,
86
],
[
74,
87
],
[
88,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
94,
96
],
[
89,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
100,
102
],
[
97,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
103,
107
],
[
107,
108
],
[
107,
109
],
[
97,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
110,
114
],
[
8,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
120,
121
],
[
120,
122
],
[
115,
123
],
[
123,
124
],
[
124,
125
],
[
115,
126
],
[
127,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
130,
132
],
[
8,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
133,
138
],
[
6,
139
],
[
139,
140
]
]
| [
"import java.util.*;\nclass Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n, k,i,tmp,j,sum=0;\n\n n = sc.nextInt();\n k = sc.nextInt();\n\n int p[] = new int[n];\n\n for (i = 0; i < n; i++) {\n p[i] = sc.nextInt();\n }\n\n for (i = 0; i < n - 1; i++) {\n for (j = i + 1; j < n; j++) {\n if (p[i] > p[j]) {\n tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }\n }\n }\n for (i = 0; i < k; i++) {\n sum += p[i];\n }\n System.out.println(sum);\n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n, k,i,tmp,j,sum=0;\n\n n = sc.nextInt();\n k = sc.nextInt();\n\n int p[] = new int[n];\n\n for (i = 0; i < n; i++) {\n p[i] = sc.nextInt();\n }\n\n for (i = 0; i < n - 1; i++) {\n for (j = i + 1; j < n; j++) {\n if (p[i] > p[j]) {\n tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }\n }\n }\n for (i = 0; i < k; i++) {\n sum += p[i];\n }\n System.out.println(sum);\n }\n\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n, k,i,tmp,j,sum=0;\n\n n = sc.nextInt();\n k = sc.nextInt();\n\n int p[] = new int[n];\n\n for (i = 0; i < n; i++) {\n p[i] = sc.nextInt();\n }\n\n for (i = 0; i < n - 1; i++) {\n for (j = i + 1; j < n; j++) {\n if (p[i] > p[j]) {\n tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }\n }\n }\n for (i = 0; i < k; i++) {\n sum += p[i];\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n, k,i,tmp,j,sum=0;\n\n n = sc.nextInt();\n k = sc.nextInt();\n\n int p[] = new int[n];\n\n for (i = 0; i < n; i++) {\n p[i] = sc.nextInt();\n }\n\n for (i = 0; i < n - 1; i++) {\n for (j = i + 1; j < n; j++) {\n if (p[i] > p[j]) {\n tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }\n }\n }\n for (i = 0; i < k; i++) {\n sum += p[i];\n }\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n",
"n",
"k",
"k",
"i",
"i",
"tmp",
"tmp",
"j",
"j",
"sum=0;",
"sum",
"0",
"n = sc.nextInt()",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"k = sc.nextInt()",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int p[] = new int[n];",
"p",
"new int[n]",
"n",
"for (i = 0; i < n; i++) {\n p[i] = sc.nextInt();\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n p[i] = sc.nextInt();\n }",
"{\n p[i] = sc.nextInt();\n }",
"p[i] = sc.nextInt()",
"p[i]",
"p",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (i = 0; i < n - 1; i++) {\n for (j = i + 1; j < n; j++) {\n if (p[i] > p[j]) {\n tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }\n }\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < n - 1",
"i",
"n - 1",
"n",
"1",
"i++",
"i++",
"i",
"{\n for (j = i + 1; j < n; j++) {\n if (p[i] > p[j]) {\n tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }\n }\n }",
"{\n for (j = i + 1; j < n; j++) {\n if (p[i] > p[j]) {\n tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }\n }\n }",
"for (j = i + 1; j < n; j++) {\n if (p[i] > p[j]) {\n tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }\n }",
"j = i + 1;",
"j = i + 1",
"j",
"i + 1",
"i",
"1",
"j < n",
"j",
"n",
"j++",
"j++",
"j",
"{\n if (p[i] > p[j]) {\n tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }\n }",
"{\n if (p[i] > p[j]) {\n tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }\n }",
"if (p[i] > p[j]) {\n tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }",
"p[i] > p[j]",
"p[i]",
"p",
"i",
"p[j]",
"p",
"j",
"{\n tmp = p[i];\n p[i] = p[j];\n p[j] = tmp;\n }",
"tmp = p[i]",
"tmp",
"p[i]",
"p",
"i",
"p[i] = p[j]",
"p[i]",
"p",
"i",
"p[j]",
"p",
"j",
"p[j] = tmp",
"p[j]",
"p",
"j",
"tmp",
"for (i = 0; i < k; i++) {\n sum += p[i];\n }",
"i = 0;",
"i = 0",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n sum += p[i];\n }",
"{\n sum += p[i];\n }",
"sum += p[i]",
"sum",
"p[i]",
"p",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args"
]
| import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n, k,i,tmp,j,sum=0;
n = sc.nextInt();
k = sc.nextInt();
int p[] = new int[n];
for (i = 0; i < n; i++) {
p[i] = sc.nextInt();
}
for (i = 0; i < n - 1; i++) {
for (j = i + 1; j < n; j++) {
if (p[i] > p[j]) {
tmp = p[i];
p[i] = p[j];
p[j] = tmp;
}
}
}
for (i = 0; i < k; i++) {
sum += p[i];
}
System.out.println(sum);
}
} |
[
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,
4,
18,
4,
18,
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,
4,
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,
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
],
[
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
],
[
195,
20
],
[
195,
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
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
46,
51
],
[
23,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
72,
73
],
[
72,
74
],
[
23,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
23,
79
],
[
79,
80
],
[
79,
81
],
[
23,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
87,
88
],
[
87,
89
],
[
82,
90
],
[
90,
91
],
[
91,
92
],
[
82,
93
],
[
94,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
97,
99
],
[
23,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
21,
104
],
[
104,
105
],
[
195,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
106,
110
],
[
110,
111
],
[
106,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
106,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
121,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
131,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
120,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
106,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
151,
152
],
[
150,
153
],
[
153,
154
],
[
106,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
159,
162
],
[
162,
163
],
[
106,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
168,
171
],
[
171,
172
],
[
106,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
175,
179
],
[
179,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
179,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
190,
191
],
[
175,
192
],
[
192,
193
],
[
0,
194
],
[
194,
195
],
[
194,
196
]
]
| [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n private static class FastReader {\n BufferedReader br;\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 } 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 static void main(final String[] args) throws IOException {\n FastReader in = new FastReader();\n PrintWriter out = new PrintWriter(System.out, true);\n\n int n = in.nextInt();\n int k = in.nextInt();\n int[] p = new int[n];\n String[] tokens = in.nextLine().split(\" \");\n for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(tokens[i]);\n }\n\n Arrays.sort(p);\n\n int price = 0;\n for (int i = 0; i < k; i++) {\n price += p[i];\n }\n\n out.println(price);\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.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n\n private static class FastReader {\n BufferedReader br;\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 } 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 static void main(final String[] args) throws IOException {\n FastReader in = new FastReader();\n PrintWriter out = new PrintWriter(System.out, true);\n\n int n = in.nextInt();\n int k = in.nextInt();\n int[] p = new int[n];\n String[] tokens = in.nextLine().split(\" \");\n for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(tokens[i]);\n }\n\n Arrays.sort(p);\n\n int price = 0;\n for (int i = 0; i < k; i++) {\n price += p[i];\n }\n\n out.println(price);\n }\n}",
"Main",
"public static void main(final String[] args) throws IOException {\n FastReader in = new FastReader();\n PrintWriter out = new PrintWriter(System.out, true);\n\n int n = in.nextInt();\n int k = in.nextInt();\n int[] p = new int[n];\n String[] tokens = in.nextLine().split(\" \");\n for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(tokens[i]);\n }\n\n Arrays.sort(p);\n\n int price = 0;\n for (int i = 0; i < k; i++) {\n price += p[i];\n }\n\n out.println(price);\n }",
"main",
"{\n FastReader in = new FastReader();\n PrintWriter out = new PrintWriter(System.out, true);\n\n int n = in.nextInt();\n int k = in.nextInt();\n int[] p = new int[n];\n String[] tokens = in.nextLine().split(\" \");\n for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(tokens[i]);\n }\n\n Arrays.sort(p);\n\n int price = 0;\n for (int i = 0; i < k; i++) {\n price += p[i];\n }\n\n out.println(price);\n }",
"FastReader in = new FastReader();",
"in",
"new FastReader()",
"PrintWriter out = new PrintWriter(System.out, true);",
"out",
"new PrintWriter(System.out, true)",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int k = in.nextInt();",
"k",
"in.nextInt()",
"in.nextInt",
"in",
"int[] p = new int[n];",
"p",
"new int[n]",
"n",
"String[] tokens = in.nextLine().split(\" \");",
"tokens",
"in.nextLine().split(\" \")",
"in.nextLine().split",
"in.nextLine()",
"in.nextLine",
"in",
"\" \"",
"for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(tokens[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n p[i] = Integer.parseInt(tokens[i]);\n }",
"{\n p[i] = Integer.parseInt(tokens[i]);\n }",
"p[i] = Integer.parseInt(tokens[i])",
"p[i]",
"p",
"i",
"Integer.parseInt(tokens[i])",
"Integer.parseInt",
"Integer",
"tokens[i]",
"tokens",
"i",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"int price = 0;",
"price",
"0",
"for (int i = 0; i < k; i++) {\n price += p[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n price += p[i];\n }",
"{\n price += p[i];\n }",
"price += p[i]",
"price",
"p[i]",
"p",
"i",
"out.println(price)",
"out.println",
"out",
"price",
"final String[] args",
"args",
"private static class FastReader {\n BufferedReader br;\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 } 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))",
"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\n private static class FastReader {\n BufferedReader br;\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 } 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 static void main(final String[] args) throws IOException {\n FastReader in = new FastReader();\n PrintWriter out = new PrintWriter(System.out, true);\n\n int n = in.nextInt();\n int k = in.nextInt();\n int[] p = new int[n];\n String[] tokens = in.nextLine().split(\" \");\n for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(tokens[i]);\n }\n\n Arrays.sort(p);\n\n int price = 0;\n for (int i = 0; i < k; i++) {\n price += p[i];\n }\n\n out.println(price);\n }\n}",
"public class Main {\n\n private static class FastReader {\n BufferedReader br;\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 } 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 static void main(final String[] args) throws IOException {\n FastReader in = new FastReader();\n PrintWriter out = new PrintWriter(System.out, true);\n\n int n = in.nextInt();\n int k = in.nextInt();\n int[] p = new int[n];\n String[] tokens = in.nextLine().split(\" \");\n for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(tokens[i]);\n }\n\n Arrays.sort(p);\n\n int price = 0;\n for (int i = 0; i < k; i++) {\n price += p[i];\n }\n\n out.println(price);\n }\n}",
"Main"
]
| import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
public class Main {
private 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;
}
}
public static void main(final String[] args) throws IOException {
FastReader in = new FastReader();
PrintWriter out = new PrintWriter(System.out, true);
int n = in.nextInt();
int k = in.nextInt();
int[] p = new int[n];
String[] tokens = in.nextLine().split(" ");
for (int i = 0; i < n; i++) {
p[i] = Integer.parseInt(tokens[i]);
}
Arrays.sort(p);
int price = 0;
for (int i = 0; i < k; i++) {
price += p[i];
}
out.println(price);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
90,
11
],
[
90,
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
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
14,
50
],
[
50,
51
],
[
51,
52
],
[
14,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
14,
57
],
[
57,
58
],
[
57,
59
],
[
14,
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
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
14,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
12,
87
],
[
87,
88
],
[
0,
89
],
[
89,
90
],
[
89,
91
]
]
| [
"import java.util.ArrayList;\nimport java.util.Collections;\nimport 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 K = sc.nextInt();\n\t\tArrayList<Integer> shoplist= new ArrayList<Integer>();\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tshoplist.add(sc.nextInt());\n\t\t}\n\t\tsc.close();\n\t\tCollections.sort(shoplist);\n\n\t\tint result = 0;\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tresult = result + shoplist.get(i);\n\t\t}\n\n\t\tSystem.out.println(result);\n\n\t}\n\n\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"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 K = sc.nextInt();\n\t\tArrayList<Integer> shoplist= new ArrayList<Integer>();\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tshoplist.add(sc.nextInt());\n\t\t}\n\t\tsc.close();\n\t\tCollections.sort(shoplist);\n\n\t\tint result = 0;\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tresult = result + shoplist.get(i);\n\t\t}\n\n\t\tSystem.out.println(result);\n\n\t}\n\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 K = sc.nextInt();\n\t\tArrayList<Integer> shoplist= new ArrayList<Integer>();\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tshoplist.add(sc.nextInt());\n\t\t}\n\t\tsc.close();\n\t\tCollections.sort(shoplist);\n\n\t\tint result = 0;\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tresult = result + shoplist.get(i);\n\t\t}\n\n\t\tSystem.out.println(result);\n\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tArrayList<Integer> shoplist= new ArrayList<Integer>();\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tshoplist.add(sc.nextInt());\n\t\t}\n\t\tsc.close();\n\t\tCollections.sort(shoplist);\n\n\t\tint result = 0;\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tresult = result + shoplist.get(i);\n\t\t}\n\n\t\tSystem.out.println(result);\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 K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ArrayList<Integer> shoplist= new ArrayList<Integer>();",
"shoplist",
"new ArrayList<Integer>()",
"for(int i=0;i<N;i++) {\n\t\t\tshoplist.add(sc.nextInt());\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tshoplist.add(sc.nextInt());\n\t\t}",
"{\n\t\t\tshoplist.add(sc.nextInt());\n\t\t}",
"shoplist.add(sc.nextInt())",
"shoplist.add",
"shoplist",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.close()",
"sc.close",
"sc",
"Collections.sort(shoplist)",
"Collections.sort",
"Collections",
"shoplist",
"int result = 0;",
"result",
"0",
"for(int i=0;i<K;i++) {\n\t\t\tresult = result + shoplist.get(i);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tresult = result + shoplist.get(i);\n\t\t}",
"{\n\t\t\tresult = result + shoplist.get(i);\n\t\t}",
"result = result + shoplist.get(i)",
"result",
"result + shoplist.get(i)",
"result",
"shoplist.get(i)",
"shoplist.get",
"shoplist",
"i",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"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 K = sc.nextInt();\n\t\tArrayList<Integer> shoplist= new ArrayList<Integer>();\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tshoplist.add(sc.nextInt());\n\t\t}\n\t\tsc.close();\n\t\tCollections.sort(shoplist);\n\n\t\tint result = 0;\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tresult = result + shoplist.get(i);\n\t\t}\n\n\t\tSystem.out.println(result);\n\n\t}\n\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 K = sc.nextInt();\n\t\tArrayList<Integer> shoplist= new ArrayList<Integer>();\n\n\t\tfor(int i=0;i<N;i++) {\n\t\t\tshoplist.add(sc.nextInt());\n\t\t}\n\t\tsc.close();\n\t\tCollections.sort(shoplist);\n\n\t\tint result = 0;\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tresult = result + shoplist.get(i);\n\t\t}\n\n\t\tSystem.out.println(result);\n\n\t}\n\n\n}",
"Main"
]
| import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int K = sc.nextInt();
ArrayList<Integer> shoplist= new ArrayList<Integer>();
for(int i=0;i<N;i++) {
shoplist.add(sc.nextInt());
}
sc.close();
Collections.sort(shoplist);
int result = 0;
for(int i=0;i<K;i++) {
result = result + shoplist.get(i);
}
System.out.println(result);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
89,
17
],
[
89,
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
],
[
31,
32
],
[
32,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
20,
37
],
[
37,
38
],
[
37,
39
],
[
20,
40
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
40,
45
],
[
45,
46
],
[
45,
47
],
[
40,
48
],
[
48,
49
],
[
49,
50
],
[
40,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
56,
57
],
[
20,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
20,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
67,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
62,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
20,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
18,
86
],
[
86,
87
],
[
0,
88
],
[
88,
89
],
[
88,
90
]
]
| [
"import java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) throws IOException {\n \tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint sum = 0;\n\n\t\tList<Integer> cost = new ArrayList<>();\n\n\t\tfor(int i=0;i<N;i++) cost.add(sc.nextInt());\n\n\t\tCollections.sort(cost);\n\n\t\tfor(int i=0;i<K;i++) sum+=cost.get(i);\n\n\t\tSystem.out.println(sum);\n\t}\n\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n \tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint sum = 0;\n\n\t\tList<Integer> cost = new ArrayList<>();\n\n\t\tfor(int i=0;i<N;i++) cost.add(sc.nextInt());\n\n\t\tCollections.sort(cost);\n\n\t\tfor(int i=0;i<K;i++) sum+=cost.get(i);\n\n\t\tSystem.out.println(sum);\n\t}\n\n}",
"Main",
"public static void main(String[] args) throws IOException {\n \tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint sum = 0;\n\n\t\tList<Integer> cost = new ArrayList<>();\n\n\t\tfor(int i=0;i<N;i++) cost.add(sc.nextInt());\n\n\t\tCollections.sort(cost);\n\n\t\tfor(int i=0;i<K;i++) sum+=cost.get(i);\n\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n \tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint sum = 0;\n\n\t\tList<Integer> cost = new ArrayList<>();\n\n\t\tfor(int i=0;i<N;i++) cost.add(sc.nextInt());\n\n\t\tCollections.sort(cost);\n\n\t\tfor(int i=0;i<K;i++) sum+=cost.get(i);\n\n\t\tSystem.out.println(sum);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"List<Integer> cost = new ArrayList<>();",
"cost",
"new ArrayList<>()",
"for(int i=0;i<N;i++) cost.add(sc.nextInt());",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"cost.add(sc.nextInt());",
"cost.add(sc.nextInt())",
"cost.add",
"cost",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Collections.sort(cost)",
"Collections.sort",
"Collections",
"cost",
"for(int i=0;i<K;i++) sum+=cost.get(i);",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"sum+=cost.get(i);",
"sum+=cost.get(i)",
"sum",
"cost.get(i)",
"cost.get",
"cost",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n \tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint sum = 0;\n\n\t\tList<Integer> cost = new ArrayList<>();\n\n\t\tfor(int i=0;i<N;i++) cost.add(sc.nextInt());\n\n\t\tCollections.sort(cost);\n\n\t\tfor(int i=0;i<K;i++) sum+=cost.get(i);\n\n\t\tSystem.out.println(sum);\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n \tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint sum = 0;\n\n\t\tList<Integer> cost = new ArrayList<>();\n\n\t\tfor(int i=0;i<N;i++) cost.add(sc.nextInt());\n\n\t\tCollections.sort(cost);\n\n\t\tfor(int i=0;i<K;i++) sum+=cost.get(i);\n\n\t\tSystem.out.println(sum);\n\t}\n\n}",
"Main"
]
| import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int K = sc.nextInt();
int sum = 0;
List<Integer> cost = new ArrayList<>();
for(int i=0;i<N;i++) cost.add(sc.nextInt());
Collections.sort(cost);
for(int i=0;i<K;i++) sum+=cost.get(i);
System.out.println(sum);
}
} |
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
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,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
81,
8
],
[
81,
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,
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
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
11,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
11,
52
],
[
52,
53
],
[
52,
54
],
[
11,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
11,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
9,
78
],
[
78,
79
],
[
0,
80
],
[
80,
81
],
[
80,
82
]
]
| [
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint length = scanner.nextInt();\n\t\tint chosen = scanner.nextInt();\n\t\tint[] numbers = new int[length];\n\t\tfor(int i = 0; i < length; i++) \n\t\t\tnumbers[i] = scanner.nextInt();\n\t\t\n\t\tArrays.sort(numbers);\n\t\t\n\t\tlong result = 0l;\n\t\tfor(int i = 0; i < chosen; i++) \n\t\t\tresult += numbers[i];\n\t\tSystem.out.print(result);\n\t}\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint length = scanner.nextInt();\n\t\tint chosen = scanner.nextInt();\n\t\tint[] numbers = new int[length];\n\t\tfor(int i = 0; i < length; i++) \n\t\t\tnumbers[i] = scanner.nextInt();\n\t\t\n\t\tArrays.sort(numbers);\n\t\t\n\t\tlong result = 0l;\n\t\tfor(int i = 0; i < chosen; i++) \n\t\t\tresult += numbers[i];\n\t\tSystem.out.print(result);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint length = scanner.nextInt();\n\t\tint chosen = scanner.nextInt();\n\t\tint[] numbers = new int[length];\n\t\tfor(int i = 0; i < length; i++) \n\t\t\tnumbers[i] = scanner.nextInt();\n\t\t\n\t\tArrays.sort(numbers);\n\t\t\n\t\tlong result = 0l;\n\t\tfor(int i = 0; i < chosen; i++) \n\t\t\tresult += numbers[i];\n\t\tSystem.out.print(result);\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint length = scanner.nextInt();\n\t\tint chosen = scanner.nextInt();\n\t\tint[] numbers = new int[length];\n\t\tfor(int i = 0; i < length; i++) \n\t\t\tnumbers[i] = scanner.nextInt();\n\t\t\n\t\tArrays.sort(numbers);\n\t\t\n\t\tlong result = 0l;\n\t\tfor(int i = 0; i < chosen; i++) \n\t\t\tresult += numbers[i];\n\t\tSystem.out.print(result);\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int length = scanner.nextInt();",
"length",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int chosen = scanner.nextInt();",
"chosen",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[] numbers = new int[length];",
"numbers",
"new int[length]",
"length",
"for(int i = 0; i < length; i++) \n\t\t\tnumbers[i] = scanner.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < length",
"i",
"length",
"i++",
"i++",
"i",
"numbers[i] = scanner.nextInt();",
"numbers[i] = scanner.nextInt()",
"numbers[i]",
"numbers",
"i",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"Arrays.sort(numbers)",
"Arrays.sort",
"Arrays",
"numbers",
"long result = 0l;",
"result",
"0l",
"for(int i = 0; i < chosen; i++) \n\t\t\tresult += numbers[i];",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < chosen",
"i",
"chosen",
"i++",
"i++",
"i",
"result += numbers[i];",
"result += numbers[i]",
"result",
"numbers[i]",
"numbers",
"i",
"System.out.print(result)",
"System.out.print",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint length = scanner.nextInt();\n\t\tint chosen = scanner.nextInt();\n\t\tint[] numbers = new int[length];\n\t\tfor(int i = 0; i < length; i++) \n\t\t\tnumbers[i] = scanner.nextInt();\n\t\t\n\t\tArrays.sort(numbers);\n\t\t\n\t\tlong result = 0l;\n\t\tfor(int i = 0; i < chosen; i++) \n\t\t\tresult += numbers[i];\n\t\tSystem.out.print(result);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint length = scanner.nextInt();\n\t\tint chosen = scanner.nextInt();\n\t\tint[] numbers = new int[length];\n\t\tfor(int i = 0; i < length; i++) \n\t\t\tnumbers[i] = scanner.nextInt();\n\t\t\n\t\tArrays.sort(numbers);\n\t\t\n\t\tlong result = 0l;\n\t\tfor(int i = 0; i < chosen; i++) \n\t\t\tresult += numbers[i];\n\t\tSystem.out.print(result);\n\t}\n}",
"Main"
]
| import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int length = scanner.nextInt();
int chosen = scanner.nextInt();
int[] numbers = new int[length];
for(int i = 0; i < length; i++)
numbers[i] = scanner.nextInt();
Arrays.sort(numbers);
long result = 0l;
for(int i = 0; i < chosen; i++)
result += numbers[i];
System.out.print(result);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
2,
2,
2,
17,
17,
17,
17,
41,
13,
39,
17,
40,
17,
17,
17,
41,
13,
39,
17,
17,
40,
17,
17,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
17,
41,
13,
4,
13,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
13,
13,
12,
13,
30,
41,
13,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
2,
13,
2,
4,
18,
13,
2,
13,
13,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
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,
0,
13,
20,
0,
13,
20,
4,
13,
4,
18,
13,
12,
13,
30,
20,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
0,
13,
17,
29,
17,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
38,
5,
13,
30,
0,
13,
17,
29,
17,
30,
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,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
308,
8
],
[
308,
9
],
[
9,
10
],
[
308,
11
],
[
11,
12
],
[
308,
13
],
[
13,
14
],
[
308,
15
],
[
15,
16
],
[
308,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
21,
21
],
[
21,
22
],
[
21,
23
],
[
21,
24
],
[
19,
25
],
[
308,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
28,
32
],
[
28,
33
],
[
308,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
36,
38
],
[
36,
39
],
[
39,
40
],
[
36,
41
],
[
308,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
44,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
44,
53
],
[
53,
54
],
[
53,
55
],
[
44,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
58,
60
],
[
44,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
44,
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
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
44,
83
],
[
83,
84
],
[
83,
85
],
[
308,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
88,
94
],
[
94,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
94,
99
],
[
99,
100
],
[
99,
101
],
[
94,
102
],
[
102,
103
],
[
103,
104
],
[
94,
105
],
[
106,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
111,
115
],
[
115,
116
],
[
115,
117
],
[
106,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
106,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
123,
127
],
[
127,
128
],
[
127,
129
],
[
106,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
86,
135
],
[
135,
136
],
[
308,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
140,
143
],
[
137,
144
],
[
144,
145
],
[
308,
146
],
[
146,
147
],
[
146,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
149,
152
],
[
146,
153
],
[
153,
154
],
[
308,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
157,
161
],
[
161,
162
],
[
161,
163
],
[
157,
164
],
[
164,
165
],
[
157,
166
],
[
166,
167
],
[
167,
168
],
[
308,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
169,
173
],
[
173,
174
],
[
308,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
177,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
182,
187
],
[
187,
188
],
[
187,
189
],
[
182,
190
],
[
190,
191
],
[
191,
192
],
[
182,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
194,
198
],
[
198,
199
],
[
177,
200
],
[
200,
201
],
[
175,
202
],
[
202,
203
],
[
308,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
211
],
[
211,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
211,
216
],
[
216,
217
],
[
216,
218
],
[
211,
219
],
[
219,
220
],
[
220,
221
],
[
211,
222
],
[
222,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
223,
227
],
[
227,
228
],
[
206,
229
],
[
229,
230
],
[
204,
231
],
[
231,
232
],
[
308,
233
],
[
233,
234
],
[
233,
235
],
[
235,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
237,
241
],
[
241,
242
],
[
242,
243
],
[
243,
244
],
[
236,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
249,
250
],
[
250,
251
],
[
250,
252
],
[
249,
253
],
[
253,
254
],
[
246,
255
],
[
255,
256
],
[
256,
257
],
[
256,
258
],
[
235,
259
],
[
259,
260
],
[
260,
261
],
[
261,
262
],
[
308,
263
],
[
263,
264
],
[
263,
265
],
[
265,
266
],
[
266,
267
],
[
267,
268
],
[
267,
269
],
[
269,
270
],
[
270,
271
],
[
270,
272
],
[
269,
273
],
[
273,
274
],
[
266,
275
],
[
275,
276
],
[
276,
277
],
[
277,
278
],
[
278,
279
],
[
308,
280
],
[
280,
281
],
[
280,
282
],
[
282,
283
],
[
283,
284
],
[
284,
285
],
[
285,
286
],
[
284,
287
],
[
287,
288
],
[
308,
289
],
[
289,
290
],
[
289,
291
],
[
291,
292
],
[
292,
293
],
[
293,
294
],
[
294,
295
],
[
293,
296
],
[
296,
297
],
[
308,
298
],
[
298,
299
],
[
298,
300
],
[
300,
301
],
[
301,
302
],
[
302,
303
],
[
303,
304
],
[
302,
305
],
[
305,
306
],
[
0,
307
],
[
307,
308
],
[
307,
309
]
]
| [
"import java.util.*;\nimport java.io.*;\n\n// Template for atcoder\npublic class Main {\n\n BufferedReader br;\n PrintWriter out;\n StringTokenizer st;\n boolean eof;\n final long MOD = 1000L * 1000L * 1000L + 7;\n private static final int[] dx = {0, -1, 0, 1};\n private static final int[] dy = {1, 0, -1, 0};\n\n void solve() throws IOException {\n int n = nextInt();\n int k = nextInt();\n int res = 0;\n int[] arr = nextIntArr(n);\n Arrays.sort(arr);\n for (int i = 0; i < k; i++) {\n res += arr[i];\n }\n outln(res);\n }\n\n void shuffle(int[] a) {\n int n = a.length;\n for(int i = 0; i < n; i++) {\n int r = i + (int) (Math.random() * (n - i));\n int tmp = a[i];\n a[i] = a[r];\n a[r] = tmp;\n }\n }\n private void outln(Object o) {\n out.println(o);\n }\n private void out(Object o) {\n out.print(o);\n }\n public Main() throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n out.close();\n }\n public static void main(String[] args) throws IOException {\n new Main();\n }\n\n public long[] nextLongArr(int n) throws IOException{\n long[] res = new long[n];\n for(int i = 0; i < n; i++)\n res[i] = nextLong();\n return res;\n }\n public int[] nextIntArr(int n) throws IOException {\n int[] res = new int[n];\n for(int i = 0; i < n; i++)\n res[i] = nextInt();\n return res;\n }\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n eof = true;\n return null;\n }\n }\n return st.nextToken();\n }\n public String nextString() {\n try {\n return br.readLine();\n } catch (IOException e) {\n eof = true;\n return null;\n }\n }\n public int nextInt() throws IOException {\n return Integer.parseInt(nextToken());\n }\n public long nextLong() throws IOException {\n return Long.parseLong(nextToken());\n }\n public double nextDouble() throws IOException {\n return Double.parseDouble(nextToken());\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n\n BufferedReader br;\n PrintWriter out;\n StringTokenizer st;\n boolean eof;\n final long MOD = 1000L * 1000L * 1000L + 7;\n private static final int[] dx = {0, -1, 0, 1};\n private static final int[] dy = {1, 0, -1, 0};\n\n void solve() throws IOException {\n int n = nextInt();\n int k = nextInt();\n int res = 0;\n int[] arr = nextIntArr(n);\n Arrays.sort(arr);\n for (int i = 0; i < k; i++) {\n res += arr[i];\n }\n outln(res);\n }\n\n void shuffle(int[] a) {\n int n = a.length;\n for(int i = 0; i < n; i++) {\n int r = i + (int) (Math.random() * (n - i));\n int tmp = a[i];\n a[i] = a[r];\n a[r] = tmp;\n }\n }\n private void outln(Object o) {\n out.println(o);\n }\n private void out(Object o) {\n out.print(o);\n }\n public Main() throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n out.close();\n }\n public static void main(String[] args) throws IOException {\n new Main();\n }\n\n public long[] nextLongArr(int n) throws IOException{\n long[] res = new long[n];\n for(int i = 0; i < n; i++)\n res[i] = nextLong();\n return res;\n }\n public int[] nextIntArr(int n) throws IOException {\n int[] res = new int[n];\n for(int i = 0; i < n; i++)\n res[i] = nextInt();\n return res;\n }\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n eof = true;\n return null;\n }\n }\n return st.nextToken();\n }\n public String nextString() {\n try {\n return br.readLine();\n } catch (IOException e) {\n eof = true;\n return null;\n }\n }\n public int nextInt() throws IOException {\n return Integer.parseInt(nextToken());\n }\n public long nextLong() throws IOException {\n return Long.parseLong(nextToken());\n }\n public double nextDouble() throws IOException {\n return Double.parseDouble(nextToken());\n }\n}",
"Main",
"BufferedReader br;",
"br",
"PrintWriter out;",
"out",
"StringTokenizer st;",
"st",
"boolean eof;",
"eof",
"final long MOD = 1000L * 1000L * 1000L + 7;",
"MOD",
"1000L * 1000L * 1000L + 7",
"1000L * 1000L * 1000L",
"1000L * 1000L * 1000L",
"1000L",
"1000L",
"1000L",
"7",
"private static final int[] dx = {0, -1, 0, 1};",
"dx",
"{0, -1, 0, 1}",
"0",
"-1",
"1",
"0",
"1",
"private static final int[] dy = {1, 0, -1, 0};",
"dy",
"{1, 0, -1, 0}",
"1",
"0",
"-1",
"1",
"0",
"void solve() throws IOException {\n int n = nextInt();\n int k = nextInt();\n int res = 0;\n int[] arr = nextIntArr(n);\n Arrays.sort(arr);\n for (int i = 0; i < k; i++) {\n res += arr[i];\n }\n outln(res);\n }",
"solve",
"{\n int n = nextInt();\n int k = nextInt();\n int res = 0;\n int[] arr = nextIntArr(n);\n Arrays.sort(arr);\n for (int i = 0; i < k; i++) {\n res += arr[i];\n }\n outln(res);\n }",
"int n = nextInt();",
"n",
"nextInt()",
"nextInt",
"int k = nextInt();",
"k",
"nextInt()",
"nextInt",
"int res = 0;",
"res",
"0",
"int[] arr = nextIntArr(n);",
"arr",
"nextIntArr(n)",
"nextIntArr",
"n",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"for (int i = 0; i < k; i++) {\n res += arr[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n res += arr[i];\n }",
"{\n res += arr[i];\n }",
"res += arr[i]",
"res",
"arr[i]",
"arr",
"i",
"outln(res)",
"outln",
"res",
"void shuffle(int[] a) {\n int n = a.length;\n for(int i = 0; i < n; i++) {\n int r = i + (int) (Math.random() * (n - i));\n int tmp = a[i];\n a[i] = a[r];\n a[r] = tmp;\n }\n }",
"shuffle",
"{\n int n = a.length;\n for(int i = 0; i < n; i++) {\n int r = i + (int) (Math.random() * (n - i));\n int tmp = a[i];\n a[i] = a[r];\n a[r] = tmp;\n }\n }",
"int n = a.length;",
"n",
"a.length",
"a",
"a.length",
"for(int i = 0; i < n; i++) {\n int r = i + (int) (Math.random() * (n - i));\n int tmp = a[i];\n a[i] = a[r];\n a[r] = tmp;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n int r = i + (int) (Math.random() * (n - i));\n int tmp = a[i];\n a[i] = a[r];\n a[r] = tmp;\n }",
"{\n int r = i + (int) (Math.random() * (n - i));\n int tmp = a[i];\n a[i] = a[r];\n a[r] = tmp;\n }",
"int r = i + (int) (Math.random() * (n - i));",
"r",
"i + (int) (Math.random() * (n - i))",
"i",
"(int) (Math.random() * (n - i))",
"Math.random()",
"Math.random",
"Math",
"(n - i)",
"n",
"i",
"int tmp = a[i];",
"tmp",
"a[i]",
"a",
"i",
"a[i] = a[r]",
"a[i]",
"a",
"i",
"a[r]",
"a",
"r",
"a[r] = tmp",
"a[r]",
"a",
"r",
"tmp",
"int[] a",
"a",
"private void outln(Object o) {\n out.println(o);\n }",
"outln",
"{\n out.println(o);\n }",
"out.println(o)",
"out.println",
"out",
"o",
"Object o",
"o",
"private void out(Object o) {\n out.print(o);\n }",
"out",
"{\n out.print(o);\n }",
"out.print(o)",
"out.print",
"out",
"o",
"Object o",
"o",
"public Main() throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n out.close();\n }",
"Main",
"{\n br = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n out.close();\n }",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"out = new PrintWriter(System.out)",
"out",
"new PrintWriter(System.out)",
"solve()",
"solve",
"out.close()",
"out.close",
"out",
"public static void main(String[] args) throws IOException {\n new Main();\n }",
"main",
"{\n new Main();\n }",
"new Main()",
"String[] args",
"args",
"public long[] nextLongArr(int n) throws IOException{\n long[] res = new long[n];\n for(int i = 0; i < n; i++)\n res[i] = nextLong();\n return res;\n }",
"nextLongArr",
"{\n long[] res = new long[n];\n for(int i = 0; i < n; i++)\n res[i] = nextLong();\n return res;\n }",
"long[] res = new long[n];",
"res",
"new long[n]",
"n",
"for(int i = 0; i < n; i++)\n res[i] = nextLong();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"res[i] = nextLong();",
"res[i] = nextLong()",
"res[i]",
"res",
"i",
"nextLong()",
"nextLong",
"return res;",
"res",
"int n",
"n",
"public int[] nextIntArr(int n) throws IOException {\n int[] res = new int[n];\n for(int i = 0; i < n; i++)\n res[i] = nextInt();\n return res;\n }",
"nextIntArr",
"{\n int[] res = new int[n];\n for(int i = 0; i < n; i++)\n res[i] = nextInt();\n return res;\n }",
"int[] res = new int[n];",
"res",
"new int[n]",
"n",
"for(int i = 0; i < n; i++)\n res[i] = nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"res[i] = nextInt();",
"res[i] = nextInt()",
"res[i]",
"res",
"i",
"nextInt()",
"nextInt",
"return res;",
"res",
"int n",
"n",
"public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n eof = true;\n return null;\n }\n }\n return st.nextToken();\n }",
"nextToken",
"{\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n eof = true;\n return null;\n }\n }\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n eof = true;\n return null;\n }\n }",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n eof = true;\n return null;\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n eof = true;\n return null;\n }",
"catch (Exception e) {\n eof = true;\n return null;\n }",
"Exception e",
"{\n eof = true;\n return null;\n }",
"eof = true",
"eof",
"true",
"return null;",
"null",
"{\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 String nextString() {\n try {\n return br.readLine();\n } catch (IOException e) {\n eof = true;\n return null;\n }\n }",
"nextString",
"{\n try {\n return br.readLine();\n } catch (IOException e) {\n eof = true;\n return null;\n }\n }",
"try {\n return br.readLine();\n } catch (IOException e) {\n eof = true;\n return null;\n }",
"catch (IOException e) {\n eof = true;\n return null;\n }",
"IOException e",
"{\n eof = true;\n return null;\n }",
"eof = true",
"eof",
"true",
"return null;",
"null",
"{\n return br.readLine();\n }",
"return br.readLine();",
"br.readLine()",
"br.readLine",
"br",
"public int nextInt() throws IOException {\n return Integer.parseInt(nextToken());\n }",
"nextInt",
"{\n return Integer.parseInt(nextToken());\n }",
"return Integer.parseInt(nextToken());",
"Integer.parseInt(nextToken())",
"Integer.parseInt",
"Integer",
"nextToken()",
"nextToken",
"public long nextLong() throws IOException {\n return Long.parseLong(nextToken());\n }",
"nextLong",
"{\n return Long.parseLong(nextToken());\n }",
"return Long.parseLong(nextToken());",
"Long.parseLong(nextToken())",
"Long.parseLong",
"Long",
"nextToken()",
"nextToken",
"public double nextDouble() throws IOException {\n return Double.parseDouble(nextToken());\n }",
"nextDouble",
"{\n return Double.parseDouble(nextToken());\n }",
"return Double.parseDouble(nextToken());",
"Double.parseDouble(nextToken())",
"Double.parseDouble",
"Double",
"nextToken()",
"nextToken",
"public class Main {\n\n BufferedReader br;\n PrintWriter out;\n StringTokenizer st;\n boolean eof;\n final long MOD = 1000L * 1000L * 1000L + 7;\n private static final int[] dx = {0, -1, 0, 1};\n private static final int[] dy = {1, 0, -1, 0};\n\n void solve() throws IOException {\n int n = nextInt();\n int k = nextInt();\n int res = 0;\n int[] arr = nextIntArr(n);\n Arrays.sort(arr);\n for (int i = 0; i < k; i++) {\n res += arr[i];\n }\n outln(res);\n }\n\n void shuffle(int[] a) {\n int n = a.length;\n for(int i = 0; i < n; i++) {\n int r = i + (int) (Math.random() * (n - i));\n int tmp = a[i];\n a[i] = a[r];\n a[r] = tmp;\n }\n }\n private void outln(Object o) {\n out.println(o);\n }\n private void out(Object o) {\n out.print(o);\n }\n public Main() throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n out.close();\n }\n public static void main(String[] args) throws IOException {\n new Main();\n }\n\n public long[] nextLongArr(int n) throws IOException{\n long[] res = new long[n];\n for(int i = 0; i < n; i++)\n res[i] = nextLong();\n return res;\n }\n public int[] nextIntArr(int n) throws IOException {\n int[] res = new int[n];\n for(int i = 0; i < n; i++)\n res[i] = nextInt();\n return res;\n }\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n eof = true;\n return null;\n }\n }\n return st.nextToken();\n }\n public String nextString() {\n try {\n return br.readLine();\n } catch (IOException e) {\n eof = true;\n return null;\n }\n }\n public int nextInt() throws IOException {\n return Integer.parseInt(nextToken());\n }\n public long nextLong() throws IOException {\n return Long.parseLong(nextToken());\n }\n public double nextDouble() throws IOException {\n return Double.parseDouble(nextToken());\n }\n}",
"public class Main {\n\n BufferedReader br;\n PrintWriter out;\n StringTokenizer st;\n boolean eof;\n final long MOD = 1000L * 1000L * 1000L + 7;\n private static final int[] dx = {0, -1, 0, 1};\n private static final int[] dy = {1, 0, -1, 0};\n\n void solve() throws IOException {\n int n = nextInt();\n int k = nextInt();\n int res = 0;\n int[] arr = nextIntArr(n);\n Arrays.sort(arr);\n for (int i = 0; i < k; i++) {\n res += arr[i];\n }\n outln(res);\n }\n\n void shuffle(int[] a) {\n int n = a.length;\n for(int i = 0; i < n; i++) {\n int r = i + (int) (Math.random() * (n - i));\n int tmp = a[i];\n a[i] = a[r];\n a[r] = tmp;\n }\n }\n private void outln(Object o) {\n out.println(o);\n }\n private void out(Object o) {\n out.print(o);\n }\n public Main() throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n out = new PrintWriter(System.out);\n solve();\n out.close();\n }\n public static void main(String[] args) throws IOException {\n new Main();\n }\n\n public long[] nextLongArr(int n) throws IOException{\n long[] res = new long[n];\n for(int i = 0; i < n; i++)\n res[i] = nextLong();\n return res;\n }\n public int[] nextIntArr(int n) throws IOException {\n int[] res = new int[n];\n for(int i = 0; i < n; i++)\n res[i] = nextInt();\n return res;\n }\n public String nextToken() {\n while (st == null || !st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n eof = true;\n return null;\n }\n }\n return st.nextToken();\n }\n public String nextString() {\n try {\n return br.readLine();\n } catch (IOException e) {\n eof = true;\n return null;\n }\n }\n public int nextInt() throws IOException {\n return Integer.parseInt(nextToken());\n }\n public long nextLong() throws IOException {\n return Long.parseLong(nextToken());\n }\n public double nextDouble() throws IOException {\n return Double.parseDouble(nextToken());\n }\n}",
"Main"
]
| import java.util.*;
import java.io.*;
// Template for atcoder
public class Main {
BufferedReader br;
PrintWriter out;
StringTokenizer st;
boolean eof;
final long MOD = 1000L * 1000L * 1000L + 7;
private static final int[] dx = {0, -1, 0, 1};
private static final int[] dy = {1, 0, -1, 0};
void solve() throws IOException {
int n = nextInt();
int k = nextInt();
int res = 0;
int[] arr = nextIntArr(n);
Arrays.sort(arr);
for (int i = 0; i < k; i++) {
res += arr[i];
}
outln(res);
}
void shuffle(int[] a) {
int n = a.length;
for(int i = 0; i < n; i++) {
int r = i + (int) (Math.random() * (n - i));
int tmp = a[i];
a[i] = a[r];
a[r] = tmp;
}
}
private void outln(Object o) {
out.println(o);
}
private void out(Object o) {
out.print(o);
}
public Main() throws IOException {
br = new BufferedReader(new InputStreamReader(System.in));
out = new PrintWriter(System.out);
solve();
out.close();
}
public static void main(String[] args) throws IOException {
new Main();
}
public long[] nextLongArr(int n) throws IOException{
long[] res = new long[n];
for(int i = 0; i < n; i++)
res[i] = nextLong();
return res;
}
public int[] nextIntArr(int n) throws IOException {
int[] res = new int[n];
for(int i = 0; i < n; i++)
res[i] = nextInt();
return res;
}
public String nextToken() {
while (st == null || !st.hasMoreTokens()) {
try {
st = new StringTokenizer(br.readLine());
} catch (Exception e) {
eof = true;
return null;
}
}
return st.nextToken();
}
public String nextString() {
try {
return br.readLine();
} catch (IOException e) {
eof = true;
return null;
}
}
public int nextInt() throws IOException {
return Integer.parseInt(nextToken());
}
public long nextLong() throws IOException {
return Long.parseLong(nextToken());
}
public double nextDouble() throws IOException {
return Double.parseDouble(nextToken());
}
}
|
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
85,
8
],
[
85,
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,
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
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
11,
53
],
[
53,
54
],
[
53,
55
],
[
11,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
11,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
9,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
]
| [
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint p[] = new int[N];\n\n\t\tfor(int i = 0;i<N;i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}\n\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\n\t\tfor(int i = 0;i<K;i++) {\n\t\t\tans=ans+p[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\n}",
"import java.util.Arrays;",
"Arrays",
"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\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint p[] = new int[N];\n\n\t\tfor(int i = 0;i<N;i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}\n\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\n\t\tfor(int i = 0;i<K;i++) {\n\t\t\tans=ans+p[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint p[] = new int[N];\n\n\t\tfor(int i = 0;i<N;i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}\n\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\n\t\tfor(int i = 0;i<K;i++) {\n\t\t\tans=ans+p[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint p[] = new int[N];\n\n\t\tfor(int i = 0;i<N;i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}\n\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\n\t\tfor(int i = 0;i<K;i++) {\n\t\t\tans=ans+p[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int p[] = new int[N];",
"p",
"new int[N]",
"N",
"for(int i = 0;i<N;i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tp[i]= sc.nextInt();\n\t\t}",
"{\n\t\t\tp[i]= sc.nextInt();\n\t\t}",
"p[i]= sc.nextInt()",
"p[i]",
"p",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"int ans = 0;",
"ans",
"0",
"for(int i = 0;i<K;i++) {\n\t\t\tans=ans+p[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tans=ans+p[i];\n\t\t}",
"{\n\t\t\tans=ans+p[i];\n\t\t}",
"ans=ans+p[i]",
"ans",
"ans+p[i]",
"ans",
"p[i]",
"p",
"i",
"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\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint p[] = new int[N];\n\n\t\tfor(int i = 0;i<N;i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}\n\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\n\t\tfor(int i = 0;i<K;i++) {\n\t\t\tans=ans+p[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint p[] = new int[N];\n\n\t\tfor(int i = 0;i<N;i++) {\n\t\t\tp[i]= sc.nextInt();\n\t\t}\n\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\n\t\tfor(int i = 0;i<K;i++) {\n\t\t\tans=ans+p[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\n\n}",
"Main"
]
| import java.util.Arrays;
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 K = sc.nextInt();
int p[] = new int[N];
for(int i = 0;i<N;i++) {
p[i]= sc.nextInt();
}
Arrays.sort(p);
int ans = 0;
for(int i = 0;i<K;i++) {
ans=ans+p[i];
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
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,
18,
13,
13,
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
],
[
12,
14
],
[
15,
16
],
[
16,
17
],
[
8,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
8,
23
],
[
23,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
23,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
30,
32
],
[
23,
33
],
[
33,
34
],
[
34,
35
],
[
23,
36
],
[
37,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
43,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
8,
49
],
[
49,
50
],
[
49,
51
],
[
8,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
67,
69
],
[
8,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
6,
76
],
[
76,
77
],
[
0,
78
],
[
78,
79
],
[
78,
80
]
]
| [
"import java.util.*;\npublic class Main {\n\n public static void main(String[] args) {\n Scanner yomi = new Scanner(System.in);\n int[] n = new int[yomi.nextInt()];\n int k = yomi.nextInt();\n for (int i=0;i<n.length;i++){\n n[i] = yomi.nextInt();\n }\n Arrays.sort(n);\n int goukei = 0;\n for (int i=0;i<k;i++){\n goukei += n[i];\n }\n System.out.println(goukei);\n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n public static void main(String[] args) {\n Scanner yomi = new Scanner(System.in);\n int[] n = new int[yomi.nextInt()];\n int k = yomi.nextInt();\n for (int i=0;i<n.length;i++){\n n[i] = yomi.nextInt();\n }\n Arrays.sort(n);\n int goukei = 0;\n for (int i=0;i<k;i++){\n goukei += n[i];\n }\n System.out.println(goukei);\n }\n\n}",
"Main",
"public static void main(String[] args) {\n Scanner yomi = new Scanner(System.in);\n int[] n = new int[yomi.nextInt()];\n int k = yomi.nextInt();\n for (int i=0;i<n.length;i++){\n n[i] = yomi.nextInt();\n }\n Arrays.sort(n);\n int goukei = 0;\n for (int i=0;i<k;i++){\n goukei += n[i];\n }\n System.out.println(goukei);\n }",
"main",
"{\n Scanner yomi = new Scanner(System.in);\n int[] n = new int[yomi.nextInt()];\n int k = yomi.nextInt();\n for (int i=0;i<n.length;i++){\n n[i] = yomi.nextInt();\n }\n Arrays.sort(n);\n int goukei = 0;\n for (int i=0;i<k;i++){\n goukei += n[i];\n }\n System.out.println(goukei);\n }",
"Scanner yomi = new Scanner(System.in);",
"yomi",
"new Scanner(System.in)",
"int[] n = new int[yomi.nextInt()];",
"n",
"new int[yomi.nextInt()]",
"yomi.nextInt()",
"yomi.nextInt",
"yomi",
"int k = yomi.nextInt();",
"k",
"yomi.nextInt()",
"yomi.nextInt",
"yomi",
"for (int i=0;i<n.length;i++){\n n[i] = yomi.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n.length",
"i",
"n.length",
"n",
"n.length",
"i++",
"i++",
"i",
"{\n n[i] = yomi.nextInt();\n }",
"{\n n[i] = yomi.nextInt();\n }",
"n[i] = yomi.nextInt()",
"n[i]",
"n",
"i",
"yomi.nextInt()",
"yomi.nextInt",
"yomi",
"Arrays.sort(n)",
"Arrays.sort",
"Arrays",
"n",
"int goukei = 0;",
"goukei",
"0",
"for (int i=0;i<k;i++){\n goukei += n[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n goukei += n[i];\n }",
"{\n goukei += n[i];\n }",
"goukei += n[i]",
"goukei",
"n[i]",
"n",
"i",
"System.out.println(goukei)",
"System.out.println",
"System.out",
"System",
"System.out",
"goukei",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner yomi = new Scanner(System.in);\n int[] n = new int[yomi.nextInt()];\n int k = yomi.nextInt();\n for (int i=0;i<n.length;i++){\n n[i] = yomi.nextInt();\n }\n Arrays.sort(n);\n int goukei = 0;\n for (int i=0;i<k;i++){\n goukei += n[i];\n }\n System.out.println(goukei);\n }\n\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner yomi = new Scanner(System.in);\n int[] n = new int[yomi.nextInt()];\n int k = yomi.nextInt();\n for (int i=0;i<n.length;i++){\n n[i] = yomi.nextInt();\n }\n Arrays.sort(n);\n int goukei = 0;\n for (int i=0;i<k;i++){\n goukei += n[i];\n }\n System.out.println(goukei);\n }\n\n}",
"Main"
]
| import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner yomi = new Scanner(System.in);
int[] n = new int[yomi.nextInt()];
int k = yomi.nextInt();
for (int i=0;i<n.length;i++){
n[i] = yomi.nextInt();
}
Arrays.sort(n);
int goukei = 0;
for (int i=0;i<k;i++){
goukei += n[i];
}
System.out.println(goukei);
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
20,
4,
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,
18,
13,
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
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
8,
18
],
[
18,
19
],
[
18,
20
],
[
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
],
[
36,
37
],
[
36,
38
],
[
35,
39
],
[
8,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
8,
44
],
[
44,
45
],
[
44,
46
],
[
8,
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
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
6,
71
],
[
71,
72
],
[
0,
73
],
[
73,
74
],
[
73,
75
]
]
| [
"import java.util.*;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\t// 入力\n\t\tScanner sc = new Scanner(System.in);\n\t\tInteger n = new Integer(Integer.parseInt(sc.next())); // 品物の種類数\n\t\tInteger k = new Integer(Integer.parseInt(sc.next())); // 何個買うか\n\t\tInteger x[] = new Integer[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tx[i] = new Integer(Integer.parseInt(sc.next()));\n\t\t}\n\n\t\t// ソート\n\t\tArrays.sort(x);\n\n\t\t// 安いものk個を買おう\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tsum += x[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\t// 入力\n\t\tScanner sc = new Scanner(System.in);\n\t\tInteger n = new Integer(Integer.parseInt(sc.next())); // 品物の種類数\n\t\tInteger k = new Integer(Integer.parseInt(sc.next())); // 何個買うか\n\t\tInteger x[] = new Integer[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tx[i] = new Integer(Integer.parseInt(sc.next()));\n\t\t}\n\n\t\t// ソート\n\t\tArrays.sort(x);\n\n\t\t// 安いものk個を買おう\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tsum += x[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\t// 入力\n\t\tScanner sc = new Scanner(System.in);\n\t\tInteger n = new Integer(Integer.parseInt(sc.next())); // 品物の種類数\n\t\tInteger k = new Integer(Integer.parseInt(sc.next())); // 何個買うか\n\t\tInteger x[] = new Integer[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tx[i] = new Integer(Integer.parseInt(sc.next()));\n\t\t}\n\n\t\t// ソート\n\t\tArrays.sort(x);\n\n\t\t// 安いものk個を買おう\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tsum += x[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}",
"main",
"{\n\n\t\t// 入力\n\t\tScanner sc = new Scanner(System.in);\n\t\tInteger n = new Integer(Integer.parseInt(sc.next())); // 品物の種類数\n\t\tInteger k = new Integer(Integer.parseInt(sc.next())); // 何個買うか\n\t\tInteger x[] = new Integer[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tx[i] = new Integer(Integer.parseInt(sc.next()));\n\t\t}\n\n\t\t// ソート\n\t\tArrays.sort(x);\n\n\t\t// 安いものk個を買おう\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tsum += x[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"Integer n = new Integer(Integer.parseInt(sc.next()));",
"n",
"new Integer(Integer.parseInt(sc.next()))",
"Integer k = new Integer(Integer.parseInt(sc.next()));",
"k",
"new Integer(Integer.parseInt(sc.next()))",
"Integer x[] = new Integer[n];",
"x",
"new Integer[n]",
"n",
"for (int i = 0; i < n; i++) {\n\t\t\tx[i] = new Integer(Integer.parseInt(sc.next()));\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tx[i] = new Integer(Integer.parseInt(sc.next()));\n\t\t}",
"{\n\t\t\tx[i] = new Integer(Integer.parseInt(sc.next()));\n\t\t}",
"x[i] = new Integer(Integer.parseInt(sc.next()))",
"x[i]",
"x",
"i",
"new Integer(Integer.parseInt(sc.next()))",
"Arrays.sort(x)",
"Arrays.sort",
"Arrays",
"x",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < k; i++) {\n\t\t\tsum += x[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tsum += x[i];\n\t\t}",
"{\n\t\t\tsum += x[i];\n\t\t}",
"sum += x[i]",
"sum",
"x[i]",
"x",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\t// 入力\n\t\tScanner sc = new Scanner(System.in);\n\t\tInteger n = new Integer(Integer.parseInt(sc.next())); // 品物の種類数\n\t\tInteger k = new Integer(Integer.parseInt(sc.next())); // 何個買うか\n\t\tInteger x[] = new Integer[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tx[i] = new Integer(Integer.parseInt(sc.next()));\n\t\t}\n\n\t\t// ソート\n\t\tArrays.sort(x);\n\n\t\t// 安いものk個を買おう\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tsum += x[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\t// 入力\n\t\tScanner sc = new Scanner(System.in);\n\t\tInteger n = new Integer(Integer.parseInt(sc.next())); // 品物の種類数\n\t\tInteger k = new Integer(Integer.parseInt(sc.next())); // 何個買うか\n\t\tInteger x[] = new Integer[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tx[i] = new Integer(Integer.parseInt(sc.next()));\n\t\t}\n\n\t\t// ソート\n\t\tArrays.sort(x);\n\n\t\t// 安いものk個を買おう\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tsum += x[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n}",
"Main"
]
| import java.util.*;
public class Main {
public static void main(String[] args) {
// 入力
Scanner sc = new Scanner(System.in);
Integer n = new Integer(Integer.parseInt(sc.next())); // 品物の種類数
Integer k = new Integer(Integer.parseInt(sc.next())); // 何個買うか
Integer x[] = new Integer[n];
for (int i = 0; i < n; i++) {
x[i] = new Integer(Integer.parseInt(sc.next()));
}
// ソート
Arrays.sort(x);
// 安いものk個を買おう
int sum = 0;
for (int i = 0; i < k; i++) {
sum += x[i];
}
System.out.println(sum);
}
} |
[
7,
15,
13,
17,
6,
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,
41,
13,
13,
41,
13,
13,
41,
13,
18,
13,
2,
2,
13,
13,
17,
42,
2,
13,
13,
30,
42,
2,
18,
13,
13,
13,
40,
13,
42,
2,
18,
13,
13,
13,
40,
13,
14,
2,
13,
13,
4,
13,
13,
40,
13,
40,
13,
14,
2,
13,
13,
4,
13,
13,
13,
13,
14,
2,
13,
13,
4,
13,
13,
13,
13,
23,
13,
23,
13,
23,
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,
4,
13,
13,
17,
2,
13,
17,
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,
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
],
[
11,
12
],
[
11,
13
],
[
8,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
8,
21
],
[
21,
22
],
[
22,
23
],
[
22,
24
],
[
21,
25
],
[
6,
26
],
[
26,
27
],
[
6,
28
],
[
28,
29
],
[
6,
30
],
[
30,
31
],
[
4,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
38,
40
],
[
34,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
45,
49
],
[
34,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
55,
61
],
[
61,
62
],
[
54,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
63,
69
],
[
69,
70
],
[
54,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
75,
76
],
[
75,
77
],
[
75,
78
],
[
78,
79
],
[
75,
80
],
[
80,
81
],
[
34,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
86,
88
],
[
86,
89
],
[
86,
90
],
[
34,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
95,
96
],
[
95,
97
],
[
95,
98
],
[
95,
99
],
[
32,
100
],
[
100,
101
],
[
32,
102
],
[
102,
103
],
[
32,
104
],
[
104,
105
],
[
4,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
108,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
108,
122
],
[
122,
123
],
[
122,
124
],
[
108,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
126,
131
],
[
131,
132
],
[
131,
133
],
[
126,
134
],
[
134,
135
],
[
135,
136
],
[
126,
137
],
[
138,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
143,
144
],
[
144,
145
],
[
108,
146
],
[
146,
147
],
[
146,
148
],
[
146,
149
],
[
146,
150
],
[
150,
151
],
[
150,
152
],
[
108,
153
],
[
153,
154
],
[
153,
155
],
[
108,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
158,
160
],
[
156,
161
],
[
161,
162
],
[
161,
163
],
[
156,
164
],
[
164,
165
],
[
165,
166
],
[
156,
167
],
[
168,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
171,
172
],
[
171,
173
],
[
108,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
176,
178
],
[
174,
179
],
[
106,
180
],
[
180,
181
]
]
| [
"import java.util.Scanner;\n\nclass Main{\n static void swap(int[] a, int idx1, int idx2){\n int t = a[idx1]; a[idx1] = a[idx2]; a[idx2] = t;\n }\n\n static void quickSort(int[] a, int left, int right){\n int pl = left;\n int pr = right;\n int x = a[(pl+pr)/2];\n\n do{\n while (a[pl] < x) pl++;\n while (a[pr] > x) pr--;\n if(pl <= pr)\n swap(a, pl++, pr--);\n }while(pl <= pr);\n\n if(left < pr) quickSort(a,left,pr);\n if(pl < right) quickSort(a,pl,right);\n }\n \n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for(int i =0; i<N;i++){\n p[i] = sc.nextInt();\n }\n \n quickSort(p,0,N-1);\n \n int sum = 0;\n for(int i = 0; i<K; i++){\n sum += p[i];\n }\n System.out.println(sum);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main{\n static void swap(int[] a, int idx1, int idx2){\n int t = a[idx1]; a[idx1] = a[idx2]; a[idx2] = t;\n }\n\n static void quickSort(int[] a, int left, int right){\n int pl = left;\n int pr = right;\n int x = a[(pl+pr)/2];\n\n do{\n while (a[pl] < x) pl++;\n while (a[pr] > x) pr--;\n if(pl <= pr)\n swap(a, pl++, pr--);\n }while(pl <= pr);\n\n if(left < pr) quickSort(a,left,pr);\n if(pl < right) quickSort(a,pl,right);\n }\n \n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for(int i =0; i<N;i++){\n p[i] = sc.nextInt();\n }\n \n quickSort(p,0,N-1);\n \n int sum = 0;\n for(int i = 0; i<K; i++){\n sum += p[i];\n }\n System.out.println(sum);\n }\n}",
"Main",
"static void swap(int[] a, int idx1, int idx2){\n int t = a[idx1]; a[idx1] = a[idx2]; a[idx2] = t;\n }",
"swap",
"{\n int t = a[idx1]; a[idx1] = a[idx2]; a[idx2] = t;\n }",
"int t = a[idx1];",
"t",
"a[idx1]",
"a",
"idx1",
"a[idx1] = a[idx2]",
"a[idx1]",
"a",
"idx1",
"a[idx2]",
"a",
"idx2",
"a[idx2] = t",
"a[idx2]",
"a",
"idx2",
"t",
"int[] a",
"a",
"int idx1",
"idx1",
"int idx2",
"idx2",
"static void quickSort(int[] a, int left, int right){\n int pl = left;\n int pr = right;\n int x = a[(pl+pr)/2];\n\n do{\n while (a[pl] < x) pl++;\n while (a[pr] > x) pr--;\n if(pl <= pr)\n swap(a, pl++, pr--);\n }while(pl <= pr);\n\n if(left < pr) quickSort(a,left,pr);\n if(pl < right) quickSort(a,pl,right);\n }",
"quickSort",
"{\n int pl = left;\n int pr = right;\n int x = a[(pl+pr)/2];\n\n do{\n while (a[pl] < x) pl++;\n while (a[pr] > x) pr--;\n if(pl <= pr)\n swap(a, pl++, pr--);\n }while(pl <= pr);\n\n if(left < pr) quickSort(a,left,pr);\n if(pl < right) quickSort(a,pl,right);\n }",
"int pl = left;",
"pl",
"left",
"int pr = right;",
"pr",
"right",
"int x = a[(pl+pr)/2];",
"x",
"a[(pl+pr)/2]",
"a",
"(pl+pr)/2",
"(pl+pr)",
"pl",
"pr",
"2",
"do{\n while (a[pl] < x) pl++;\n while (a[pr] > x) pr--;\n if(pl <= pr)\n swap(a, pl++, pr--);\n }while(pl <= pr);",
"pl <= pr",
"pl",
"pr",
"{\n while (a[pl] < x) pl++;\n while (a[pr] > x) pr--;\n if(pl <= pr)\n swap(a, pl++, pr--);\n }",
"while (a[pl] < x) pl++;",
"a[pl] < x",
"a[pl]",
"a",
"pl",
"x",
"pl++",
"pl",
"while (a[pr] > x) pr--;",
"a[pr] > x",
"a[pr]",
"a",
"pr",
"x",
"pr--",
"pr",
"if(pl <= pr)\n swap(a, pl++, pr--);",
"pl <= pr",
"pl",
"pr",
"swap(a, pl++, pr--)",
"swap",
"a",
"pl++",
"pl",
"pr--",
"pr",
"if(left < pr) quickSort(a,left,pr);",
"left < pr",
"left",
"pr",
"quickSort(a,left,pr)",
"quickSort",
"a",
"left",
"pr",
"if(pl < right) quickSort(a,pl,right);",
"pl < right",
"pl",
"right",
"quickSort(a,pl,right)",
"quickSort",
"a",
"pl",
"right",
"int[] a",
"a",
"int left",
"left",
"int right",
"right",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for(int i =0; i<N;i++){\n p[i] = sc.nextInt();\n }\n \n quickSort(p,0,N-1);\n \n int sum = 0;\n for(int i = 0; i<K; i++){\n sum += p[i];\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] p = new int[N];\n for(int i =0; i<N;i++){\n p[i] = sc.nextInt();\n }\n \n quickSort(p,0,N-1);\n \n int sum = 0;\n for(int i = 0; i<K; i++){\n sum += p[i];\n }\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] p = new int[N];",
"p",
"new int[N]",
"N",
"for(int i =0; i<N;i++){\n p[i] = sc.nextInt();\n }",
"int i =0;",
"int i =0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n p[i] = sc.nextInt();\n }",
"{\n p[i] = sc.nextInt();\n }",
"p[i] = sc.nextInt()",
"p[i]",
"p",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"quickSort(p,0,N-1)",
"quickSort",
"p",
"0",
"N-1",
"N",
"1",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i<K; i++){\n sum += p[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n sum += p[i];\n }",
"{\n sum += p[i];\n }",
"sum += p[i]",
"sum",
"p[i]",
"p",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args"
]
| import java.util.Scanner;
class Main{
static void swap(int[] a, int idx1, int idx2){
int t = a[idx1]; a[idx1] = a[idx2]; a[idx2] = t;
}
static void quickSort(int[] a, int left, int right){
int pl = left;
int pr = right;
int x = a[(pl+pr)/2];
do{
while (a[pl] < x) pl++;
while (a[pr] > x) pr--;
if(pl <= pr)
swap(a, pl++, pr--);
}while(pl <= pr);
if(left < pr) quickSort(a,left,pr);
if(pl < right) quickSort(a,pl,right);
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int K = sc.nextInt();
int[] p = new int[N];
for(int i =0; i<N;i++){
p[i] = sc.nextInt();
}
quickSort(p,0,N-1);
int sum = 0;
for(int i = 0; i<K; i++){
sum += p[i];
}
System.out.println(sum);
}
} |
[
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,
4,
18,
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,
4,
18,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
41,
13,
20,
4,
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
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
102,
11
],
[
102,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
15,
17
],
[
14,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
20,
23
],
[
23,
24
],
[
24,
25
],
[
14,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
31,
32
],
[
32,
33
],
[
14,
34
],
[
34,
35
],
[
34,
36
],
[
14,
38
],
[
38,
39
],
[
38,
40
],
[
14,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
41,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
61,
62
],
[
62,
63
],
[
14,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
14,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
68,
79
],
[
80,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
14,
86
],
[
86,
87
],
[
86,
88
],
[
14,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
14,
93
],
[
93,
94
],
[
94,
95
],
[
14,
96
],
[
96,
97
],
[
97,
98
],
[
12,
99
],
[
99,
100
],
[
0,
101
],
[
101,
102
],
[
101,
103
]
]
| [
"import java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.next());\n int K = Integer.parseInt(sc.next());\n int p[] = new int[N];\n int kakaku = 0;\n\n for (int i = 0; i < N; i++) {\n p[i] = Integer.parseInt(sc.next());\n }\n\n Arrays.sort(p);\n\n for (int i = 0; i < K; i++) {\n kakaku += p[i];\n }\n\n PrintWriter out = new PrintWriter(System.out);\n out.println(kakaku);\n\n sc.close();\n out.flush();\n }\n}",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Arrays;",
"Arrays",
"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 int N = Integer.parseInt(sc.next());\n int K = Integer.parseInt(sc.next());\n int p[] = new int[N];\n int kakaku = 0;\n\n for (int i = 0; i < N; i++) {\n p[i] = Integer.parseInt(sc.next());\n }\n\n Arrays.sort(p);\n\n for (int i = 0; i < K; i++) {\n kakaku += p[i];\n }\n\n PrintWriter out = new PrintWriter(System.out);\n out.println(kakaku);\n\n sc.close();\n out.flush();\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.next());\n int K = Integer.parseInt(sc.next());\n int p[] = new int[N];\n int kakaku = 0;\n\n for (int i = 0; i < N; i++) {\n p[i] = Integer.parseInt(sc.next());\n }\n\n Arrays.sort(p);\n\n for (int i = 0; i < K; i++) {\n kakaku += p[i];\n }\n\n PrintWriter out = new PrintWriter(System.out);\n out.println(kakaku);\n\n sc.close();\n out.flush();\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.next());\n int K = Integer.parseInt(sc.next());\n int p[] = new int[N];\n int kakaku = 0;\n\n for (int i = 0; i < N; i++) {\n p[i] = Integer.parseInt(sc.next());\n }\n\n Arrays.sort(p);\n\n for (int i = 0; i < K; i++) {\n kakaku += p[i];\n }\n\n PrintWriter out = new PrintWriter(System.out);\n out.println(kakaku);\n\n sc.close();\n out.flush();\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 K = Integer.parseInt(sc.next());",
"K",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int p[] = new int[N];",
"p",
"new int[N]",
"N",
"int kakaku = 0;",
"kakaku",
"0",
"for (int i = 0; i < N; i++) {\n p[i] = Integer.parseInt(sc.next());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n p[i] = Integer.parseInt(sc.next());\n }",
"{\n p[i] = Integer.parseInt(sc.next());\n }",
"p[i] = Integer.parseInt(sc.next())",
"p[i]",
"p",
"i",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"for (int i = 0; i < K; i++) {\n kakaku += p[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < K",
"i",
"K",
"i++",
"i++",
"i",
"{\n kakaku += p[i];\n }",
"{\n kakaku += p[i];\n }",
"kakaku += p[i]",
"kakaku",
"p[i]",
"p",
"i",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"out.println(kakaku)",
"out.println",
"out",
"kakaku",
"sc.close()",
"sc.close",
"sc",
"out.flush()",
"out.flush",
"out",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.next());\n int K = Integer.parseInt(sc.next());\n int p[] = new int[N];\n int kakaku = 0;\n\n for (int i = 0; i < N; i++) {\n p[i] = Integer.parseInt(sc.next());\n }\n\n Arrays.sort(p);\n\n for (int i = 0; i < K; i++) {\n kakaku += p[i];\n }\n\n PrintWriter out = new PrintWriter(System.out);\n out.println(kakaku);\n\n sc.close();\n out.flush();\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = Integer.parseInt(sc.next());\n int K = Integer.parseInt(sc.next());\n int p[] = new int[N];\n int kakaku = 0;\n\n for (int i = 0; i < N; i++) {\n p[i] = Integer.parseInt(sc.next());\n }\n\n Arrays.sort(p);\n\n for (int i = 0; i < K; i++) {\n kakaku += p[i];\n }\n\n PrintWriter out = new PrintWriter(System.out);\n out.println(kakaku);\n\n sc.close();\n out.flush();\n }\n}",
"Main"
]
| import java.io.PrintWriter;
import java.util.Arrays;
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 K = Integer.parseInt(sc.next());
int p[] = new int[N];
int kakaku = 0;
for (int i = 0; i < N; i++) {
p[i] = Integer.parseInt(sc.next());
}
Arrays.sort(p);
for (int i = 0; i < K; i++) {
kakaku += p[i];
}
PrintWriter out = new PrintWriter(System.out);
out.println(kakaku);
sc.close();
out.flush();
}
} |
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
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,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
83,
8
],
[
83,
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,
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
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
11,
53
],
[
53,
54
],
[
53,
55
],
[
11,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
11,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
9,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
]
| [
"import java.util.Arrays;\nimport 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 k = sc.nextInt();\n int[] fluitArray = new int[n];\n for (int i = 0; i < n; i++) {\n fluitArray[i] = sc.nextInt();\n }\n Arrays.sort(fluitArray);\n int result = 0;\n for(int i = 0; i<k; i++) {\n result += fluitArray[i];\n }\n System.out.println(result);\n }\n}",
"import java.util.Arrays;",
"Arrays",
"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 int n = sc.nextInt();\n int k = sc.nextInt();\n int[] fluitArray = new int[n];\n for (int i = 0; i < n; i++) {\n fluitArray[i] = sc.nextInt();\n }\n Arrays.sort(fluitArray);\n int result = 0;\n for(int i = 0; i<k; i++) {\n result += fluitArray[i];\n }\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 k = sc.nextInt();\n int[] fluitArray = new int[n];\n for (int i = 0; i < n; i++) {\n fluitArray[i] = sc.nextInt();\n }\n Arrays.sort(fluitArray);\n int result = 0;\n for(int i = 0; i<k; i++) {\n result += fluitArray[i];\n }\n System.out.println(result);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int[] fluitArray = new int[n];\n for (int i = 0; i < n; i++) {\n fluitArray[i] = sc.nextInt();\n }\n Arrays.sort(fluitArray);\n int result = 0;\n for(int i = 0; i<k; i++) {\n result += fluitArray[i];\n }\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 k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] fluitArray = new int[n];",
"fluitArray",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n fluitArray[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n fluitArray[i] = sc.nextInt();\n }",
"{\n fluitArray[i] = sc.nextInt();\n }",
"fluitArray[i] = sc.nextInt()",
"fluitArray[i]",
"fluitArray",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(fluitArray)",
"Arrays.sort",
"Arrays",
"fluitArray",
"int result = 0;",
"result",
"0",
"for(int i = 0; i<k; i++) {\n result += fluitArray[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n result += fluitArray[i];\n }",
"{\n result += fluitArray[i];\n }",
"result += fluitArray[i]",
"result",
"fluitArray[i]",
"fluitArray",
"i",
"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 k = sc.nextInt();\n int[] fluitArray = new int[n];\n for (int i = 0; i < n; i++) {\n fluitArray[i] = sc.nextInt();\n }\n Arrays.sort(fluitArray);\n int result = 0;\n for(int i = 0; i<k; i++) {\n result += fluitArray[i];\n }\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 k = sc.nextInt();\n int[] fluitArray = new int[n];\n for (int i = 0; i < n; i++) {\n fluitArray[i] = sc.nextInt();\n }\n Arrays.sort(fluitArray);\n int result = 0;\n for(int i = 0; i<k; i++) {\n result += fluitArray[i];\n }\n System.out.println(result);\n }\n}",
"Main"
]
| import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int[] fluitArray = new int[n];
for (int i = 0; i < n; i++) {
fluitArray[i] = sc.nextInt();
}
Arrays.sort(fluitArray);
int result = 0;
for(int i = 0; i<k; i++) {
result += fluitArray[i];
}
System.out.println(result);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
17,
41,
13,
41,
13,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
20,
13,
14,
2,
13,
13,
30,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
13,
11,
1,
0,
13,
2,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
18,
13,
13,
0,
13,
13,
0,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
11,
19
],
[
19,
20
],
[
11,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
11,
28
],
[
28,
29
],
[
11,
30
],
[
30,
31
],
[
11,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
11,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
11,
42
],
[
42,
43
],
[
42,
44
],
[
11,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
63,
67
],
[
67,
68
],
[
68,
69
],
[
50,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
75,
76
],
[
75,
77
],
[
70,
78
],
[
78,
79
],
[
79,
80
],
[
70,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
82,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
86,
93
],
[
93,
94
],
[
93,
95
],
[
86,
96
],
[
96,
97
],
[
97,
98
],
[
86,
99
],
[
100,
100
],
[
100,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
106,
108
],
[
101,
109
],
[
109,
110
],
[
109,
111
],
[
82,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
82,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
117,
121
],
[
121,
122
],
[
121,
123
],
[
82,
124
],
[
124,
125
],
[
125,
126
],
[
125,
127
],
[
124,
128
],
[
50,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
129,
134
],
[
134,
135
],
[
134,
136
],
[
129,
137
],
[
137,
138
],
[
138,
139
],
[
129,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
143,
144
],
[
143,
145
],
[
50,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
146,
151
],
[
9,
152
],
[
152,
153
]
]
| [
"import java.util.*;\nimport java.io.*;\nclass Main\n{\n public static void main(String args[])throws IOException\n {\n Scanner obj=new Scanner(System.in);\n int N,i,min,j,temp,tot=0;\n int p[],k;\n N=obj.nextInt();\n k=obj.nextInt();\n p=new int[N];\n if(N>=k)\n {\n for(i=0;i<N;i++)\n p[i]=obj.nextInt();\n for(i=0;i<N;i++)\n {\n min=i;\n for(j=i+1;j<N;j++)\n {\n if(p[j]<p[min])\n min=j;\n }\n temp=p[i];\n p[i]=p[min];\n p[min]=temp;\n }\n for(i=0;i<k;i++)\n tot+=p[i];\n System.out.println(tot);\n }\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 Scanner obj=new Scanner(System.in);\n int N,i,min,j,temp,tot=0;\n int p[],k;\n N=obj.nextInt();\n k=obj.nextInt();\n p=new int[N];\n if(N>=k)\n {\n for(i=0;i<N;i++)\n p[i]=obj.nextInt();\n for(i=0;i<N;i++)\n {\n min=i;\n for(j=i+1;j<N;j++)\n {\n if(p[j]<p[min])\n min=j;\n }\n temp=p[i];\n p[i]=p[min];\n p[min]=temp;\n }\n for(i=0;i<k;i++)\n tot+=p[i];\n System.out.println(tot);\n }\n }\n}",
"Main",
"public static void main(String args[])throws IOException\n {\n Scanner obj=new Scanner(System.in);\n int N,i,min,j,temp,tot=0;\n int p[],k;\n N=obj.nextInt();\n k=obj.nextInt();\n p=new int[N];\n if(N>=k)\n {\n for(i=0;i<N;i++)\n p[i]=obj.nextInt();\n for(i=0;i<N;i++)\n {\n min=i;\n for(j=i+1;j<N;j++)\n {\n if(p[j]<p[min])\n min=j;\n }\n temp=p[i];\n p[i]=p[min];\n p[min]=temp;\n }\n for(i=0;i<k;i++)\n tot+=p[i];\n System.out.println(tot);\n }\n }",
"main",
"{\n Scanner obj=new Scanner(System.in);\n int N,i,min,j,temp,tot=0;\n int p[],k;\n N=obj.nextInt();\n k=obj.nextInt();\n p=new int[N];\n if(N>=k)\n {\n for(i=0;i<N;i++)\n p[i]=obj.nextInt();\n for(i=0;i<N;i++)\n {\n min=i;\n for(j=i+1;j<N;j++)\n {\n if(p[j]<p[min])\n min=j;\n }\n temp=p[i];\n p[i]=p[min];\n p[min]=temp;\n }\n for(i=0;i<k;i++)\n tot+=p[i];\n System.out.println(tot);\n }\n }",
"Scanner obj=new Scanner(System.in);",
"obj",
"new Scanner(System.in)",
"int N",
"N",
"i",
"i",
"min",
"min",
"j",
"j",
"temp",
"temp",
"tot=0;",
"tot",
"0",
"int p[]",
"p",
"k;",
"k",
"N=obj.nextInt()",
"N",
"obj.nextInt()",
"obj.nextInt",
"obj",
"k=obj.nextInt()",
"k",
"obj.nextInt()",
"obj.nextInt",
"obj",
"p=new int[N]",
"p",
"new int[N]",
"N",
"if(N>=k)\n {\n for(i=0;i<N;i++)\n p[i]=obj.nextInt();\n for(i=0;i<N;i++)\n {\n min=i;\n for(j=i+1;j<N;j++)\n {\n if(p[j]<p[min])\n min=j;\n }\n temp=p[i];\n p[i]=p[min];\n p[min]=temp;\n }\n for(i=0;i<k;i++)\n tot+=p[i];\n System.out.println(tot);\n }",
"N>=k",
"N",
"k",
"{\n for(i=0;i<N;i++)\n p[i]=obj.nextInt();\n for(i=0;i<N;i++)\n {\n min=i;\n for(j=i+1;j<N;j++)\n {\n if(p[j]<p[min])\n min=j;\n }\n temp=p[i];\n p[i]=p[min];\n p[min]=temp;\n }\n for(i=0;i<k;i++)\n tot+=p[i];\n System.out.println(tot);\n }",
"for(i=0;i<N;i++)\n p[i]=obj.nextInt();",
"i=0;",
"i=0",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"p[i]=obj.nextInt();",
"p[i]=obj.nextInt()",
"p[i]",
"p",
"i",
"obj.nextInt()",
"obj.nextInt",
"obj",
"for(i=0;i<N;i++)\n {\n min=i;\n for(j=i+1;j<N;j++)\n {\n if(p[j]<p[min])\n min=j;\n }\n temp=p[i];\n p[i]=p[min];\n p[min]=temp;\n }",
"i=0;",
"i=0",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n min=i;\n for(j=i+1;j<N;j++)\n {\n if(p[j]<p[min])\n min=j;\n }\n temp=p[i];\n p[i]=p[min];\n p[min]=temp;\n }",
"{\n min=i;\n for(j=i+1;j<N;j++)\n {\n if(p[j]<p[min])\n min=j;\n }\n temp=p[i];\n p[i]=p[min];\n p[min]=temp;\n }",
"min=i",
"min",
"i",
"for(j=i+1;j<N;j++)\n {\n if(p[j]<p[min])\n min=j;\n }",
"j=i+1;",
"j=i+1",
"j",
"i+1",
"i",
"1",
"j<N",
"j",
"N",
"j++",
"j++",
"j",
"{\n if(p[j]<p[min])\n min=j;\n }",
"{\n if(p[j]<p[min])\n min=j;\n }",
"if(p[j]<p[min])\n min=j;",
"p[j]<p[min]",
"p[j]",
"p",
"j",
"p[min]",
"p",
"min",
"min=j",
"min",
"j",
"temp=p[i]",
"temp",
"p[i]",
"p",
"i",
"p[i]=p[min]",
"p[i]",
"p",
"i",
"p[min]",
"p",
"min",
"p[min]=temp",
"p[min]",
"p",
"min",
"temp",
"for(i=0;i<k;i++)\n tot+=p[i];",
"i=0;",
"i=0",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"tot+=p[i];",
"tot+=p[i]",
"tot",
"p[i]",
"p",
"i",
"System.out.println(tot)",
"System.out.println",
"System.out",
"System",
"System.out",
"tot",
"String args[]",
"args"
]
| import java.util.*;
import java.io.*;
class Main
{
public static void main(String args[])throws IOException
{
Scanner obj=new Scanner(System.in);
int N,i,min,j,temp,tot=0;
int p[],k;
N=obj.nextInt();
k=obj.nextInt();
p=new int[N];
if(N>=k)
{
for(i=0;i<N;i++)
p[i]=obj.nextInt();
for(i=0;i<N;i++)
{
min=i;
for(j=i+1;j<N;j++)
{
if(p[j]<p[min])
min=j;
}
temp=p[i];
p[i]=p[min];
p[min]=temp;
}
for(i=0;i<k;i++)
tot+=p[i];
System.out.println(tot);
}
}
}
|
[
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,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
94,
11
],
[
94,
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
],
[
30,
31
],
[
31,
32
],
[
28,
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
],
[
45,
48
],
[
49,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
14,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
14,
61
],
[
61,
62
],
[
61,
63
],
[
14,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
81,
82
],
[
82,
83
],
[
81,
84
],
[
14,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
12,
91
],
[
91,
92
],
[
0,
93
],
[
93,
94
],
[
93,
95
]
]
| [
"import java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] numList = sc.nextLine().split(\" \");\n String[] priceList = sc.nextLine().split(\" \");\n\n int sumNumber = Integer.parseInt(numList[1]);\n\n //sort priceList by asc\n ArrayList<Integer> priceListAsc = new ArrayList<>();\n for(String str : priceList){\n priceListAsc.add(Integer.parseInt(str));\n }\n\n Collections.sort(priceListAsc);\n int minSum = 0;\n for(int i = 0;i < sumNumber; i++){\n minSum = minSum + priceListAsc.get(i);\n }\n System.out.println(minSum);\n }\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"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 String[] numList = sc.nextLine().split(\" \");\n String[] priceList = sc.nextLine().split(\" \");\n\n int sumNumber = Integer.parseInt(numList[1]);\n\n //sort priceList by asc\n ArrayList<Integer> priceListAsc = new ArrayList<>();\n for(String str : priceList){\n priceListAsc.add(Integer.parseInt(str));\n }\n\n Collections.sort(priceListAsc);\n int minSum = 0;\n for(int i = 0;i < sumNumber; i++){\n minSum = minSum + priceListAsc.get(i);\n }\n System.out.println(minSum);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] numList = sc.nextLine().split(\" \");\n String[] priceList = sc.nextLine().split(\" \");\n\n int sumNumber = Integer.parseInt(numList[1]);\n\n //sort priceList by asc\n ArrayList<Integer> priceListAsc = new ArrayList<>();\n for(String str : priceList){\n priceListAsc.add(Integer.parseInt(str));\n }\n\n Collections.sort(priceListAsc);\n int minSum = 0;\n for(int i = 0;i < sumNumber; i++){\n minSum = minSum + priceListAsc.get(i);\n }\n System.out.println(minSum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String[] numList = sc.nextLine().split(\" \");\n String[] priceList = sc.nextLine().split(\" \");\n\n int sumNumber = Integer.parseInt(numList[1]);\n\n //sort priceList by asc\n ArrayList<Integer> priceListAsc = new ArrayList<>();\n for(String str : priceList){\n priceListAsc.add(Integer.parseInt(str));\n }\n\n Collections.sort(priceListAsc);\n int minSum = 0;\n for(int i = 0;i < sumNumber; i++){\n minSum = minSum + priceListAsc.get(i);\n }\n System.out.println(minSum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] numList = sc.nextLine().split(\" \");",
"numList",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"String[] priceList = sc.nextLine().split(\" \");",
"priceList",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"int sumNumber = Integer.parseInt(numList[1]);",
"sumNumber",
"Integer.parseInt(numList[1])",
"Integer.parseInt",
"Integer",
"numList[1]",
"numList",
"1",
"ArrayList<Integer> priceListAsc = new ArrayList<>();",
"priceListAsc",
"new ArrayList<>()",
"for(String str : priceList){\n priceListAsc.add(Integer.parseInt(str));\n }",
"String str",
"priceList",
"{\n priceListAsc.add(Integer.parseInt(str));\n }",
"{\n priceListAsc.add(Integer.parseInt(str));\n }",
"priceListAsc.add(Integer.parseInt(str))",
"priceListAsc.add",
"priceListAsc",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"Collections.sort(priceListAsc)",
"Collections.sort",
"Collections",
"priceListAsc",
"int minSum = 0;",
"minSum",
"0",
"for(int i = 0;i < sumNumber; i++){\n minSum = minSum + priceListAsc.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < sumNumber",
"i",
"sumNumber",
"i++",
"i++",
"i",
"{\n minSum = minSum + priceListAsc.get(i);\n }",
"{\n minSum = minSum + priceListAsc.get(i);\n }",
"minSum = minSum + priceListAsc.get(i)",
"minSum",
"minSum + priceListAsc.get(i)",
"minSum",
"priceListAsc.get(i)",
"priceListAsc.get",
"priceListAsc",
"i",
"System.out.println(minSum)",
"System.out.println",
"System.out",
"System",
"System.out",
"minSum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] numList = sc.nextLine().split(\" \");\n String[] priceList = sc.nextLine().split(\" \");\n\n int sumNumber = Integer.parseInt(numList[1]);\n\n //sort priceList by asc\n ArrayList<Integer> priceListAsc = new ArrayList<>();\n for(String str : priceList){\n priceListAsc.add(Integer.parseInt(str));\n }\n\n Collections.sort(priceListAsc);\n int minSum = 0;\n for(int i = 0;i < sumNumber; i++){\n minSum = minSum + priceListAsc.get(i);\n }\n System.out.println(minSum);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] numList = sc.nextLine().split(\" \");\n String[] priceList = sc.nextLine().split(\" \");\n\n int sumNumber = Integer.parseInt(numList[1]);\n\n //sort priceList by asc\n ArrayList<Integer> priceListAsc = new ArrayList<>();\n for(String str : priceList){\n priceListAsc.add(Integer.parseInt(str));\n }\n\n Collections.sort(priceListAsc);\n int minSum = 0;\n for(int i = 0;i < sumNumber; i++){\n minSum = minSum + priceListAsc.get(i);\n }\n System.out.println(minSum);\n }\n}",
"Main"
]
| import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] numList = sc.nextLine().split(" ");
String[] priceList = sc.nextLine().split(" ");
int sumNumber = Integer.parseInt(numList[1]);
//sort priceList by asc
ArrayList<Integer> priceListAsc = new ArrayList<>();
for(String str : priceList){
priceListAsc.add(Integer.parseInt(str));
}
Collections.sort(priceListAsc);
int minSum = 0;
for(int i = 0;i < sumNumber; i++){
minSum = minSum + priceListAsc.get(i);
}
System.out.println(minSum);
}
}
|
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
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,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
83,
8
],
[
83,
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,
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
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
11,
53
],
[
53,
54
],
[
53,
55
],
[
11,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
11,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
9,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
]
| [
"import java.util.Scanner;\t//・・・①\nimport java.util.Arrays;\npublic class Main {\n public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\t//・・・②\n // System.out.println(\"何か入力してください。\");\n int N = scanner.nextInt();\t//・・・③\n // System.out.println(\"入力した文字列は \" + string + \" です。\");\n int K = scanner.nextInt();\n // int int3 = scanner.nextInt();\n int[] p = new int[N];\n // ArrayList<Integer> foo = new ArrayList<>();\n\n for(int i=0; i<N; i++){\n p[i] = scanner.nextInt();\n \n }\n Arrays.sort(p);\n int sum=0;\n for(int j=0;j<K;j++){\n sum += p[j];\n }\n System.out.println(sum);\n\n \n }\n}",
"import java.util.Scanner;\t//・・・①",
"Scanner",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"public class Main {\n public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\t//・・・②\n // System.out.println(\"何か入力してください。\");\n int N = scanner.nextInt();\t//・・・③\n // System.out.println(\"入力した文字列は \" + string + \" です。\");\n int K = scanner.nextInt();\n // int int3 = scanner.nextInt();\n int[] p = new int[N];\n // ArrayList<Integer> foo = new ArrayList<>();\n\n for(int i=0; i<N; i++){\n p[i] = scanner.nextInt();\n \n }\n Arrays.sort(p);\n int sum=0;\n for(int j=0;j<K;j++){\n sum += p[j];\n }\n System.out.println(sum);\n\n \n }\n}",
"Main",
"public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\t//・・・②\n // System.out.println(\"何か入力してください。\");\n int N = scanner.nextInt();\t//・・・③\n // System.out.println(\"入力した文字列は \" + string + \" です。\");\n int K = scanner.nextInt();\n // int int3 = scanner.nextInt();\n int[] p = new int[N];\n // ArrayList<Integer> foo = new ArrayList<>();\n\n for(int i=0; i<N; i++){\n p[i] = scanner.nextInt();\n \n }\n Arrays.sort(p);\n int sum=0;\n for(int j=0;j<K;j++){\n sum += p[j];\n }\n System.out.println(sum);\n\n \n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\t//・・・②\n // System.out.println(\"何か入力してください。\");\n int N = scanner.nextInt();\t//・・・③\n // System.out.println(\"入力した文字列は \" + string + \" です。\");\n int K = scanner.nextInt();\n // int int3 = scanner.nextInt();\n int[] p = new int[N];\n // ArrayList<Integer> foo = new ArrayList<>();\n\n for(int i=0; i<N; i++){\n p[i] = scanner.nextInt();\n \n }\n Arrays.sort(p);\n int sum=0;\n for(int j=0;j<K;j++){\n sum += p[j];\n }\n System.out.println(sum);\n\n \n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int N = scanner.nextInt();",
"N",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int K = scanner.nextInt();",
"K",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[] p = new int[N];",
"p",
"new int[N]",
"N",
"for(int i=0; i<N; i++){\n p[i] = scanner.nextInt();\n \n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n p[i] = scanner.nextInt();\n \n }",
"{\n p[i] = scanner.nextInt();\n \n }",
"p[i] = scanner.nextInt()",
"p[i]",
"p",
"i",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"int sum=0;",
"sum",
"0",
"for(int j=0;j<K;j++){\n sum += p[j];\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<K",
"j",
"K",
"j++",
"j++",
"j",
"{\n sum += p[j];\n }",
"{\n sum += p[j];\n }",
"sum += p[j]",
"sum",
"p[j]",
"p",
"j",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String args[]",
"args",
"public class Main {\n public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\t//・・・②\n // System.out.println(\"何か入力してください。\");\n int N = scanner.nextInt();\t//・・・③\n // System.out.println(\"入力した文字列は \" + string + \" です。\");\n int K = scanner.nextInt();\n // int int3 = scanner.nextInt();\n int[] p = new int[N];\n // ArrayList<Integer> foo = new ArrayList<>();\n\n for(int i=0; i<N; i++){\n p[i] = scanner.nextInt();\n \n }\n Arrays.sort(p);\n int sum=0;\n for(int j=0;j<K;j++){\n sum += p[j];\n }\n System.out.println(sum);\n\n \n }\n}",
"public class Main {\n public static void main(String args[]) {\n Scanner scanner = new Scanner(System.in);\t//・・・②\n // System.out.println(\"何か入力してください。\");\n int N = scanner.nextInt();\t//・・・③\n // System.out.println(\"入力した文字列は \" + string + \" です。\");\n int K = scanner.nextInt();\n // int int3 = scanner.nextInt();\n int[] p = new int[N];\n // ArrayList<Integer> foo = new ArrayList<>();\n\n for(int i=0; i<N; i++){\n p[i] = scanner.nextInt();\n \n }\n Arrays.sort(p);\n int sum=0;\n for(int j=0;j<K;j++){\n sum += p[j];\n }\n System.out.println(sum);\n\n \n }\n}",
"Main"
]
| import java.util.Scanner; //・・・①
import java.util.Arrays;
public class Main {
public static void main(String args[]) {
Scanner scanner = new Scanner(System.in); //・・・②
// System.out.println("何か入力してください。");
int N = scanner.nextInt(); //・・・③
// System.out.println("入力した文字列は " + string + " です。");
int K = scanner.nextInt();
// int int3 = scanner.nextInt();
int[] p = new int[N];
// ArrayList<Integer> foo = new ArrayList<>();
for(int i=0; i<N; i++){
p[i] = scanner.nextInt();
}
Arrays.sort(p);
int sum=0;
for(int j=0;j<K;j++){
sum += p[j];
}
System.out.println(sum);
}
} |
[
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,
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,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
18,
13,
13,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
4,
18,
13,
13,
30,
4,
18,
13,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
28,
13,
13,
30,
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
],
[
151,
5
],
[
151,
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,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
48,
53
],
[
53,
54
],
[
53,
55
],
[
48,
56
],
[
56,
57
],
[
57,
58
],
[
48,
59
],
[
60,
60
],
[
60,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
68,
69
],
[
68,
70
],
[
8,
71
],
[
71,
72
],
[
71,
73
],
[
8,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
79,
81
],
[
74,
82
],
[
82,
83
],
[
83,
84
],
[
74,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
90,
91
],
[
90,
92
],
[
8,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
93,
98
],
[
98,
99
],
[
98,
100
],
[
93,
101
],
[
101,
102
],
[
102,
103
],
[
93,
104
],
[
105,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
108,
110
],
[
107,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
106,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
116,
119
],
[
119,
120
],
[
119,
121
],
[
115,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
8,
129
],
[
129,
130
],
[
129,
131
],
[
8,
132
],
[
132,
133
],
[
132,
134
],
[
132,
135
],
[
136,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
139,
141
],
[
8,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
144,
146
],
[
142,
147
],
[
6,
148
],
[
148,
149
],
[
0,
150
],
[
150,
151
],
[
150,
152
]
]
| [
"import java.util.*;\n\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n int n=Integer.parseInt(line[0]);\n int k=Integer.parseInt(line[1]);\n\n String[] line1 = sc.nextLine().split(\" \");\n \n int[] num=new int[n];\n for(int i=0;i<n;i++){\n num[i]=Integer.parseInt(line1[i]);\n }\n\n List<Integer> list=new ArrayList<Integer>();\n\n for(int i=0;i<k;i++){\n list.add(num[i]);\n } \n for(int i=k;i<n;i++){\n if(num[i]<Collections.max(list)){\n list.add(num[i]);\n list.remove(Collections.max(list));\n }\n }\n int sum=0;\n\n for(int value:list){\n sum=sum+value;\n }\n\n System.out.println(sum);\n }\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 String[] line = sc.nextLine().split(\" \");\n int n=Integer.parseInt(line[0]);\n int k=Integer.parseInt(line[1]);\n\n String[] line1 = sc.nextLine().split(\" \");\n \n int[] num=new int[n];\n for(int i=0;i<n;i++){\n num[i]=Integer.parseInt(line1[i]);\n }\n\n List<Integer> list=new ArrayList<Integer>();\n\n for(int i=0;i<k;i++){\n list.add(num[i]);\n } \n for(int i=k;i<n;i++){\n if(num[i]<Collections.max(list)){\n list.add(num[i]);\n list.remove(Collections.max(list));\n }\n }\n int sum=0;\n\n for(int value:list){\n sum=sum+value;\n }\n\n System.out.println(sum);\n }\n \n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n int n=Integer.parseInt(line[0]);\n int k=Integer.parseInt(line[1]);\n\n String[] line1 = sc.nextLine().split(\" \");\n \n int[] num=new int[n];\n for(int i=0;i<n;i++){\n num[i]=Integer.parseInt(line1[i]);\n }\n\n List<Integer> list=new ArrayList<Integer>();\n\n for(int i=0;i<k;i++){\n list.add(num[i]);\n } \n for(int i=k;i<n;i++){\n if(num[i]<Collections.max(list)){\n list.add(num[i]);\n list.remove(Collections.max(list));\n }\n }\n int sum=0;\n\n for(int value:list){\n sum=sum+value;\n }\n\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n int n=Integer.parseInt(line[0]);\n int k=Integer.parseInt(line[1]);\n\n String[] line1 = sc.nextLine().split(\" \");\n \n int[] num=new int[n];\n for(int i=0;i<n;i++){\n num[i]=Integer.parseInt(line1[i]);\n }\n\n List<Integer> list=new ArrayList<Integer>();\n\n for(int i=0;i<k;i++){\n list.add(num[i]);\n } \n for(int i=k;i<n;i++){\n if(num[i]<Collections.max(list)){\n list.add(num[i]);\n list.remove(Collections.max(list));\n }\n }\n int sum=0;\n\n for(int value:list){\n sum=sum+value;\n }\n\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] line = sc.nextLine().split(\" \");",
"line",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"int n=Integer.parseInt(line[0]);",
"n",
"Integer.parseInt(line[0])",
"Integer.parseInt",
"Integer",
"line[0]",
"line",
"0",
"int k=Integer.parseInt(line[1]);",
"k",
"Integer.parseInt(line[1])",
"Integer.parseInt",
"Integer",
"line[1]",
"line",
"1",
"String[] line1 = sc.nextLine().split(\" \");",
"line1",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"int[] num=new int[n];",
"num",
"new int[n]",
"n",
"for(int i=0;i<n;i++){\n num[i]=Integer.parseInt(line1[i]);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n num[i]=Integer.parseInt(line1[i]);\n }",
"{\n num[i]=Integer.parseInt(line1[i]);\n }",
"num[i]=Integer.parseInt(line1[i])",
"num[i]",
"num",
"i",
"Integer.parseInt(line1[i])",
"Integer.parseInt",
"Integer",
"line1[i]",
"line1",
"i",
"List<Integer> list=new ArrayList<Integer>();",
"list",
"new ArrayList<Integer>()",
"for(int i=0;i<k;i++){\n list.add(num[i]);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n list.add(num[i]);\n }",
"{\n list.add(num[i]);\n }",
"list.add(num[i])",
"list.add",
"list",
"num[i]",
"num",
"i",
"for(int i=k;i<n;i++){\n if(num[i]<Collections.max(list)){\n list.add(num[i]);\n list.remove(Collections.max(list));\n }\n }",
"int i=k;",
"int i=k;",
"i",
"k",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n if(num[i]<Collections.max(list)){\n list.add(num[i]);\n list.remove(Collections.max(list));\n }\n }",
"{\n if(num[i]<Collections.max(list)){\n list.add(num[i]);\n list.remove(Collections.max(list));\n }\n }",
"if(num[i]<Collections.max(list)){\n list.add(num[i]);\n list.remove(Collections.max(list));\n }",
"num[i]<Collections.max(list)",
"num[i]",
"num",
"i",
"Collections.max(list)",
"Collections.max",
"Collections",
"list",
"{\n list.add(num[i]);\n list.remove(Collections.max(list));\n }",
"list.add(num[i])",
"list.add",
"list",
"num[i]",
"num",
"i",
"list.remove(Collections.max(list))",
"list.remove",
"list",
"Collections.max(list)",
"Collections.max",
"Collections",
"list",
"int sum=0;",
"sum",
"0",
"for(int value:list){\n sum=sum+value;\n }",
"int value",
"list",
"{\n sum=sum+value;\n }",
"{\n sum=sum+value;\n }",
"sum=sum+value",
"sum",
"sum+value",
"sum",
"value",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n int n=Integer.parseInt(line[0]);\n int k=Integer.parseInt(line[1]);\n\n String[] line1 = sc.nextLine().split(\" \");\n \n int[] num=new int[n];\n for(int i=0;i<n;i++){\n num[i]=Integer.parseInt(line1[i]);\n }\n\n List<Integer> list=new ArrayList<Integer>();\n\n for(int i=0;i<k;i++){\n list.add(num[i]);\n } \n for(int i=k;i<n;i++){\n if(num[i]<Collections.max(list)){\n list.add(num[i]);\n list.remove(Collections.max(list));\n }\n }\n int sum=0;\n\n for(int value:list){\n sum=sum+value;\n }\n\n System.out.println(sum);\n }\n \n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] line = sc.nextLine().split(\" \");\n int n=Integer.parseInt(line[0]);\n int k=Integer.parseInt(line[1]);\n\n String[] line1 = sc.nextLine().split(\" \");\n \n int[] num=new int[n];\n for(int i=0;i<n;i++){\n num[i]=Integer.parseInt(line1[i]);\n }\n\n List<Integer> list=new ArrayList<Integer>();\n\n for(int i=0;i<k;i++){\n list.add(num[i]);\n } \n for(int i=k;i<n;i++){\n if(num[i]<Collections.max(list)){\n list.add(num[i]);\n list.remove(Collections.max(list));\n }\n }\n int sum=0;\n\n for(int value:list){\n sum=sum+value;\n }\n\n System.out.println(sum);\n }\n \n}",
"Main"
]
| import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] line = sc.nextLine().split(" ");
int n=Integer.parseInt(line[0]);
int k=Integer.parseInt(line[1]);
String[] line1 = sc.nextLine().split(" ");
int[] num=new int[n];
for(int i=0;i<n;i++){
num[i]=Integer.parseInt(line1[i]);
}
List<Integer> list=new ArrayList<Integer>();
for(int i=0;i<k;i++){
list.add(num[i]);
}
for(int i=k;i<n;i++){
if(num[i]<Collections.max(list)){
list.add(num[i]);
list.remove(Collections.max(list));
}
}
int sum=0;
for(int value:list){
sum=sum+value;
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
17,
41,
13,
17,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
14,
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,
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
],
[
155,
23
],
[
155,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
26,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
26,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
26,
40
],
[
40,
41
],
[
40,
42
],
[
26,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
43,
51
],
[
51,
52
],
[
52,
53
],
[
43,
54
],
[
55,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
26,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
26,
69
],
[
69,
70
],
[
69,
71
],
[
26,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
87,
90
],
[
26,
91
],
[
91,
92
],
[
92,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
24,
97
],
[
97,
98
],
[
155,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
104,
105
],
[
104,
106
],
[
99,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
113,
115
],
[
107,
116
],
[
116,
117
],
[
99,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
122,
126
],
[
126,
127
],
[
127,
128
],
[
128,
129
],
[
121,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
131,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
120,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
99,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
150,
151
],
[
149,
152
],
[
152,
153
],
[
0,
154
],
[
154,
155
],
[
154,
156
]
]
| [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.Collections;\n//import java.util.Scanner;\nimport java.util.StringTokenizer;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tFastScanner sc = new FastScanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tArrayList<Integer> priceList = new ArrayList<Integer>();\n\n\t\tfor (int i= 0; i < N; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tpriceList.add(p);\n\t\t}\n\n\n\t\tCollections.sort(priceList);\n\n\t\tint anser = 0;\n\t\tfor (int n = 0; n < K; n++) {\n\t\t\tanser += priceList.get(n);\n\t\t}\n\n\t\tSystem.out.println(anser);\n\t}\n\n\tprivate static class FastScanner {\n\t\tprivate BufferedReader reader = null;\n\t\tprivate StringTokenizer tokenizer = null;\n\n\t\tpublic FastScanner(InputStream in) {\n\t\t\treader = new BufferedReader(new InputStreamReader(in));\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\tif (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t}\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tFastScanner sc = new FastScanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tArrayList<Integer> priceList = new ArrayList<Integer>();\n\n\t\tfor (int i= 0; i < N; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tpriceList.add(p);\n\t\t}\n\n\n\t\tCollections.sort(priceList);\n\n\t\tint anser = 0;\n\t\tfor (int n = 0; n < K; n++) {\n\t\t\tanser += priceList.get(n);\n\t\t}\n\n\t\tSystem.out.println(anser);\n\t}\n\n\tprivate static class FastScanner {\n\t\tprivate BufferedReader reader = null;\n\t\tprivate StringTokenizer tokenizer = null;\n\n\t\tpublic FastScanner(InputStream in) {\n\t\t\treader = new BufferedReader(new InputStreamReader(in));\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\tif (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tFastScanner sc = new FastScanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tArrayList<Integer> priceList = new ArrayList<Integer>();\n\n\t\tfor (int i= 0; i < N; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tpriceList.add(p);\n\t\t}\n\n\n\t\tCollections.sort(priceList);\n\n\t\tint anser = 0;\n\t\tfor (int n = 0; n < K; n++) {\n\t\t\tanser += priceList.get(n);\n\t\t}\n\n\t\tSystem.out.println(anser);\n\t}",
"main",
"{\n\t\tFastScanner sc = new FastScanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tArrayList<Integer> priceList = new ArrayList<Integer>();\n\n\t\tfor (int i= 0; i < N; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tpriceList.add(p);\n\t\t}\n\n\n\t\tCollections.sort(priceList);\n\n\t\tint anser = 0;\n\t\tfor (int n = 0; n < K; n++) {\n\t\t\tanser += priceList.get(n);\n\t\t}\n\n\t\tSystem.out.println(anser);\n\t}",
"FastScanner sc = new FastScanner(System.in);",
"sc",
"new FastScanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ArrayList<Integer> priceList = new ArrayList<Integer>();",
"priceList",
"new ArrayList<Integer>()",
"for (int i= 0; i < N; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tpriceList.add(p);\n\t\t}",
"int i= 0;",
"int i= 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tint p = sc.nextInt();\n\t\t\tpriceList.add(p);\n\t\t}",
"{\n\t\t\tint p = sc.nextInt();\n\t\t\tpriceList.add(p);\n\t\t}",
"int p = sc.nextInt();",
"p",
"sc.nextInt()",
"sc.nextInt",
"sc",
"priceList.add(p)",
"priceList.add",
"priceList",
"p",
"Collections.sort(priceList)",
"Collections.sort",
"Collections",
"priceList",
"int anser = 0;",
"anser",
"0",
"for (int n = 0; n < K; n++) {\n\t\t\tanser += priceList.get(n);\n\t\t}",
"int n = 0;",
"int n = 0;",
"n",
"0",
"n < K",
"n",
"K",
"n++",
"n++",
"n",
"{\n\t\t\tanser += priceList.get(n);\n\t\t}",
"{\n\t\t\tanser += priceList.get(n);\n\t\t}",
"anser += priceList.get(n)",
"anser",
"priceList.get(n)",
"priceList.get",
"priceList",
"n",
"System.out.println(anser)",
"System.out.println",
"System.out",
"System",
"System.out",
"anser",
"String[] args",
"args",
"private static class FastScanner {\n\t\tprivate BufferedReader reader = null;\n\t\tprivate StringTokenizer tokenizer = null;\n\n\t\tpublic FastScanner(InputStream in) {\n\t\t\treader = new BufferedReader(new InputStreamReader(in));\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\tif (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t}",
"FastScanner",
"private BufferedReader reader = null;",
"reader",
"null",
"private StringTokenizer tokenizer = null;",
"tokenizer",
"null",
"public FastScanner(InputStream in) {\n\t\t\treader = new BufferedReader(new InputStreamReader(in));\n\t\t\ttokenizer = null;\n\t\t}",
"FastScanner",
"{\n\t\t\treader = new BufferedReader(new InputStreamReader(in));\n\t\t\ttokenizer = null;\n\t\t}",
"reader = new BufferedReader(new InputStreamReader(in))",
"reader",
"new BufferedReader(new InputStreamReader(in))",
"tokenizer = null",
"tokenizer",
"null",
"InputStream in",
"in",
"public String next() {\n\t\t\tif (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}",
"next",
"{\n\t\t\tif (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}",
"if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}",
"try {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}",
"catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}",
"IOException e",
"{\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t}",
"tokenizer = new StringTokenizer(reader.readLine())",
"tokenizer",
"new StringTokenizer(reader.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"public int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}",
"nextInt",
"{\n\t\t\treturn Integer.parseInt(next());\n\t\t}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tFastScanner sc = new FastScanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tArrayList<Integer> priceList = new ArrayList<Integer>();\n\n\t\tfor (int i= 0; i < N; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tpriceList.add(p);\n\t\t}\n\n\n\t\tCollections.sort(priceList);\n\n\t\tint anser = 0;\n\t\tfor (int n = 0; n < K; n++) {\n\t\t\tanser += priceList.get(n);\n\t\t}\n\n\t\tSystem.out.println(anser);\n\t}\n\n\tprivate static class FastScanner {\n\t\tprivate BufferedReader reader = null;\n\t\tprivate StringTokenizer tokenizer = null;\n\n\t\tpublic FastScanner(InputStream in) {\n\t\t\treader = new BufferedReader(new InputStreamReader(in));\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\tif (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tFastScanner sc = new FastScanner(System.in);\n\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tArrayList<Integer> priceList = new ArrayList<Integer>();\n\n\t\tfor (int i= 0; i < N; i++) {\n\t\t\tint p = sc.nextInt();\n\t\t\tpriceList.add(p);\n\t\t}\n\n\n\t\tCollections.sort(priceList);\n\n\t\tint anser = 0;\n\t\tfor (int n = 0; n < K; n++) {\n\t\t\tanser += priceList.get(n);\n\t\t}\n\n\t\tSystem.out.println(anser);\n\t}\n\n\tprivate static class FastScanner {\n\t\tprivate BufferedReader reader = null;\n\t\tprivate StringTokenizer tokenizer = null;\n\n\t\tpublic FastScanner(InputStream in) {\n\t\t\treader = new BufferedReader(new InputStreamReader(in));\n\t\t\ttokenizer = null;\n\t\t}\n\n\t\tpublic String next() {\n\t\t\tif (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\t\ttry {\n\t\t\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tokenizer.nextToken();\n\t\t}\n\n\t\tpublic int nextInt() {\n\t\t\treturn Integer.parseInt(next());\n\t\t}\n\n\t}\n}",
"Main"
]
| import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
//import java.util.Scanner;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
FastScanner sc = new FastScanner(System.in);
int N = sc.nextInt();
int K = sc.nextInt();
ArrayList<Integer> priceList = new ArrayList<Integer>();
for (int i= 0; i < N; i++) {
int p = sc.nextInt();
priceList.add(p);
}
Collections.sort(priceList);
int anser = 0;
for (int n = 0; n < K; n++) {
anser += priceList.get(n);
}
System.out.println(anser);
}
private static class FastScanner {
private BufferedReader reader = null;
private StringTokenizer tokenizer = null;
public FastScanner(InputStream in) {
reader = new BufferedReader(new InputStreamReader(in));
tokenizer = null;
}
public String next() {
if (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,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
18,
13,
13,
4,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
18,
13,
13,
14,
2,
13,
17,
30,
29,
17,
41,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
4,
18,
13,
13,
14,
2,
4,
18,
13,
13,
30,
4,
18,
13,
42,
2,
4,
18,
13,
17,
30,
0,
13,
4,
18,
13,
4,
18,
13,
29,
13,
23,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
119,
5
],
[
119,
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
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
51,
54
],
[
6,
55
],
[
55,
56
],
[
119,
57
],
[
57,
58
],
[
57,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
62,
64
],
[
59,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
65,
69
],
[
69,
70
],
[
70,
71
],
[
59,
72
],
[
72,
73
],
[
72,
74
],
[
59,
75
],
[
75,
76
],
[
75,
77
],
[
59,
78
],
[
78,
79
],
[
78,
80
],
[
78,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
82,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
88,
92
],
[
87,
93
],
[
93,
94
],
[
94,
95
],
[
95,
96
],
[
59,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
98,
102
],
[
97,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
103,
109
],
[
109,
110
],
[
110,
111
],
[
59,
112
],
[
112,
113
],
[
57,
114
],
[
114,
115
],
[
57,
116
],
[
116,
117
],
[
0,
118
],
[
118,
119
],
[
118,
120
]
]
| [
"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 n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i=0; i<n; i++) {\n\t\t arr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tSystem.out.println(solve(arr, k));\n\t}\n\t\n\tpublic static int solve(int[] arr, int k) {\n\t int n = arr.length;\n\t \n\t if(n==0) {\n\t return 0;\n\t }\n\t \n\t int sum = 0;\n\t \n\t PriorityQueue<Integer> heap = new PriorityQueue(Collections.reverseOrder());\n\t for(int i: arr) {\n\t heap.add(i);\n\t \n\t if(heap.size() > k) {\n\t heap.remove();\n\t }\n\t }\n\t \n\t while(heap.size() > 0) {\n\t sum += heap.peek();\n\t heap.remove();\n\t }\n\t return sum;\n\t}\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 n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i=0; i<n; i++) {\n\t\t arr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tSystem.out.println(solve(arr, k));\n\t}\n\t\n\tpublic static int solve(int[] arr, int k) {\n\t int n = arr.length;\n\t \n\t if(n==0) {\n\t return 0;\n\t }\n\t \n\t int sum = 0;\n\t \n\t PriorityQueue<Integer> heap = new PriorityQueue(Collections.reverseOrder());\n\t for(int i: arr) {\n\t heap.add(i);\n\t \n\t if(heap.size() > k) {\n\t heap.remove();\n\t }\n\t }\n\t \n\t while(heap.size() > 0) {\n\t sum += heap.peek();\n\t heap.remove();\n\t }\n\t return sum;\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i=0; i<n; i++) {\n\t\t arr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tSystem.out.println(solve(arr, k));\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i=0; i<n; i++) {\n\t\t arr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tSystem.out.println(solve(arr, k));\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"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 arr[i] = sc.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t arr[i] = sc.nextInt();\n\t\t}",
"{\n\t\t arr[i] = sc.nextInt();\n\t\t}",
"arr[i] = sc.nextInt()",
"arr[i]",
"arr",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"System.out.println(solve(arr, k))",
"System.out.println",
"System.out",
"System",
"System.out",
"solve(arr, k)",
"solve",
"arr",
"k",
"String[] args",
"args",
"public static int solve(int[] arr, int k) {\n\t int n = arr.length;\n\t \n\t if(n==0) {\n\t return 0;\n\t }\n\t \n\t int sum = 0;\n\t \n\t PriorityQueue<Integer> heap = new PriorityQueue(Collections.reverseOrder());\n\t for(int i: arr) {\n\t heap.add(i);\n\t \n\t if(heap.size() > k) {\n\t heap.remove();\n\t }\n\t }\n\t \n\t while(heap.size() > 0) {\n\t sum += heap.peek();\n\t heap.remove();\n\t }\n\t return sum;\n\t}",
"solve",
"{\n\t int n = arr.length;\n\t \n\t if(n==0) {\n\t return 0;\n\t }\n\t \n\t int sum = 0;\n\t \n\t PriorityQueue<Integer> heap = new PriorityQueue(Collections.reverseOrder());\n\t for(int i: arr) {\n\t heap.add(i);\n\t \n\t if(heap.size() > k) {\n\t heap.remove();\n\t }\n\t }\n\t \n\t while(heap.size() > 0) {\n\t sum += heap.peek();\n\t heap.remove();\n\t }\n\t return sum;\n\t}",
"int n = arr.length;",
"n",
"arr.length",
"arr",
"arr.length",
"if(n==0) {\n\t return 0;\n\t }",
"n==0",
"n",
"0",
"{\n\t return 0;\n\t }",
"return 0;",
"0",
"int sum = 0;",
"sum",
"0",
"PriorityQueue<Integer> heap = new PriorityQueue(Collections.reverseOrder());",
"heap",
"new PriorityQueue(Collections.reverseOrder())",
"for(int i: arr) {\n\t heap.add(i);\n\t \n\t if(heap.size() > k) {\n\t heap.remove();\n\t }\n\t }",
"int i",
"arr",
"{\n\t heap.add(i);\n\t \n\t if(heap.size() > k) {\n\t heap.remove();\n\t }\n\t }",
"{\n\t heap.add(i);\n\t \n\t if(heap.size() > k) {\n\t heap.remove();\n\t }\n\t }",
"heap.add(i)",
"heap.add",
"heap",
"i",
"if(heap.size() > k) {\n\t heap.remove();\n\t }",
"heap.size() > k",
"heap.size()",
"heap.size",
"heap",
"k",
"{\n\t heap.remove();\n\t }",
"heap.remove()",
"heap.remove",
"heap",
"while(heap.size() > 0) {\n\t sum += heap.peek();\n\t heap.remove();\n\t }",
"heap.size() > 0",
"heap.size()",
"heap.size",
"heap",
"0",
"{\n\t sum += heap.peek();\n\t heap.remove();\n\t }",
"sum += heap.peek()",
"sum",
"heap.peek()",
"heap.peek",
"heap",
"heap.remove()",
"heap.remove",
"heap",
"return sum;",
"sum",
"int[] arr",
"arr",
"int k",
"k",
"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 k = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i=0; i<n; i++) {\n\t\t arr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tSystem.out.println(solve(arr, k));\n\t}\n\t\n\tpublic static int solve(int[] arr, int k) {\n\t int n = arr.length;\n\t \n\t if(n==0) {\n\t return 0;\n\t }\n\t \n\t int sum = 0;\n\t \n\t PriorityQueue<Integer> heap = new PriorityQueue(Collections.reverseOrder());\n\t for(int i: arr) {\n\t heap.add(i);\n\t \n\t if(heap.size() > k) {\n\t heap.remove();\n\t }\n\t }\n\t \n\t while(heap.size() > 0) {\n\t sum += heap.peek();\n\t heap.remove();\n\t }\n\t return sum;\n\t}\n}",
"public class Main\n{\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i=0; i<n; i++) {\n\t\t arr[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tSystem.out.println(solve(arr, k));\n\t}\n\t\n\tpublic static int solve(int[] arr, int k) {\n\t int n = arr.length;\n\t \n\t if(n==0) {\n\t return 0;\n\t }\n\t \n\t int sum = 0;\n\t \n\t PriorityQueue<Integer> heap = new PriorityQueue(Collections.reverseOrder());\n\t for(int i: arr) {\n\t heap.add(i);\n\t \n\t if(heap.size() > k) {\n\t heap.remove();\n\t }\n\t }\n\t \n\t while(heap.size() > 0) {\n\t sum += heap.peek();\n\t heap.remove();\n\t }\n\t return sum;\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 k = sc.nextInt();
int[] arr = new int[n];
for(int i=0; i<n; i++) {
arr[i] = sc.nextInt();
}
System.out.println(solve(arr, k));
}
public static int solve(int[] arr, int k) {
int n = arr.length;
if(n==0) {
return 0;
}
int sum = 0;
PriorityQueue<Integer> heap = new PriorityQueue(Collections.reverseOrder());
for(int i: arr) {
heap.add(i);
if(heap.size() > k) {
heap.remove();
}
}
while(heap.size() > 0) {
sum += heap.peek();
heap.remove();
}
return sum;
}
}
|
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
41,
13,
17,
41,
13,
18,
13,
13,
41,
13,
18,
13,
13,
41,
13,
2,
2,
13,
17,
13,
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,
0,
18,
13,
13,
4,
18,
13,
4,
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,
18,
13,
13,
13,
12,
13,
30,
4,
18,
20,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
105,
5
],
[
105,
6
],
[
6,
7
],
[
6,
8
],
[
105,
9
],
[
9,
10
],
[
9,
11
],
[
105,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
14,
16
],
[
105,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
19,
21
],
[
105,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
25,
27
],
[
24,
28
],
[
105,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
31,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
42,
43
],
[
42,
44
],
[
31,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
31,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
31,
69
],
[
69,
70
],
[
69,
71
],
[
31,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
72,
83
],
[
84,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
87,
89
],
[
31,
90
],
[
90,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
90,
95
],
[
105,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
96,
102
],
[
102,
103
],
[
0,
104
],
[
104,
105
],
[
104,
106
]
]
| [
"import java.util.*;\n\npublic class Main {\n\tScanner sc = new Scanner(System.in);\n\tfinal int MOD = 998244353;\n\tfinal int MAX = Integer.MAX_VALUE;\n\tfinal long LMAX = Long.MAX_VALUE;\n\tlong inf = LMAX / 2 - MAX;\n\n\tvoid doIt() {\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint p[] = new int[N];\n\t\tfor(int i = 0; i < N; i++)\n\t\t\tp[i] = sc.nextInt();\n\t\tArrays.sort(p);\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tsum += p[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().doIt();\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tScanner sc = new Scanner(System.in);\n\tfinal int MOD = 998244353;\n\tfinal int MAX = Integer.MAX_VALUE;\n\tfinal long LMAX = Long.MAX_VALUE;\n\tlong inf = LMAX / 2 - MAX;\n\n\tvoid doIt() {\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint p[] = new int[N];\n\t\tfor(int i = 0; i < N; i++)\n\t\t\tp[i] = sc.nextInt();\n\t\tArrays.sort(p);\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tsum += p[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().doIt();\n\t}\n}",
"Main",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"final int MOD = 998244353;",
"MOD",
"998244353",
"final int MAX = Integer.MAX_VALUE;",
"MAX",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"final long LMAX = Long.MAX_VALUE;",
"LMAX",
"Long.MAX_VALUE",
"Long",
"Long.MAX_VALUE",
"long inf = LMAX / 2 - MAX;",
"inf",
"LMAX / 2 - MAX",
"LMAX / 2",
"LMAX",
"2",
"MAX",
"void doIt() {\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint p[] = new int[N];\n\t\tfor(int i = 0; i < N; i++)\n\t\t\tp[i] = sc.nextInt();\n\t\tArrays.sort(p);\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tsum += p[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"doIt",
"{\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint p[] = new int[N];\n\t\tfor(int i = 0; i < N; i++)\n\t\t\tp[i] = sc.nextInt();\n\t\tArrays.sort(p);\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tsum += p[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int p[] = new int[N];",
"p",
"new int[N]",
"N",
"for(int i = 0; i < N; i++)\n\t\t\tp[i] = sc.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"p[i] = sc.nextInt();",
"p[i] = sc.nextInt()",
"p[i]",
"p",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < K; i++) {\n\t\t\tsum += p[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tsum += p[i];\n\t\t}",
"{\n\t\t\tsum += p[i];\n\t\t}",
"sum += p[i]",
"sum",
"p[i]",
"p",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"public static void main(String[] args) {\n\t\tnew Main().doIt();\n\t}",
"main",
"{\n\t\tnew Main().doIt();\n\t}",
"new Main().doIt()",
"new Main().doIt",
"new Main()",
"String[] args",
"args",
"public class Main {\n\tScanner sc = new Scanner(System.in);\n\tfinal int MOD = 998244353;\n\tfinal int MAX = Integer.MAX_VALUE;\n\tfinal long LMAX = Long.MAX_VALUE;\n\tlong inf = LMAX / 2 - MAX;\n\n\tvoid doIt() {\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint p[] = new int[N];\n\t\tfor(int i = 0; i < N; i++)\n\t\t\tp[i] = sc.nextInt();\n\t\tArrays.sort(p);\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tsum += p[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().doIt();\n\t}\n}",
"public class Main {\n\tScanner sc = new Scanner(System.in);\n\tfinal int MOD = 998244353;\n\tfinal int MAX = Integer.MAX_VALUE;\n\tfinal long LMAX = Long.MAX_VALUE;\n\tlong inf = LMAX / 2 - MAX;\n\n\tvoid doIt() {\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint p[] = new int[N];\n\t\tfor(int i = 0; i < N; i++)\n\t\t\tp[i] = sc.nextInt();\n\t\tArrays.sort(p);\n\t\tint sum = 0;\n\t\tfor(int i = 0; i < K; i++) {\n\t\t\tsum += p[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n\n\tpublic static void main(String[] args) {\n\t\tnew Main().doIt();\n\t}\n}",
"Main"
]
| import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
final int MOD = 998244353;
final int MAX = Integer.MAX_VALUE;
final long LMAX = Long.MAX_VALUE;
long inf = LMAX / 2 - MAX;
void doIt() {
int N = sc.nextInt();
int K = sc.nextInt();
int p[] = new int[N];
for(int i = 0; i < N; i++)
p[i] = sc.nextInt();
Arrays.sort(p);
int sum = 0;
for(int i = 0; i < K; i++) {
sum += p[i];
}
System.out.println(sum);
}
public static void main(String[] args) {
new Main().doIt();
}
}
|
[
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,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
81,
8
],
[
81,
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,
29
],
[
29,
30
],
[
29,
31
],
[
11,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
32,
40
],
[
40,
41
],
[
41,
42
],
[
32,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
49,
50
],
[
11,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
11,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
11,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
9,
78
],
[
78,
79
],
[
0,
80
],
[
80,
81
],
[
80,
82
]
]
| [
"import java.util.*;\nimport java.lang.Math;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\n \t\t\n \tint n = sc.nextInt();\n \tint k = sc.nextInt();\n \tint frs[] = new int[n];\n \tint prs = 0;\n \t\n \tfor(int i = 0;i < n;i++) frs[i] = sc.nextInt();\n \tArrays.sort(frs);\n \tfor(int i = 0;i < k;i++) prs += frs[i];\n \n \tSystem.out.println(prs);\n \n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.lang.Math;",
"Math",
"java.lang",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\n \t\t\n \tint n = sc.nextInt();\n \tint k = sc.nextInt();\n \tint frs[] = new int[n];\n \tint prs = 0;\n \t\n \tfor(int i = 0;i < n;i++) frs[i] = sc.nextInt();\n \tArrays.sort(frs);\n \tfor(int i = 0;i < k;i++) prs += frs[i];\n \n \tSystem.out.println(prs);\n \n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\n \t\t\n \tint n = sc.nextInt();\n \tint k = sc.nextInt();\n \tint frs[] = new int[n];\n \tint prs = 0;\n \t\n \tfor(int i = 0;i < n;i++) frs[i] = sc.nextInt();\n \tArrays.sort(frs);\n \tfor(int i = 0;i < k;i++) prs += frs[i];\n \n \tSystem.out.println(prs);\n \n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\n \t\t\n \tint n = sc.nextInt();\n \tint k = sc.nextInt();\n \tint frs[] = new int[n];\n \tint prs = 0;\n \t\n \tfor(int i = 0;i < n;i++) frs[i] = sc.nextInt();\n \tArrays.sort(frs);\n \tfor(int i = 0;i < k;i++) prs += frs[i];\n \n \tSystem.out.println(prs);\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 k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int frs[] = new int[n];",
"frs",
"new int[n]",
"n",
"int prs = 0;",
"prs",
"0",
"for(int i = 0;i < n;i++) frs[i] = sc.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"frs[i] = sc.nextInt();",
"frs[i] = sc.nextInt()",
"frs[i]",
"frs",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(frs)",
"Arrays.sort",
"Arrays",
"frs",
"for(int i = 0;i < k;i++) prs += frs[i];",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"prs += frs[i];",
"prs += frs[i]",
"prs",
"frs[i]",
"frs",
"i",
"System.out.println(prs)",
"System.out.println",
"System.out",
"System",
"System.out",
"prs",
"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 \tint n = sc.nextInt();\n \tint k = sc.nextInt();\n \tint frs[] = new int[n];\n \tint prs = 0;\n \t\n \tfor(int i = 0;i < n;i++) frs[i] = sc.nextInt();\n \tArrays.sort(frs);\n \tfor(int i = 0;i < k;i++) prs += frs[i];\n \n \tSystem.out.println(prs);\n \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 \tint n = sc.nextInt();\n \tint k = sc.nextInt();\n \tint frs[] = new int[n];\n \tint prs = 0;\n \t\n \tfor(int i = 0;i < n;i++) frs[i] = sc.nextInt();\n \tArrays.sort(frs);\n \tfor(int i = 0;i < k;i++) prs += frs[i];\n \n \tSystem.out.println(prs);\n \n\t}\n}",
"Main"
]
| import java.util.*;
import java.lang.Math;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int frs[] = new int[n];
int prs = 0;
for(int i = 0;i < n;i++) frs[i] = sc.nextInt();
Arrays.sort(frs);
for(int i = 0;i < k;i++) prs += frs[i];
System.out.println(prs);
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
88,
5
],
[
88,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
33,
35
],
[
31,
36
],
[
36,
37
],
[
36,
38
],
[
31,
39
],
[
39,
40
],
[
40,
41
],
[
31,
42
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
8,
57
],
[
57,
58
],
[
57,
59
],
[
8,
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
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
8,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
6,
85
],
[
85,
86
],
[
0,
87
],
[
87,
88
],
[
87,
89
]
]
| [
"import java.util.*;\n\npublic class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n \tint k = Integer.parseInt(sc.next());\n \tArrayList<Integer> list = new ArrayList<>();\n \tfor(int cnt = 0;cnt < n;cnt++){\n \tlist.add(Integer.parseInt(sc.next()));\n }\n \tCollections.sort(list);\n \tint total = 0;\n \tfor(int cnt = 0;cnt < k;cnt++){\n \ttotal += list.get(cnt);\n }\n \tSystem.out.println(total);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n \tint k = Integer.parseInt(sc.next());\n \tArrayList<Integer> list = new ArrayList<>();\n \tfor(int cnt = 0;cnt < n;cnt++){\n \tlist.add(Integer.parseInt(sc.next()));\n }\n \tCollections.sort(list);\n \tint total = 0;\n \tfor(int cnt = 0;cnt < k;cnt++){\n \ttotal += list.get(cnt);\n }\n \tSystem.out.println(total);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n \tint k = Integer.parseInt(sc.next());\n \tArrayList<Integer> list = new ArrayList<>();\n \tfor(int cnt = 0;cnt < n;cnt++){\n \tlist.add(Integer.parseInt(sc.next()));\n }\n \tCollections.sort(list);\n \tint total = 0;\n \tfor(int cnt = 0;cnt < k;cnt++){\n \ttotal += list.get(cnt);\n }\n \tSystem.out.println(total);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = Integer.parseInt(sc.next());\n \tint k = Integer.parseInt(sc.next());\n \tArrayList<Integer> list = new ArrayList<>();\n \tfor(int cnt = 0;cnt < n;cnt++){\n \tlist.add(Integer.parseInt(sc.next()));\n }\n \tCollections.sort(list);\n \tint total = 0;\n \tfor(int cnt = 0;cnt < k;cnt++){\n \ttotal += list.get(cnt);\n }\n \tSystem.out.println(total);\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 k = Integer.parseInt(sc.next());",
"k",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"ArrayList<Integer> list = new ArrayList<>();",
"list",
"new ArrayList<>()",
"for(int cnt = 0;cnt < n;cnt++){\n \tlist.add(Integer.parseInt(sc.next()));\n }",
"int cnt = 0;",
"int cnt = 0;",
"cnt",
"0",
"cnt < n",
"cnt",
"n",
"cnt++",
"cnt++",
"cnt",
"{\n \tlist.add(Integer.parseInt(sc.next()));\n }",
"{\n \tlist.add(Integer.parseInt(sc.next()));\n }",
"list.add(Integer.parseInt(sc.next()))",
"list.add",
"list",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"Collections.sort(list)",
"Collections.sort",
"Collections",
"list",
"int total = 0;",
"total",
"0",
"for(int cnt = 0;cnt < k;cnt++){\n \ttotal += list.get(cnt);\n }",
"int cnt = 0;",
"int cnt = 0;",
"cnt",
"0",
"cnt < k",
"cnt",
"k",
"cnt++",
"cnt++",
"cnt",
"{\n \ttotal += list.get(cnt);\n }",
"{\n \ttotal += list.get(cnt);\n }",
"total += list.get(cnt)",
"total",
"list.get(cnt)",
"list.get",
"list",
"cnt",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"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 = Integer.parseInt(sc.next());\n \tint k = Integer.parseInt(sc.next());\n \tArrayList<Integer> list = new ArrayList<>();\n \tfor(int cnt = 0;cnt < n;cnt++){\n \tlist.add(Integer.parseInt(sc.next()));\n }\n \tCollections.sort(list);\n \tint total = 0;\n \tfor(int cnt = 0;cnt < k;cnt++){\n \ttotal += list.get(cnt);\n }\n \tSystem.out.println(total);\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 = Integer.parseInt(sc.next());\n \tint k = Integer.parseInt(sc.next());\n \tArrayList<Integer> list = new ArrayList<>();\n \tfor(int cnt = 0;cnt < n;cnt++){\n \tlist.add(Integer.parseInt(sc.next()));\n }\n \tCollections.sort(list);\n \tint total = 0;\n \tfor(int cnt = 0;cnt < k;cnt++){\n \ttotal += list.get(cnt);\n }\n \tSystem.out.println(total);\n\t}\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 k = Integer.parseInt(sc.next());
ArrayList<Integer> list = new ArrayList<>();
for(int cnt = 0;cnt < n;cnt++){
list.add(Integer.parseInt(sc.next()));
}
Collections.sort(list);
int total = 0;
for(int cnt = 0;cnt < k;cnt++){
total += list.get(cnt);
}
System.out.println(total);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
41,
13,
17,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
42,
2,
40,
13,
17,
30,
4,
18,
13,
4,
18,
13,
41,
13,
17,
42,
2,
40,
13,
17,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
68,
8
],
[
68,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
11,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
11,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
11,
33
],
[
33,
34
],
[
34,
35
],
[
35,
36
],
[
34,
37
],
[
33,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
39,
42
],
[
42,
43
],
[
43,
44
],
[
11,
45
],
[
45,
46
],
[
45,
47
],
[
11,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
48,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
56,
57
],
[
57,
58
],
[
11,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
9,
65
],
[
65,
66
],
[
0,
67
],
[
67,
68
],
[
67,
69
]
]
| [
"import java.util.PriorityQueue;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\n\t\tint n,k = 0;\n\t\tn = scanner.nextInt();\n\t\tk = scanner.nextInt(); // 買う果物\n\n\t\twhile (n-- > 0){\n\t\t\tpq.add(scanner.nextInt());\n\t\t}\n\n\t\tint sum = 0;\n\t\twhile (k-- > 0){\n\t\t\tsum += pq.poll();\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"import java.util.PriorityQueue;",
"PriorityQueue",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\n\t\tint n,k = 0;\n\t\tn = scanner.nextInt();\n\t\tk = scanner.nextInt(); // 買う果物\n\n\t\twhile (n-- > 0){\n\t\t\tpq.add(scanner.nextInt());\n\t\t}\n\n\t\tint sum = 0;\n\t\twhile (k-- > 0){\n\t\t\tsum += pq.poll();\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\n\t\tint n,k = 0;\n\t\tn = scanner.nextInt();\n\t\tk = scanner.nextInt(); // 買う果物\n\n\t\twhile (n-- > 0){\n\t\t\tpq.add(scanner.nextInt());\n\t\t}\n\n\t\tint sum = 0;\n\t\twhile (k-- > 0){\n\t\t\tsum += pq.poll();\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}",
"main",
"{\n\t\tScanner scanner = new Scanner(System.in);\n\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\n\t\tint n,k = 0;\n\t\tn = scanner.nextInt();\n\t\tk = scanner.nextInt(); // 買う果物\n\n\t\twhile (n-- > 0){\n\t\t\tpq.add(scanner.nextInt());\n\t\t}\n\n\t\tint sum = 0;\n\t\twhile (k-- > 0){\n\t\t\tsum += pq.poll();\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"PriorityQueue<Integer> pq = new PriorityQueue<>();",
"pq",
"new PriorityQueue<>()",
"int n",
"n",
"k = 0;",
"k",
"0",
"n = scanner.nextInt()",
"n",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"k = scanner.nextInt()",
"k",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"while (n-- > 0){\n\t\t\tpq.add(scanner.nextInt());\n\t\t}",
"n-- > 0",
"n--",
"n",
"0",
"{\n\t\t\tpq.add(scanner.nextInt());\n\t\t}",
"pq.add(scanner.nextInt())",
"pq.add",
"pq",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int sum = 0;",
"sum",
"0",
"while (k-- > 0){\n\t\t\tsum += pq.poll();\n\t\t}",
"k-- > 0",
"k--",
"k",
"0",
"{\n\t\t\tsum += pq.poll();\n\t\t}",
"sum += pq.poll()",
"sum",
"pq.poll()",
"pq.poll",
"pq",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\n\t\tint n,k = 0;\n\t\tn = scanner.nextInt();\n\t\tk = scanner.nextInt(); // 買う果物\n\n\t\twhile (n-- > 0){\n\t\t\tpq.add(scanner.nextInt());\n\t\t}\n\n\t\tint sum = 0;\n\t\twhile (k-- > 0){\n\t\t\tsum += pq.poll();\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\n\t\tint n,k = 0;\n\t\tn = scanner.nextInt();\n\t\tk = scanner.nextInt(); // 買う果物\n\n\t\twhile (n-- > 0){\n\t\t\tpq.add(scanner.nextInt());\n\t\t}\n\n\t\tint sum = 0;\n\t\twhile (k-- > 0){\n\t\t\tsum += pq.poll();\n\t\t}\n\t\tSystem.out.println(sum);\n\n\t}\n\n}",
"Main"
]
| import java.util.PriorityQueue;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
PriorityQueue<Integer> pq = new PriorityQueue<>();
int n,k = 0;
n = scanner.nextInt();
k = scanner.nextInt(); // 買う果物
while (n-- > 0){
pq.add(scanner.nextInt());
}
int sum = 0;
while (k-- > 0){
sum += pq.poll();
}
System.out.println(sum);
}
}
|
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
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,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
83,
8
],
[
83,
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,
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
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
11,
53
],
[
53,
54
],
[
53,
55
],
[
11,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
11,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
9,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
]
| [
"import java.util.Scanner;\nimport java.util.Arrays;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 整数の入力\n\t\tint a = sc.nextInt();//種類数\n\t\tint b = sc.nextInt();//買う数\n\t\t\n\t\tint[] c = new int[a];\n\t\t\n\t\tfor(int i = 0; i < a; i++) {\n\t\t\tc[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(c);\n\t\t\n\t\tint d = 0;\n\t\t\n\t\tfor(int i = 0; i < b; i++) {\n\t\t\td += c[i];\n\t\t}\n\t\tSystem.out.println(d);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 整数の入力\n\t\tint a = sc.nextInt();//種類数\n\t\tint b = sc.nextInt();//買う数\n\t\t\n\t\tint[] c = new int[a];\n\t\t\n\t\tfor(int i = 0; i < a; i++) {\n\t\t\tc[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(c);\n\t\t\n\t\tint d = 0;\n\t\t\n\t\tfor(int i = 0; i < b; i++) {\n\t\t\td += c[i];\n\t\t}\n\t\tSystem.out.println(d);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 整数の入力\n\t\tint a = sc.nextInt();//種類数\n\t\tint b = sc.nextInt();//買う数\n\t\t\n\t\tint[] c = new int[a];\n\t\t\n\t\tfor(int i = 0; i < a; i++) {\n\t\t\tc[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(c);\n\t\t\n\t\tint d = 0;\n\t\t\n\t\tfor(int i = 0; i < b; i++) {\n\t\t\td += c[i];\n\t\t}\n\t\tSystem.out.println(d);\n\t}",
"main",
"{\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 整数の入力\n\t\tint a = sc.nextInt();//種類数\n\t\tint b = sc.nextInt();//買う数\n\t\t\n\t\tint[] c = new int[a];\n\t\t\n\t\tfor(int i = 0; i < a; i++) {\n\t\t\tc[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(c);\n\t\t\n\t\tint d = 0;\n\t\t\n\t\tfor(int i = 0; i < b; i++) {\n\t\t\td += c[i];\n\t\t}\n\t\tSystem.out.println(d);\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",
"int[] c = new int[a];",
"c",
"new int[a]",
"a",
"for(int i = 0; i < a; i++) {\n\t\t\tc[i] = sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a",
"i",
"a",
"i++",
"i++",
"i",
"{\n\t\t\tc[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tc[i] = sc.nextInt();\n\t\t}",
"c[i] = sc.nextInt()",
"c[i]",
"c",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(c)",
"Arrays.sort",
"Arrays",
"c",
"int d = 0;",
"d",
"0",
"for(int i = 0; i < b; i++) {\n\t\t\td += c[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < b",
"i",
"b",
"i++",
"i++",
"i",
"{\n\t\t\td += c[i];\n\t\t}",
"{\n\t\t\td += c[i];\n\t\t}",
"d += c[i]",
"d",
"c[i]",
"c",
"i",
"System.out.println(d)",
"System.out.println",
"System.out",
"System",
"System.out",
"d",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 整数の入力\n\t\tint a = sc.nextInt();//種類数\n\t\tint b = sc.nextInt();//買う数\n\t\t\n\t\tint[] c = new int[a];\n\t\t\n\t\tfor(int i = 0; i < a; i++) {\n\t\t\tc[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(c);\n\t\t\n\t\tint d = 0;\n\t\t\n\t\tfor(int i = 0; i < b; i++) {\n\t\t\td += c[i];\n\t\t}\n\t\tSystem.out.println(d);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\n\t\t// 整数の入力\n\t\tint a = sc.nextInt();//種類数\n\t\tint b = sc.nextInt();//買う数\n\t\t\n\t\tint[] c = new int[a];\n\t\t\n\t\tfor(int i = 0; i < a; i++) {\n\t\t\tc[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(c);\n\t\t\n\t\tint d = 0;\n\t\t\n\t\tfor(int i = 0; i < b; i++) {\n\t\t\td += c[i];\n\t\t}\n\t\tSystem.out.println(d);\n\t}\n}",
"Main"
]
| import java.util.Scanner;
import java.util.Arrays;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
// 整数の入力
int a = sc.nextInt();//種類数
int b = sc.nextInt();//買う数
int[] c = new int[a];
for(int i = 0; i < a; i++) {
c[i] = sc.nextInt();
}
Arrays.sort(c);
int d = 0;
for(int i = 0; i < b; i++) {
d += c[i];
}
System.out.println(d);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
20,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
4,
13,
13,
4,
18,
18,
13,
13,
4,
13,
13,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
29,
13,
23,
13,
23,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
4,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
11,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
11,
22
],
[
22,
23
],
[
22,
24
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
11,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
31,
33
],
[
29,
34
],
[
34,
35
],
[
34,
36
],
[
34,
37
],
[
9,
38
],
[
38,
39
],
[
4,
40
],
[
40,
41
],
[
40,
42
],
[
42,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
43,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
43,
53
],
[
53,
54
],
[
54,
55
],
[
43,
56
],
[
57,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
59,
61
],
[
58,
62
],
[
62,
63
],
[
63,
64
],
[
40,
65
],
[
65,
66
],
[
4,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
69,
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
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
69,
95
],
[
95,
96
],
[
67,
97
],
[
97,
98
],
[
67,
99
],
[
99,
100
]
]
| [
"import java.util.*;\nclass Main {\n static Scanner scan = new Scanner(System.in);\n public static void main(String[] args) {\n \tint N = scan.nextInt();\n int K = scan.nextInt();\n int[] arr = new int[N];\n takeInput(arr);\n System.out.println(minPrice(arr, K));\n }\n private static void takeInput(int[] arr) {\n \tfor(int i = 0; i < arr.length; i++) {\n \tarr[i] = scan.nextInt();\n }\n }\n private static int minPrice(int[] arr, int K) {\n \tArrays.sort(arr);\n int sum = 0;\n for(int i = 0; i < K; i++) {\n \tsum += arr[i];\n }\n return sum;\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main {\n static Scanner scan = new Scanner(System.in);\n public static void main(String[] args) {\n \tint N = scan.nextInt();\n int K = scan.nextInt();\n int[] arr = new int[N];\n takeInput(arr);\n System.out.println(minPrice(arr, K));\n }\n private static void takeInput(int[] arr) {\n \tfor(int i = 0; i < arr.length; i++) {\n \tarr[i] = scan.nextInt();\n }\n }\n private static int minPrice(int[] arr, int K) {\n \tArrays.sort(arr);\n int sum = 0;\n for(int i = 0; i < K; i++) {\n \tsum += arr[i];\n }\n return sum;\n }\n}",
"Main",
"static Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"public static void main(String[] args) {\n \tint N = scan.nextInt();\n int K = scan.nextInt();\n int[] arr = new int[N];\n takeInput(arr);\n System.out.println(minPrice(arr, K));\n }",
"main",
"{\n \tint N = scan.nextInt();\n int K = scan.nextInt();\n int[] arr = new int[N];\n takeInput(arr);\n System.out.println(minPrice(arr, K));\n }",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int K = scan.nextInt();",
"K",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] arr = new int[N];",
"arr",
"new int[N]",
"N",
"takeInput(arr)",
"takeInput",
"arr",
"System.out.println(minPrice(arr, K))",
"System.out.println",
"System.out",
"System",
"System.out",
"minPrice(arr, K)",
"minPrice",
"arr",
"K",
"String[] args",
"args",
"private static void takeInput(int[] arr) {\n \tfor(int i = 0; i < arr.length; i++) {\n \tarr[i] = scan.nextInt();\n }\n }",
"takeInput",
"{\n \tfor(int i = 0; i < arr.length; i++) {\n \tarr[i] = scan.nextInt();\n }\n }",
"for(int i = 0; i < arr.length; i++) {\n \tarr[i] = scan.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < arr.length",
"i",
"arr.length",
"arr",
"arr.length",
"i++",
"i++",
"i",
"{\n \tarr[i] = scan.nextInt();\n }",
"{\n \tarr[i] = scan.nextInt();\n }",
"arr[i] = scan.nextInt()",
"arr[i]",
"arr",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] arr",
"arr",
"private static int minPrice(int[] arr, int K) {\n \tArrays.sort(arr);\n int sum = 0;\n for(int i = 0; i < K; i++) {\n \tsum += arr[i];\n }\n return sum;\n }",
"minPrice",
"{\n \tArrays.sort(arr);\n int sum = 0;\n for(int i = 0; i < K; i++) {\n \tsum += arr[i];\n }\n return sum;\n }",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < K; i++) {\n \tsum += arr[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < K",
"i",
"K",
"i++",
"i++",
"i",
"{\n \tsum += arr[i];\n }",
"{\n \tsum += arr[i];\n }",
"sum += arr[i]",
"sum",
"arr[i]",
"arr",
"i",
"return sum;",
"sum",
"int[] arr",
"arr",
"int K",
"K"
]
| import java.util.*;
class Main {
static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
int N = scan.nextInt();
int K = scan.nextInt();
int[] arr = new int[N];
takeInput(arr);
System.out.println(minPrice(arr, K));
}
private static void takeInput(int[] arr) {
for(int i = 0; i < arr.length; i++) {
arr[i] = scan.nextInt();
}
}
private static int minPrice(int[] arr, int K) {
Arrays.sort(arr);
int sum = 0;
for(int i = 0; i < K; i++) {
sum += arr[i];
}
return 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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
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,
18,
13,
13,
13,
23,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
31,
32
],
[
31,
33
],
[
26,
34
],
[
34,
35
],
[
35,
36
],
[
26,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
43,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
8,
49
],
[
49,
50
],
[
49,
51
],
[
8,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
8,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
6,
75
],
[
75,
76
]
]
| [
"import java.util.*;\n\nclass Main{\n\n public static void main(String args[]){\n\n Scanner s=new Scanner(System.in);\n int N=s.nextInt();\n int K=s.nextInt();\n int[] L=new int[N];\n\tfor(int i=0;i<N;i++) L[i]=s.nextInt();\n Arrays.sort(L);\n int ans=0;\n for(int i=0;i<K;i++) ans+=L[i];\n System.out.println(ans);\n\n } \n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n\n public static void main(String args[]){\n\n Scanner s=new Scanner(System.in);\n int N=s.nextInt();\n int K=s.nextInt();\n int[] L=new int[N];\n\tfor(int i=0;i<N;i++) L[i]=s.nextInt();\n Arrays.sort(L);\n int ans=0;\n for(int i=0;i<K;i++) ans+=L[i];\n System.out.println(ans);\n\n } \n}",
"Main",
"public static void main(String args[]){\n\n Scanner s=new Scanner(System.in);\n int N=s.nextInt();\n int K=s.nextInt();\n int[] L=new int[N];\n\tfor(int i=0;i<N;i++) L[i]=s.nextInt();\n Arrays.sort(L);\n int ans=0;\n for(int i=0;i<K;i++) ans+=L[i];\n System.out.println(ans);\n\n }",
"main",
"{\n\n Scanner s=new Scanner(System.in);\n int N=s.nextInt();\n int K=s.nextInt();\n int[] L=new int[N];\n\tfor(int i=0;i<N;i++) L[i]=s.nextInt();\n Arrays.sort(L);\n int ans=0;\n for(int i=0;i<K;i++) ans+=L[i];\n System.out.println(ans);\n\n }",
"Scanner s=new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int N=s.nextInt();",
"N",
"s.nextInt()",
"s.nextInt",
"s",
"int K=s.nextInt();",
"K",
"s.nextInt()",
"s.nextInt",
"s",
"int[] L=new int[N];",
"L",
"new int[N]",
"N",
"for(int i=0;i<N;i++) L[i]=s.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"L[i]=s.nextInt();",
"L[i]=s.nextInt()",
"L[i]",
"L",
"i",
"s.nextInt()",
"s.nextInt",
"s",
"Arrays.sort(L)",
"Arrays.sort",
"Arrays",
"L",
"int ans=0;",
"ans",
"0",
"for(int i=0;i<K;i++) ans+=L[i];",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"ans+=L[i];",
"ans+=L[i]",
"ans",
"L[i]",
"L",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String args[]",
"args"
]
| import java.util.*;
class Main{
public static void main(String args[]){
Scanner s=new Scanner(System.in);
int N=s.nextInt();
int K=s.nextInt();
int[] L=new int[N];
for(int i=0;i<N;i++) L[i]=s.nextInt();
Arrays.sort(L);
int ans=0;
for(int i=0;i<K;i++) ans+=L[i];
System.out.println(ans);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
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,
13,
12,
13,
30,
20,
23,
13,
6,
13,
41,
13,
18,
13,
13,
41,
13,
20,
17,
41,
13,
17,
41,
13,
17,
12,
13,
30,
14,
2,
13,
13,
30,
29,
17,
30,
0,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
13,
14,
2,
13,
17,
30,
29,
17,
29,
17,
12,
13,
30,
14,
4,
13,
29,
18,
13,
40,
13,
29,
40,
17,
12,
13,
30,
29,
2,
2,
17,
13,
2,
13,
17,
23,
13,
12,
13,
30,
42,
2,
4,
13,
40,
4,
13,
18,
13,
13,
40,
13,
29,
4,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
20,
41,
13,
4,
13,
42,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
14,
2,
2,
13,
17,
2,
17,
13,
30,
37,
20,
42,
17,
30,
14,
2,
2,
17,
13,
2,
13,
17,
30,
0,
13,
17,
0,
13,
2,
13,
17,
14,
2,
2,
13,
40,
17,
40,
4,
13,
13,
30,
29,
8,
13,
40,
13,
13,
30,
37,
20,
0,
13,
4,
13,
12,
13,
30,
41,
13,
4,
13,
14,
2,
2,
13,
18,
13,
13,
2,
13,
18,
13,
13,
37,
20,
29,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
340,
11
],
[
340,
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,
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
],
[
14,
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
],
[
74,
76
],
[
14,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
340,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
83,
87
],
[
87,
88
],
[
0,
89
],
[
89,
90
],
[
89,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
89,
96
],
[
96,
97
],
[
96,
98
],
[
89,
100
],
[
100,
101
],
[
100,
102
],
[
89,
103
],
[
103,
104
],
[
103,
105
],
[
89,
106
],
[
106,
107
],
[
106,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
114,
115
],
[
109,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
120,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
116,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
134,
138
],
[
138,
139
],
[
139,
140
],
[
108,
141
],
[
141,
142
],
[
89,
143
],
[
143,
144
],
[
143,
145
],
[
145,
146
],
[
146,
147
],
[
147,
148
],
[
146,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
152,
153
],
[
146,
154
],
[
154,
155
],
[
155,
156
],
[
89,
157
],
[
157,
158
],
[
157,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
161,
165
],
[
165,
166
],
[
165,
167
],
[
157,
168
],
[
168,
169
],
[
89,
170
],
[
170,
171
],
[
170,
172
],
[
172,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
174,
177
],
[
177,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
180,
182
],
[
173,
183
],
[
183,
184
],
[
172,
185
],
[
185,
186
],
[
186,
187
],
[
89,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
191,
195
],
[
195,
196
],
[
190,
197
],
[
197,
198
],
[
197,
199
],
[
190,
200
],
[
200,
201
],
[
200,
202
],
[
202,
203
],
[
190,
204
],
[
204,
205
],
[
205,
206
],
[
205,
207
],
[
204,
208
],
[
208,
209
],
[
209,
210
],
[
210,
211
],
[
209,
212
],
[
208,
213
],
[
213,
214
],
[
213,
215
],
[
215,
216
],
[
190,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
89,
221
],
[
221,
222
],
[
221,
223
],
[
223,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
224,
228
],
[
228,
229
],
[
223,
230
],
[
230,
231
],
[
230,
232
],
[
223,
233
],
[
233,
234
],
[
233,
235
],
[
223,
236
],
[
236,
237
],
[
236,
238
],
[
238,
239
],
[
223,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
240,
244
],
[
244,
245
],
[
245,
246
],
[
245,
247
],
[
244,
248
],
[
248,
249
],
[
248,
250
],
[
250,
251
],
[
223,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
254,
256
],
[
253,
257
],
[
257,
258
],
[
257,
259
],
[
252,
260
],
[
260,
261
],
[
261,
262
],
[
223,
263
],
[
263,
264
],
[
263,
265
],
[
265,
266
],
[
266,
267
],
[
267,
268
],
[
268,
269
],
[
268,
270
],
[
267,
271
],
[
271,
272
],
[
271,
273
],
[
266,
274
],
[
274,
275
],
[
275,
276
],
[
275,
277
],
[
274,
278
],
[
278,
279
],
[
278,
280
],
[
280,
281
],
[
280,
282
],
[
266,
283
],
[
283,
284
],
[
284,
285
],
[
285,
286
],
[
285,
287
],
[
287,
288
],
[
284,
289
],
[
289,
290
],
[
290,
291
],
[
290,
292
],
[
283,
293
],
[
293,
294
],
[
294,
295
],
[
295,
296
],
[
295,
297
],
[
297,
298
],
[
295,
299
],
[
283,
300
],
[
300,
301
],
[
301,
302
],
[
265,
303
],
[
303,
304
],
[
303,
305
],
[
305,
306
],
[
89,
307
],
[
307,
308
],
[
307,
309
],
[
309,
310
],
[
310,
311
],
[
310,
312
],
[
312,
313
],
[
309,
314
],
[
314,
315
],
[
315,
316
],
[
316,
317
],
[
316,
318
],
[
318,
319
],
[
318,
320
],
[
315,
321
],
[
321,
322
],
[
321,
323
],
[
323,
324
],
[
323,
325
],
[
314,
326
],
[
326,
327
],
[
309,
328
],
[
328,
329
],
[
89,
330
],
[
330,
331
],
[
330,
332
],
[
332,
333
],
[
333,
334
],
[
334,
335
],
[
335,
336
],
[
334,
337
],
[
337,
338
],
[
0,
339
],
[
339,
340
],
[
339,
341
]
]
| [
"import java.io.IOException;\nimport java.io.InputStream;\nimport java.util.*;\n\npublic class Main {\n\t\n\tpublic Main() {\n\t\tFastScanner scanner = new FastScanner();\n\t\tint N = scanner.nextInt();\n\t\tint K = scanner.nextInt();\n\t\t\n\t\tint[] P = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tP[i] = scanner.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(P);\n\t\t\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tans += P[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tnew Main();\n\t}\n}\n\nclass FastScanner {\n\tprivate final InputStream in = System.in;\n\tprivate final byte[] buffer = new byte[1024];\n\tprivate int ptr = 0;\n\tprivate int buflen = 0;\n\t\n\tprivate boolean hasNextByte() {\n\t\tif (ptr < buflen) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tptr = 0;\n\t\t\ttry {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\t\n\tprivate int readByte() {\n\t\tif (hasNextByte()) return buffer[ptr++];\n\t\telse return -1;\n\t}\n\t\n\tprivate static boolean isPrintableChar(int c) {\n\t\treturn 33 <= c && c <= 126;\n\t}\n\t\n\tpublic boolean hasNext() {\n\t\twhile (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;\n\t\treturn hasNextByte();\n\t}\n\t\n\tpublic String next() {\n\t\tif (!hasNext()) throw new NoSuchElementException();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint b = readByte();\n\t\twhile (isPrintableChar(b)) {\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}\n\t\n\tpublic long nextLong() {\n\t\tif (!hasNext()) throw new NoSuchElementException();\n\t\tlong n = 0;\n\t\tboolean minus = false;\n\t\tint b = readByte();\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\t\tif (b < '0' || '9' < b) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile (true) {\n\t\t\tif ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\t\n\tpublic int nextInt() {\n\t\tlong nl = nextLong();\n\t\tif (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n\t\treturn (int) nl;\n\t}\n\t\n\tpublic double nextDouble() {\n\t\treturn Double.parseDouble(next());\n\t}\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\t\n\tpublic Main() {\n\t\tFastScanner scanner = new FastScanner();\n\t\tint N = scanner.nextInt();\n\t\tint K = scanner.nextInt();\n\t\t\n\t\tint[] P = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tP[i] = scanner.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(P);\n\t\t\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tans += P[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tnew Main();\n\t}\n}",
"Main",
"public Main() {\n\t\tFastScanner scanner = new FastScanner();\n\t\tint N = scanner.nextInt();\n\t\tint K = scanner.nextInt();\n\t\t\n\t\tint[] P = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tP[i] = scanner.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(P);\n\t\t\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tans += P[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}",
"Main",
"{\n\t\tFastScanner scanner = new FastScanner();\n\t\tint N = scanner.nextInt();\n\t\tint K = scanner.nextInt();\n\t\t\n\t\tint[] P = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tP[i] = scanner.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(P);\n\t\t\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tans += P[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}",
"FastScanner scanner = new FastScanner();",
"scanner",
"new FastScanner()",
"int N = scanner.nextInt();",
"N",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int K = scanner.nextInt();",
"K",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[] P = new int[N];",
"P",
"new int[N]",
"N",
"for (int i = 0; i < N; i++) {\n\t\t\tP[i] = scanner.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tP[i] = scanner.nextInt();\n\t\t}",
"{\n\t\t\tP[i] = scanner.nextInt();\n\t\t}",
"P[i] = scanner.nextInt()",
"P[i]",
"P",
"i",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"Arrays.sort(P)",
"Arrays.sort",
"Arrays",
"P",
"int ans = 0;",
"ans",
"0",
"for (int i = 0; i < K; i++) {\n\t\t\tans += P[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tans += P[i];\n\t\t}",
"{\n\t\t\tans += P[i];\n\t\t}",
"ans += P[i]",
"ans",
"P[i]",
"P",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"public static void main(String[] args) {\n\t\tnew Main();\n\t}",
"main",
"{\n\t\tnew Main();\n\t}",
"new Main()",
"String[] args",
"args",
"class FastScanner {\n\tprivate final InputStream in = System.in;\n\tprivate final byte[] buffer = new byte[1024];\n\tprivate int ptr = 0;\n\tprivate int buflen = 0;\n\t\n\tprivate boolean hasNextByte() {\n\t\tif (ptr < buflen) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tptr = 0;\n\t\t\ttry {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\t\n\tprivate int readByte() {\n\t\tif (hasNextByte()) return buffer[ptr++];\n\t\telse return -1;\n\t}\n\t\n\tprivate static boolean isPrintableChar(int c) {\n\t\treturn 33 <= c && c <= 126;\n\t}\n\t\n\tpublic boolean hasNext() {\n\t\twhile (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;\n\t\treturn hasNextByte();\n\t}\n\t\n\tpublic String next() {\n\t\tif (!hasNext()) throw new NoSuchElementException();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint b = readByte();\n\t\twhile (isPrintableChar(b)) {\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}\n\t\n\tpublic long nextLong() {\n\t\tif (!hasNext()) throw new NoSuchElementException();\n\t\tlong n = 0;\n\t\tboolean minus = false;\n\t\tint b = readByte();\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\t\tif (b < '0' || '9' < b) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile (true) {\n\t\t\tif ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}\n\t\n\tpublic int nextInt() {\n\t\tlong nl = nextLong();\n\t\tif (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n\t\treturn (int) nl;\n\t}\n\t\n\tpublic double nextDouble() {\n\t\treturn Double.parseDouble(next());\n\t}\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\t\tif (ptr < buflen) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tptr = 0;\n\t\t\ttry {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"hasNextByte",
"{\n\t\tif (ptr < buflen) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tptr = 0;\n\t\t\ttry {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"if (ptr < buflen) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tptr = 0;\n\t\t\ttry {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"ptr < buflen",
"ptr",
"buflen",
"{\n\t\t\treturn true;\n\t\t}",
"return true;",
"true",
"{\n\t\t\tptr = 0;\n\t\t\ttry {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"ptr = 0",
"ptr",
"0",
"try {\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"IOException e",
"{\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\t\tbuflen = in.read(buffer);\n\t\t\t}",
"buflen = in.read(buffer)",
"buflen",
"in.read(buffer)",
"in.read",
"in",
"buffer",
"if (buflen <= 0) {\n\t\t\t\treturn false;\n\t\t\t}",
"buflen <= 0",
"buflen",
"0",
"{\n\t\t\t\treturn false;\n\t\t\t}",
"return false;",
"false",
"return true;",
"true",
"private int readByte() {\n\t\tif (hasNextByte()) return buffer[ptr++];\n\t\telse return -1;\n\t}",
"readByte",
"{\n\t\tif (hasNextByte()) return buffer[ptr++];\n\t\telse return -1;\n\t}",
"if (hasNextByte()) return buffer[ptr++];\n\t\telse return -1;",
"hasNextByte()",
"hasNextByte",
"return buffer[ptr++];",
"buffer[ptr++]",
"buffer",
"ptr++",
"ptr",
"return -1;",
"-1",
"1",
"private static boolean isPrintableChar(int c) {\n\t\treturn 33 <= c && c <= 126;\n\t}",
"isPrintableChar",
"{\n\t\treturn 33 <= c && c <= 126;\n\t}",
"return 33 <= c && c <= 126;",
"33 <= c && c <= 126",
"33 <= c",
"33",
"c",
"c <= 126",
"c",
"126",
"int c",
"c",
"public boolean hasNext() {\n\t\twhile (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;\n\t\treturn hasNextByte();\n\t}",
"hasNext",
"{\n\t\twhile (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;\n\t\treturn hasNextByte();\n\t}",
"while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;",
"hasNextByte() && !isPrintableChar(buffer[ptr])",
"hasNextByte()",
"hasNextByte",
"!isPrintableChar(buffer[ptr])",
"isPrintableChar(buffer[ptr])",
"isPrintableChar",
"buffer[ptr]",
"buffer",
"ptr",
"ptr++",
"ptr",
"return hasNextByte();",
"hasNextByte()",
"hasNextByte",
"public String next() {\n\t\tif (!hasNext()) throw new NoSuchElementException();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint b = readByte();\n\t\twhile (isPrintableChar(b)) {\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}",
"next",
"{\n\t\tif (!hasNext()) throw new NoSuchElementException();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tint b = readByte();\n\t\twhile (isPrintableChar(b)) {\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}\n\t\treturn sb.toString();\n\t}",
"if (!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"while (isPrintableChar(b)) {\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}",
"isPrintableChar(b)",
"isPrintableChar",
"b",
"{\n\t\t\tsb.appendCodePoint(b);\n\t\t\tb = readByte();\n\t\t}",
"sb.appendCodePoint(b)",
"sb.appendCodePoint",
"sb",
"b",
"b = readByte()",
"b",
"readByte()",
"readByte",
"return sb.toString();",
"sb.toString()",
"sb.toString",
"sb",
"public long nextLong() {\n\t\tif (!hasNext()) throw new NoSuchElementException();\n\t\tlong n = 0;\n\t\tboolean minus = false;\n\t\tint b = readByte();\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\t\tif (b < '0' || '9' < b) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile (true) {\n\t\t\tif ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}",
"nextLong",
"{\n\t\tif (!hasNext()) throw new NoSuchElementException();\n\t\tlong n = 0;\n\t\tboolean minus = false;\n\t\tint b = readByte();\n\t\tif (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}\n\t\tif (b < '0' || '9' < b) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile (true) {\n\t\t\tif ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}\n\t}",
"if (!hasNext()) throw new NoSuchElementException();",
"!hasNext()",
"hasNext()",
"hasNext",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"long n = 0;",
"n",
"0",
"boolean minus = false;",
"minus",
"false",
"int b = readByte();",
"b",
"readByte()",
"readByte",
"if (b == '-') {\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}",
"b == '-'",
"b",
"'-'",
"{\n\t\t\tminus = true;\n\t\t\tb = readByte();\n\t\t}",
"minus = true",
"minus",
"true",
"b = readByte()",
"b",
"readByte()",
"readByte",
"if (b < '0' || '9' < b) {\n\t\t\tthrow new NumberFormatException();\n\t\t}",
"b < '0' || '9' < b",
"b < '0'",
"b",
"'0'",
"'9' < b",
"'9'",
"b",
"{\n\t\t\tthrow new NumberFormatException();\n\t\t}",
"throw new NumberFormatException();",
"new NumberFormatException()",
"while (true) {\n\t\t\tif ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}",
"true",
"{\n\t\t\tif ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tb = readByte();\n\t\t}",
"if ('0' <= b && b <= '9') {\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t} else if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}",
"'0' <= b && b <= '9'",
"'0' <= b",
"'0'",
"b",
"b <= '9'",
"b",
"'9'",
"{\n\t\t\t\tn *= 10;\n\t\t\t\tn += b - '0';\n\t\t\t}",
"n *= 10",
"n",
"10",
"n += b - '0'",
"n",
"b - '0'",
"b",
"'0'",
"if (b == -1 || !isPrintableChar(b)) {\n\t\t\t\treturn minus ? -n : n;\n\t\t\t} else {\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}",
"b == -1 || !isPrintableChar(b)",
"b == -1",
"b",
"-1",
"1",
"!isPrintableChar(b)",
"isPrintableChar(b)",
"isPrintableChar",
"b",
"{\n\t\t\t\treturn minus ? -n : n;\n\t\t\t}",
"return minus ? -n : n;",
"minus ? -n : n",
"minus",
"-n",
"n",
"n",
"{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}",
"throw new NumberFormatException();",
"new NumberFormatException()",
"b = readByte()",
"b",
"readByte()",
"readByte",
"public int nextInt() {\n\t\tlong nl = nextLong();\n\t\tif (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n\t\treturn (int) nl;\n\t}",
"nextInt",
"{\n\t\tlong nl = nextLong();\n\t\tif (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();\n\t\treturn (int) nl;\n\t}",
"long nl = nextLong();",
"nl",
"nextLong()",
"nextLong",
"if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();",
"nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE",
"nl < Integer.MIN_VALUE",
"nl",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"nl > Integer.MAX_VALUE",
"nl",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"throw new NumberFormatException();",
"new NumberFormatException()",
"return (int) nl;",
"(int) nl",
"public double nextDouble() {\n\t\treturn Double.parseDouble(next());\n\t}",
"nextDouble",
"{\n\t\treturn Double.parseDouble(next());\n\t}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"public class Main {\n\t\n\tpublic Main() {\n\t\tFastScanner scanner = new FastScanner();\n\t\tint N = scanner.nextInt();\n\t\tint K = scanner.nextInt();\n\t\t\n\t\tint[] P = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tP[i] = scanner.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(P);\n\t\t\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tans += P[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tnew Main();\n\t}\n}",
"public class Main {\n\t\n\tpublic Main() {\n\t\tFastScanner scanner = new FastScanner();\n\t\tint N = scanner.nextInt();\n\t\tint K = scanner.nextInt();\n\t\t\n\t\tint[] P = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tP[i] = scanner.nextInt();\n\t\t}\n\t\t\n\t\tArrays.sort(P);\n\t\t\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tans += P[i];\n\t\t}\n\t\t\n\t\tSystem.out.println(ans);\n\t}\n\t\n\tpublic static void main(String[] args) {\n\t\tnew Main();\n\t}\n}",
"Main"
]
| import java.io.IOException;
import java.io.InputStream;
import java.util.*;
public class Main {
public Main() {
FastScanner scanner = new FastScanner();
int N = scanner.nextInt();
int K = scanner.nextInt();
int[] P = new int[N];
for (int i = 0; i < N; i++) {
P[i] = scanner.nextInt();
}
Arrays.sort(P);
int ans = 0;
for (int i = 0; i < K; i++) {
ans += P[i];
}
System.out.println(ans);
}
public static void main(String[] args) {
new Main();
}
}
class FastScanner {
private final InputStream in = System.in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
private boolean hasNextByte() {
if (ptr < buflen) {
return true;
} else {
ptr = 0;
try {
buflen = in.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
if (buflen <= 0) {
return false;
}
}
return true;
}
private int readByte() {
if (hasNextByte()) return buffer[ptr++];
else return -1;
}
private static boolean isPrintableChar(int c) {
return 33 <= c && c <= 126;
}
public boolean hasNext() {
while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
return hasNextByte();
}
public String next() {
if (!hasNext()) throw new NoSuchElementException();
StringBuilder sb = new StringBuilder();
int b = readByte();
while (isPrintableChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public long nextLong() {
if (!hasNext()) throw new NoSuchElementException();
long n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
if (b < '0' || '9' < b) {
throw new NumberFormatException();
}
while (true) {
if ('0' <= b && b <= '9') {
n *= 10;
n += b - '0';
} else if (b == -1 || !isPrintableChar(b)) {
return minus ? -n : n;
} else {
throw new NumberFormatException();
}
b = readByte();
}
}
public int nextInt() {
long nl = nextLong();
if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
return (int) nl;
}
public double nextDouble() {
return Double.parseDouble(next());
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
17,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
4,
13,
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,
18,
13,
13,
13,
12,
13,
30,
0,
13,
20,
41,
13,
4,
18,
13,
17,
14,
2,
13,
17,
30,
38,
5,
13,
30,
37,
20,
30,
0,
13,
20,
41,
13,
17,
42,
13,
30,
4,
13,
38,
5,
13,
30,
37,
20,
30,
4,
18,
13,
17,
14,
2,
4,
18,
13,
17,
30,
4,
18,
13,
4,
18,
18,
13,
13,
17,
30,
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,
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,
29,
4,
18,
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,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
249,
8
],
[
249,
9
],
[
9,
10
],
[
249,
11
],
[
11,
12
],
[
11,
13
],
[
249,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
16,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
16,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
27,
29
],
[
16,
30
],
[
30,
31
],
[
31,
32
],
[
30,
33
],
[
16,
34
],
[
34,
35
],
[
34,
36
],
[
16,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
42,
43
],
[
42,
44
],
[
37,
45
],
[
45,
46
],
[
46,
47
],
[
37,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
51,
52
],
[
51,
53
],
[
16,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
54,
59
],
[
249,
60
],
[
60,
61
],
[
60,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
62,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
72,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
77,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
62,
87
],
[
87,
88
],
[
87,
89
],
[
62,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
95,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
101,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
107,
111
],
[
106,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
112,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
116,
121
],
[
106,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
60,
126
],
[
126,
127
],
[
249,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
132,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
131,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
145,
146
],
[
141,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
130,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
249,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
159,
160
],
[
160,
161
],
[
159,
162
],
[
162,
163
],
[
249,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
168,
171
],
[
171,
172
],
[
249,
173
],
[
173,
174
],
[
173,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
177,
180
],
[
180,
181
],
[
249,
182
],
[
182,
183
],
[
182,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
189,
194
],
[
194,
195
],
[
194,
196
],
[
189,
197
],
[
197,
198
],
[
198,
199
],
[
189,
200
],
[
200,
201
],
[
201,
202
],
[
202,
203
],
[
202,
204
],
[
201,
205
],
[
205,
206
],
[
184,
207
],
[
207,
208
],
[
182,
209
],
[
209,
210
],
[
249,
211
],
[
211,
212
],
[
211,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
249,
219
],
[
219,
220
],
[
219,
221
],
[
221,
222
],
[
222,
223
],
[
222,
224
],
[
221,
226
],
[
226,
227
],
[
227,
228
],
[
228,
229
],
[
228,
230
],
[
226,
231
],
[
231,
232
],
[
231,
233
],
[
226,
234
],
[
234,
235
],
[
235,
236
],
[
226,
237
],
[
237,
238
],
[
238,
239
],
[
239,
240
],
[
239,
241
],
[
238,
242
],
[
242,
243
],
[
221,
244
],
[
244,
245
],
[
219,
246
],
[
246,
247
],
[
0,
248
],
[
248,
249
],
[
248,
250
]
]
| [
"import java.util.*;\nimport java.io.*;\n\npublic class Main {\t\n\n\tprivate static void solve(){\n\t\t//Implement solution here.\n\t\tint N = ni();\n\t\tint K = ni();\n\t\tint[] p = na(N);\n\t\tArrays.sort(p);\n\t\tint result = 0;\n\t\tfor(int i = 0; i < K; i++)result+=p[i];\n\t\tSystem.out.println(result);\n\t}\n\n\t//Switch input source (stdin/file)\n\tprivate static BufferedReader br;\n\tpublic static void main(String[] args){\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\tString debugDataPath = System.getenv(\"DD_PATH\"); \n\t\tif(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\tboolean hasNext = true;\n\t\twhile(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}\n\t}\n\n\t//Input read utility\n\tprivate static StringTokenizer tokenizer = null;\n\tpublic static String next() {\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\treturn tokenizer.nextToken();\n\t}\n\t//Get next single int\n\tprivate static int ni() {\n\t\treturn Integer.parseInt(next());\n\t}\n\t//Get next single long\n\tprivate static long nl() {\n\t\treturn Long.parseLong(next());\n\t}\n\t//Get next single double\n\tprivate static double nd() {\n\t\treturn Double.parseDouble(next());\n\t}\n\t//Get next int array from one line\n\tprivate static int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\t//Get next char array from one line\n\tprivate static char[] ns() {\n\t\treturn next().toCharArray();\n\t}\n\t//Get next long array from one line\n\tprivate static long[] nal(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\t\n\n\tprivate static void solve(){\n\t\t//Implement solution here.\n\t\tint N = ni();\n\t\tint K = ni();\n\t\tint[] p = na(N);\n\t\tArrays.sort(p);\n\t\tint result = 0;\n\t\tfor(int i = 0; i < K; i++)result+=p[i];\n\t\tSystem.out.println(result);\n\t}\n\n\t//Switch input source (stdin/file)\n\tprivate static BufferedReader br;\n\tpublic static void main(String[] args){\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\tString debugDataPath = System.getenv(\"DD_PATH\"); \n\t\tif(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\tboolean hasNext = true;\n\t\twhile(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}\n\t}\n\n\t//Input read utility\n\tprivate static StringTokenizer tokenizer = null;\n\tpublic static String next() {\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\treturn tokenizer.nextToken();\n\t}\n\t//Get next single int\n\tprivate static int ni() {\n\t\treturn Integer.parseInt(next());\n\t}\n\t//Get next single long\n\tprivate static long nl() {\n\t\treturn Long.parseLong(next());\n\t}\n\t//Get next single double\n\tprivate static double nd() {\n\t\treturn Double.parseDouble(next());\n\t}\n\t//Get next int array from one line\n\tprivate static int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\t//Get next char array from one line\n\tprivate static char[] ns() {\n\t\treturn next().toCharArray();\n\t}\n\t//Get next long array from one line\n\tprivate static long[] nal(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}\n}",
"Main",
"//Switch input source (stdin/file)\n\tprivate static BufferedReader br;",
"br",
"//Input read utility\n\tprivate static StringTokenizer tokenizer = null;",
"tokenizer",
"null",
"private static void solve(){\n\t\t//Implement solution here.\n\t\tint N = ni();\n\t\tint K = ni();\n\t\tint[] p = na(N);\n\t\tArrays.sort(p);\n\t\tint result = 0;\n\t\tfor(int i = 0; i < K; i++)result+=p[i];\n\t\tSystem.out.println(result);\n\t}",
"solve",
"{\n\t\t//Implement solution here.\n\t\tint N = ni();\n\t\tint K = ni();\n\t\tint[] p = na(N);\n\t\tArrays.sort(p);\n\t\tint result = 0;\n\t\tfor(int i = 0; i < K; i++)result+=p[i];\n\t\tSystem.out.println(result);\n\t}",
"int N = ni();",
"N",
"ni()",
"ni",
"int K = ni();",
"K",
"ni()",
"ni",
"int[] p = na(N);",
"p",
"na(N)",
"na",
"N",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"int result = 0;",
"result",
"0",
"for(int i = 0; i < K; i++)result+=p[i];",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < K",
"i",
"K",
"i++",
"i++",
"i",
"result+=p[i];",
"result+=p[i]",
"result",
"p[i]",
"p",
"i",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"public static void main(String[] args){\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\tString debugDataPath = System.getenv(\"DD_PATH\"); \n\t\tif(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\tboolean hasNext = true;\n\t\twhile(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}\n\t}",
"main",
"{\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\tString debugDataPath = System.getenv(\"DD_PATH\"); \n\t\tif(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\tboolean hasNext = true;\n\t\twhile(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}\n\t}",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String debugDataPath = System.getenv(\"DD_PATH\");",
"debugDataPath",
"System.getenv(\"DD_PATH\")",
"System.getenv",
"System",
"\"DD_PATH\"",
"if(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}",
"debugDataPath != null",
"debugDataPath",
"null",
"{\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}",
"try{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"Exception e",
"{\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}",
"br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))))",
"br",
"new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))))",
"boolean hasNext = true;",
"hasNext",
"true",
"while(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}",
"hasNext",
"{\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}",
"solve()",
"solve",
"try{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"Exception e",
"{\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}",
"br.mark(1)",
"br.mark",
"br",
"1",
"if(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}",
"br.read() > 0",
"br.read()",
"br.read",
"br",
"0",
"{\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t}",
"br.reset()",
"br.reset",
"br",
"System.out.println(\"---\")",
"System.out.println",
"System.out",
"System",
"System.out",
"\"---\"",
"{\n\t\t\t\t\thasNext = false;\n\t\t\t\t}",
"hasNext = false",
"hasNext",
"false",
"String[] args",
"args",
"public static String next() {\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\treturn tokenizer.nextToken();\n\t}",
"next",
"{\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\treturn tokenizer.nextToken();\n\t}",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}",
"try {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"Exception e",
"{\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}",
"throw new RuntimeException(e);",
"new RuntimeException(e)",
"{\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t}",
"tokenizer = new StringTokenizer(br.readLine())",
"tokenizer",
"new StringTokenizer(br.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"//Get next single int\n\tprivate static int ni() {\n\t\treturn Integer.parseInt(next());\n\t}",
"ni",
"{\n\t\treturn Integer.parseInt(next());\n\t}",
"return Integer.parseInt(next());",
"Integer.parseInt(next())",
"Integer.parseInt",
"Integer",
"next()",
"next",
"//Get next single long\n\tprivate static long nl() {\n\t\treturn Long.parseLong(next());\n\t}",
"nl",
"{\n\t\treturn Long.parseLong(next());\n\t}",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"//Get next single double\n\tprivate static double nd() {\n\t\treturn Double.parseDouble(next());\n\t}",
"nd",
"{\n\t\treturn Double.parseDouble(next());\n\t}",
"return Double.parseDouble(next());",
"Double.parseDouble(next())",
"Double.parseDouble",
"Double",
"next()",
"next",
"//Get next int array from one line\n\tprivate static int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}",
"na",
"{\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = ni();",
"a[i] = ni()",
"a[i]",
"a",
"i",
"ni()",
"ni",
"return a;",
"a",
"int n",
"n",
"//Get next char array from one line\n\tprivate static char[] ns() {\n\t\treturn next().toCharArray();\n\t}",
"ns",
"{\n\t\treturn next().toCharArray();\n\t}",
"return next().toCharArray();",
"next().toCharArray()",
"next().toCharArray",
"next()",
"next",
"//Get next long array from one line\n\tprivate static long[] nal(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}",
"nal",
"{\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = nl();",
"a[i] = nl()",
"a[i]",
"a",
"i",
"nl()",
"nl",
"return a;",
"a",
"int n",
"n",
"public class Main {\t\n\n\tprivate static void solve(){\n\t\t//Implement solution here.\n\t\tint N = ni();\n\t\tint K = ni();\n\t\tint[] p = na(N);\n\t\tArrays.sort(p);\n\t\tint result = 0;\n\t\tfor(int i = 0; i < K; i++)result+=p[i];\n\t\tSystem.out.println(result);\n\t}\n\n\t//Switch input source (stdin/file)\n\tprivate static BufferedReader br;\n\tpublic static void main(String[] args){\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\tString debugDataPath = System.getenv(\"DD_PATH\"); \n\t\tif(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\tboolean hasNext = true;\n\t\twhile(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}\n\t}\n\n\t//Input read utility\n\tprivate static StringTokenizer tokenizer = null;\n\tpublic static String next() {\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\treturn tokenizer.nextToken();\n\t}\n\t//Get next single int\n\tprivate static int ni() {\n\t\treturn Integer.parseInt(next());\n\t}\n\t//Get next single long\n\tprivate static long nl() {\n\t\treturn Long.parseLong(next());\n\t}\n\t//Get next single double\n\tprivate static double nd() {\n\t\treturn Double.parseDouble(next());\n\t}\n\t//Get next int array from one line\n\tprivate static int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\t//Get next char array from one line\n\tprivate static char[] ns() {\n\t\treturn next().toCharArray();\n\t}\n\t//Get next long array from one line\n\tprivate static long[] nal(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}\n}",
"public class Main {\t\n\n\tprivate static void solve(){\n\t\t//Implement solution here.\n\t\tint N = ni();\n\t\tint K = ni();\n\t\tint[] p = na(N);\n\t\tArrays.sort(p);\n\t\tint result = 0;\n\t\tfor(int i = 0; i < K; i++)result+=p[i];\n\t\tSystem.out.println(result);\n\t}\n\n\t//Switch input source (stdin/file)\n\tprivate static BufferedReader br;\n\tpublic static void main(String[] args){\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\n\t\tString debugDataPath = System.getenv(\"DD_PATH\"); \n\t\tif(debugDataPath != null){\n\t\t\ttry{\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\tboolean hasNext = true;\n\t\twhile(hasNext){\n\t\t\tsolve();\t\n\t\t\ttry{\n\t\t\t\tbr.mark(1);\n\t\t\t\tif(br.read() > 0){\n\t\t\t\t\tbr.reset();\t\t\t\n\t\t\t\t\tSystem.out.println(\"---\");\n\t\t\t\t} else {\n\t\t\t\t\thasNext = false;\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t} \n\t\t}\n\t}\n\n\t//Input read utility\n\tprivate static StringTokenizer tokenizer = null;\n\tpublic static String next() {\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\n\t\t\ttry {\n\t\t\t\ttokenizer = new StringTokenizer(br.readLine());\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t\treturn tokenizer.nextToken();\n\t}\n\t//Get next single int\n\tprivate static int ni() {\n\t\treturn Integer.parseInt(next());\n\t}\n\t//Get next single long\n\tprivate static long nl() {\n\t\treturn Long.parseLong(next());\n\t}\n\t//Get next single double\n\tprivate static double nd() {\n\t\treturn Double.parseDouble(next());\n\t}\n\t//Get next int array from one line\n\tprivate static int[] na(int n) {\n\t\tint[] a = new int[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = ni();\n\t\treturn a;\n\t}\n\t//Get next char array from one line\n\tprivate static char[] ns() {\n\t\treturn next().toCharArray();\n\t}\n\t//Get next long array from one line\n\tprivate static long[] nal(int n) {\n\t\tlong[] a = new long[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\ta[i] = nl();\n\t\treturn a;\n\t}\n}",
"Main"
]
| import java.util.*;
import java.io.*;
public class Main {
private static void solve(){
//Implement solution here.
int N = ni();
int K = ni();
int[] p = na(N);
Arrays.sort(p);
int result = 0;
for(int i = 0; i < K; i++)result+=p[i];
System.out.println(result);
}
//Switch input source (stdin/file)
private static BufferedReader br;
public static void main(String[] args){
br = new BufferedReader(new InputStreamReader(System.in));
String debugDataPath = System.getenv("DD_PATH");
if(debugDataPath != null){
try{
br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
}catch(Exception e){
throw new RuntimeException(e);
}
}
boolean hasNext = true;
while(hasNext){
solve();
try{
br.mark(1);
if(br.read() > 0){
br.reset();
System.out.println("---");
} else {
hasNext = false;
}
}catch(Exception e){
throw new RuntimeException(e);
}
}
}
//Input read utility
private static StringTokenizer tokenizer = null;
public static String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(br.readLine());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
//Get next single int
private static int ni() {
return Integer.parseInt(next());
}
//Get next single long
private static long nl() {
return Long.parseLong(next());
}
//Get next single double
private static double nd() {
return Double.parseDouble(next());
}
//Get next int array from one line
private static int[] na(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++)
a[i] = ni();
return a;
}
//Get next char array from one line
private static char[] ns() {
return next().toCharArray();
}
//Get next long array from one line
private static long[] nal(int n) {
long[] a = new long[n];
for (int i = 0; i < n; i++)
a[i] = nl();
return a;
}
}
|
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
11,
1,
41,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
18,
13,
13,
30,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
13,
0,
18,
13,
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,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
128,
5
],
[
128,
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
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
46,
51
],
[
51,
52
],
[
51,
53
],
[
46,
54
],
[
54,
55
],
[
55,
56
],
[
46,
57
],
[
58,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
64,
66
],
[
59,
67
],
[
67,
68
],
[
68,
69
],
[
59,
70
],
[
71,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
73,
77
],
[
77,
78
],
[
77,
79
],
[
72,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
80,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
86,
90
],
[
90,
91
],
[
90,
92
],
[
80,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
93,
97
],
[
8,
98
],
[
98,
99
],
[
98,
100
],
[
8,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
101,
106
],
[
106,
107
],
[
106,
108
],
[
101,
109
],
[
109,
110
],
[
110,
111
],
[
101,
112
],
[
113,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
116,
117
],
[
116,
118
],
[
8,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
6,
125
],
[
125,
126
],
[
0,
127
],
[
127,
128
],
[
127,
129
]
]
| [
"import java.util.Scanner;\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 k = sc.nextInt();\n\t\tint[] price = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tprice[i] = sc.nextInt();\n\t\t}\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tfor(int j = i; j < n; j++){\n\t\t\t\tif(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint res = 0;\n\t\tfor(int i = 0; i < k; i++){\n\t\t\tres += price[i];\n\t\t}\n\t\tSystem.out.println(res);\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 k = sc.nextInt();\n\t\tint[] price = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tprice[i] = sc.nextInt();\n\t\t}\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tfor(int j = i; j < n; j++){\n\t\t\t\tif(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint res = 0;\n\t\tfor(int i = 0; i < k; i++){\n\t\t\tres += price[i];\n\t\t}\n\t\tSystem.out.println(res);\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 k = sc.nextInt();\n\t\tint[] price = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tprice[i] = sc.nextInt();\n\t\t}\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tfor(int j = i; j < n; j++){\n\t\t\t\tif(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint res = 0;\n\t\tfor(int i = 0; i < k; i++){\n\t\t\tres += price[i];\n\t\t}\n\t\tSystem.out.println(res);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] price = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tprice[i] = sc.nextInt();\n\t\t}\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tfor(int j = i; j < n; j++){\n\t\t\t\tif(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint res = 0;\n\t\tfor(int i = 0; i < k; i++){\n\t\t\tres += price[i];\n\t\t}\n\t\tSystem.out.println(res);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] price = new int[n];",
"price",
"new int[n]",
"n",
"for(int i = 0; i < n; i++){\n\t\t\tprice[i] = sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tprice[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tprice[i] = sc.nextInt();\n\t\t}",
"price[i] = sc.nextInt()",
"price[i]",
"price",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int i = 0; i < n; i++){\n\t\t\tfor(int j = i; j < n; j++){\n\t\t\t\tif(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j = i; j < n; j++){\n\t\t\t\tif(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j = i; j < n; j++){\n\t\t\t\tif(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j = i; j < n; j++){\n\t\t\t\tif(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}\n\t\t\t}",
"int j = i;",
"int j = i;",
"j",
"i",
"j < n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\t\t\tif(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}\n\t\t\t}",
"if(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}",
"price[i] > price[j]",
"price[i]",
"price",
"i",
"price[j]",
"price",
"j",
"{\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}",
"int tmp = price[i];",
"tmp",
"price[i]",
"price",
"i",
"price[i] = price[j]",
"price[i]",
"price",
"i",
"price[j]",
"price",
"j",
"price[j] = tmp",
"price[j]",
"price",
"j",
"tmp",
"int res = 0;",
"res",
"0",
"for(int i = 0; i < k; i++){\n\t\t\tres += price[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tres += price[i];\n\t\t}",
"{\n\t\t\tres += price[i];\n\t\t}",
"res += price[i]",
"res",
"price[i]",
"price",
"i",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"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 k = sc.nextInt();\n\t\tint[] price = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tprice[i] = sc.nextInt();\n\t\t}\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tfor(int j = i; j < n; j++){\n\t\t\t\tif(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint res = 0;\n\t\tfor(int i = 0; i < k; i++){\n\t\t\tres += price[i];\n\t\t}\n\t\tSystem.out.println(res);\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 k = sc.nextInt();\n\t\tint[] price = new int[n];\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tprice[i] = sc.nextInt();\n\t\t}\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tfor(int j = i; j < n; j++){\n\t\t\t\tif(price[i] > price[j]){\n\t\t\t\t\tint tmp = price[i];\n\t\t\t\t\tprice[i] = price[j];\n\t\t\t\t\tprice[j] = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint res = 0;\n\t\tfor(int i = 0; i < k; i++){\n\t\t\tres += price[i];\n\t\t}\n\t\tSystem.out.println(res);\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 k = sc.nextInt();
int[] price = new int[n];
for(int i = 0; i < n; i++){
price[i] = sc.nextInt();
}
for(int i = 0; i < n; i++){
for(int j = i; j < n; j++){
if(price[i] > price[j]){
int tmp = price[i];
price[i] = price[j];
price[j] = tmp;
}
}
}
int res = 0;
for(int i = 0; i < k; i++){
res += price[i];
}
System.out.println(res);
}
} |
[
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,
0,
18,
13,
13,
4,
18,
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,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
78,
5
],
[
78,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
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
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
43,
44
],
[
8,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
8,
49
],
[
49,
50
],
[
49,
51
],
[
8,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
8,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
6,
75
],
[
75,
76
],
[
0,
77
],
[
77,
78
],
[
77,
79
]
]
| [
"import java.util.*;\n\npublic class Main {\n \n\tpublic static void main(String[] args) {\n Scanner sr = new Scanner(System.in);\n int N = sr.nextInt();\n int K = sr.nextInt();\n int p[] = new int[N];\n for(int i = 0;i<N;i++)\n p[i] = sr.nextInt();\n Arrays.sort(p);\n int sum = 0;\n for(int j = 0;j<K;j++)\n sum+=p[j];\n System.out.print(sum);\n \n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n \n\tpublic static void main(String[] args) {\n Scanner sr = new Scanner(System.in);\n int N = sr.nextInt();\n int K = sr.nextInt();\n int p[] = new int[N];\n for(int i = 0;i<N;i++)\n p[i] = sr.nextInt();\n Arrays.sort(p);\n int sum = 0;\n for(int j = 0;j<K;j++)\n sum+=p[j];\n System.out.print(sum);\n \n\t}\n}",
"Main",
"public static void main(String[] args) {\n Scanner sr = new Scanner(System.in);\n int N = sr.nextInt();\n int K = sr.nextInt();\n int p[] = new int[N];\n for(int i = 0;i<N;i++)\n p[i] = sr.nextInt();\n Arrays.sort(p);\n int sum = 0;\n for(int j = 0;j<K;j++)\n sum+=p[j];\n System.out.print(sum);\n \n\t}",
"main",
"{\n Scanner sr = new Scanner(System.in);\n int N = sr.nextInt();\n int K = sr.nextInt();\n int p[] = new int[N];\n for(int i = 0;i<N;i++)\n p[i] = sr.nextInt();\n Arrays.sort(p);\n int sum = 0;\n for(int j = 0;j<K;j++)\n sum+=p[j];\n System.out.print(sum);\n \n\t}",
"Scanner sr = new Scanner(System.in);",
"sr",
"new Scanner(System.in)",
"int N = sr.nextInt();",
"N",
"sr.nextInt()",
"sr.nextInt",
"sr",
"int K = sr.nextInt();",
"K",
"sr.nextInt()",
"sr.nextInt",
"sr",
"int p[] = new int[N];",
"p",
"new int[N]",
"N",
"for(int i = 0;i<N;i++)\n p[i] = sr.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"p[i] = sr.nextInt();",
"p[i] = sr.nextInt()",
"p[i]",
"p",
"i",
"sr.nextInt()",
"sr.nextInt",
"sr",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"int sum = 0;",
"sum",
"0",
"for(int j = 0;j<K;j++)\n sum+=p[j];",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j<K",
"j",
"K",
"j++",
"j++",
"j",
"sum+=p[j];",
"sum+=p[j]",
"sum",
"p[j]",
"p",
"j",
"System.out.print(sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n \n\tpublic static void main(String[] args) {\n Scanner sr = new Scanner(System.in);\n int N = sr.nextInt();\n int K = sr.nextInt();\n int p[] = new int[N];\n for(int i = 0;i<N;i++)\n p[i] = sr.nextInt();\n Arrays.sort(p);\n int sum = 0;\n for(int j = 0;j<K;j++)\n sum+=p[j];\n System.out.print(sum);\n \n\t}\n}",
"public class Main {\n \n\tpublic static void main(String[] args) {\n Scanner sr = new Scanner(System.in);\n int N = sr.nextInt();\n int K = sr.nextInt();\n int p[] = new int[N];\n for(int i = 0;i<N;i++)\n p[i] = sr.nextInt();\n Arrays.sort(p);\n int sum = 0;\n for(int j = 0;j<K;j++)\n sum+=p[j];\n System.out.print(sum);\n \n\t}\n}",
"Main"
]
| import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sr = new Scanner(System.in);
int N = sr.nextInt();
int K = sr.nextInt();
int p[] = new int[N];
for(int i = 0;i<N;i++)
p[i] = sr.nextInt();
Arrays.sort(p);
int sum = 0;
for(int j = 0;j<K;j++)
sum+=p[j];
System.out.print(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,
0,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
4,
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,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
114,
8
],
[
114,
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
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
66,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
73,
74
],
[
73,
75
],
[
11,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
11,
80
],
[
80,
81
],
[
80,
82
],
[
11,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
83,
91
],
[
91,
92
],
[
92,
93
],
[
83,
94
],
[
95,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
11,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
11,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
105,
110
],
[
9,
111
],
[
111,
112
],
[
0,
113
],
[
113,
114
],
[
113,
115
]
]
| [
"import java.io.*;\nimport java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n String [] inp = buffer.readLine().split(\" \");\n int n = Integer.parseInt(inp[0]), k = Integer.parseInt(inp[1]);\n inp = buffer.readLine().split(\" \");\n int [] prices = new int[n];\n for (int pos = 0; pos < n; pos++)\n prices[pos] = Integer.parseInt(inp[pos]);\n Arrays.sort(prices);\n int sum = 0;\n for (int pos = 0; pos < k; pos++) {\n sum += prices[pos];\n }\n sb.append(sum);\n System.out.println(sb);\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n String [] inp = buffer.readLine().split(\" \");\n int n = Integer.parseInt(inp[0]), k = Integer.parseInt(inp[1]);\n inp = buffer.readLine().split(\" \");\n int [] prices = new int[n];\n for (int pos = 0; pos < n; pos++)\n prices[pos] = Integer.parseInt(inp[pos]);\n Arrays.sort(prices);\n int sum = 0;\n for (int pos = 0; pos < k; pos++) {\n sum += prices[pos];\n }\n sb.append(sum);\n System.out.println(sb);\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n String [] inp = buffer.readLine().split(\" \");\n int n = Integer.parseInt(inp[0]), k = Integer.parseInt(inp[1]);\n inp = buffer.readLine().split(\" \");\n int [] prices = new int[n];\n for (int pos = 0; pos < n; pos++)\n prices[pos] = Integer.parseInt(inp[pos]);\n Arrays.sort(prices);\n int sum = 0;\n for (int pos = 0; pos < k; pos++) {\n sum += prices[pos];\n }\n sb.append(sum);\n System.out.println(sb);\n }",
"main",
"{\n BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n String [] inp = buffer.readLine().split(\" \");\n int n = Integer.parseInt(inp[0]), k = Integer.parseInt(inp[1]);\n inp = buffer.readLine().split(\" \");\n int [] prices = new int[n];\n for (int pos = 0; pos < n; pos++)\n prices[pos] = Integer.parseInt(inp[pos]);\n Arrays.sort(prices);\n int sum = 0;\n for (int pos = 0; pos < k; pos++) {\n sum += prices[pos];\n }\n sb.append(sum);\n System.out.println(sb);\n }",
"BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));",
"buffer",
"new BufferedReader(new InputStreamReader(System.in))",
"StringBuilder sb = new StringBuilder();",
"sb",
"new StringBuilder()",
"String [] inp = buffer.readLine().split(\" \");",
"inp",
"buffer.readLine().split(\" \")",
"buffer.readLine().split",
"buffer.readLine()",
"buffer.readLine",
"buffer",
"\" \"",
"int n = Integer.parseInt(inp[0])",
"n",
"Integer.parseInt(inp[0])",
"Integer.parseInt",
"Integer",
"inp[0]",
"inp",
"0",
"k = Integer.parseInt(inp[1]);",
"k",
"Integer.parseInt(inp[1])",
"Integer.parseInt",
"Integer",
"inp[1]",
"inp",
"1",
"inp = buffer.readLine().split(\" \")",
"inp",
"buffer.readLine().split(\" \")",
"buffer.readLine().split",
"buffer.readLine()",
"buffer.readLine",
"buffer",
"\" \"",
"int [] prices = new int[n];",
"prices",
"new int[n]",
"n",
"for (int pos = 0; pos < n; pos++)\n prices[pos] = Integer.parseInt(inp[pos]);",
"int pos = 0;",
"int pos = 0;",
"pos",
"0",
"pos < n",
"pos",
"n",
"pos++",
"pos++",
"pos",
"prices[pos] = Integer.parseInt(inp[pos]);",
"prices[pos] = Integer.parseInt(inp[pos])",
"prices[pos]",
"prices",
"pos",
"Integer.parseInt(inp[pos])",
"Integer.parseInt",
"Integer",
"inp[pos]",
"inp",
"pos",
"Arrays.sort(prices)",
"Arrays.sort",
"Arrays",
"prices",
"int sum = 0;",
"sum",
"0",
"for (int pos = 0; pos < k; pos++) {\n sum += prices[pos];\n }",
"int pos = 0;",
"int pos = 0;",
"pos",
"0",
"pos < k",
"pos",
"k",
"pos++",
"pos++",
"pos",
"{\n sum += prices[pos];\n }",
"{\n sum += prices[pos];\n }",
"sum += prices[pos]",
"sum",
"prices[pos]",
"prices",
"pos",
"sb.append(sum)",
"sb.append",
"sb",
"sum",
"System.out.println(sb)",
"System.out.println",
"System.out",
"System",
"System.out",
"sb",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n String [] inp = buffer.readLine().split(\" \");\n int n = Integer.parseInt(inp[0]), k = Integer.parseInt(inp[1]);\n inp = buffer.readLine().split(\" \");\n int [] prices = new int[n];\n for (int pos = 0; pos < n; pos++)\n prices[pos] = Integer.parseInt(inp[pos]);\n Arrays.sort(prices);\n int sum = 0;\n for (int pos = 0; pos < k; pos++) {\n sum += prices[pos];\n }\n sb.append(sum);\n System.out.println(sb);\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb = new StringBuilder();\n String [] inp = buffer.readLine().split(\" \");\n int n = Integer.parseInt(inp[0]), k = Integer.parseInt(inp[1]);\n inp = buffer.readLine().split(\" \");\n int [] prices = new int[n];\n for (int pos = 0; pos < n; pos++)\n prices[pos] = Integer.parseInt(inp[pos]);\n Arrays.sort(prices);\n int sum = 0;\n for (int pos = 0; pos < k; pos++) {\n sum += prices[pos];\n }\n sb.append(sum);\n System.out.println(sb);\n }\n}",
"Main"
]
| import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
String [] inp = buffer.readLine().split(" ");
int n = Integer.parseInt(inp[0]), k = Integer.parseInt(inp[1]);
inp = buffer.readLine().split(" ");
int [] prices = new int[n];
for (int pos = 0; pos < n; pos++)
prices[pos] = Integer.parseInt(inp[pos]);
Arrays.sort(prices);
int sum = 0;
for (int pos = 0; pos < k; pos++) {
sum += prices[pos];
}
sb.append(sum);
System.out.println(sb);
}
}
|
[
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,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
4,
18,
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,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
96,
14
],
[
96,
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
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
17,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
55,
62
],
[
62,
63
],
[
63,
64
],
[
17,
65
],
[
65,
66
],
[
65,
67
],
[
17,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
68,
79
],
[
80,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
17,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
89,
91
],
[
87,
92
],
[
15,
93
],
[
93,
94
],
[
0,
95
],
[
95,
96
],
[
95,
97
]
]
| [
"import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\nimport java.util.stream.Collectors;\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 k = sc.nextInt();\n List<Integer> list = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n list.add(sc.nextInt());\n }\n List<Integer> collect = list.stream().sorted().collect(Collectors.toList());\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += collect.get(i);\n }\n System.out.println(sum);\n }\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.stream.Collectors;",
"Collectors",
"java.util.stream",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n List<Integer> list = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n list.add(sc.nextInt());\n }\n List<Integer> collect = list.stream().sorted().collect(Collectors.toList());\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += collect.get(i);\n }\n System.out.println(sum);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n List<Integer> list = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n list.add(sc.nextInt());\n }\n List<Integer> collect = list.stream().sorted().collect(Collectors.toList());\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += collect.get(i);\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n List<Integer> list = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n list.add(sc.nextInt());\n }\n List<Integer> collect = list.stream().sorted().collect(Collectors.toList());\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += collect.get(i);\n }\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"List<Integer> list = new ArrayList<>();",
"list",
"new ArrayList<>()",
"for (int i = 0; i < n; i++) {\n list.add(sc.nextInt());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n list.add(sc.nextInt());\n }",
"{\n list.add(sc.nextInt());\n }",
"list.add(sc.nextInt())",
"list.add",
"list",
"sc.nextInt()",
"sc.nextInt",
"sc",
"List<Integer> collect = list.stream().sorted().collect(Collectors.toList());",
"collect",
"list.stream().sorted().collect(Collectors.toList())",
"list.stream().sorted().collect",
"list.stream().sorted()",
"list.stream().sorted",
"list.stream()",
"list.stream",
"list",
"Collectors.toList()",
"Collectors.toList",
"Collectors",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < k; i++) {\n sum += collect.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n sum += collect.get(i);\n }",
"{\n sum += collect.get(i);\n }",
"sum += collect.get(i)",
"sum",
"collect.get(i)",
"collect.get",
"collect",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"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 k = sc.nextInt();\n List<Integer> list = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n list.add(sc.nextInt());\n }\n List<Integer> collect = list.stream().sorted().collect(Collectors.toList());\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += collect.get(i);\n }\n System.out.println(sum);\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 k = sc.nextInt();\n List<Integer> list = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n list.add(sc.nextInt());\n }\n List<Integer> collect = list.stream().sorted().collect(Collectors.toList());\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += collect.get(i);\n }\n System.out.println(sum);\n }\n}",
"Main"
]
| import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
List<Integer> list = new ArrayList<>();
for (int i = 0; i < n; i++) {
list.add(sc.nextInt());
}
List<Integer> collect = list.stream().sorted().collect(Collectors.toList());
int sum = 0;
for (int i = 0; i < k; i++) {
sum += collect.get(i);
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
4,
18,
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,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
95,
8
],
[
95,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
17,
20
],
[
20,
21
],
[
21,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
25,
28
],
[
28,
29
],
[
29,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
11,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
35,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
56,
57
],
[
11,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
11,
62
],
[
62,
63
],
[
62,
64
],
[
11,
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
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
11,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
11,
89
],
[
89,
90
],
[
90,
91
],
[
9,
92
],
[
92,
93
],
[
0,
94
],
[
94,
95
],
[
94,
96
]
]
| [
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n int varieties = Integer.parseInt(sc.next());\n int buyCount = Integer.parseInt(sc.next());\n int[] prices = new int[varieties];\n for (int i = 0; i < varieties; i++) {\n prices[i] = Integer.parseInt(sc.next());\n }\n\n Arrays.sort(prices);\n\n int sum = 0;\n for (int i = 0; i < buyCount; i++) {\n sum += prices[i];\n }\n\n System.out.println(sum);\n sc.close();\n }\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n int varieties = Integer.parseInt(sc.next());\n int buyCount = Integer.parseInt(sc.next());\n int[] prices = new int[varieties];\n for (int i = 0; i < varieties; i++) {\n prices[i] = Integer.parseInt(sc.next());\n }\n\n Arrays.sort(prices);\n\n int sum = 0;\n for (int i = 0; i < buyCount; i++) {\n sum += prices[i];\n }\n\n System.out.println(sum);\n sc.close();\n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n int varieties = Integer.parseInt(sc.next());\n int buyCount = Integer.parseInt(sc.next());\n int[] prices = new int[varieties];\n for (int i = 0; i < varieties; i++) {\n prices[i] = Integer.parseInt(sc.next());\n }\n\n Arrays.sort(prices);\n\n int sum = 0;\n for (int i = 0; i < buyCount; i++) {\n sum += prices[i];\n }\n\n System.out.println(sum);\n sc.close();\n }",
"main",
"{\n\n Scanner sc = new Scanner(System.in);\n\n int varieties = Integer.parseInt(sc.next());\n int buyCount = Integer.parseInt(sc.next());\n int[] prices = new int[varieties];\n for (int i = 0; i < varieties; i++) {\n prices[i] = Integer.parseInt(sc.next());\n }\n\n Arrays.sort(prices);\n\n int sum = 0;\n for (int i = 0; i < buyCount; i++) {\n sum += prices[i];\n }\n\n System.out.println(sum);\n sc.close();\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int varieties = Integer.parseInt(sc.next());",
"varieties",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int buyCount = Integer.parseInt(sc.next());",
"buyCount",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"int[] prices = new int[varieties];",
"prices",
"new int[varieties]",
"varieties",
"for (int i = 0; i < varieties; i++) {\n prices[i] = Integer.parseInt(sc.next());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < varieties",
"i",
"varieties",
"i++",
"i++",
"i",
"{\n prices[i] = Integer.parseInt(sc.next());\n }",
"{\n prices[i] = Integer.parseInt(sc.next());\n }",
"prices[i] = Integer.parseInt(sc.next())",
"prices[i]",
"prices",
"i",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"Arrays.sort(prices)",
"Arrays.sort",
"Arrays",
"prices",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < buyCount; i++) {\n sum += prices[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < buyCount",
"i",
"buyCount",
"i++",
"i++",
"i",
"{\n sum += prices[i];\n }",
"{\n sum += prices[i];\n }",
"sum += prices[i]",
"sum",
"prices[i]",
"prices",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n int varieties = Integer.parseInt(sc.next());\n int buyCount = Integer.parseInt(sc.next());\n int[] prices = new int[varieties];\n for (int i = 0; i < varieties; i++) {\n prices[i] = Integer.parseInt(sc.next());\n }\n\n Arrays.sort(prices);\n\n int sum = 0;\n for (int i = 0; i < buyCount; i++) {\n sum += prices[i];\n }\n\n System.out.println(sum);\n sc.close();\n }\n}",
"public class Main {\n public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n\n int varieties = Integer.parseInt(sc.next());\n int buyCount = Integer.parseInt(sc.next());\n int[] prices = new int[varieties];\n for (int i = 0; i < varieties; i++) {\n prices[i] = Integer.parseInt(sc.next());\n }\n\n Arrays.sort(prices);\n\n int sum = 0;\n for (int i = 0; i < buyCount; i++) {\n sum += prices[i];\n }\n\n System.out.println(sum);\n sc.close();\n }\n}",
"Main"
]
| import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int varieties = Integer.parseInt(sc.next());
int buyCount = Integer.parseInt(sc.next());
int[] prices = new int[varieties];
for (int i = 0; i < varieties; i++) {
prices[i] = Integer.parseInt(sc.next());
}
Arrays.sort(prices);
int sum = 0;
for (int i = 0; i < buyCount; i++) {
sum += prices[i];
}
System.out.println(sum);
sc.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
41,
13,
17,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
41,
13,
18,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
18,
13,
13,
4,
18,
13,
13,
12,
13,
30,
41,
13,
4,
18,
13,
41,
13,
20,
4,
18,
13,
41,
13,
4,
18,
13,
14,
13,
4,
18,
18,
13,
13,
2,
17,
2,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
0,
13,
20,
0,
13,
20,
0,
13,
20,
12,
13,
30,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
29,
4,
18,
13,
4,
18,
13,
12,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
41,
13,
18,
13,
13,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
29,
13,
12,
13,
30,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
18,
13,
13,
11,
1,
41,
13,
17,
41,
13,
18,
13,
13,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
29,
13,
12,
13,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
7,
11
],
[
11,
12
],
[
7,
13
],
[
13,
14
],
[
7,
15
],
[
15,
16
],
[
15,
17
],
[
7,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
20,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
20,
29
],
[
29,
30
],
[
30,
31
],
[
29,
32
],
[
20,
33
],
[
33,
34
],
[
33,
35
],
[
20,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
37,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
43,
45
],
[
36,
46
],
[
46,
47
],
[
46,
48
],
[
36,
49
],
[
49,
50
],
[
50,
51
],
[
36,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
55,
57
],
[
20,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
7,
62
],
[
62,
63
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
64,
70
],
[
70,
71
],
[
70,
72
],
[
64,
73
],
[
73,
74
],
[
74,
75
],
[
64,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
64,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
64,
93
],
[
93,
94
],
[
94,
95
],
[
62,
96
],
[
96,
97
],
[
7,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
100,
104
],
[
104,
105
],
[
104,
106
],
[
100,
107
],
[
107,
108
],
[
107,
109
],
[
7,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
117,
118
],
[
118,
119
],
[
7,
120
],
[
120,
121
],
[
120,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
125,
126
],
[
124,
127
],
[
127,
128
],
[
128,
129
],
[
7,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
138,
139
],
[
135,
140
],
[
132,
141
],
[
141,
142
],
[
141,
143
],
[
144,
145
],
[
144,
146
],
[
132,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
148,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
154,
156
],
[
147,
157
],
[
157,
158
],
[
157,
159
],
[
147,
160
],
[
160,
161
],
[
161,
162
],
[
147,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
169,
170
],
[
168,
171
],
[
171,
172
],
[
171,
173
],
[
132,
174
],
[
174,
175
],
[
7,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
181,
186
],
[
178,
187
],
[
187,
188
],
[
187,
189
],
[
190,
191
],
[
190,
192
],
[
178,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
194,
198
],
[
198,
199
],
[
198,
200
],
[
200,
201
],
[
200,
202
],
[
193,
203
],
[
203,
204
],
[
203,
205
],
[
193,
206
],
[
206,
207
],
[
207,
208
],
[
193,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
211,
213
],
[
210,
214
],
[
214,
215
],
[
215,
216
],
[
214,
217
],
[
217,
218
],
[
217,
219
],
[
178,
220
],
[
220,
221
],
[
7,
222
],
[
222,
223
],
[
222,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
224,
228
],
[
228,
229
],
[
229,
230
],
[
224,
231
],
[
231,
232
],
[
232,
233
]
]
| [
"import java.io.*;\nimport java.util.*;\n\nclass Main {\n BufferedReader bf;\n PrintWriter writer;\n StringBuilder sb;\n static boolean local_system = false;\n\n void run() throws IOException {\n int[] c = ints();\n int[] d = ints();\n Arrays.sort(d);\n int sum = 0;\n for(int i = 0,h=c[1];i<h;i++) sum+=d[i];\n writer.println(sum);\n }\n\n public static void main(String[] args) throws IOException {\n long start_time = System.currentTimeMillis();\n Main obj = new Main();\n obj.run();\n long end_time = System.currentTimeMillis();\n if (local_system) obj.writer.println(\"Time : \" + (end_time - start_time));\n obj.close();\n }\n\n public Main(){\n writer = new PrintWriter(System.out);\n bf = new BufferedReader(new InputStreamReader(System.in));\n sb = new StringBuilder();\n }\n\n public int getInt() throws IOException {\n return Integer.parseInt(bf.readLine());\n }\n\n public long getLong() throws IOException {\n return Long.parseLong(bf.readLine());\n }\n\n public int[] ints() throws IOException {\n String[] data = bf.readLine().split(\" \");\n int[] send = new int[data.length];\n for (int i = 0, h = data.length; i < h; i++) send[i] = Integer.parseInt(data[i]);\n return send;\n }\n\n public long[] longs() throws IOException {\n String[] data = bf.readLine().split(\" \");\n long[] send = new long[data.length];\n for (int i = 0, h = data.length; i < h; i++) send[i] = Long.parseLong(data[i]);\n return send;\n }\n\n public void close() throws IOException{\n writer.flush();\n writer.close();\n bf.close();\n }\n}\n\n",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"class Main {\n BufferedReader bf;\n PrintWriter writer;\n StringBuilder sb;\n static boolean local_system = false;\n\n void run() throws IOException {\n int[] c = ints();\n int[] d = ints();\n Arrays.sort(d);\n int sum = 0;\n for(int i = 0,h=c[1];i<h;i++) sum+=d[i];\n writer.println(sum);\n }\n\n public static void main(String[] args) throws IOException {\n long start_time = System.currentTimeMillis();\n Main obj = new Main();\n obj.run();\n long end_time = System.currentTimeMillis();\n if (local_system) obj.writer.println(\"Time : \" + (end_time - start_time));\n obj.close();\n }\n\n public Main(){\n writer = new PrintWriter(System.out);\n bf = new BufferedReader(new InputStreamReader(System.in));\n sb = new StringBuilder();\n }\n\n public int getInt() throws IOException {\n return Integer.parseInt(bf.readLine());\n }\n\n public long getLong() throws IOException {\n return Long.parseLong(bf.readLine());\n }\n\n public int[] ints() throws IOException {\n String[] data = bf.readLine().split(\" \");\n int[] send = new int[data.length];\n for (int i = 0, h = data.length; i < h; i++) send[i] = Integer.parseInt(data[i]);\n return send;\n }\n\n public long[] longs() throws IOException {\n String[] data = bf.readLine().split(\" \");\n long[] send = new long[data.length];\n for (int i = 0, h = data.length; i < h; i++) send[i] = Long.parseLong(data[i]);\n return send;\n }\n\n public void close() throws IOException{\n writer.flush();\n writer.close();\n bf.close();\n }\n}",
"Main",
"BufferedReader bf;",
"bf",
"PrintWriter writer;",
"writer",
"StringBuilder sb;",
"sb",
"static boolean local_system = false;",
"local_system",
"false",
"void run() throws IOException {\n int[] c = ints();\n int[] d = ints();\n Arrays.sort(d);\n int sum = 0;\n for(int i = 0,h=c[1];i<h;i++) sum+=d[i];\n writer.println(sum);\n }",
"run",
"{\n int[] c = ints();\n int[] d = ints();\n Arrays.sort(d);\n int sum = 0;\n for(int i = 0,h=c[1];i<h;i++) sum+=d[i];\n writer.println(sum);\n }",
"int[] c = ints();",
"c",
"ints()",
"ints",
"int[] d = ints();",
"d",
"ints()",
"ints",
"Arrays.sort(d)",
"Arrays.sort",
"Arrays",
"d",
"int sum = 0;",
"sum",
"0",
"for(int i = 0,h=c[1];i<h;i++) sum+=d[i];",
"int i = 0,h=c[1];",
"int i = 0",
"i",
"0",
"h=c[1];",
"h",
"c[1]",
"c",
"1",
"i<h",
"i",
"h",
"i++",
"i++",
"i",
"sum+=d[i];",
"sum+=d[i]",
"sum",
"d[i]",
"d",
"i",
"writer.println(sum)",
"writer.println",
"writer",
"sum",
"public static void main(String[] args) throws IOException {\n long start_time = System.currentTimeMillis();\n Main obj = new Main();\n obj.run();\n long end_time = System.currentTimeMillis();\n if (local_system) obj.writer.println(\"Time : \" + (end_time - start_time));\n obj.close();\n }",
"main",
"{\n long start_time = System.currentTimeMillis();\n Main obj = new Main();\n obj.run();\n long end_time = System.currentTimeMillis();\n if (local_system) obj.writer.println(\"Time : \" + (end_time - start_time));\n obj.close();\n }",
"long start_time = System.currentTimeMillis();",
"start_time",
"System.currentTimeMillis()",
"System.currentTimeMillis",
"System",
"Main obj = new Main();",
"obj",
"new Main()",
"obj.run()",
"obj.run",
"obj",
"long end_time = System.currentTimeMillis();",
"end_time",
"System.currentTimeMillis()",
"System.currentTimeMillis",
"System",
"if (local_system) obj.writer.println(\"Time : \" + (end_time - start_time));",
"local_system",
"obj.writer.println(\"Time : \" + (end_time - start_time))",
"obj.writer.println",
"obj.writer",
"obj",
"obj.writer",
"\"Time : \" + (end_time - start_time)",
"\"Time : \"",
"(end_time - start_time)",
"end_time",
"start_time",
"obj.close()",
"obj.close",
"obj",
"String[] args",
"args",
"public Main(){\n writer = new PrintWriter(System.out);\n bf = new BufferedReader(new InputStreamReader(System.in));\n sb = new StringBuilder();\n }",
"Main",
"{\n writer = new PrintWriter(System.out);\n bf = new BufferedReader(new InputStreamReader(System.in));\n sb = new StringBuilder();\n }",
"writer = new PrintWriter(System.out)",
"writer",
"new PrintWriter(System.out)",
"bf = new BufferedReader(new InputStreamReader(System.in))",
"bf",
"new BufferedReader(new InputStreamReader(System.in))",
"sb = new StringBuilder()",
"sb",
"new StringBuilder()",
"public int getInt() throws IOException {\n return Integer.parseInt(bf.readLine());\n }",
"getInt",
"{\n return Integer.parseInt(bf.readLine());\n }",
"return Integer.parseInt(bf.readLine());",
"Integer.parseInt(bf.readLine())",
"Integer.parseInt",
"Integer",
"bf.readLine()",
"bf.readLine",
"bf",
"public long getLong() throws IOException {\n return Long.parseLong(bf.readLine());\n }",
"getLong",
"{\n return Long.parseLong(bf.readLine());\n }",
"return Long.parseLong(bf.readLine());",
"Long.parseLong(bf.readLine())",
"Long.parseLong",
"Long",
"bf.readLine()",
"bf.readLine",
"bf",
"public int[] ints() throws IOException {\n String[] data = bf.readLine().split(\" \");\n int[] send = new int[data.length];\n for (int i = 0, h = data.length; i < h; i++) send[i] = Integer.parseInt(data[i]);\n return send;\n }",
"ints",
"{\n String[] data = bf.readLine().split(\" \");\n int[] send = new int[data.length];\n for (int i = 0, h = data.length; i < h; i++) send[i] = Integer.parseInt(data[i]);\n return send;\n }",
"String[] data = bf.readLine().split(\" \");",
"data",
"bf.readLine().split(\" \")",
"bf.readLine().split",
"bf.readLine()",
"bf.readLine",
"bf",
"\" \"",
"int[] send = new int[data.length];",
"send",
"new int[data.length]",
"data.length",
"data",
"data.length",
"for (int i = 0, h = data.length; i < h; i++) send[i] = Integer.parseInt(data[i]);",
"int i = 0, h = data.length;",
"int i = 0",
"i",
"0",
"h = data.length;",
"h",
"data.length",
"data",
"data.length",
"i < h",
"i",
"h",
"i++",
"i++",
"i",
"send[i] = Integer.parseInt(data[i]);",
"send[i] = Integer.parseInt(data[i])",
"send[i]",
"send",
"i",
"Integer.parseInt(data[i])",
"Integer.parseInt",
"Integer",
"data[i]",
"data",
"i",
"return send;",
"send",
"public long[] longs() throws IOException {\n String[] data = bf.readLine().split(\" \");\n long[] send = new long[data.length];\n for (int i = 0, h = data.length; i < h; i++) send[i] = Long.parseLong(data[i]);\n return send;\n }",
"longs",
"{\n String[] data = bf.readLine().split(\" \");\n long[] send = new long[data.length];\n for (int i = 0, h = data.length; i < h; i++) send[i] = Long.parseLong(data[i]);\n return send;\n }",
"String[] data = bf.readLine().split(\" \");",
"data",
"bf.readLine().split(\" \")",
"bf.readLine().split",
"bf.readLine()",
"bf.readLine",
"bf",
"\" \"",
"long[] send = new long[data.length];",
"send",
"new long[data.length]",
"data.length",
"data",
"data.length",
"for (int i = 0, h = data.length; i < h; i++) send[i] = Long.parseLong(data[i]);",
"int i = 0, h = data.length;",
"int i = 0",
"i",
"0",
"h = data.length;",
"h",
"data.length",
"data",
"data.length",
"i < h",
"i",
"h",
"i++",
"i++",
"i",
"send[i] = Long.parseLong(data[i]);",
"send[i] = Long.parseLong(data[i])",
"send[i]",
"send",
"i",
"Long.parseLong(data[i])",
"Long.parseLong",
"Long",
"data[i]",
"data",
"i",
"return send;",
"send",
"public void close() throws IOException{\n writer.flush();\n writer.close();\n bf.close();\n }",
"close",
"{\n writer.flush();\n writer.close();\n bf.close();\n }",
"writer.flush()",
"writer.flush",
"writer",
"writer.close()",
"writer.close",
"writer",
"bf.close()",
"bf.close",
"bf"
]
| import java.io.*;
import java.util.*;
class Main {
BufferedReader bf;
PrintWriter writer;
StringBuilder sb;
static boolean local_system = false;
void run() throws IOException {
int[] c = ints();
int[] d = ints();
Arrays.sort(d);
int sum = 0;
for(int i = 0,h=c[1];i<h;i++) sum+=d[i];
writer.println(sum);
}
public static void main(String[] args) throws IOException {
long start_time = System.currentTimeMillis();
Main obj = new Main();
obj.run();
long end_time = System.currentTimeMillis();
if (local_system) obj.writer.println("Time : " + (end_time - start_time));
obj.close();
}
public Main(){
writer = new PrintWriter(System.out);
bf = new BufferedReader(new InputStreamReader(System.in));
sb = new StringBuilder();
}
public int getInt() throws IOException {
return Integer.parseInt(bf.readLine());
}
public long getLong() throws IOException {
return Long.parseLong(bf.readLine());
}
public int[] ints() throws IOException {
String[] data = bf.readLine().split(" ");
int[] send = new int[data.length];
for (int i = 0, h = data.length; i < h; i++) send[i] = Integer.parseInt(data[i]);
return send;
}
public long[] longs() throws IOException {
String[] data = bf.readLine().split(" ");
long[] send = new long[data.length];
for (int i = 0, h = data.length; i < h; i++) send[i] = Long.parseLong(data[i]);
return send;
}
public void close() throws IOException{
writer.flush();
writer.close();
bf.close();
}
}
|
[
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,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
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,
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,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
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
],
[
168,
14
],
[
168,
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,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
35,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
49,
51
],
[
48,
52
],
[
52,
53
],
[
53,
54
],
[
17,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
17,
59
],
[
59,
60
],
[
59,
61
],
[
17,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
67,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
62,
73
],
[
74,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
17,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
15,
86
],
[
86,
87
],
[
168,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
88,
92
],
[
92,
93
],
[
88,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
88,
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
],
[
118,
119
],
[
113,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
102,
124
],
[
124,
125
],
[
125,
126
],
[
126,
127
],
[
88,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
134,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
134,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
145,
146
],
[
130,
147
],
[
147,
148
],
[
88,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
153,
156
],
[
156,
157
],
[
88,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
162,
165
],
[
165,
166
],
[
0,
167
],
[
167,
168
],
[
167,
169
]
]
| [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\nimport java.util.StringTokenizer;\n\npublic class Main {\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n 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 } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return str;\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n long nextLong() { return Long.parseLong(next()); }\n }\n\n public static void main(String[] args) {\n FastReader sn = new FastReader();\n int N = sn.nextInt();\n int K = sn.nextInt();\n int []arr = new int[N];\n for(int i=0;i<N;i++) {\n arr[i] = sn.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<K;i++) {\n sum+=arr[i];\n }\n System.out.println(sum);\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n 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 } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return str;\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n long nextLong() { return Long.parseLong(next()); }\n }\n\n public static void main(String[] args) {\n FastReader sn = new FastReader();\n int N = sn.nextInt();\n int K = sn.nextInt();\n int []arr = new int[N];\n for(int i=0;i<N;i++) {\n arr[i] = sn.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<K;i++) {\n sum+=arr[i];\n }\n System.out.println(sum);\n }\n}",
"Main",
"public static void main(String[] args) {\n FastReader sn = new FastReader();\n int N = sn.nextInt();\n int K = sn.nextInt();\n int []arr = new int[N];\n for(int i=0;i<N;i++) {\n arr[i] = sn.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<K;i++) {\n sum+=arr[i];\n }\n System.out.println(sum);\n }",
"main",
"{\n FastReader sn = new FastReader();\n int N = sn.nextInt();\n int K = sn.nextInt();\n int []arr = new int[N];\n for(int i=0;i<N;i++) {\n arr[i] = sn.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<K;i++) {\n sum+=arr[i];\n }\n System.out.println(sum);\n }",
"FastReader sn = new FastReader();",
"sn",
"new FastReader()",
"int N = sn.nextInt();",
"N",
"sn.nextInt()",
"sn.nextInt",
"sn",
"int K = sn.nextInt();",
"K",
"sn.nextInt()",
"sn.nextInt",
"sn",
"int []arr = new int[N];",
"arr",
"new int[N]",
"N",
"for(int i=0;i<N;i++) {\n arr[i] = sn.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n arr[i] = sn.nextInt();\n }",
"{\n arr[i] = sn.nextInt();\n }",
"arr[i] = sn.nextInt()",
"arr[i]",
"arr",
"i",
"sn.nextInt()",
"sn.nextInt",
"sn",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"int sum=0;",
"sum",
"0",
"for(int i=0;i<K;i++) {\n sum+=arr[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n sum+=arr[i];\n }",
"{\n sum+=arr[i];\n }",
"sum+=arr[i]",
"sum",
"arr[i]",
"arr",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n 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 } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return str;\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n long nextLong() { return Long.parseLong(next()); }\n }",
"FastReader",
"BufferedReader br;",
"br",
"StringTokenizer st;",
"st",
"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 } catch (Exception 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 (Exception 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 (Exception 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 (Exception e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\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 st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return str;\n }",
"nextLine",
"{\n String str = \"\";\n try {\n str = br.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return str;\n }",
"String str = \"\";",
"str",
"\"\"",
"try {\n str = br.readLine();\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 str = br.readLine();\n }",
"str = br.readLine()",
"str",
"br.readLine()",
"br.readLine",
"br",
"return str;",
"str",
"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() { return Long.parseLong(next()); }",
"nextLong",
"{ return Long.parseLong(next()); }",
"return Long.parseLong(next());",
"Long.parseLong(next())",
"Long.parseLong",
"Long",
"next()",
"next",
"public class Main {\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n 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 } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return str;\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n long nextLong() { return Long.parseLong(next()); }\n }\n\n public static void main(String[] args) {\n FastReader sn = new FastReader();\n int N = sn.nextInt();\n int K = sn.nextInt();\n int []arr = new int[N];\n for(int i=0;i<N;i++) {\n arr[i] = sn.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<K;i++) {\n sum+=arr[i];\n }\n System.out.println(sum);\n }\n}",
"public class Main {\n static class FastReader {\n BufferedReader br;\n StringTokenizer st;\n\n 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 } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n String nextLine() {\n String str = \"\";\n try {\n str = br.readLine();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return str;\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n long nextLong() { return Long.parseLong(next()); }\n }\n\n public static void main(String[] args) {\n FastReader sn = new FastReader();\n int N = sn.nextInt();\n int K = sn.nextInt();\n int []arr = new int[N];\n for(int i=0;i<N;i++) {\n arr[i] = sn.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int i=0;i<K;i++) {\n sum+=arr[i];\n }\n System.out.println(sum);\n }\n}",
"Main"
]
| import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
public class Main {
static class FastReader {
BufferedReader br;
StringTokenizer st;
FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (Exception e) {
e.printStackTrace();
}
}
return st.nextToken();
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (Exception e) {
e.printStackTrace();
}
return str;
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() { return Long.parseLong(next()); }
}
public static void main(String[] args) {
FastReader sn = new FastReader();
int N = sn.nextInt();
int K = sn.nextInt();
int []arr = new int[N];
for(int i=0;i<N;i++) {
arr[i] = sn.nextInt();
}
Arrays.sort(arr);
int sum=0;
for(int i=0;i<K;i++) {
sum+=arr[i];
}
System.out.println(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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
4,
18,
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
],
[
47,
48
],
[
46,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
8,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
6,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
]
| [
"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 N = sc.nextInt();\n int K = sc.nextInt();\n \n int[] price = new int[N];\n for(int i=0;i<N;i++){\n price[i] = sc.nextInt();\n }\n \n Arrays.sort(price);\n \n int money = 0;\n for(int i=0;i<K;i++){\n money = money + price[i];\n }\n \n System.out.println(String.valueOf(money));\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 N = sc.nextInt();\n int K = sc.nextInt();\n \n int[] price = new int[N];\n for(int i=0;i<N;i++){\n price[i] = sc.nextInt();\n }\n \n Arrays.sort(price);\n \n int money = 0;\n for(int i=0;i<K;i++){\n money = money + price[i];\n }\n \n System.out.println(String.valueOf(money));\n }\n}",
"Main",
"public static void main(String[] args ) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n \n int[] price = new int[N];\n for(int i=0;i<N;i++){\n price[i] = sc.nextInt();\n }\n \n Arrays.sort(price);\n \n int money = 0;\n for(int i=0;i<K;i++){\n money = money + price[i];\n }\n \n System.out.println(String.valueOf(money));\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n \n int[] price = new int[N];\n for(int i=0;i<N;i++){\n price[i] = sc.nextInt();\n }\n \n Arrays.sort(price);\n \n int money = 0;\n for(int i=0;i<K;i++){\n money = money + price[i];\n }\n \n System.out.println(String.valueOf(money));\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] price = new int[N];",
"price",
"new int[N]",
"N",
"for(int i=0;i<N;i++){\n price[i] = sc.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n price[i] = sc.nextInt();\n }",
"{\n price[i] = sc.nextInt();\n }",
"price[i] = sc.nextInt()",
"price[i]",
"price",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(price)",
"Arrays.sort",
"Arrays",
"price",
"int money = 0;",
"money",
"0",
"for(int i=0;i<K;i++){\n money = money + price[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n money = money + price[i];\n }",
"{\n money = money + price[i];\n }",
"money = money + price[i]",
"money",
"money + price[i]",
"money",
"price[i]",
"price",
"i",
"System.out.println(String.valueOf(money))",
"System.out.println",
"System.out",
"System",
"System.out",
"String.valueOf(money)",
"String.valueOf",
"String",
"money",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args ) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n \n int[] price = new int[N];\n for(int i=0;i<N;i++){\n price[i] = sc.nextInt();\n }\n \n Arrays.sort(price);\n \n int money = 0;\n for(int i=0;i<K;i++){\n money = money + price[i];\n }\n \n System.out.println(String.valueOf(money));\n }\n}",
"public class Main {\n public static void main(String[] args ) throws Exception {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n \n int[] price = new int[N];\n for(int i=0;i<N;i++){\n price[i] = sc.nextInt();\n }\n \n Arrays.sort(price);\n \n int money = 0;\n for(int i=0;i<K;i++){\n money = money + price[i];\n }\n \n System.out.println(String.valueOf(money));\n }\n}",
"Main"
]
| import java.util.*;
public class Main {
public static void main(String[] args ) throws Exception {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int K = sc.nextInt();
int[] price = new int[N];
for(int i=0;i<N;i++){
price[i] = sc.nextInt();
}
Arrays.sort(price);
int money = 0;
for(int i=0;i<K;i++){
money = money + price[i];
}
System.out.println(String.valueOf(money));
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
17,
41,
13,
17,
41,
13,
20,
17,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
2,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
17,
4,
18,
13,
13,
17,
11,
1,
41,
13,
17,
2,
2,
13,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
17,
30,
11,
1,
41,
13,
2,
13,
13,
2,
13,
13,
1,
0,
13,
13,
30,
30,
0,
18,
13,
13,
17,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
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,
18,
13,
13,
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
],
[
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
],
[
266,
17
],
[
266,
18
],
[
18,
19
],
[
18,
20
],
[
266,
21
],
[
21,
22
],
[
21,
23
],
[
266,
24
],
[
24,
25
],
[
24,
26
],
[
266,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
30,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
28,
44
],
[
44,
45
],
[
28,
46
],
[
46,
47
],
[
266,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
54,
58
],
[
50,
59
],
[
59,
60
],
[
60,
61
],
[
61,
62
],
[
61,
63
],
[
59,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
64,
68
],
[
59,
69
],
[
69,
70
],
[
70,
71
],
[
59,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
74,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
81,
88
],
[
88,
89
],
[
88,
90
],
[
81,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
81,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
97,
101
],
[
266,
102
],
[
102,
103
],
[
102,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
104,
108
],
[
108,
109
],
[
108,
110
],
[
110,
111
],
[
111,
112
],
[
104,
113
],
[
113,
114
],
[
113,
115
],
[
115,
116
],
[
116,
117
],
[
104,
118
],
[
118,
119
],
[
118,
120
],
[
104,
122
],
[
122,
123
],
[
122,
124
],
[
104,
125
],
[
125,
126
],
[
126,
127
],
[
127,
128
],
[
127,
129
],
[
125,
130
],
[
130,
131
],
[
130,
132
],
[
125,
133
],
[
133,
134
],
[
134,
135
],
[
125,
136
],
[
137,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
142,
143
],
[
143,
144
],
[
104,
145
],
[
145,
146
],
[
146,
147
],
[
145,
148
],
[
104,
149
],
[
149,
150
],
[
149,
151
],
[
104,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
152,
157
],
[
157,
158
],
[
157,
159
],
[
152,
160
],
[
160,
161
],
[
161,
162
],
[
152,
163
],
[
163,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
166,
168
],
[
104,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
169,
174
],
[
102,
175
],
[
175,
176
],
[
266,
177
],
[
177,
178
],
[
177,
179
],
[
179,
180
],
[
177,
181
],
[
181,
182
],
[
177,
183
],
[
183,
184
],
[
183,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
177,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
193,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
192,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
202,
209
],
[
209,
210
],
[
210,
211
],
[
210,
212
],
[
191,
213
],
[
213,
214
],
[
214,
215
],
[
215,
216
],
[
177,
217
],
[
217,
218
],
[
217,
219
],
[
219,
220
],
[
220,
221
],
[
221,
222
],
[
222,
223
],
[
221,
224
],
[
224,
225
],
[
177,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
229,
230
],
[
230,
231
],
[
231,
232
],
[
230,
233
],
[
233,
234
],
[
177,
235
],
[
235,
236
],
[
235,
237
],
[
237,
238
],
[
238,
239
],
[
239,
240
],
[
240,
241
],
[
239,
242
],
[
242,
243
],
[
177,
244
],
[
244,
245
],
[
244,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
246,
250
],
[
250,
251
],
[
251,
252
],
[
251,
253
],
[
253,
254
],
[
254,
255
],
[
255,
256
],
[
250,
257
],
[
257,
258
],
[
258,
259
],
[
258,
260
],
[
260,
261
],
[
261,
262
],
[
246,
263
],
[
263,
264
],
[
0,
265
],
[
265,
266
],
[
265,
267
]
]
| [
"\nimport java.io.*;\n\nimport java.math.BigInteger;\nimport java.util.*;\n\nimport java.util.ArrayList;\n\nimport java.util.Scanner;\n\n\npublic class Main {\n\n static 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 } 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 static final int mod = 1000000007;\n static final int mod1 = 1073741824;\n\n public static int gcd(int a, int b) {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n\n static boolean prime[] = new boolean[1000001];\n\n public static void sieve() {\n int n = 1000000;\n\n Arrays.fill(prime, true);\n for (int j = 2; j * j <= n; j++) {\n if (prime[j] == true) {\n for (int i = j * j; i <= n; i += j) {\n prime[i] = false;\n }\n }\n }\n /*for(int j=2;j<=n;j++)\n {\n if(prime[j]==true)\n System.out.println(j);\n }*/\n\n }\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n //Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int k=sc.nextInt();\n int a[]=new int[n];\n HashMap<Integer,Integer>hm=new HashMap<>();\n for(int j=0;j<n;j++) {\n a[j] = sc.nextInt();\n\n }\n Arrays.sort(a);\n long ans=0;\n for(int j=0;j<k;j++)\n ans+=a[j];\n System.out.println(ans);\n\n\n\n }\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"import java.io.*;",
"io.*",
"java",
"import java.math.BigInteger;",
"BigInteger",
"java.math",
"import java.util.*;",
"util.*",
"java",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n static 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 } 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 static final int mod = 1000000007;\n static final int mod1 = 1073741824;\n\n public static int gcd(int a, int b) {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n\n static boolean prime[] = new boolean[1000001];\n\n public static void sieve() {\n int n = 1000000;\n\n Arrays.fill(prime, true);\n for (int j = 2; j * j <= n; j++) {\n if (prime[j] == true) {\n for (int i = j * j; i <= n; i += j) {\n prime[i] = false;\n }\n }\n }\n /*for(int j=2;j<=n;j++)\n {\n if(prime[j]==true)\n System.out.println(j);\n }*/\n\n }\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n //Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int k=sc.nextInt();\n int a[]=new int[n];\n HashMap<Integer,Integer>hm=new HashMap<>();\n for(int j=0;j<n;j++) {\n a[j] = sc.nextInt();\n\n }\n Arrays.sort(a);\n long ans=0;\n for(int j=0;j<k;j++)\n ans+=a[j];\n System.out.println(ans);\n\n\n\n }\n}",
"Main",
"static final int mod = 1000000007;",
"mod",
"1000000007",
"static final int mod1 = 1073741824;",
"mod1",
"1073741824",
"static boolean prime[] = new boolean[1000001];",
"prime",
"new boolean[1000001]",
"1000001",
"public static int gcd(int a, int b) {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }",
"gcd",
"{\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }",
"if (a == 0)\n return b;",
"a == 0",
"a",
"0",
"return b;",
"b",
"return gcd(b % a, a);",
"gcd(b % a, a)",
"gcd",
"b % a",
"b",
"a",
"a",
"int a",
"a",
"int b",
"b",
"public static void sieve() {\n int n = 1000000;\n\n Arrays.fill(prime, true);\n for (int j = 2; j * j <= n; j++) {\n if (prime[j] == true) {\n for (int i = j * j; i <= n; i += j) {\n prime[i] = false;\n }\n }\n }\n /*for(int j=2;j<=n;j++)\n {\n if(prime[j]==true)\n System.out.println(j);\n }*/\n\n }",
"sieve",
"{\n int n = 1000000;\n\n Arrays.fill(prime, true);\n for (int j = 2; j * j <= n; j++) {\n if (prime[j] == true) {\n for (int i = j * j; i <= n; i += j) {\n prime[i] = false;\n }\n }\n }\n /*for(int j=2;j<=n;j++)\n {\n if(prime[j]==true)\n System.out.println(j);\n }*/\n\n }",
"int n = 1000000;",
"n",
"1000000",
"Arrays.fill(prime, true)",
"Arrays.fill",
"Arrays",
"prime",
"true",
"for (int j = 2; j * j <= n; j++) {\n if (prime[j] == true) {\n for (int i = j * j; i <= n; i += j) {\n prime[i] = false;\n }\n }\n }",
"int j = 2;",
"int j = 2;",
"j",
"2",
"j * j <= n",
"j * j",
"j",
"j",
"n",
"j++",
"j++",
"j",
"{\n if (prime[j] == true) {\n for (int i = j * j; i <= n; i += j) {\n prime[i] = false;\n }\n }\n }",
"{\n if (prime[j] == true) {\n for (int i = j * j; i <= n; i += j) {\n prime[i] = false;\n }\n }\n }",
"if (prime[j] == true) {\n for (int i = j * j; i <= n; i += j) {\n prime[i] = false;\n }\n }",
"prime[j] == true",
"prime[j]",
"prime",
"j",
"true",
"{\n for (int i = j * j; i <= n; i += j) {\n prime[i] = false;\n }\n }",
"for (int i = j * j; i <= n; i += j) {\n prime[i] = false;\n }",
"int i = j * j;",
"int i = j * j;",
"i",
"j * j",
"j",
"j",
"i <= n",
"i",
"n",
"i += j",
"i += j",
"i",
"j",
"{\n prime[i] = false;\n }",
"{\n prime[i] = false;\n }",
"prime[i] = false",
"prime[i]",
"prime",
"i",
"false",
"public static void main(String[] args) {\n FastReader sc = new FastReader();\n //Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int k=sc.nextInt();\n int a[]=new int[n];\n HashMap<Integer,Integer>hm=new HashMap<>();\n for(int j=0;j<n;j++) {\n a[j] = sc.nextInt();\n\n }\n Arrays.sort(a);\n long ans=0;\n for(int j=0;j<k;j++)\n ans+=a[j];\n System.out.println(ans);\n\n\n\n }",
"main",
"{\n FastReader sc = new FastReader();\n //Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int k=sc.nextInt();\n int a[]=new int[n];\n HashMap<Integer,Integer>hm=new HashMap<>();\n for(int j=0;j<n;j++) {\n a[j] = sc.nextInt();\n\n }\n Arrays.sort(a);\n long ans=0;\n for(int j=0;j<k;j++)\n ans+=a[j];\n System.out.println(ans);\n\n\n\n }",
"FastReader sc = new FastReader();",
"sc",
"new FastReader()",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k=sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int a[]=new int[n];",
"a",
"new int[n]",
"n",
"HashMap<Integer,Integer>hm=new HashMap<>();",
"hm",
"new HashMap<>()",
"for(int j=0;j<n;j++) {\n a[j] = sc.nextInt();\n\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"{\n a[j] = sc.nextInt();\n\n }",
"{\n a[j] = sc.nextInt();\n\n }",
"a[j] = sc.nextInt()",
"a[j]",
"a",
"j",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(a)",
"Arrays.sort",
"Arrays",
"a",
"long ans=0;",
"ans",
"0",
"for(int j=0;j<k;j++)\n ans+=a[j];",
"int j=0;",
"int j=0;",
"j",
"0",
"j<k",
"j",
"k",
"j++",
"j++",
"j",
"ans+=a[j];",
"ans+=a[j]",
"ans",
"a[j]",
"a",
"j",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"static 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 } 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\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 } 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\n static 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 } 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 static final int mod = 1000000007;\n static final int mod1 = 1073741824;\n\n public static int gcd(int a, int b) {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n\n static boolean prime[] = new boolean[1000001];\n\n public static void sieve() {\n int n = 1000000;\n\n Arrays.fill(prime, true);\n for (int j = 2; j * j <= n; j++) {\n if (prime[j] == true) {\n for (int i = j * j; i <= n; i += j) {\n prime[i] = false;\n }\n }\n }\n /*for(int j=2;j<=n;j++)\n {\n if(prime[j]==true)\n System.out.println(j);\n }*/\n\n }\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n //Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int k=sc.nextInt();\n int a[]=new int[n];\n HashMap<Integer,Integer>hm=new HashMap<>();\n for(int j=0;j<n;j++) {\n a[j] = sc.nextInt();\n\n }\n Arrays.sort(a);\n long ans=0;\n for(int j=0;j<k;j++)\n ans+=a[j];\n System.out.println(ans);\n\n\n\n }\n}",
"public class Main {\n\n static 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 } 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 static final int mod = 1000000007;\n static final int mod1 = 1073741824;\n\n public static int gcd(int a, int b) {\n if (a == 0)\n return b;\n return gcd(b % a, a);\n }\n\n static boolean prime[] = new boolean[1000001];\n\n public static void sieve() {\n int n = 1000000;\n\n Arrays.fill(prime, true);\n for (int j = 2; j * j <= n; j++) {\n if (prime[j] == true) {\n for (int i = j * j; i <= n; i += j) {\n prime[i] = false;\n }\n }\n }\n /*for(int j=2;j<=n;j++)\n {\n if(prime[j]==true)\n System.out.println(j);\n }*/\n\n }\n\n public static void main(String[] args) {\n FastReader sc = new FastReader();\n //Scanner sc=new Scanner(System.in);\n int n=sc.nextInt();\n int k=sc.nextInt();\n int a[]=new int[n];\n HashMap<Integer,Integer>hm=new HashMap<>();\n for(int j=0;j<n;j++) {\n a[j] = sc.nextInt();\n\n }\n Arrays.sort(a);\n long ans=0;\n for(int j=0;j<k;j++)\n ans+=a[j];\n System.out.println(ans);\n\n\n\n }\n}",
"Main"
]
|
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
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;
}
}
static final int mod = 1000000007;
static final int mod1 = 1073741824;
public static int gcd(int a, int b) {
if (a == 0)
return b;
return gcd(b % a, a);
}
static boolean prime[] = new boolean[1000001];
public static void sieve() {
int n = 1000000;
Arrays.fill(prime, true);
for (int j = 2; j * j <= n; j++) {
if (prime[j] == true) {
for (int i = j * j; i <= n; i += j) {
prime[i] = false;
}
}
}
/*for(int j=2;j<=n;j++)
{
if(prime[j]==true)
System.out.println(j);
}*/
}
public static void main(String[] args) {
FastReader sc = new FastReader();
//Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int k=sc.nextInt();
int a[]=new int[n];
HashMap<Integer,Integer>hm=new HashMap<>();
for(int j=0;j<n;j++) {
a[j] = sc.nextInt();
}
Arrays.sort(a);
long ans=0;
for(int j=0;j<k;j++)
ans+=a[j];
System.out.println(ans);
}
}
|
[
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,
41,
13,
17,
41,
13,
41,
13,
41,
13,
20,
12,
13,
30,
12,
13,
30,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
4,
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,
13,
4,
18,
13,
12,
13,
30,
4,
18,
20,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
4,
18,
13,
13,
23,
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,
42,
2,
2,
13,
17,
40,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
0,
13,
17,
29,
4,
18,
13,
12,
13,
30,
29,
17,
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
],
[
194,
26
],
[
194,
27
],
[
27,
28
],
[
27,
29
],
[
194,
30
],
[
30,
31
],
[
30,
32
],
[
194,
33
],
[
33,
34
],
[
194,
35
],
[
35,
36
],
[
194,
37
],
[
37,
38
],
[
37,
39
],
[
194,
40
],
[
40,
41
],
[
40,
42
],
[
194,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
45,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
45,
54
],
[
54,
55
],
[
54,
56
],
[
45,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
58,
66
],
[
66,
67
],
[
67,
68
],
[
58,
69
],
[
70,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
71,
75
],
[
75,
76
],
[
45,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
45,
81
],
[
81,
82
],
[
81,
83
],
[
45,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
84,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
99,
101
],
[
45,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
45,
106
],
[
106,
107
],
[
107,
108
],
[
194,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
109,
115
],
[
115,
116
],
[
194,
117
],
[
117,
118
],
[
117,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
120,
125
],
[
125,
126
],
[
126,
127
],
[
125,
128
],
[
117,
129
],
[
129,
130
],
[
194,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
138,
139
],
[
194,
140
],
[
140,
141
],
[
140,
142
],
[
142,
143
],
[
143,
144
],
[
144,
145
],
[
145,
146
],
[
144,
147
],
[
147,
148
],
[
194,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
153,
154
],
[
154,
155
],
[
153,
156
],
[
156,
157
],
[
194,
158
],
[
158,
159
],
[
158,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
163,
164
],
[
163,
165
],
[
162,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
161,
170
],
[
170,
171
],
[
171,
172
],
[
171,
173
],
[
160,
174
],
[
174,
175
],
[
175,
176
],
[
176,
177
],
[
194,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
180,
184
],
[
184,
185
],
[
185,
186
],
[
186,
187
],
[
194,
188
],
[
188,
189
],
[
188,
190
],
[
190,
191
],
[
191,
192
],
[
0,
193
],
[
193,
194
],
[
193,
195
]
]
| [
"\n\nimport java.io.BufferedReader;\nimport java.io.BufferedWriter;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.OutputStreamWriter;\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.StringTokenizer;\n\npublic class Main {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer tokenizer = null;\n int totalCases, testNum;\n\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n\n void solve() throws IOException {\n\n }\n\n void execute() throws IOException {\n int n = ni();\n int k = ni();\n int[] arr = new int[n];\n for(int i = 0; i < n; i++) {\n arr[i] = ni();\n }\n Arrays.sort(arr);\n int res = 0;\n for (int i = 0; i < k; i++) {\n res += arr[i];\n }\n out.println(res);\n out.close();\n }\n\n public static void main(String[] args) throws IOException {\n new Main().execute();\n }\n\n void debug(Object... os) {\n System.out.println(Arrays.deepToString(os));\n }\n\n int ni() throws IOException {\n return Integer.parseInt(ns());\n }\n\n long nl() throws IOException {\n return Long.parseLong(ns());\n }\n\n double nd() throws IOException {\n return Double.parseDouble(ns());\n }\n\n String ns() throws IOException {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(br.readLine());\n }\n return tokenizer.nextToken();\n }\n\n String nline() throws IOException {\n tokenizer = null;\n return br.readLine();\n }\n\n boolean input() throws IOException {\n return true;\n }\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.BufferedWriter;",
"BufferedWriter",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.OutputStreamWriter;",
"OutputStreamWriter",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer tokenizer = null;\n int totalCases, testNum;\n\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n\n void solve() throws IOException {\n\n }\n\n void execute() throws IOException {\n int n = ni();\n int k = ni();\n int[] arr = new int[n];\n for(int i = 0; i < n; i++) {\n arr[i] = ni();\n }\n Arrays.sort(arr);\n int res = 0;\n for (int i = 0; i < k; i++) {\n res += arr[i];\n }\n out.println(res);\n out.close();\n }\n\n public static void main(String[] args) throws IOException {\n new Main().execute();\n }\n\n void debug(Object... os) {\n System.out.println(Arrays.deepToString(os));\n }\n\n int ni() throws IOException {\n return Integer.parseInt(ns());\n }\n\n long nl() throws IOException {\n return Long.parseLong(ns());\n }\n\n double nd() throws IOException {\n return Double.parseDouble(ns());\n }\n\n String ns() throws IOException {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(br.readLine());\n }\n return tokenizer.nextToken();\n }\n\n String nline() throws IOException {\n tokenizer = null;\n return br.readLine();\n }\n\n boolean input() throws IOException {\n return true;\n }\n\n}",
"Main",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"StringTokenizer tokenizer = null;",
"tokenizer",
"null",
"int totalCases",
"totalCases",
"testNum;",
"testNum",
"PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));",
"out",
"new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)))",
"void solve() throws IOException {\n\n }",
"solve",
"{\n\n }",
"void execute() throws IOException {\n int n = ni();\n int k = ni();\n int[] arr = new int[n];\n for(int i = 0; i < n; i++) {\n arr[i] = ni();\n }\n Arrays.sort(arr);\n int res = 0;\n for (int i = 0; i < k; i++) {\n res += arr[i];\n }\n out.println(res);\n out.close();\n }",
"execute",
"{\n int n = ni();\n int k = ni();\n int[] arr = new int[n];\n for(int i = 0; i < n; i++) {\n arr[i] = ni();\n }\n Arrays.sort(arr);\n int res = 0;\n for (int i = 0; i < k; i++) {\n res += arr[i];\n }\n out.println(res);\n out.close();\n }",
"int n = ni();",
"n",
"ni()",
"ni",
"int k = ni();",
"k",
"ni()",
"ni",
"int[] arr = new int[n];",
"arr",
"new int[n]",
"n",
"for(int i = 0; i < n; i++) {\n arr[i] = ni();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = ni();\n }",
"{\n arr[i] = ni();\n }",
"arr[i] = ni()",
"arr[i]",
"arr",
"i",
"ni()",
"ni",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"int res = 0;",
"res",
"0",
"for (int i = 0; i < k; i++) {\n res += arr[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n res += arr[i];\n }",
"{\n res += arr[i];\n }",
"res += arr[i]",
"res",
"arr[i]",
"arr",
"i",
"out.println(res)",
"out.println",
"out",
"res",
"out.close()",
"out.close",
"out",
"public static void main(String[] args) throws IOException {\n new Main().execute();\n }",
"main",
"{\n new Main().execute();\n }",
"new Main().execute()",
"new Main().execute",
"new Main()",
"String[] args",
"args",
"void debug(Object... os) {\n System.out.println(Arrays.deepToString(os));\n }",
"debug",
"{\n System.out.println(Arrays.deepToString(os));\n }",
"System.out.println(Arrays.deepToString(os))",
"System.out.println",
"System.out",
"System",
"System.out",
"Arrays.deepToString(os)",
"Arrays.deepToString",
"Arrays",
"os",
"Object... os",
"os",
"int ni() throws IOException {\n return Integer.parseInt(ns());\n }",
"ni",
"{\n return Integer.parseInt(ns());\n }",
"return Integer.parseInt(ns());",
"Integer.parseInt(ns())",
"Integer.parseInt",
"Integer",
"ns()",
"ns",
"long nl() throws IOException {\n return Long.parseLong(ns());\n }",
"nl",
"{\n return Long.parseLong(ns());\n }",
"return Long.parseLong(ns());",
"Long.parseLong(ns())",
"Long.parseLong",
"Long",
"ns()",
"ns",
"double nd() throws IOException {\n return Double.parseDouble(ns());\n }",
"nd",
"{\n return Double.parseDouble(ns());\n }",
"return Double.parseDouble(ns());",
"Double.parseDouble(ns())",
"Double.parseDouble",
"Double",
"ns()",
"ns",
"String ns() throws IOException {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(br.readLine());\n }\n return tokenizer.nextToken();\n }",
"ns",
"{\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(br.readLine());\n }\n return tokenizer.nextToken();\n }",
"while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(br.readLine());\n }",
"tokenizer == null || !tokenizer.hasMoreTokens()",
"tokenizer == null",
"tokenizer",
"null",
"!tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens()",
"tokenizer.hasMoreTokens",
"tokenizer",
"{\n tokenizer = new StringTokenizer(br.readLine());\n }",
"tokenizer = new StringTokenizer(br.readLine())",
"tokenizer",
"new StringTokenizer(br.readLine())",
"return tokenizer.nextToken();",
"tokenizer.nextToken()",
"tokenizer.nextToken",
"tokenizer",
"String nline() throws IOException {\n tokenizer = null;\n return br.readLine();\n }",
"nline",
"{\n tokenizer = null;\n return br.readLine();\n }",
"tokenizer = null",
"tokenizer",
"null",
"return br.readLine();",
"br.readLine()",
"br.readLine",
"br",
"boolean input() throws IOException {\n return true;\n }",
"input",
"{\n return true;\n }",
"return true;",
"true",
"public class Main {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer tokenizer = null;\n int totalCases, testNum;\n\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n\n void solve() throws IOException {\n\n }\n\n void execute() throws IOException {\n int n = ni();\n int k = ni();\n int[] arr = new int[n];\n for(int i = 0; i < n; i++) {\n arr[i] = ni();\n }\n Arrays.sort(arr);\n int res = 0;\n for (int i = 0; i < k; i++) {\n res += arr[i];\n }\n out.println(res);\n out.close();\n }\n\n public static void main(String[] args) throws IOException {\n new Main().execute();\n }\n\n void debug(Object... os) {\n System.out.println(Arrays.deepToString(os));\n }\n\n int ni() throws IOException {\n return Integer.parseInt(ns());\n }\n\n long nl() throws IOException {\n return Long.parseLong(ns());\n }\n\n double nd() throws IOException {\n return Double.parseDouble(ns());\n }\n\n String ns() throws IOException {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(br.readLine());\n }\n return tokenizer.nextToken();\n }\n\n String nline() throws IOException {\n tokenizer = null;\n return br.readLine();\n }\n\n boolean input() throws IOException {\n return true;\n }\n\n}",
"public class Main {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer tokenizer = null;\n int totalCases, testNum;\n\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n\n void solve() throws IOException {\n\n }\n\n void execute() throws IOException {\n int n = ni();\n int k = ni();\n int[] arr = new int[n];\n for(int i = 0; i < n; i++) {\n arr[i] = ni();\n }\n Arrays.sort(arr);\n int res = 0;\n for (int i = 0; i < k; i++) {\n res += arr[i];\n }\n out.println(res);\n out.close();\n }\n\n public static void main(String[] args) throws IOException {\n new Main().execute();\n }\n\n void debug(Object... os) {\n System.out.println(Arrays.deepToString(os));\n }\n\n int ni() throws IOException {\n return Integer.parseInt(ns());\n }\n\n long nl() throws IOException {\n return Long.parseLong(ns());\n }\n\n double nd() throws IOException {\n return Double.parseDouble(ns());\n }\n\n String ns() throws IOException {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n tokenizer = new StringTokenizer(br.readLine());\n }\n return tokenizer.nextToken();\n }\n\n String nline() throws IOException {\n tokenizer = null;\n return br.readLine();\n }\n\n boolean input() throws IOException {\n return true;\n }\n\n}",
"Main"
]
|
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
public class Main {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer tokenizer = null;
int totalCases, testNum;
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
void solve() throws IOException {
}
void execute() throws IOException {
int n = ni();
int k = ni();
int[] arr = new int[n];
for(int i = 0; i < n; i++) {
arr[i] = ni();
}
Arrays.sort(arr);
int res = 0;
for (int i = 0; i < k; i++) {
res += arr[i];
}
out.println(res);
out.close();
}
public static void main(String[] args) throws IOException {
new Main().execute();
}
void debug(Object... os) {
System.out.println(Arrays.deepToString(os));
}
int ni() throws IOException {
return Integer.parseInt(ns());
}
long nl() throws IOException {
return Long.parseLong(ns());
}
double nd() throws IOException {
return Double.parseDouble(ns());
}
String ns() throws IOException {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
tokenizer = new StringTokenizer(br.readLine());
}
return tokenizer.nextToken();
}
String nline() throws IOException {
tokenizer = null;
return br.readLine();
}
boolean input() throws IOException {
return true;
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
4,
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,
18,
13,
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
],
[
14,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
22,
25
],
[
25,
26
],
[
26,
27
],
[
8,
28
],
[
28,
29
],
[
28,
30
],
[
8,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
32,
42
],
[
42,
43
],
[
43,
44
],
[
32,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
52,
53
],
[
51,
54
],
[
54,
55
],
[
55,
56
],
[
8,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
8,
61
],
[
61,
62
],
[
61,
63
],
[
8,
64
],
[
64,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
64,
69
],
[
69,
70
],
[
69,
71
],
[
64,
72
],
[
72,
73
],
[
73,
74
],
[
64,
75
],
[
76,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
8,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
6,
88
],
[
88,
89
],
[
0,
90
],
[
90,
91
],
[
90,
92
]
]
| [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args){\n\n Scanner scan = new Scanner( System.in );\n\n int N = Integer.parseInt( scan.next() );\n int K = Integer.parseInt( scan.next() );\n\n int[] p = new int[N];\n\n for (int i=0; i< p.length; i++){\n p[i] = Integer.parseInt( scan.next() );\n }\n Arrays.sort(p);\n\n int sum = 0;\n for(int i=0; i<K; i++){\n sum += p[i];\n }\n System.out.println(sum);\n\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args){\n\n Scanner scan = new Scanner( System.in );\n\n int N = Integer.parseInt( scan.next() );\n int K = Integer.parseInt( scan.next() );\n\n int[] p = new int[N];\n\n for (int i=0; i< p.length; i++){\n p[i] = Integer.parseInt( scan.next() );\n }\n Arrays.sort(p);\n\n int sum = 0;\n for(int i=0; i<K; i++){\n sum += p[i];\n }\n System.out.println(sum);\n\n }\n}",
"Main",
"public static void main(String[] args){\n\n Scanner scan = new Scanner( System.in );\n\n int N = Integer.parseInt( scan.next() );\n int K = Integer.parseInt( scan.next() );\n\n int[] p = new int[N];\n\n for (int i=0; i< p.length; i++){\n p[i] = Integer.parseInt( scan.next() );\n }\n Arrays.sort(p);\n\n int sum = 0;\n for(int i=0; i<K; i++){\n sum += p[i];\n }\n System.out.println(sum);\n\n }",
"main",
"{\n\n Scanner scan = new Scanner( System.in );\n\n int N = Integer.parseInt( scan.next() );\n int K = Integer.parseInt( scan.next() );\n\n int[] p = new int[N];\n\n for (int i=0; i< p.length; i++){\n p[i] = Integer.parseInt( scan.next() );\n }\n Arrays.sort(p);\n\n int sum = 0;\n for(int i=0; i<K; i++){\n sum += p[i];\n }\n System.out.println(sum);\n\n }",
"Scanner scan = new Scanner( System.in );",
"scan",
"new Scanner( System.in )",
"int N = Integer.parseInt( scan.next() );",
"N",
"Integer.parseInt( scan.next() )",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"int K = Integer.parseInt( scan.next() );",
"K",
"Integer.parseInt( scan.next() )",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"int[] p = new int[N];",
"p",
"new int[N]",
"N",
"for (int i=0; i< p.length; i++){\n p[i] = Integer.parseInt( scan.next() );\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i< p.length",
"i",
"p.length",
"p",
"p.length",
"i++",
"i++",
"i",
"{\n p[i] = Integer.parseInt( scan.next() );\n }",
"{\n p[i] = Integer.parseInt( scan.next() );\n }",
"p[i] = Integer.parseInt( scan.next() )",
"p[i]",
"p",
"i",
"Integer.parseInt( scan.next() )",
"Integer.parseInt",
"Integer",
"scan.next()",
"scan.next",
"scan",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"int sum = 0;",
"sum",
"0",
"for(int i=0; i<K; i++){\n sum += p[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n sum += p[i];\n }",
"{\n sum += p[i];\n }",
"sum += p[i]",
"sum",
"p[i]",
"p",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args){\n\n Scanner scan = new Scanner( System.in );\n\n int N = Integer.parseInt( scan.next() );\n int K = Integer.parseInt( scan.next() );\n\n int[] p = new int[N];\n\n for (int i=0; i< p.length; i++){\n p[i] = Integer.parseInt( scan.next() );\n }\n Arrays.sort(p);\n\n int sum = 0;\n for(int i=0; i<K; i++){\n sum += p[i];\n }\n System.out.println(sum);\n\n }\n}",
"public class Main {\n public static void main(String[] args){\n\n Scanner scan = new Scanner( System.in );\n\n int N = Integer.parseInt( scan.next() );\n int K = Integer.parseInt( scan.next() );\n\n int[] p = new int[N];\n\n for (int i=0; i< p.length; i++){\n p[i] = Integer.parseInt( scan.next() );\n }\n Arrays.sort(p);\n\n int sum = 0;\n for(int i=0; i<K; i++){\n sum += p[i];\n }\n System.out.println(sum);\n\n }\n}",
"Main"
]
| import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scan = new Scanner( System.in );
int N = Integer.parseInt( scan.next() );
int K = Integer.parseInt( scan.next() );
int[] p = new int[N];
for (int i=0; i< p.length; i++){
p[i] = Integer.parseInt( scan.next() );
}
Arrays.sort(p);
int sum = 0;
for(int i=0; i<K; i++){
sum += p[i];
}
System.out.println(sum);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
13,
4,
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,
18,
13,
13,
13,
23,
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,
42,
2,
2,
13,
17,
40,
4,
18,
13,
0,
13,
20,
29,
4,
18,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
132,
8
],
[
132,
9
],
[
9,
10
],
[
132,
11
],
[
11,
12
],
[
132,
13
],
[
13,
14
],
[
132,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
17,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
17,
29
],
[
29,
30
],
[
29,
31
],
[
17,
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
],
[
17,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
17,
56
],
[
56,
57
],
[
56,
58
],
[
17,
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
],
[
17,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
15,
83
],
[
83,
84
],
[
132,
85
],
[
85,
86
],
[
85,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
92,
93
],
[
132,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
101,
102
],
[
132,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
106,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
110,
111
],
[
132,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
116,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
115,
124
],
[
124,
125
],
[
124,
126
],
[
114,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
0,
131
],
[
131,
132
],
[
131,
133
]
]
| [
"import java.util.*; \nimport java.io.*;\n\npublic class Main {\n static StringTokenizer st;\n static BufferedReader br; \n static PrintWriter out;\n \n public static void main(String[] args) throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n\n int N = nextInt();\n int K = nextInt();\n\n int[] input = new int[N];\n\n for (int i=0; i<N; i++) {\n input[i] = nextInt();\n }\n\n Arrays.sort(input);\n\n int ans = 0;\n for (int i=0; i<K; i++) {\n ans += input[i] ;\n }\n System.out.println(ans);\n \n \n }\n \n \n public static int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n public static long nextLong() throws IOException {\n return Long.parseLong(next());\n }\n\n public static double nextDouble() throws IOException {\n return Double.parseDouble(next());\n }\n\n static String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"public class Main {\n static StringTokenizer st;\n static BufferedReader br; \n static PrintWriter out;\n \n public static void main(String[] args) throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n\n int N = nextInt();\n int K = nextInt();\n\n int[] input = new int[N];\n\n for (int i=0; i<N; i++) {\n input[i] = nextInt();\n }\n\n Arrays.sort(input);\n\n int ans = 0;\n for (int i=0; i<K; i++) {\n ans += input[i] ;\n }\n System.out.println(ans);\n \n \n }\n \n \n public static int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n public static long nextLong() throws IOException {\n return Long.parseLong(next());\n }\n\n public static double nextDouble() throws IOException {\n return Double.parseDouble(next());\n }\n\n static String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n}",
"Main",
"static StringTokenizer st;",
"st",
"static BufferedReader br;",
"br",
"static PrintWriter out;",
"out",
"public static void main(String[] args) throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n\n int N = nextInt();\n int K = nextInt();\n\n int[] input = new int[N];\n\n for (int i=0; i<N; i++) {\n input[i] = nextInt();\n }\n\n Arrays.sort(input);\n\n int ans = 0;\n for (int i=0; i<K; i++) {\n ans += input[i] ;\n }\n System.out.println(ans);\n \n \n }",
"main",
"{\n br = new BufferedReader(new InputStreamReader(System.in));\n\n int N = nextInt();\n int K = nextInt();\n\n int[] input = new int[N];\n\n for (int i=0; i<N; i++) {\n input[i] = nextInt();\n }\n\n Arrays.sort(input);\n\n int ans = 0;\n for (int i=0; i<K; i++) {\n ans += input[i] ;\n }\n System.out.println(ans);\n \n \n }",
"br = new BufferedReader(new InputStreamReader(System.in))",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"int N = nextInt();",
"N",
"nextInt()",
"nextInt",
"int K = nextInt();",
"K",
"nextInt()",
"nextInt",
"int[] input = new int[N];",
"input",
"new int[N]",
"N",
"for (int i=0; i<N; i++) {\n input[i] = nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n input[i] = nextInt();\n }",
"{\n input[i] = nextInt();\n }",
"input[i] = nextInt()",
"input[i]",
"input",
"i",
"nextInt()",
"nextInt",
"Arrays.sort(input)",
"Arrays.sort",
"Arrays",
"input",
"int ans = 0;",
"ans",
"0",
"for (int i=0; i<K; i++) {\n ans += input[i] ;\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n ans += input[i] ;\n }",
"{\n ans += input[i] ;\n }",
"ans += input[i]",
"ans",
"input[i]",
"input",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public static int nextInt() throws 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 static long nextLong() throws 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 static double nextDouble() throws 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",
"static String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"st = new StringTokenizer(br.readLine().trim())",
"st",
"new StringTokenizer(br.readLine().trim())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"public class Main {\n static StringTokenizer st;\n static BufferedReader br; \n static PrintWriter out;\n \n public static void main(String[] args) throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n\n int N = nextInt();\n int K = nextInt();\n\n int[] input = new int[N];\n\n for (int i=0; i<N; i++) {\n input[i] = nextInt();\n }\n\n Arrays.sort(input);\n\n int ans = 0;\n for (int i=0; i<K; i++) {\n ans += input[i] ;\n }\n System.out.println(ans);\n \n \n }\n \n \n public static int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n public static long nextLong() throws IOException {\n return Long.parseLong(next());\n }\n\n public static double nextDouble() throws IOException {\n return Double.parseDouble(next());\n }\n\n static String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n}",
"public class Main {\n static StringTokenizer st;\n static BufferedReader br; \n static PrintWriter out;\n \n public static void main(String[] args) throws IOException {\n br = new BufferedReader(new InputStreamReader(System.in));\n\n int N = nextInt();\n int K = nextInt();\n\n int[] input = new int[N];\n\n for (int i=0; i<N; i++) {\n input[i] = nextInt();\n }\n\n Arrays.sort(input);\n\n int ans = 0;\n for (int i=0; i<K; i++) {\n ans += input[i] ;\n }\n System.out.println(ans);\n \n \n }\n \n \n public static int nextInt() throws IOException {\n return Integer.parseInt(next());\n }\n public static long nextLong() throws IOException {\n return Long.parseLong(next());\n }\n\n public static double nextDouble() throws IOException {\n return Double.parseDouble(next());\n }\n\n static String next() throws IOException {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine().trim());\n return st.nextToken();\n }\n}",
"Main"
]
| import java.util.*;
import java.io.*;
public class Main {
static StringTokenizer st;
static BufferedReader br;
static PrintWriter out;
public static void main(String[] args) throws IOException {
br = new BufferedReader(new InputStreamReader(System.in));
int N = nextInt();
int K = nextInt();
int[] input = new int[N];
for (int i=0; i<N; i++) {
input[i] = nextInt();
}
Arrays.sort(input);
int ans = 0;
for (int i=0; i<K; i++) {
ans += input[i] ;
}
System.out.println(ans);
}
public static int nextInt() throws IOException {
return Integer.parseInt(next());
}
public static long nextLong() throws IOException {
return Long.parseLong(next());
}
public static double nextDouble() throws IOException {
return Double.parseDouble(next());
}
static String next() throws IOException {
while (st == null || !st.hasMoreTokens())
st = new StringTokenizer(br.readLine().trim());
return st.nextToken();
}
} |
[
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,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
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,
13,
4,
18,
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,
40,
13,
29,
4,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
20,
41,
13,
4,
13,
42,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
40,
4,
13,
37,
20,
41,
13,
17,
41,
13,
17,
41,
13,
4,
13,
14,
2,
13,
17,
30,
0,
13,
17,
0,
13,
4,
13,
14,
2,
2,
13,
17,
2,
17,
13,
30,
37,
20,
42,
17,
30,
14,
2,
2,
17,
13,
2,
13,
17,
30,
0,
13,
17,
0,
13,
2,
13,
17,
14,
2,
2,
13,
40,
17,
40,
4,
13,
13,
30,
29,
8,
13,
40,
13,
13,
30,
37,
20,
0,
13,
4,
13,
12,
13,
30,
41,
13,
4,
13,
14,
2,
2,
13,
18,
13,
13,
2,
13,
18,
13,
13,
37,
20,
29,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
38,
5,
13,
30,
30,
4,
18,
13,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
7,
12
],
[
12,
13
],
[
12,
14
],
[
7,
15
],
[
15,
16
],
[
15,
17
],
[
7,
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
],
[
31,
32
],
[
32,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
20,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
50,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
20,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
20,
62
],
[
62,
63
],
[
62,
64
],
[
20,
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
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
20,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
20,
89
],
[
89,
90
],
[
90,
91
],
[
18,
92
],
[
92,
93
],
[
0,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
94,
101
],
[
101,
102
],
[
101,
103
],
[
94,
105
],
[
105,
106
],
[
105,
107
],
[
94,
108
],
[
108,
109
],
[
108,
110
],
[
94,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
114,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
125,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
121,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
139,
143
],
[
143,
144
],
[
144,
145
],
[
113,
146
],
[
146,
147
],
[
94,
148
],
[
148,
149
],
[
148,
150
],
[
150,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
158,
159
],
[
151,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
94,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
168,
172
],
[
172,
173
],
[
172,
174
],
[
164,
175
],
[
175,
176
],
[
94,
177
],
[
177,
178
],
[
177,
179
],
[
179,
180
],
[
180,
181
],
[
181,
182
],
[
182,
183
],
[
181,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
187,
188
],
[
187,
189
],
[
180,
190
],
[
190,
191
],
[
179,
192
],
[
192,
193
],
[
193,
194
],
[
94,
195
],
[
195,
196
],
[
195,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
200,
201
],
[
198,
202
],
[
202,
203
],
[
197,
204
],
[
204,
205
],
[
204,
206
],
[
197,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
197,
211
],
[
211,
212
],
[
212,
213
],
[
212,
214
],
[
211,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
216,
219
],
[
215,
220
],
[
220,
221
],
[
220,
222
],
[
222,
223
],
[
197,
224
],
[
224,
225
],
[
225,
226
],
[
226,
227
],
[
94,
228
],
[
228,
229
],
[
228,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
231,
235
],
[
235,
236
],
[
230,
237
],
[
237,
238
],
[
237,
239
],
[
230,
240
],
[
240,
241
],
[
240,
242
],
[
230,
243
],
[
243,
244
],
[
243,
245
],
[
245,
246
],
[
230,
247
],
[
247,
248
],
[
248,
249
],
[
248,
250
],
[
247,
251
],
[
251,
252
],
[
252,
253
],
[
252,
254
],
[
251,
255
],
[
255,
256
],
[
255,
257
],
[
257,
258
],
[
230,
259
],
[
259,
260
],
[
260,
261
],
[
261,
262
],
[
261,
263
],
[
260,
264
],
[
264,
265
],
[
264,
266
],
[
259,
267
],
[
267,
268
],
[
268,
269
],
[
230,
270
],
[
270,
271
],
[
270,
272
],
[
272,
273
],
[
273,
274
],
[
274,
275
],
[
275,
276
],
[
275,
277
],
[
274,
278
],
[
278,
279
],
[
278,
280
],
[
273,
281
],
[
281,
282
],
[
282,
283
],
[
282,
284
],
[
281,
285
],
[
285,
286
],
[
285,
287
],
[
287,
288
],
[
287,
289
],
[
273,
290
],
[
290,
291
],
[
291,
292
],
[
292,
293
],
[
292,
294
],
[
294,
295
],
[
291,
296
],
[
296,
297
],
[
297,
298
],
[
297,
299
],
[
290,
300
],
[
300,
301
],
[
301,
302
],
[
302,
303
],
[
302,
304
],
[
304,
305
],
[
302,
306
],
[
290,
307
],
[
307,
308
],
[
308,
309
],
[
272,
310
],
[
310,
311
],
[
310,
312
],
[
312,
313
],
[
94,
314
],
[
314,
315
],
[
314,
316
],
[
316,
317
],
[
317,
318
],
[
317,
319
],
[
319,
320
],
[
316,
321
],
[
321,
322
],
[
322,
323
],
[
323,
324
],
[
323,
325
],
[
325,
326
],
[
325,
327
],
[
322,
328
],
[
328,
329
],
[
328,
330
],
[
330,
331
],
[
330,
332
],
[
321,
333
],
[
333,
334
],
[
316,
335
],
[
335,
336
],
[
94,
337
],
[
337,
338
],
[
337,
339
],
[
339,
340
],
[
340,
341
],
[
341,
342
],
[
342,
343
],
[
341,
344
],
[
344,
345
],
[
94,
346
],
[
346,
347
],
[
346,
348
],
[
348,
349
],
[
349,
350
],
[
350,
351
],
[
350,
352
],
[
349,
353
],
[
353,
354
],
[
354,
355
],
[
355,
356
],
[
94,
357
]
]
| [
"import java.io.*;\nimport java.util.*;\nclass Main{\n\tstatic final long MOD = 1_000_000_007; // 10^9+7\n\tstatic final int MAX = 2_147_483_646; // intMax \n\tstatic final int INF = 1_000_000_000; // 10^9 \n\tpublic static void main(String[] args) throws Exception{\n\t\thayami saori = new hayami();\n\t\tint n = saori.saori_hayami();\n\t\tint k = saori.saori_hayami();\n\t\tint[] p = new int[n];\n\t\tfor(int i = 0;i < n;i++){\n\t\t\tp[i] = saori.saori_hayami();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\tfor(int i = 0;i < k;i++){\n\t\t\tans += p[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tsaori.close();\n\t}\n}\n\nclass hayami implements Closeable {\n\tprivate final InputStream in = System.in;\n\tprivate final byte[] hayami = new byte[1024];\n\tprivate int Hayami = 0;\n\tprivate int saori = 0;\n\tprivate boolean HayamiSaori() {\n\t\tif (Hayami < saori) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\tHayami = 0;\n\t\t\ttry {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tprivate int SaoriHayami() { \n\t\tif (HayamiSaori()) {\n return hayami[Hayami++];\n }else{\n return -1;\n }\n\t}\n\tprivate static boolean hayami_saori(int hayami) { \n\t\treturn 33 <= hayami && hayami <= 126;\n\t}\n\tpublic boolean hayamisaori() { \n\t\twhile(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();\n\t}\n\tpublic String nextHayami() {\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tStringBuilder hayamin = new StringBuilder();\n\t\tint saori = SaoriHayami();\n\t\twhile(hayami_saori(saori)) {\n\t\t\thayamin.appendCodePoint(saori);\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\treturn hayamin.toString();\n\t}\n\tpublic long saorihayami() {//nextLong\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tlong hayami = 0;\n\t\tboolean misao = false;\n\t\tint saori = SaoriHayami();\n\t\tif (saori == '-') {\n\t\t\tmisao = true;\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\tif (saori < '0' || '9' < saori) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile(true){\n\t\t\tif ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t}\n\tpublic int saori_hayami() {//nextInt\n\t\tlong hayami = saorihayami();\n\t\tif (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();\n\t\treturn (int) hayami;\n\t}\n\tpublic double Hayamin() { //nextDouble\n\t\treturn Double.parseDouble(nextHayami());\n\t}\n\tpublic void close() {\n\t\ttry {\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t}\n }\n \n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"class Main{\n\tstatic final long MOD = 1_000_000_007; // 10^9+7\n\tstatic final int MAX = 2_147_483_646; // intMax \n\tstatic final int INF = 1_000_000_000; // 10^9 \n\tpublic static void main(String[] args) throws Exception{\n\t\thayami saori = new hayami();\n\t\tint n = saori.saori_hayami();\n\t\tint k = saori.saori_hayami();\n\t\tint[] p = new int[n];\n\t\tfor(int i = 0;i < n;i++){\n\t\t\tp[i] = saori.saori_hayami();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\tfor(int i = 0;i < k;i++){\n\t\t\tans += p[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tsaori.close();\n\t}\n}",
"Main",
"static final long MOD = 1_000_000_007; // 10^9+7",
"MOD",
"1_000_000_007",
"static final int MAX = 2_147_483_646; // intMax ",
"MAX",
"2_147_483_646",
"static final int INF = 1_000_000_000; // 10^9 ",
"INF",
"1_000_000_000",
"public static void main(String[] args) throws Exception{\n\t\thayami saori = new hayami();\n\t\tint n = saori.saori_hayami();\n\t\tint k = saori.saori_hayami();\n\t\tint[] p = new int[n];\n\t\tfor(int i = 0;i < n;i++){\n\t\t\tp[i] = saori.saori_hayami();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\tfor(int i = 0;i < k;i++){\n\t\t\tans += p[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tsaori.close();\n\t}",
"main",
"{\n\t\thayami saori = new hayami();\n\t\tint n = saori.saori_hayami();\n\t\tint k = saori.saori_hayami();\n\t\tint[] p = new int[n];\n\t\tfor(int i = 0;i < n;i++){\n\t\t\tp[i] = saori.saori_hayami();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint ans = 0;\n\t\tfor(int i = 0;i < k;i++){\n\t\t\tans += p[i];\n\t\t}\n\t\tSystem.out.println(ans);\n\t\tsaori.close();\n\t}",
"hayami saori = new hayami();",
"saori",
"new hayami()",
"int n = saori.saori_hayami();",
"n",
"saori.saori_hayami()",
"saori.saori_hayami",
"saori",
"int k = saori.saori_hayami();",
"k",
"saori.saori_hayami()",
"saori.saori_hayami",
"saori",
"int[] p = new int[n];",
"p",
"new int[n]",
"n",
"for(int i = 0;i < n;i++){\n\t\t\tp[i] = saori.saori_hayami();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tp[i] = saori.saori_hayami();\n\t\t}",
"{\n\t\t\tp[i] = saori.saori_hayami();\n\t\t}",
"p[i] = saori.saori_hayami()",
"p[i]",
"p",
"i",
"saori.saori_hayami()",
"saori.saori_hayami",
"saori",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"int ans = 0;",
"ans",
"0",
"for(int i = 0;i < k;i++){\n\t\t\tans += p[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tans += p[i];\n\t\t}",
"{\n\t\t\tans += p[i];\n\t\t}",
"ans += p[i]",
"ans",
"p[i]",
"p",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"saori.close()",
"saori.close",
"saori",
"String[] args",
"args",
"class hayami implements Closeable {\n\tprivate final InputStream in = System.in;\n\tprivate final byte[] hayami = new byte[1024];\n\tprivate int Hayami = 0;\n\tprivate int saori = 0;\n\tprivate boolean HayamiSaori() {\n\t\tif (Hayami < saori) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\tHayami = 0;\n\t\t\ttry {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tprivate int SaoriHayami() { \n\t\tif (HayamiSaori()) {\n return hayami[Hayami++];\n }else{\n return -1;\n }\n\t}\n\tprivate static boolean hayami_saori(int hayami) { \n\t\treturn 33 <= hayami && hayami <= 126;\n\t}\n\tpublic boolean hayamisaori() { \n\t\twhile(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();\n\t}\n\tpublic String nextHayami() {\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tStringBuilder hayamin = new StringBuilder();\n\t\tint saori = SaoriHayami();\n\t\twhile(hayami_saori(saori)) {\n\t\t\thayamin.appendCodePoint(saori);\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\treturn hayamin.toString();\n\t}\n\tpublic long saorihayami() {//nextLong\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tlong hayami = 0;\n\t\tboolean misao = false;\n\t\tint saori = SaoriHayami();\n\t\tif (saori == '-') {\n\t\t\tmisao = true;\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\tif (saori < '0' || '9' < saori) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile(true){\n\t\t\tif ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t}\n\tpublic int saori_hayami() {//nextInt\n\t\tlong hayami = saorihayami();\n\t\tif (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();\n\t\treturn (int) hayami;\n\t}\n\tpublic double Hayamin() { //nextDouble\n\t\treturn Double.parseDouble(nextHayami());\n\t}\n\tpublic void close() {\n\t\ttry {\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t}\n }\n \n}",
"hayami",
"private final InputStream in = System.in;",
"in",
"System.in",
"System",
"System.in",
"private final byte[] hayami = new byte[1024];",
"hayami",
"new byte[1024]",
"1024",
"private int Hayami = 0;",
"Hayami",
"0",
"private int saori = 0;",
"saori",
"0",
"private boolean HayamiSaori() {\n\t\tif (Hayami < saori) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\tHayami = 0;\n\t\t\ttry {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"HayamiSaori",
"{\n\t\tif (Hayami < saori) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\tHayami = 0;\n\t\t\ttry {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"if (Hayami < saori) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\tHayami = 0;\n\t\t\ttry {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"Hayami < saori",
"Hayami",
"saori",
"{\n\t\t\treturn true;\n\t\t}",
"return true;",
"true",
"{\n\t\t\tHayami = 0;\n\t\t\ttry {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"Hayami = 0",
"Hayami",
"0",
"try {\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"IOException e",
"{\n\t\t\t\te.printStackTrace();\n\t\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"{\n\t\t\t\tsaori = in.read(hayami);\n\t\t\t}",
"saori = in.read(hayami)",
"saori",
"in.read(hayami)",
"in.read",
"in",
"hayami",
"if (saori <= 0) {\n\t\t\t\treturn false;\n\t\t\t}",
"saori <= 0",
"saori",
"0",
"{\n\t\t\t\treturn false;\n\t\t\t}",
"return false;",
"false",
"return true;",
"true",
"private int SaoriHayami() { \n\t\tif (HayamiSaori()) {\n return hayami[Hayami++];\n }else{\n return -1;\n }\n\t}",
"SaoriHayami",
"{ \n\t\tif (HayamiSaori()) {\n return hayami[Hayami++];\n }else{\n return -1;\n }\n\t}",
"if (HayamiSaori()) {\n return hayami[Hayami++];\n }else{\n return -1;\n }",
"HayamiSaori()",
"HayamiSaori",
"{\n return hayami[Hayami++];\n }",
"return hayami[Hayami++];",
"hayami[Hayami++]",
"hayami",
"Hayami++",
"Hayami",
"{\n return -1;\n }",
"return -1;",
"-1",
"1",
"private static boolean hayami_saori(int hayami) { \n\t\treturn 33 <= hayami && hayami <= 126;\n\t}",
"hayami_saori",
"{ \n\t\treturn 33 <= hayami && hayami <= 126;\n\t}",
"return 33 <= hayami && hayami <= 126;",
"33 <= hayami && hayami <= 126",
"33 <= hayami",
"33",
"hayami",
"hayami <= 126",
"hayami",
"126",
"int hayami",
"hayami",
"public boolean hayamisaori() { \n\t\twhile(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();\n\t}",
"hayamisaori",
"{ \n\t\twhile(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();\n\t}",
"while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++;",
"HayamiSaori() && !hayami_saori(hayami[Hayami])",
"HayamiSaori()",
"HayamiSaori",
"!hayami_saori(hayami[Hayami])",
"hayami_saori(hayami[Hayami])",
"hayami_saori",
"hayami[Hayami]",
"hayami",
"Hayami",
"Hayami++",
"Hayami",
"return HayamiSaori();",
"HayamiSaori()",
"HayamiSaori",
"public String nextHayami() {\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tStringBuilder hayamin = new StringBuilder();\n\t\tint saori = SaoriHayami();\n\t\twhile(hayami_saori(saori)) {\n\t\t\thayamin.appendCodePoint(saori);\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\treturn hayamin.toString();\n\t}",
"nextHayami",
"{\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tStringBuilder hayamin = new StringBuilder();\n\t\tint saori = SaoriHayami();\n\t\twhile(hayami_saori(saori)) {\n\t\t\thayamin.appendCodePoint(saori);\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\treturn hayamin.toString();\n\t}",
"if (!hayamisaori()) throw new NoSuchElementException();",
"!hayamisaori()",
"hayamisaori()",
"hayamisaori",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"StringBuilder hayamin = new StringBuilder();",
"hayamin",
"new StringBuilder()",
"int saori = SaoriHayami();",
"saori",
"SaoriHayami()",
"SaoriHayami",
"while(hayami_saori(saori)) {\n\t\t\thayamin.appendCodePoint(saori);\n\t\t\tsaori = SaoriHayami();\n\t\t}",
"hayami_saori(saori)",
"hayami_saori",
"saori",
"{\n\t\t\thayamin.appendCodePoint(saori);\n\t\t\tsaori = SaoriHayami();\n\t\t}",
"hayamin.appendCodePoint(saori)",
"hayamin.appendCodePoint",
"hayamin",
"saori",
"saori = SaoriHayami()",
"saori",
"SaoriHayami()",
"SaoriHayami",
"return hayamin.toString();",
"hayamin.toString()",
"hayamin.toString",
"hayamin",
"public long saorihayami() {//nextLong\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tlong hayami = 0;\n\t\tboolean misao = false;\n\t\tint saori = SaoriHayami();\n\t\tif (saori == '-') {\n\t\t\tmisao = true;\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\tif (saori < '0' || '9' < saori) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile(true){\n\t\t\tif ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t}",
"saorihayami",
"{//nextLong\n\t\tif (!hayamisaori()) throw new NoSuchElementException();\n\t\tlong hayami = 0;\n\t\tboolean misao = false;\n\t\tint saori = SaoriHayami();\n\t\tif (saori == '-') {\n\t\t\tmisao = true;\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t\tif (saori < '0' || '9' < saori) {\n\t\t\tthrow new NumberFormatException();\n\t\t}\n\t\twhile(true){\n\t\t\tif ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tsaori = SaoriHayami();\n\t\t}\n\t}",
"if (!hayamisaori()) throw new NoSuchElementException();",
"!hayamisaori()",
"hayamisaori()",
"hayamisaori",
"throw new NoSuchElementException();",
"new NoSuchElementException()",
"long hayami = 0;",
"hayami",
"0",
"boolean misao = false;",
"misao",
"false",
"int saori = SaoriHayami();",
"saori",
"SaoriHayami()",
"SaoriHayami",
"if (saori == '-') {\n\t\t\tmisao = true;\n\t\t\tsaori = SaoriHayami();\n\t\t}",
"saori == '-'",
"saori",
"'-'",
"{\n\t\t\tmisao = true;\n\t\t\tsaori = SaoriHayami();\n\t\t}",
"misao = true",
"misao",
"true",
"saori = SaoriHayami()",
"saori",
"SaoriHayami()",
"SaoriHayami",
"if (saori < '0' || '9' < saori) {\n\t\t\tthrow new NumberFormatException();\n\t\t}",
"saori < '0' || '9' < saori",
"saori < '0'",
"saori",
"'0'",
"'9' < saori",
"'9'",
"saori",
"{\n\t\t\tthrow new NumberFormatException();\n\t\t}",
"throw new NumberFormatException();",
"new NumberFormatException()",
"while(true){\n\t\t\tif ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tsaori = SaoriHayami();\n\t\t}",
"true",
"{\n\t\t\tif ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}\n\t\t\tsaori = SaoriHayami();\n\t\t}",
"if ('0' <= saori && saori <= '9') {\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}else if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}",
"'0' <= saori && saori <= '9'",
"'0' <= saori",
"'0'",
"saori",
"saori <= '9'",
"saori",
"'9'",
"{\n\t\t\t\thayami *= 10;\n\t\t\t\thayami += saori - '0';\n\t\t\t}",
"hayami *= 10",
"hayami",
"10",
"hayami += saori - '0'",
"hayami",
"saori - '0'",
"saori",
"'0'",
"if(saori == -1 || !hayami_saori(saori)){\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}else{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}",
"saori == -1 || !hayami_saori(saori)",
"saori == -1",
"saori",
"-1",
"1",
"!hayami_saori(saori)",
"hayami_saori(saori)",
"hayami_saori",
"saori",
"{\n\t\t\t\treturn misao ? -hayami : hayami;\n\t\t\t}",
"return misao ? -hayami : hayami;",
"misao ? -hayami : hayami",
"misao",
"-hayami",
"hayami",
"hayami",
"{\n\t\t\t\tthrow new NumberFormatException();\n\t\t\t}",
"throw new NumberFormatException();",
"new NumberFormatException()",
"saori = SaoriHayami()",
"saori",
"SaoriHayami()",
"SaoriHayami",
"public int saori_hayami() {//nextInt\n\t\tlong hayami = saorihayami();\n\t\tif (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();\n\t\treturn (int) hayami;\n\t}",
"saori_hayami",
"{//nextInt\n\t\tlong hayami = saorihayami();\n\t\tif (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();\n\t\treturn (int) hayami;\n\t}",
"long hayami = saorihayami();",
"hayami",
"saorihayami()",
"saorihayami",
"if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();",
"hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE",
"hayami < Integer.MIN_VALUE",
"hayami",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"hayami > Integer.MAX_VALUE",
"hayami",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"throw new NumberFormatException();",
"new NumberFormatException()",
"return (int) hayami;",
"(int) hayami",
"public double Hayamin() { //nextDouble\n\t\treturn Double.parseDouble(nextHayami());\n\t}",
"Hayamin",
"{ //nextDouble\n\t\treturn Double.parseDouble(nextHayami());\n\t}",
"return Double.parseDouble(nextHayami());",
"Double.parseDouble(nextHayami())",
"Double.parseDouble",
"Double",
"nextHayami()",
"nextHayami",
"public void close() {\n\t\ttry {\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t}\n }",
"close",
"{\n\t\ttry {\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t}\n }",
"try {\n\t\t\tin.close();\n\t\t} catch (IOException e) {\n\t\t}",
"catch (IOException e) {\n\t\t}",
"IOException e",
"{\n\t\t}",
"{\n\t\t\tin.close();\n\t\t}",
"in.close()",
"in.close",
"in",
"Closeable"
]
| import java.io.*;
import java.util.*;
class Main{
static final long MOD = 1_000_000_007; // 10^9+7
static final int MAX = 2_147_483_646; // intMax
static final int INF = 1_000_000_000; // 10^9
public static void main(String[] args) throws Exception{
hayami saori = new hayami();
int n = saori.saori_hayami();
int k = saori.saori_hayami();
int[] p = new int[n];
for(int i = 0;i < n;i++){
p[i] = saori.saori_hayami();
}
Arrays.sort(p);
int ans = 0;
for(int i = 0;i < k;i++){
ans += p[i];
}
System.out.println(ans);
saori.close();
}
}
class hayami implements Closeable {
private final InputStream in = System.in;
private final byte[] hayami = new byte[1024];
private int Hayami = 0;
private int saori = 0;
private boolean HayamiSaori() {
if (Hayami < saori) {
return true;
}else{
Hayami = 0;
try {
saori = in.read(hayami);
} catch (IOException e) {
e.printStackTrace();
}
if (saori <= 0) {
return false;
}
}
return true;
}
private int SaoriHayami() {
if (HayamiSaori()) {
return hayami[Hayami++];
}else{
return -1;
}
}
private static boolean hayami_saori(int hayami) {
return 33 <= hayami && hayami <= 126;
}
public boolean hayamisaori() {
while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
}
public String nextHayami() {
if (!hayamisaori()) throw new NoSuchElementException();
StringBuilder hayamin = new StringBuilder();
int saori = SaoriHayami();
while(hayami_saori(saori)) {
hayamin.appendCodePoint(saori);
saori = SaoriHayami();
}
return hayamin.toString();
}
public long saorihayami() {//nextLong
if (!hayamisaori()) throw new NoSuchElementException();
long hayami = 0;
boolean misao = false;
int saori = SaoriHayami();
if (saori == '-') {
misao = true;
saori = SaoriHayami();
}
if (saori < '0' || '9' < saori) {
throw new NumberFormatException();
}
while(true){
if ('0' <= saori && saori <= '9') {
hayami *= 10;
hayami += saori - '0';
}else if(saori == -1 || !hayami_saori(saori)){
return misao ? -hayami : hayami;
}else{
throw new NumberFormatException();
}
saori = SaoriHayami();
}
}
public int saori_hayami() {//nextInt
long hayami = saorihayami();
if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
return (int) hayami;
}
public double Hayamin() { //nextDouble
return Double.parseDouble(nextHayami());
}
public void close() {
try {
in.close();
} catch (IOException e) {
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
28,
13,
13,
30,
30,
4,
18,
13,
4,
18,
13,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
111,
14
],
[
111,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
20,
22
],
[
19,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
19,
28
],
[
28,
29
],
[
28,
30
],
[
30,
31
],
[
31,
32
],
[
19,
33
],
[
33,
34
],
[
33,
35
],
[
35,
36
],
[
36,
37
],
[
35,
38
],
[
19,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
19,
45
],
[
45,
46
],
[
45,
47
],
[
47,
48
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
50,
52
],
[
19,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
55,
58
],
[
58,
59
],
[
58,
60
],
[
19,
61
],
[
61,
62
],
[
61,
63
],
[
19,
64
],
[
64,
65
],
[
64,
66
],
[
64,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
19,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
19,
80
],
[
80,
81
],
[
80,
82
],
[
19,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
83,
91
],
[
91,
92
],
[
92,
93
],
[
83,
94
],
[
95,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
19,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
104,
106
],
[
102,
107
],
[
15,
108
],
[
108,
109
],
[
0,
110
],
[
110,
111
],
[
110,
112
]
]
| [
"import java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\ttry(Scanner scanner = new Scanner(System.in)) {\n\t\t\tString data1 = scanner.nextLine();\n\t\t\tString data2 = scanner.nextLine();\n\n\t\t\tString[] arr1 = data1.split(\" \");\n\t\t\tString[] arr2 = data2.split(\" \");\n\n\t\t\tint syurui = Integer.parseInt(arr1[0]);\n\t\t\tint sentaku = Integer.parseInt(arr1[1]);\n\n\t\t\tList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor (String str : arr2) {\n\t\t\t\tlist.add(Integer.parseInt(str));\n\t\t\t}\n\n\t\t\tCollections.sort(list);\n\n\t\t\tint total = 0;\n\t\t\tfor (int i = 0; i < sentaku; i++) {\n\t\t\t\ttotal += list.get(i);\n\t\t\t}\n\n\t\t\tSystem.out.println(total);\n\t\t}\n\t}\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\ttry(Scanner scanner = new Scanner(System.in)) {\n\t\t\tString data1 = scanner.nextLine();\n\t\t\tString data2 = scanner.nextLine();\n\n\t\t\tString[] arr1 = data1.split(\" \");\n\t\t\tString[] arr2 = data2.split(\" \");\n\n\t\t\tint syurui = Integer.parseInt(arr1[0]);\n\t\t\tint sentaku = Integer.parseInt(arr1[1]);\n\n\t\t\tList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor (String str : arr2) {\n\t\t\t\tlist.add(Integer.parseInt(str));\n\t\t\t}\n\n\t\t\tCollections.sort(list);\n\n\t\t\tint total = 0;\n\t\t\tfor (int i = 0; i < sentaku; i++) {\n\t\t\t\ttotal += list.get(i);\n\t\t\t}\n\n\t\t\tSystem.out.println(total);\n\t\t}\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\ttry(Scanner scanner = new Scanner(System.in)) {\n\t\t\tString data1 = scanner.nextLine();\n\t\t\tString data2 = scanner.nextLine();\n\n\t\t\tString[] arr1 = data1.split(\" \");\n\t\t\tString[] arr2 = data2.split(\" \");\n\n\t\t\tint syurui = Integer.parseInt(arr1[0]);\n\t\t\tint sentaku = Integer.parseInt(arr1[1]);\n\n\t\t\tList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor (String str : arr2) {\n\t\t\t\tlist.add(Integer.parseInt(str));\n\t\t\t}\n\n\t\t\tCollections.sort(list);\n\n\t\t\tint total = 0;\n\t\t\tfor (int i = 0; i < sentaku; i++) {\n\t\t\t\ttotal += list.get(i);\n\t\t\t}\n\n\t\t\tSystem.out.println(total);\n\t\t}\n\t}",
"main",
"{\n\t\ttry(Scanner scanner = new Scanner(System.in)) {\n\t\t\tString data1 = scanner.nextLine();\n\t\t\tString data2 = scanner.nextLine();\n\n\t\t\tString[] arr1 = data1.split(\" \");\n\t\t\tString[] arr2 = data2.split(\" \");\n\n\t\t\tint syurui = Integer.parseInt(arr1[0]);\n\t\t\tint sentaku = Integer.parseInt(arr1[1]);\n\n\t\t\tList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor (String str : arr2) {\n\t\t\t\tlist.add(Integer.parseInt(str));\n\t\t\t}\n\n\t\t\tCollections.sort(list);\n\n\t\t\tint total = 0;\n\t\t\tfor (int i = 0; i < sentaku; i++) {\n\t\t\t\ttotal += list.get(i);\n\t\t\t}\n\n\t\t\tSystem.out.println(total);\n\t\t}\n\t}",
"try(Scanner scanner = new Scanner(System.in)) {\n\t\t\tString data1 = scanner.nextLine();\n\t\t\tString data2 = scanner.nextLine();\n\n\t\t\tString[] arr1 = data1.split(\" \");\n\t\t\tString[] arr2 = data2.split(\" \");\n\n\t\t\tint syurui = Integer.parseInt(arr1[0]);\n\t\t\tint sentaku = Integer.parseInt(arr1[1]);\n\n\t\t\tList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor (String str : arr2) {\n\t\t\t\tlist.add(Integer.parseInt(str));\n\t\t\t}\n\n\t\t\tCollections.sort(list);\n\n\t\t\tint total = 0;\n\t\t\tfor (int i = 0; i < sentaku; i++) {\n\t\t\t\ttotal += list.get(i);\n\t\t\t}\n\n\t\t\tSystem.out.println(total);\n\t\t}",
"{\n\t\t\tString data1 = scanner.nextLine();\n\t\t\tString data2 = scanner.nextLine();\n\n\t\t\tString[] arr1 = data1.split(\" \");\n\t\t\tString[] arr2 = data2.split(\" \");\n\n\t\t\tint syurui = Integer.parseInt(arr1[0]);\n\t\t\tint sentaku = Integer.parseInt(arr1[1]);\n\n\t\t\tList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor (String str : arr2) {\n\t\t\t\tlist.add(Integer.parseInt(str));\n\t\t\t}\n\n\t\t\tCollections.sort(list);\n\n\t\t\tint total = 0;\n\t\t\tfor (int i = 0; i < sentaku; i++) {\n\t\t\t\ttotal += list.get(i);\n\t\t\t}\n\n\t\t\tSystem.out.println(total);\n\t\t}",
"Scanner scanner = new Scanner(System.in)",
"Scanner scanner = new Scanner(System.in)",
"new Scanner(System.in)",
"String data1 = scanner.nextLine();",
"data1",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"String data2 = scanner.nextLine();",
"data2",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"String[] arr1 = data1.split(\" \");",
"arr1",
"data1.split(\" \")",
"data1.split",
"data1",
"\" \"",
"String[] arr2 = data2.split(\" \");",
"arr2",
"data2.split(\" \")",
"data2.split",
"data2",
"\" \"",
"int syurui = Integer.parseInt(arr1[0]);",
"syurui",
"Integer.parseInt(arr1[0])",
"Integer.parseInt",
"Integer",
"arr1[0]",
"arr1",
"0",
"int sentaku = Integer.parseInt(arr1[1]);",
"sentaku",
"Integer.parseInt(arr1[1])",
"Integer.parseInt",
"Integer",
"arr1[1]",
"arr1",
"1",
"List<Integer> list = new ArrayList<Integer>();",
"list",
"new ArrayList<Integer>()",
"for (String str : arr2) {\n\t\t\t\tlist.add(Integer.parseInt(str));\n\t\t\t}",
"String str",
"arr2",
"{\n\t\t\t\tlist.add(Integer.parseInt(str));\n\t\t\t}",
"{\n\t\t\t\tlist.add(Integer.parseInt(str));\n\t\t\t}",
"list.add(Integer.parseInt(str))",
"list.add",
"list",
"Integer.parseInt(str)",
"Integer.parseInt",
"Integer",
"str",
"Collections.sort(list)",
"Collections.sort",
"Collections",
"list",
"int total = 0;",
"total",
"0",
"for (int i = 0; i < sentaku; i++) {\n\t\t\t\ttotal += list.get(i);\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < sentaku",
"i",
"sentaku",
"i++",
"i++",
"i",
"{\n\t\t\t\ttotal += list.get(i);\n\t\t\t}",
"{\n\t\t\t\ttotal += list.get(i);\n\t\t\t}",
"total += list.get(i)",
"total",
"list.get(i)",
"list.get",
"list",
"i",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\ttry(Scanner scanner = new Scanner(System.in)) {\n\t\t\tString data1 = scanner.nextLine();\n\t\t\tString data2 = scanner.nextLine();\n\n\t\t\tString[] arr1 = data1.split(\" \");\n\t\t\tString[] arr2 = data2.split(\" \");\n\n\t\t\tint syurui = Integer.parseInt(arr1[0]);\n\t\t\tint sentaku = Integer.parseInt(arr1[1]);\n\n\t\t\tList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor (String str : arr2) {\n\t\t\t\tlist.add(Integer.parseInt(str));\n\t\t\t}\n\n\t\t\tCollections.sort(list);\n\n\t\t\tint total = 0;\n\t\t\tfor (int i = 0; i < sentaku; i++) {\n\t\t\t\ttotal += list.get(i);\n\t\t\t}\n\n\t\t\tSystem.out.println(total);\n\t\t}\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\ttry(Scanner scanner = new Scanner(System.in)) {\n\t\t\tString data1 = scanner.nextLine();\n\t\t\tString data2 = scanner.nextLine();\n\n\t\t\tString[] arr1 = data1.split(\" \");\n\t\t\tString[] arr2 = data2.split(\" \");\n\n\t\t\tint syurui = Integer.parseInt(arr1[0]);\n\t\t\tint sentaku = Integer.parseInt(arr1[1]);\n\n\t\t\tList<Integer> list = new ArrayList<Integer>();\n\t\t\tfor (String str : arr2) {\n\t\t\t\tlist.add(Integer.parseInt(str));\n\t\t\t}\n\n\t\t\tCollections.sort(list);\n\n\t\t\tint total = 0;\n\t\t\tfor (int i = 0; i < sentaku; i++) {\n\t\t\t\ttotal += list.get(i);\n\t\t\t}\n\n\t\t\tSystem.out.println(total);\n\t\t}\n\t}\n}",
"Main"
]
| import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try(Scanner scanner = new Scanner(System.in)) {
String data1 = scanner.nextLine();
String data2 = scanner.nextLine();
String[] arr1 = data1.split(" ");
String[] arr2 = data2.split(" ");
int syurui = Integer.parseInt(arr1[0]);
int sentaku = Integer.parseInt(arr1[1]);
List<Integer> list = new ArrayList<Integer>();
for (String str : arr2) {
list.add(Integer.parseInt(str));
}
Collections.sort(list);
int total = 0;
for (int i = 0; i < sentaku; i++) {
total += list.get(i);
}
System.out.println(total);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
13,
0,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
91,
11
],
[
91,
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,
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
],
[
46,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
14,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
14,
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
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
72,
79
],
[
79,
80
],
[
79,
81
],
[
14,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
12,
88
],
[
88,
89
],
[
0,
90
],
[
90,
91
],
[
90,
92
]
]
| [
"import java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Scanner;\n\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint N = scanner.nextInt();\n\t\tint K = scanner.nextInt();\n\t\tArrayList<Integer> prices = new ArrayList<>();\n\t\tint total = 0;\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tint p = scanner.nextInt();\n\t\t\tprices.add(p);\n\t\t}\n\n\t\tCollections.sort(prices);\n\n\t\tfor (int j = 0; j < K; j++) {\n\t\t\tint price = prices.get(j);\n\t\t\ttotal += price;\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}\n\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"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\tScanner scanner = new Scanner(System.in);\n\t\tint N = scanner.nextInt();\n\t\tint K = scanner.nextInt();\n\t\tArrayList<Integer> prices = new ArrayList<>();\n\t\tint total = 0;\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tint p = scanner.nextInt();\n\t\t\tprices.add(p);\n\t\t}\n\n\t\tCollections.sort(prices);\n\n\t\tfor (int j = 0; j < K; j++) {\n\t\t\tint price = prices.get(j);\n\t\t\ttotal += price;\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint N = scanner.nextInt();\n\t\tint K = scanner.nextInt();\n\t\tArrayList<Integer> prices = new ArrayList<>();\n\t\tint total = 0;\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tint p = scanner.nextInt();\n\t\t\tprices.add(p);\n\t\t}\n\n\t\tCollections.sort(prices);\n\n\t\tfor (int j = 0; j < K; j++) {\n\t\t\tint price = prices.get(j);\n\t\t\ttotal += price;\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint N = scanner.nextInt();\n\t\tint K = scanner.nextInt();\n\t\tArrayList<Integer> prices = new ArrayList<>();\n\t\tint total = 0;\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tint p = scanner.nextInt();\n\t\t\tprices.add(p);\n\t\t}\n\n\t\tCollections.sort(prices);\n\n\t\tfor (int j = 0; j < K; j++) {\n\t\t\tint price = prices.get(j);\n\t\t\ttotal += price;\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int N = scanner.nextInt();",
"N",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int K = scanner.nextInt();",
"K",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"ArrayList<Integer> prices = new ArrayList<>();",
"prices",
"new ArrayList<>()",
"int total = 0;",
"total",
"0",
"for (int i = 0; i < N; i++) {\n\t\t\tint p = scanner.nextInt();\n\t\t\tprices.add(p);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tint p = scanner.nextInt();\n\t\t\tprices.add(p);\n\t\t}",
"{\n\t\t\tint p = scanner.nextInt();\n\t\t\tprices.add(p);\n\t\t}",
"int p = scanner.nextInt();",
"p",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"prices.add(p)",
"prices.add",
"prices",
"p",
"Collections.sort(prices)",
"Collections.sort",
"Collections",
"prices",
"for (int j = 0; j < K; j++) {\n\t\t\tint price = prices.get(j);\n\t\t\ttotal += price;\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < K",
"j",
"K",
"j++",
"j++",
"j",
"{\n\t\t\tint price = prices.get(j);\n\t\t\ttotal += price;\n\t\t}",
"{\n\t\t\tint price = prices.get(j);\n\t\t\ttotal += price;\n\t\t}",
"int price = prices.get(j);",
"price",
"prices.get(j)",
"prices.get",
"prices",
"j",
"total += price",
"total",
"price",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint N = scanner.nextInt();\n\t\tint K = scanner.nextInt();\n\t\tArrayList<Integer> prices = new ArrayList<>();\n\t\tint total = 0;\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tint p = scanner.nextInt();\n\t\t\tprices.add(p);\n\t\t}\n\n\t\tCollections.sort(prices);\n\n\t\tfor (int j = 0; j < K; j++) {\n\t\t\tint price = prices.get(j);\n\t\t\ttotal += price;\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scanner = new Scanner(System.in);\n\t\tint N = scanner.nextInt();\n\t\tint K = scanner.nextInt();\n\t\tArrayList<Integer> prices = new ArrayList<>();\n\t\tint total = 0;\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tint p = scanner.nextInt();\n\t\t\tprices.add(p);\n\t\t}\n\n\t\tCollections.sort(prices);\n\n\t\tfor (int j = 0; j < K; j++) {\n\t\t\tint price = prices.get(j);\n\t\t\ttotal += price;\n\t\t}\n\n\t\tSystem.out.println(total);\n\t}\n\n}",
"Main"
]
| import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int K = scanner.nextInt();
ArrayList<Integer> prices = new ArrayList<>();
int total = 0;
for (int i = 0; i < N; i++) {
int p = scanner.nextInt();
prices.add(p);
}
Collections.sort(prices);
for (int j = 0; j < K; j++) {
int price = prices.get(j);
total += price;
}
System.out.println(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,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
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
],
[
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
],
[
39,
40
],
[
38,
41
],
[
41,
42
],
[
42,
43
],
[
8,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
8,
48
],
[
48,
49
],
[
48,
50
],
[
8,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
8,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
6,
76
],
[
76,
77
],
[
0,
78
],
[
78,
79
],
[
78,
80
]
]
| [
"import java.util.*;\npublic class Main {\n\tpublic static void main (String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt(), K = sc.nextInt();\n ArrayList<Integer> list = new ArrayList<>();\n for (int i=0; i<N; i++) {\n list.add(sc.nextInt());\n }\n Collections.sort(list);\n int ans = 0;\n for (int j=0; j<K; j++) {\n ans += list.get(j);\n }\n System.out.println(ans);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main (String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt(), K = sc.nextInt();\n ArrayList<Integer> list = new ArrayList<>();\n for (int i=0; i<N; i++) {\n list.add(sc.nextInt());\n }\n Collections.sort(list);\n int ans = 0;\n for (int j=0; j<K; j++) {\n ans += list.get(j);\n }\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(), K = sc.nextInt();\n ArrayList<Integer> list = new ArrayList<>();\n for (int i=0; i<N; i++) {\n list.add(sc.nextInt());\n }\n Collections.sort(list);\n int ans = 0;\n for (int j=0; j<K; j++) {\n ans += list.get(j);\n }\n System.out.println(ans);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt(), K = sc.nextInt();\n ArrayList<Integer> list = new ArrayList<>();\n for (int i=0; i<N; i++) {\n list.add(sc.nextInt());\n }\n Collections.sort(list);\n int ans = 0;\n for (int j=0; j<K; j++) {\n ans += list.get(j);\n }\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",
"K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ArrayList<Integer> list = new ArrayList<>();",
"list",
"new ArrayList<>()",
"for (int i=0; i<N; i++) {\n list.add(sc.nextInt());\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n list.add(sc.nextInt());\n }",
"{\n list.add(sc.nextInt());\n }",
"list.add(sc.nextInt())",
"list.add",
"list",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Collections.sort(list)",
"Collections.sort",
"Collections",
"list",
"int ans = 0;",
"ans",
"0",
"for (int j=0; j<K; j++) {\n ans += list.get(j);\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<K",
"j",
"K",
"j++",
"j++",
"j",
"{\n ans += list.get(j);\n }",
"{\n ans += list.get(j);\n }",
"ans += list.get(j)",
"ans",
"list.get(j)",
"list.get",
"list",
"j",
"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 Scanner sc = new Scanner(System.in);\n int N = sc.nextInt(), K = sc.nextInt();\n ArrayList<Integer> list = new ArrayList<>();\n for (int i=0; i<N; i++) {\n list.add(sc.nextInt());\n }\n Collections.sort(list);\n int ans = 0;\n for (int j=0; j<K; j++) {\n ans += list.get(j);\n }\n System.out.println(ans);\n }\n}",
"public class Main {\n\tpublic static void main (String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt(), K = sc.nextInt();\n ArrayList<Integer> list = new ArrayList<>();\n for (int i=0; i<N; i++) {\n list.add(sc.nextInt());\n }\n Collections.sort(list);\n int ans = 0;\n for (int j=0; j<K; j++) {\n ans += list.get(j);\n }\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(), K = sc.nextInt();
ArrayList<Integer> list = new ArrayList<>();
for (int i=0; i<N; i++) {
list.add(sc.nextInt());
}
Collections.sort(list);
int ans = 0;
for (int j=0; j<K; j++) {
ans += list.get(j);
}
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,
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,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
80,
5
],
[
80,
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
],
[
49,
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
],
[
8,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
6,
77
],
[
77,
78
],
[
0,
79
],
[
79,
80
],
[
79,
81
]
]
| [
"import java.util.*;\n\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int num = sc.nextInt();\n int BuyNum = sc.nextInt();\n int ans = 0;\n int[] price = new int[num];\n for (int i = 0; i < num; i++){\n price[i] = sc.nextInt();\n }\n \tArrays.sort(price);\n for (int i = 0; i < BuyNum; i++) {\n ans += price[i];\n }\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 \n int num = sc.nextInt();\n int BuyNum = sc.nextInt();\n int ans = 0;\n int[] price = new int[num];\n for (int i = 0; i < num; i++){\n price[i] = sc.nextInt();\n }\n \tArrays.sort(price);\n for (int i = 0; i < BuyNum; i++) {\n ans += price[i];\n }\n System.out.println(ans);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int num = sc.nextInt();\n int BuyNum = sc.nextInt();\n int ans = 0;\n int[] price = new int[num];\n for (int i = 0; i < num; i++){\n price[i] = sc.nextInt();\n }\n \tArrays.sort(price);\n for (int i = 0; i < BuyNum; i++) {\n ans += price[i];\n }\n System.out.println(ans);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n \n int num = sc.nextInt();\n int BuyNum = sc.nextInt();\n int ans = 0;\n int[] price = new int[num];\n for (int i = 0; i < num; i++){\n price[i] = sc.nextInt();\n }\n \tArrays.sort(price);\n for (int i = 0; i < BuyNum; i++) {\n ans += price[i];\n }\n System.out.println(ans);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int num = sc.nextInt();",
"num",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int BuyNum = sc.nextInt();",
"BuyNum",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int ans = 0;",
"ans",
"0",
"int[] price = new int[num];",
"price",
"new int[num]",
"num",
"for (int i = 0; i < num; i++){\n price[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < num",
"i",
"num",
"i++",
"i++",
"i",
"{\n price[i] = sc.nextInt();\n }",
"{\n price[i] = sc.nextInt();\n }",
"price[i] = sc.nextInt()",
"price[i]",
"price",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(price)",
"Arrays.sort",
"Arrays",
"price",
"for (int i = 0; i < BuyNum; i++) {\n ans += price[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < BuyNum",
"i",
"BuyNum",
"i++",
"i++",
"i",
"{\n ans += price[i];\n }",
"{\n ans += price[i];\n }",
"ans += price[i]",
"ans",
"price[i]",
"price",
"i",
"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 \n int num = sc.nextInt();\n int BuyNum = sc.nextInt();\n int ans = 0;\n int[] price = new int[num];\n for (int i = 0; i < num; i++){\n price[i] = sc.nextInt();\n }\n \tArrays.sort(price);\n for (int i = 0; i < BuyNum; i++) {\n ans += price[i];\n }\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 \n int num = sc.nextInt();\n int BuyNum = sc.nextInt();\n int ans = 0;\n int[] price = new int[num];\n for (int i = 0; i < num; i++){\n price[i] = sc.nextInt();\n }\n \tArrays.sort(price);\n for (int i = 0; i < BuyNum; i++) {\n ans += price[i];\n }\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 num = sc.nextInt();
int BuyNum = sc.nextInt();
int ans = 0;
int[] price = new int[num];
for (int i = 0; i < num; i++){
price[i] = sc.nextInt();
}
Arrays.sort(price);
for (int i = 0; i < BuyNum; i++) {
ans += price[i];
}
System.out.println(ans);
}
}
|
[
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,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
93,
14
],
[
93,
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
],
[
48,
49
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
17,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
17,
57
],
[
57,
58
],
[
57,
59
],
[
17,
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
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
77,
80
],
[
17,
81
],
[
81,
82
],
[
82,
83
],
[
83,
84
],
[
83,
85
],
[
81,
86
],
[
17,
87
],
[
87,
88
],
[
88,
89
],
[
15,
90
],
[
90,
91
],
[
0,
92
],
[
92,
93
],
[
92,
94
]
]
| [
"import java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport 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 K = scan.nextInt();\n\n List<Integer> listN = new ArrayList<Integer>();\n\n for(int i = 0; i < N; i++){\n listN.add(scan.nextInt());\n }\n\n Collections.sort(listN);\n\n int sum = 0;\n\n for(int i = 0; i < K; i++){\n sum = sum + listN.get(i);\n }\n\n System.out.println(sum);\n\n scan.close();\n }\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.List;",
"List",
"java.util",
"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 K = scan.nextInt();\n\n List<Integer> listN = new ArrayList<Integer>();\n\n for(int i = 0; i < N; i++){\n listN.add(scan.nextInt());\n }\n\n Collections.sort(listN);\n\n int sum = 0;\n\n for(int i = 0; i < K; i++){\n sum = sum + listN.get(i);\n }\n\n System.out.println(sum);\n\n scan.close();\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int K = scan.nextInt();\n\n List<Integer> listN = new ArrayList<Integer>();\n\n for(int i = 0; i < N; i++){\n listN.add(scan.nextInt());\n }\n\n Collections.sort(listN);\n\n int sum = 0;\n\n for(int i = 0; i < K; i++){\n sum = sum + listN.get(i);\n }\n\n System.out.println(sum);\n\n scan.close();\n }",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int K = scan.nextInt();\n\n List<Integer> listN = new ArrayList<Integer>();\n\n for(int i = 0; i < N; i++){\n listN.add(scan.nextInt());\n }\n\n Collections.sort(listN);\n\n int sum = 0;\n\n for(int i = 0; i < K; i++){\n sum = sum + listN.get(i);\n }\n\n System.out.println(sum);\n\n scan.close();\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int K = scan.nextInt();",
"K",
"scan.nextInt()",
"scan.nextInt",
"scan",
"List<Integer> listN = new ArrayList<Integer>();",
"listN",
"new ArrayList<Integer>()",
"for(int i = 0; i < N; i++){\n listN.add(scan.nextInt());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n listN.add(scan.nextInt());\n }",
"{\n listN.add(scan.nextInt());\n }",
"listN.add(scan.nextInt())",
"listN.add",
"listN",
"scan.nextInt()",
"scan.nextInt",
"scan",
"Collections.sort(listN)",
"Collections.sort",
"Collections",
"listN",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i < K; i++){\n sum = sum + listN.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < K",
"i",
"K",
"i++",
"i++",
"i",
"{\n sum = sum + listN.get(i);\n }",
"{\n sum = sum + listN.get(i);\n }",
"sum = sum + listN.get(i)",
"sum",
"sum + listN.get(i)",
"sum",
"listN.get(i)",
"listN.get",
"listN",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"scan.close()",
"scan.close",
"scan",
"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 K = scan.nextInt();\n\n List<Integer> listN = new ArrayList<Integer>();\n\n for(int i = 0; i < N; i++){\n listN.add(scan.nextInt());\n }\n\n Collections.sort(listN);\n\n int sum = 0;\n\n for(int i = 0; i < K; i++){\n sum = sum + listN.get(i);\n }\n\n System.out.println(sum);\n\n scan.close();\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 K = scan.nextInt();\n\n List<Integer> listN = new ArrayList<Integer>();\n\n for(int i = 0; i < N; i++){\n listN.add(scan.nextInt());\n }\n\n Collections.sort(listN);\n\n int sum = 0;\n\n for(int i = 0; i < K; i++){\n sum = sum + listN.get(i);\n }\n\n System.out.println(sum);\n\n scan.close();\n }\n}",
"Main"
]
| import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
int K = scan.nextInt();
List<Integer> listN = new ArrayList<Integer>();
for(int i = 0; i < N; i++){
listN.add(scan.nextInt());
}
Collections.sort(listN);
int sum = 0;
for(int i = 0; i < K; i++){
sum = sum + listN.get(i);
}
System.out.println(sum);
scan.close();
}
} |
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
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,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
86,
8
],
[
86,
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,
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
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
11,
53
],
[
53,
54
],
[
53,
55
],
[
11,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
11,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
11,
80
],
[
80,
81
],
[
81,
82
],
[
9,
83
],
[
83,
84
],
[
0,
85
],
[
85,
86
],
[
85,
87
]
]
| [
"import java.util.Arrays;\nimport java.util.Scanner;\n\n// ABC171-B\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tint[] fruitList = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tfruitList[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(fruitList);\n\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tsum += fruitList[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t}\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"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\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tint[] fruitList = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tfruitList[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(fruitList);\n\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tsum += fruitList[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tint[] fruitList = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tfruitList[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(fruitList);\n\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tsum += fruitList[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t}",
"main",
"{\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tint[] fruitList = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tfruitList[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(fruitList);\n\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tsum += fruitList[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\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 K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] fruitList = new int[N];",
"fruitList",
"new int[N]",
"N",
"for (int i = 0; i < N; i++) {\n\t\t\tfruitList[i] = sc.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tfruitList[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tfruitList[i] = sc.nextInt();\n\t\t}",
"fruitList[i] = sc.nextInt()",
"fruitList[i]",
"fruitList",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(fruitList)",
"Arrays.sort",
"Arrays",
"fruitList",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < K; i++) {\n\t\t\tsum += fruitList[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tsum += fruitList[i];\n\t\t}",
"{\n\t\t\tsum += fruitList[i];\n\t\t}",
"sum += fruitList[i]",
"sum",
"fruitList[i]",
"fruitList",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"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\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tint[] fruitList = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tfruitList[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(fruitList);\n\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tsum += fruitList[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\n\t\tint[] fruitList = new int[N];\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tfruitList[i] = sc.nextInt();\n\t\t}\n\t\tArrays.sort(fruitList);\n\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < K; i++) {\n\t\t\tsum += fruitList[i];\n\t\t}\n\n\t\tSystem.out.println(sum);\n\t\tsc.close();\n\t}\n}",
"Main"
]
| import java.util.Arrays;
import java.util.Scanner;
// ABC171-B
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int K = sc.nextInt();
int[] fruitList = new int[N];
for (int i = 0; i < N; i++) {
fruitList[i] = sc.nextInt();
}
Arrays.sort(fruitList);
int sum = 0;
for (int i = 0; i < K; i++) {
sum += fruitList[i];
}
System.out.println(sum);
sc.close();
}
}
|
[
7,
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,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
82,
5
],
[
82,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
23,
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
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
8,
47
],
[
47,
48
],
[
48,
49
],
[
47,
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
],
[
67,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
8,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
6,
79
],
[
79,
80
],
[
0,
81
],
[
81,
82
],
[
81,
83
]
]
| [
"import java.util.*;\npublic class Main {\n public static void main(String[] args) {\n Scanner console = new Scanner(System.in);\n int fruitTypeNum = console.nextInt();\n int buyFruitNum = console.nextInt();\n console.nextLine();\n\n ArrayList<Integer> minPrices = new ArrayList<Integer>(fruitTypeNum);\n for(int i = 0; i < fruitTypeNum; i++){\n minPrices.add(console.nextInt());\n }\n Collections.sort(minPrices);\n\n int total = 0;\n for(int i = 0; i < buyFruitNum; i++){\n total += minPrices.get(i);\n }\n System.out.println(total);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner console = new Scanner(System.in);\n int fruitTypeNum = console.nextInt();\n int buyFruitNum = console.nextInt();\n console.nextLine();\n\n ArrayList<Integer> minPrices = new ArrayList<Integer>(fruitTypeNum);\n for(int i = 0; i < fruitTypeNum; i++){\n minPrices.add(console.nextInt());\n }\n Collections.sort(minPrices);\n\n int total = 0;\n for(int i = 0; i < buyFruitNum; i++){\n total += minPrices.get(i);\n }\n System.out.println(total);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner console = new Scanner(System.in);\n int fruitTypeNum = console.nextInt();\n int buyFruitNum = console.nextInt();\n console.nextLine();\n\n ArrayList<Integer> minPrices = new ArrayList<Integer>(fruitTypeNum);\n for(int i = 0; i < fruitTypeNum; i++){\n minPrices.add(console.nextInt());\n }\n Collections.sort(minPrices);\n\n int total = 0;\n for(int i = 0; i < buyFruitNum; i++){\n total += minPrices.get(i);\n }\n System.out.println(total);\n }",
"main",
"{\n Scanner console = new Scanner(System.in);\n int fruitTypeNum = console.nextInt();\n int buyFruitNum = console.nextInt();\n console.nextLine();\n\n ArrayList<Integer> minPrices = new ArrayList<Integer>(fruitTypeNum);\n for(int i = 0; i < fruitTypeNum; i++){\n minPrices.add(console.nextInt());\n }\n Collections.sort(minPrices);\n\n int total = 0;\n for(int i = 0; i < buyFruitNum; i++){\n total += minPrices.get(i);\n }\n System.out.println(total);\n }",
"Scanner console = new Scanner(System.in);",
"console",
"new Scanner(System.in)",
"int fruitTypeNum = console.nextInt();",
"fruitTypeNum",
"console.nextInt()",
"console.nextInt",
"console",
"int buyFruitNum = console.nextInt();",
"buyFruitNum",
"console.nextInt()",
"console.nextInt",
"console",
"console.nextLine()",
"console.nextLine",
"console",
"ArrayList<Integer> minPrices = new ArrayList<Integer>(fruitTypeNum);",
"minPrices",
"new ArrayList<Integer>(fruitTypeNum)",
"for(int i = 0; i < fruitTypeNum; i++){\n minPrices.add(console.nextInt());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < fruitTypeNum",
"i",
"fruitTypeNum",
"i++",
"i++",
"i",
"{\n minPrices.add(console.nextInt());\n }",
"{\n minPrices.add(console.nextInt());\n }",
"minPrices.add(console.nextInt())",
"minPrices.add",
"minPrices",
"console.nextInt()",
"console.nextInt",
"console",
"Collections.sort(minPrices)",
"Collections.sort",
"Collections",
"minPrices",
"int total = 0;",
"total",
"0",
"for(int i = 0; i < buyFruitNum; i++){\n total += minPrices.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < buyFruitNum",
"i",
"buyFruitNum",
"i++",
"i++",
"i",
"{\n total += minPrices.get(i);\n }",
"{\n total += minPrices.get(i);\n }",
"total += minPrices.get(i)",
"total",
"minPrices.get(i)",
"minPrices.get",
"minPrices",
"i",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner console = new Scanner(System.in);\n int fruitTypeNum = console.nextInt();\n int buyFruitNum = console.nextInt();\n console.nextLine();\n\n ArrayList<Integer> minPrices = new ArrayList<Integer>(fruitTypeNum);\n for(int i = 0; i < fruitTypeNum; i++){\n minPrices.add(console.nextInt());\n }\n Collections.sort(minPrices);\n\n int total = 0;\n for(int i = 0; i < buyFruitNum; i++){\n total += minPrices.get(i);\n }\n System.out.println(total);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner console = new Scanner(System.in);\n int fruitTypeNum = console.nextInt();\n int buyFruitNum = console.nextInt();\n console.nextLine();\n\n ArrayList<Integer> minPrices = new ArrayList<Integer>(fruitTypeNum);\n for(int i = 0; i < fruitTypeNum; i++){\n minPrices.add(console.nextInt());\n }\n Collections.sort(minPrices);\n\n int total = 0;\n for(int i = 0; i < buyFruitNum; i++){\n total += minPrices.get(i);\n }\n System.out.println(total);\n }\n}",
"Main"
]
| import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
int fruitTypeNum = console.nextInt();
int buyFruitNum = console.nextInt();
console.nextLine();
ArrayList<Integer> minPrices = new ArrayList<Integer>(fruitTypeNum);
for(int i = 0; i < fruitTypeNum; i++){
minPrices.add(console.nextInt());
}
Collections.sort(minPrices);
int total = 0;
for(int i = 0; i < buyFruitNum; i++){
total += minPrices.get(i);
}
System.out.println(total);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
13,
0,
13,
13,
41,
13,
4,
18,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
97,
11
],
[
97,
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
],
[
43,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
14,
53
],
[
53,
54
],
[
53,
55
],
[
14,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
72,
73
],
[
71,
74
],
[
68,
75
],
[
75,
76
],
[
75,
77
],
[
68,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
68,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
14,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
12,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
]
]
| [
"import java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n\n Scanner entrada = new Scanner(System.in);\n int tipos = entrada.nextInt();\n int eleccion = entrada.nextInt();\n ArrayList<Integer> listaPrecios = new ArrayList<Integer>();\n for (int i = 0; i < tipos; i++) {\n int valor = entrada.nextInt();\n listaPrecios.add(valor);\n }\n int sumaMin = 0;\n for (int i = 0; i < eleccion; i++) {\n int min = Collections.min(listaPrecios);\n sumaMin += min;\n int index = listaPrecios.indexOf(min);\n listaPrecios.remove(index);\n }\n System.out.println(sumaMin);\n }\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner entrada = new Scanner(System.in);\n int tipos = entrada.nextInt();\n int eleccion = entrada.nextInt();\n ArrayList<Integer> listaPrecios = new ArrayList<Integer>();\n for (int i = 0; i < tipos; i++) {\n int valor = entrada.nextInt();\n listaPrecios.add(valor);\n }\n int sumaMin = 0;\n for (int i = 0; i < eleccion; i++) {\n int min = Collections.min(listaPrecios);\n sumaMin += min;\n int index = listaPrecios.indexOf(min);\n listaPrecios.remove(index);\n }\n System.out.println(sumaMin);\n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner entrada = new Scanner(System.in);\n int tipos = entrada.nextInt();\n int eleccion = entrada.nextInt();\n ArrayList<Integer> listaPrecios = new ArrayList<Integer>();\n for (int i = 0; i < tipos; i++) {\n int valor = entrada.nextInt();\n listaPrecios.add(valor);\n }\n int sumaMin = 0;\n for (int i = 0; i < eleccion; i++) {\n int min = Collections.min(listaPrecios);\n sumaMin += min;\n int index = listaPrecios.indexOf(min);\n listaPrecios.remove(index);\n }\n System.out.println(sumaMin);\n }",
"main",
"{\n\n Scanner entrada = new Scanner(System.in);\n int tipos = entrada.nextInt();\n int eleccion = entrada.nextInt();\n ArrayList<Integer> listaPrecios = new ArrayList<Integer>();\n for (int i = 0; i < tipos; i++) {\n int valor = entrada.nextInt();\n listaPrecios.add(valor);\n }\n int sumaMin = 0;\n for (int i = 0; i < eleccion; i++) {\n int min = Collections.min(listaPrecios);\n sumaMin += min;\n int index = listaPrecios.indexOf(min);\n listaPrecios.remove(index);\n }\n System.out.println(sumaMin);\n }",
"Scanner entrada = new Scanner(System.in);",
"entrada",
"new Scanner(System.in)",
"int tipos = entrada.nextInt();",
"tipos",
"entrada.nextInt()",
"entrada.nextInt",
"entrada",
"int eleccion = entrada.nextInt();",
"eleccion",
"entrada.nextInt()",
"entrada.nextInt",
"entrada",
"ArrayList<Integer> listaPrecios = new ArrayList<Integer>();",
"listaPrecios",
"new ArrayList<Integer>()",
"for (int i = 0; i < tipos; i++) {\n int valor = entrada.nextInt();\n listaPrecios.add(valor);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < tipos",
"i",
"tipos",
"i++",
"i++",
"i",
"{\n int valor = entrada.nextInt();\n listaPrecios.add(valor);\n }",
"{\n int valor = entrada.nextInt();\n listaPrecios.add(valor);\n }",
"int valor = entrada.nextInt();",
"valor",
"entrada.nextInt()",
"entrada.nextInt",
"entrada",
"listaPrecios.add(valor)",
"listaPrecios.add",
"listaPrecios",
"valor",
"int sumaMin = 0;",
"sumaMin",
"0",
"for (int i = 0; i < eleccion; i++) {\n int min = Collections.min(listaPrecios);\n sumaMin += min;\n int index = listaPrecios.indexOf(min);\n listaPrecios.remove(index);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < eleccion",
"i",
"eleccion",
"i++",
"i++",
"i",
"{\n int min = Collections.min(listaPrecios);\n sumaMin += min;\n int index = listaPrecios.indexOf(min);\n listaPrecios.remove(index);\n }",
"{\n int min = Collections.min(listaPrecios);\n sumaMin += min;\n int index = listaPrecios.indexOf(min);\n listaPrecios.remove(index);\n }",
"int min = Collections.min(listaPrecios);",
"min",
"Collections.min(listaPrecios)",
"Collections.min",
"Collections",
"listaPrecios",
"sumaMin += min",
"sumaMin",
"min",
"int index = listaPrecios.indexOf(min);",
"index",
"listaPrecios.indexOf(min)",
"listaPrecios.indexOf",
"listaPrecios",
"min",
"listaPrecios.remove(index)",
"listaPrecios.remove",
"listaPrecios",
"index",
"System.out.println(sumaMin)",
"System.out.println",
"System.out",
"System",
"System.out",
"sumaMin",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner entrada = new Scanner(System.in);\n int tipos = entrada.nextInt();\n int eleccion = entrada.nextInt();\n ArrayList<Integer> listaPrecios = new ArrayList<Integer>();\n for (int i = 0; i < tipos; i++) {\n int valor = entrada.nextInt();\n listaPrecios.add(valor);\n }\n int sumaMin = 0;\n for (int i = 0; i < eleccion; i++) {\n int min = Collections.min(listaPrecios);\n sumaMin += min;\n int index = listaPrecios.indexOf(min);\n listaPrecios.remove(index);\n }\n System.out.println(sumaMin);\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner entrada = new Scanner(System.in);\n int tipos = entrada.nextInt();\n int eleccion = entrada.nextInt();\n ArrayList<Integer> listaPrecios = new ArrayList<Integer>();\n for (int i = 0; i < tipos; i++) {\n int valor = entrada.nextInt();\n listaPrecios.add(valor);\n }\n int sumaMin = 0;\n for (int i = 0; i < eleccion; i++) {\n int min = Collections.min(listaPrecios);\n sumaMin += min;\n int index = listaPrecios.indexOf(min);\n listaPrecios.remove(index);\n }\n System.out.println(sumaMin);\n }\n}",
"Main"
]
| import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
int tipos = entrada.nextInt();
int eleccion = entrada.nextInt();
ArrayList<Integer> listaPrecios = new ArrayList<Integer>();
for (int i = 0; i < tipos; i++) {
int valor = entrada.nextInt();
listaPrecios.add(valor);
}
int sumaMin = 0;
for (int i = 0; i < eleccion; i++) {
int min = Collections.min(listaPrecios);
sumaMin += min;
int index = listaPrecios.indexOf(min);
listaPrecios.remove(index);
}
System.out.println(sumaMin);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
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,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
92,
17
],
[
92,
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
],
[
31,
32
],
[
32,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
20,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
50,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
20,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
20,
62
],
[
62,
63
],
[
62,
64
],
[
20,
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
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
20,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
18,
89
],
[
89,
90
],
[
0,
91
],
[
91,
92
],
[
91,
93
]
]
| [
"import java.io.*;\nimport java.util.*;\nimport java.text.*;\nimport java.math.*;\nimport java.util.regex.*;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\t// code to read values\n\t\t// code to call required method\n\t\t// code to display the result\n\t\t// System.out.println(Math.ceil(2.5));\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i=0; i<n; i++){\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t//System.out.println(arr[0]);\n\t\t\n\t\tArrays.sort(arr);\n\t\t//System.out.println(arr[0]);\n\t\tint sum = 0;\n\t\tfor(int i=0; i<k; i++){\n\t\t\tsum += arr[i];\n\t\t\t//System.out.println(arr[0]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"import java.text.*;",
"text.*",
"java",
"import java.math.*;",
"math.*",
"java",
"import java.util.regex.*;",
"regex.*",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t// code to read values\n\t\t// code to call required method\n\t\t// code to display the result\n\t\t// System.out.println(Math.ceil(2.5));\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i=0; i<n; i++){\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t//System.out.println(arr[0]);\n\t\t\n\t\tArrays.sort(arr);\n\t\t//System.out.println(arr[0]);\n\t\tint sum = 0;\n\t\tfor(int i=0; i<k; i++){\n\t\t\tsum += arr[i];\n\t\t\t//System.out.println(arr[0]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// code to read values\n\t\t// code to call required method\n\t\t// code to display the result\n\t\t// System.out.println(Math.ceil(2.5));\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i=0; i<n; i++){\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t//System.out.println(arr[0]);\n\t\t\n\t\tArrays.sort(arr);\n\t\t//System.out.println(arr[0]);\n\t\tint sum = 0;\n\t\tfor(int i=0; i<k; i++){\n\t\t\tsum += arr[i];\n\t\t\t//System.out.println(arr[0]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\t// code to read values\n\t\t// code to call required method\n\t\t// code to display the result\n\t\t// System.out.println(Math.ceil(2.5));\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i=0; i<n; i++){\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t//System.out.println(arr[0]);\n\t\t\n\t\tArrays.sort(arr);\n\t\t//System.out.println(arr[0]);\n\t\tint sum = 0;\n\t\tfor(int i=0; i<k; i++){\n\t\t\tsum += arr[i];\n\t\t\t//System.out.println(arr[0]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"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\tarr[i] = sc.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tarr[i] = sc.nextInt();\n\t\t}",
"arr[i] = sc.nextInt()",
"arr[i]",
"arr",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"int sum = 0;",
"sum",
"0",
"for(int i=0; i<k; i++){\n\t\t\tsum += arr[i];\n\t\t\t//System.out.println(arr[0]);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tsum += arr[i];\n\t\t\t//System.out.println(arr[0]);\n\t\t}",
"{\n\t\t\tsum += arr[i];\n\t\t\t//System.out.println(arr[0]);\n\t\t}",
"sum += arr[i]",
"sum",
"arr[i]",
"arr",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t// code to read values\n\t\t// code to call required method\n\t\t// code to display the result\n\t\t// System.out.println(Math.ceil(2.5));\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i=0; i<n; i++){\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t//System.out.println(arr[0]);\n\t\t\n\t\tArrays.sort(arr);\n\t\t//System.out.println(arr[0]);\n\t\tint sum = 0;\n\t\tfor(int i=0; i<k; i++){\n\t\t\tsum += arr[i];\n\t\t\t//System.out.println(arr[0]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\t// code to read values\n\t\t// code to call required method\n\t\t// code to display the result\n\t\t// System.out.println(Math.ceil(2.5));\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor(int i=0; i<n; i++){\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\t//System.out.println(arr[0]);\n\t\t\n\t\tArrays.sort(arr);\n\t\t//System.out.println(arr[0]);\n\t\tint sum = 0;\n\t\tfor(int i=0; i<k; i++){\n\t\t\tsum += arr[i];\n\t\t\t//System.out.println(arr[0]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"Main"
]
| import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Main {
public static void main(String[] args) {
// code to read values
// code to call required method
// code to display the result
// System.out.println(Math.ceil(2.5));
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int[] arr = new int[n];
for(int i=0; i<n; i++){
arr[i] = sc.nextInt();
}
//System.out.println(arr[0]);
Arrays.sort(arr);
//System.out.println(arr[0]);
int sum = 0;
for(int i=0; i<k; i++){
sum += arr[i];
//System.out.println(arr[0]);
}
System.out.println(sum);
}
} |
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
2,
13,
13,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
87,
8
],
[
87,
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,
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
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
11,
53
],
[
53,
54
],
[
53,
55
],
[
11,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
65,
66
],
[
65,
67
],
[
56,
68
],
[
68,
69
],
[
69,
70
],
[
56,
71
],
[
72,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
11,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
9,
84
],
[
84,
85
],
[
0,
86
],
[
86,
87
],
[
86,
88
]
]
| [
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int size = s.nextInt();\n int k = s.nextInt();\n int elements[] = new int[size];\n for(int i=0;i<size;i++) {\n elements[i] = s.nextInt();\n }\n Arrays.sort(elements);\n long sum = 0;\n for(int i=0;i<k&&i<size;i++) {\n sum += elements[i];\n }\n System.out.println(sum);\n }\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"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 size = s.nextInt();\n int k = s.nextInt();\n int elements[] = new int[size];\n for(int i=0;i<size;i++) {\n elements[i] = s.nextInt();\n }\n Arrays.sort(elements);\n long sum = 0;\n for(int i=0;i<k&&i<size;i++) {\n sum += elements[i];\n }\n System.out.println(sum);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int size = s.nextInt();\n int k = s.nextInt();\n int elements[] = new int[size];\n for(int i=0;i<size;i++) {\n elements[i] = s.nextInt();\n }\n Arrays.sort(elements);\n long sum = 0;\n for(int i=0;i<k&&i<size;i++) {\n sum += elements[i];\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner s = new Scanner(System.in);\n int size = s.nextInt();\n int k = s.nextInt();\n int elements[] = new int[size];\n for(int i=0;i<size;i++) {\n elements[i] = s.nextInt();\n }\n Arrays.sort(elements);\n long sum = 0;\n for(int i=0;i<k&&i<size;i++) {\n sum += elements[i];\n }\n System.out.println(sum);\n }",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int size = s.nextInt();",
"size",
"s.nextInt()",
"s.nextInt",
"s",
"int k = s.nextInt();",
"k",
"s.nextInt()",
"s.nextInt",
"s",
"int elements[] = new int[size];",
"elements",
"new int[size]",
"size",
"for(int i=0;i<size;i++) {\n elements[i] = s.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<size",
"i",
"size",
"i++",
"i++",
"i",
"{\n elements[i] = s.nextInt();\n }",
"{\n elements[i] = s.nextInt();\n }",
"elements[i] = s.nextInt()",
"elements[i]",
"elements",
"i",
"s.nextInt()",
"s.nextInt",
"s",
"Arrays.sort(elements)",
"Arrays.sort",
"Arrays",
"elements",
"long sum = 0;",
"sum",
"0",
"for(int i=0;i<k&&i<size;i++) {\n sum += elements[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k&&i<size",
"i<k",
"i",
"k",
"i<size",
"i",
"size",
"i++",
"i++",
"i",
"{\n sum += elements[i];\n }",
"{\n sum += elements[i];\n }",
"sum += elements[i]",
"sum",
"elements[i]",
"elements",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int size = s.nextInt();\n int k = s.nextInt();\n int elements[] = new int[size];\n for(int i=0;i<size;i++) {\n elements[i] = s.nextInt();\n }\n Arrays.sort(elements);\n long sum = 0;\n for(int i=0;i<k&&i<size;i++) {\n sum += elements[i];\n }\n System.out.println(sum);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n int size = s.nextInt();\n int k = s.nextInt();\n int elements[] = new int[size];\n for(int i=0;i<size;i++) {\n elements[i] = s.nextInt();\n }\n Arrays.sort(elements);\n long sum = 0;\n for(int i=0;i<k&&i<size;i++) {\n sum += elements[i];\n }\n System.out.println(sum);\n }\n}",
"Main"
]
| import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int size = s.nextInt();
int k = s.nextInt();
int elements[] = new int[size];
for(int i=0;i<size;i++) {
elements[i] = s.nextInt();
}
Arrays.sort(elements);
long sum = 0;
for(int i=0;i<k&&i<size;i++) {
sum += elements[i];
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
97,
17
],
[
97,
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
],
[
31,
32
],
[
32,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
20,
38
],
[
38,
39
],
[
38,
40
],
[
20,
41
],
[
41,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
41,
46
],
[
46,
47
],
[
46,
48
],
[
41,
49
],
[
49,
50
],
[
50,
51
],
[
41,
52
],
[
53,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
58,
59
],
[
59,
60
],
[
20,
61
],
[
61,
62
],
[
62,
63
],
[
61,
64
],
[
20,
65
],
[
65,
66
],
[
65,
67
],
[
20,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
73,
74
],
[
73,
75
],
[
68,
76
],
[
76,
77
],
[
77,
78
],
[
68,
79
],
[
80,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
83,
84
],
[
83,
85
],
[
85,
86
],
[
85,
87
],
[
20,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
18,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
]
]
| [
"import java.io.*;\nimport java.util.Scanner;\nimport java.util.Arrays;\nimport java.util.ArrayList;\nimport java.math.BigDecimal;\n\npublic class Main{\n\n public static void main(String[] args){\n //START\n\n Scanner sc=new Scanner(System.in);\n\n //String N=sc.next();\n\n int N=sc.nextInt();\n int K=sc.nextInt();\n\n int[] p=new int[N];\n\n int i=0;\n\n for(i=0;i<N;i++){\n p[i]=sc.nextInt();\n //System.out.println(p[i]+\" \");\n }\n\n Arrays.sort(p);\n\n int sum=0;\n\n for(i=0;i<K;i++){\n sum=sum+p[i];\n //System.out.println(p[i]);\n }\n\n System.out.print(sum);\n //END\n }\n}\n\n\n\n",
"import java.io.*;",
"io.*",
"java",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"public class Main{\n\n public static void main(String[] args){\n //START\n\n Scanner sc=new Scanner(System.in);\n\n //String N=sc.next();\n\n int N=sc.nextInt();\n int K=sc.nextInt();\n\n int[] p=new int[N];\n\n int i=0;\n\n for(i=0;i<N;i++){\n p[i]=sc.nextInt();\n //System.out.println(p[i]+\" \");\n }\n\n Arrays.sort(p);\n\n int sum=0;\n\n for(i=0;i<K;i++){\n sum=sum+p[i];\n //System.out.println(p[i]);\n }\n\n System.out.print(sum);\n //END\n }\n}",
"Main",
"public static void main(String[] args){\n //START\n\n Scanner sc=new Scanner(System.in);\n\n //String N=sc.next();\n\n int N=sc.nextInt();\n int K=sc.nextInt();\n\n int[] p=new int[N];\n\n int i=0;\n\n for(i=0;i<N;i++){\n p[i]=sc.nextInt();\n //System.out.println(p[i]+\" \");\n }\n\n Arrays.sort(p);\n\n int sum=0;\n\n for(i=0;i<K;i++){\n sum=sum+p[i];\n //System.out.println(p[i]);\n }\n\n System.out.print(sum);\n //END\n }",
"main",
"{\n //START\n\n Scanner sc=new Scanner(System.in);\n\n //String N=sc.next();\n\n int N=sc.nextInt();\n int K=sc.nextInt();\n\n int[] p=new int[N];\n\n int i=0;\n\n for(i=0;i<N;i++){\n p[i]=sc.nextInt();\n //System.out.println(p[i]+\" \");\n }\n\n Arrays.sort(p);\n\n int sum=0;\n\n for(i=0;i<K;i++){\n sum=sum+p[i];\n //System.out.println(p[i]);\n }\n\n System.out.print(sum);\n //END\n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N=sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int K=sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] p=new int[N];",
"p",
"new int[N]",
"N",
"int i=0;",
"i",
"0",
"for(i=0;i<N;i++){\n p[i]=sc.nextInt();\n //System.out.println(p[i]+\" \");\n }",
"i=0;",
"i=0",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n p[i]=sc.nextInt();\n //System.out.println(p[i]+\" \");\n }",
"{\n p[i]=sc.nextInt();\n //System.out.println(p[i]+\" \");\n }",
"p[i]=sc.nextInt()",
"p[i]",
"p",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"int sum=0;",
"sum",
"0",
"for(i=0;i<K;i++){\n sum=sum+p[i];\n //System.out.println(p[i]);\n }",
"i=0;",
"i=0",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n sum=sum+p[i];\n //System.out.println(p[i]);\n }",
"{\n sum=sum+p[i];\n //System.out.println(p[i]);\n }",
"sum=sum+p[i]",
"sum",
"sum+p[i]",
"sum",
"p[i]",
"p",
"i",
"System.out.print(sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main{\n\n public static void main(String[] args){\n //START\n\n Scanner sc=new Scanner(System.in);\n\n //String N=sc.next();\n\n int N=sc.nextInt();\n int K=sc.nextInt();\n\n int[] p=new int[N];\n\n int i=0;\n\n for(i=0;i<N;i++){\n p[i]=sc.nextInt();\n //System.out.println(p[i]+\" \");\n }\n\n Arrays.sort(p);\n\n int sum=0;\n\n for(i=0;i<K;i++){\n sum=sum+p[i];\n //System.out.println(p[i]);\n }\n\n System.out.print(sum);\n //END\n }\n}",
"public class Main{\n\n public static void main(String[] args){\n //START\n\n Scanner sc=new Scanner(System.in);\n\n //String N=sc.next();\n\n int N=sc.nextInt();\n int K=sc.nextInt();\n\n int[] p=new int[N];\n\n int i=0;\n\n for(i=0;i<N;i++){\n p[i]=sc.nextInt();\n //System.out.println(p[i]+\" \");\n }\n\n Arrays.sort(p);\n\n int sum=0;\n\n for(i=0;i<K;i++){\n sum=sum+p[i];\n //System.out.println(p[i]);\n }\n\n System.out.print(sum);\n //END\n }\n}",
"Main"
]
| import java.io.*;
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.math.BigDecimal;
public class Main{
public static void main(String[] args){
//START
Scanner sc=new Scanner(System.in);
//String N=sc.next();
int N=sc.nextInt();
int K=sc.nextInt();
int[] p=new int[N];
int i=0;
for(i=0;i<N;i++){
p[i]=sc.nextInt();
//System.out.println(p[i]+" ");
}
Arrays.sort(p);
int sum=0;
for(i=0;i<K;i++){
sum=sum+p[i];
//System.out.println(p[i]);
}
System.out.print(sum);
//END
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
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,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
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
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
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
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
8,
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
],
[
63,
64
],
[
8,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
6,
71
],
[
71,
72
],
[
0,
73
],
[
73,
74
],
[
73,
75
]
]
| [
"import java.util.*;\npublic class Main { \n public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n int o=0;\n int n=sc.nextInt();\n int k=sc.nextInt();\n PriorityQueue<Integer> p=new PriorityQueue<>();\n \tfor(int i=0;i<n;i++){\n \t\tp.offer(sc.nextInt());\n\t\t}\n for(int j=0;j<k;j++){\n \to+=p.poll();\n \t}\n System.out.println(o);\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 o=0;\n int n=sc.nextInt();\n int k=sc.nextInt();\n PriorityQueue<Integer> p=new PriorityQueue<>();\n \tfor(int i=0;i<n;i++){\n \t\tp.offer(sc.nextInt());\n\t\t}\n for(int j=0;j<k;j++){\n \to+=p.poll();\n \t}\n System.out.println(o);\n }\n \n}",
"Main",
"public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n int o=0;\n int n=sc.nextInt();\n int k=sc.nextInt();\n PriorityQueue<Integer> p=new PriorityQueue<>();\n \tfor(int i=0;i<n;i++){\n \t\tp.offer(sc.nextInt());\n\t\t}\n for(int j=0;j<k;j++){\n \to+=p.poll();\n \t}\n System.out.println(o);\n }",
"main",
"{\n Scanner sc=new Scanner(System.in);\n int o=0;\n int n=sc.nextInt();\n int k=sc.nextInt();\n PriorityQueue<Integer> p=new PriorityQueue<>();\n \tfor(int i=0;i<n;i++){\n \t\tp.offer(sc.nextInt());\n\t\t}\n for(int j=0;j<k;j++){\n \to+=p.poll();\n \t}\n System.out.println(o);\n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int o=0;",
"o",
"0",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k=sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"PriorityQueue<Integer> p=new PriorityQueue<>();",
"p",
"new PriorityQueue<>()",
"for(int i=0;i<n;i++){\n \t\tp.offer(sc.nextInt());\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n \t\tp.offer(sc.nextInt());\n\t\t}",
"{\n \t\tp.offer(sc.nextInt());\n\t\t}",
"p.offer(sc.nextInt())",
"p.offer",
"p",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for(int j=0;j<k;j++){\n \to+=p.poll();\n \t}",
"int j=0;",
"int j=0;",
"j",
"0",
"j<k",
"j",
"k",
"j++",
"j++",
"j",
"{\n \to+=p.poll();\n \t}",
"{\n \to+=p.poll();\n \t}",
"o+=p.poll()",
"o",
"p.poll()",
"p.poll",
"p",
"System.out.println(o)",
"System.out.println",
"System.out",
"System",
"System.out",
"o",
"String[] args",
"args",
"public class Main { \n public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n int o=0;\n int n=sc.nextInt();\n int k=sc.nextInt();\n PriorityQueue<Integer> p=new PriorityQueue<>();\n \tfor(int i=0;i<n;i++){\n \t\tp.offer(sc.nextInt());\n\t\t}\n for(int j=0;j<k;j++){\n \to+=p.poll();\n \t}\n System.out.println(o);\n }\n \n}",
"public class Main { \n public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n int o=0;\n int n=sc.nextInt();\n int k=sc.nextInt();\n PriorityQueue<Integer> p=new PriorityQueue<>();\n \tfor(int i=0;i<n;i++){\n \t\tp.offer(sc.nextInt());\n\t\t}\n for(int j=0;j<k;j++){\n \to+=p.poll();\n \t}\n System.out.println(o);\n }\n \n}",
"Main"
]
| import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int o=0;
int n=sc.nextInt();
int k=sc.nextInt();
PriorityQueue<Integer> p=new PriorityQueue<>();
for(int i=0;i<n;i++){
p.offer(sc.nextInt());
}
for(int j=0;j<k;j++){
o+=p.poll();
}
System.out.println(o);
}
} |
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
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,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
83,
8
],
[
83,
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,
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
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
11,
53
],
[
53,
54
],
[
53,
55
],
[
11,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
11,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
9,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
]
| [
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i ++ ) {\n A[i] = sc.nextInt();\n }\n\n Arrays.sort(A);\n int res = 0;\n for (int i = 0; i < K; i ++ ) {\n res += A[i];\n }\n System.out.println(res);\n }\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i ++ ) {\n A[i] = sc.nextInt();\n }\n\n Arrays.sort(A);\n int res = 0;\n for (int i = 0; i < K; i ++ ) {\n res += A[i];\n }\n System.out.println(res);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i ++ ) {\n A[i] = sc.nextInt();\n }\n\n Arrays.sort(A);\n int res = 0;\n for (int i = 0; i < K; i ++ ) {\n res += A[i];\n }\n System.out.println(res);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i ++ ) {\n A[i] = sc.nextInt();\n }\n\n Arrays.sort(A);\n int res = 0;\n for (int i = 0; i < K; i ++ ) {\n res += A[i];\n }\n System.out.println(res);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] A = new int[N];",
"A",
"new int[N]",
"N",
"for (int i = 0; i < N; i ++ ) {\n A[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"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",
"Arrays.sort(A)",
"Arrays.sort",
"Arrays",
"A",
"int res = 0;",
"res",
"0",
"for (int i = 0; i < K; i ++ ) {\n res += A[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < K",
"i",
"K",
"i ++",
"i ++",
"i",
"{\n res += A[i];\n }",
"{\n res += A[i];\n }",
"res += A[i]",
"res",
"A[i]",
"A",
"i",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i ++ ) {\n A[i] = sc.nextInt();\n }\n\n Arrays.sort(A);\n int res = 0;\n for (int i = 0; i < K; i ++ ) {\n res += A[i];\n }\n System.out.println(res);\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int N = sc.nextInt();\n int K = sc.nextInt();\n int[] A = new int[N];\n for (int i = 0; i < N; i ++ ) {\n A[i] = sc.nextInt();\n }\n\n Arrays.sort(A);\n int res = 0;\n for (int i = 0; i < K; i ++ ) {\n res += A[i];\n }\n System.out.println(res);\n }\n}",
"Main"
]
| import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int K = sc.nextInt();
int[] A = new int[N];
for (int i = 0; i < N; i ++ ) {
A[i] = sc.nextInt();
}
Arrays.sort(A);
int res = 0;
for (int i = 0; i < K; i ++ ) {
res += A[i];
}
System.out.println(res);
}
} |
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
83,
11
],
[
83,
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,
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
],
[
47,
48
],
[
46,
49
],
[
49,
50
],
[
50,
51
],
[
14,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
14,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
70,
73
],
[
14,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
12,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
]
| [
"import java.io.CharArrayReader;\nimport java.lang.reflect.Array;\nimport 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 k = sc.nextInt();\n int s = 0;\n ArrayList<Integer> arr = new ArrayList<Integer>();\n for(int i=0;i<n;i++)arr.add(sc.nextInt());\n Collections.sort(arr);\n for(int j=0;j<k;j++)s += arr.get(j);\n System.out.println(s);\n }\n}",
"import java.io.CharArrayReader;",
"CharArrayReader",
"java.io",
"import java.lang.reflect.Array;",
"Array",
"java.lang.reflect",
"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 k = sc.nextInt();\n int s = 0;\n ArrayList<Integer> arr = new ArrayList<Integer>();\n for(int i=0;i<n;i++)arr.add(sc.nextInt());\n Collections.sort(arr);\n for(int j=0;j<k;j++)s += arr.get(j);\n System.out.println(s);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int s = 0;\n ArrayList<Integer> arr = new ArrayList<Integer>();\n for(int i=0;i<n;i++)arr.add(sc.nextInt());\n Collections.sort(arr);\n for(int j=0;j<k;j++)s += arr.get(j);\n System.out.println(s);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int s = 0;\n ArrayList<Integer> arr = new ArrayList<Integer>();\n for(int i=0;i<n;i++)arr.add(sc.nextInt());\n Collections.sort(arr);\n for(int j=0;j<k;j++)s += arr.get(j);\n System.out.println(s);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int s = 0;",
"s",
"0",
"ArrayList<Integer> arr = new ArrayList<Integer>();",
"arr",
"new ArrayList<Integer>()",
"for(int i=0;i<n;i++)arr.add(sc.nextInt());",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"arr.add(sc.nextInt());",
"arr.add(sc.nextInt())",
"arr.add",
"arr",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Collections.sort(arr)",
"Collections.sort",
"Collections",
"arr",
"for(int j=0;j<k;j++)s += arr.get(j);",
"int j=0;",
"int j=0;",
"j",
"0",
"j<k",
"j",
"k",
"j++",
"j++",
"j",
"s += arr.get(j);",
"s += arr.get(j)",
"s",
"arr.get(j)",
"arr.get",
"arr",
"j",
"System.out.println(s)",
"System.out.println",
"System.out",
"System",
"System.out",
"s",
"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 k = sc.nextInt();\n int s = 0;\n ArrayList<Integer> arr = new ArrayList<Integer>();\n for(int i=0;i<n;i++)arr.add(sc.nextInt());\n Collections.sort(arr);\n for(int j=0;j<k;j++)s += arr.get(j);\n System.out.println(s);\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 k = sc.nextInt();\n int s = 0;\n ArrayList<Integer> arr = new ArrayList<Integer>();\n for(int i=0;i<n;i++)arr.add(sc.nextInt());\n Collections.sort(arr);\n for(int j=0;j<k;j++)s += arr.get(j);\n System.out.println(s);\n }\n}",
"Main"
]
| import java.io.CharArrayReader;
import java.lang.reflect.Array;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int s = 0;
ArrayList<Integer> arr = new ArrayList<Integer>();
for(int i=0;i<n;i++)arr.add(sc.nextInt());
Collections.sort(arr);
for(int j=0;j<k;j++)s += arr.get(j);
System.out.println(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,
18,
13,
13,
4,
18,
13,
4,
18,
13,
4,
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,
18,
13,
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
],
[
47,
48
],
[
8,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
8,
53
],
[
53,
54
],
[
53,
55
],
[
8,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
8,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
6,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
]
| [
"import java.util.*;\n\npublic class Main{\npublic static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int K = scan.nextInt();\n int []p = new int[N];\n for(int i=0;i<N;i++) {\n p[i] = scan.nextInt();\n }\n scan.close();\n\n Arrays.sort(p);\n\n int sum = 0;\n for(int i=0;i<K;i++) {\n sum += p[i];\n }\n\n System.out.println(sum);\n}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main{\npublic static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int K = scan.nextInt();\n int []p = new int[N];\n for(int i=0;i<N;i++) {\n p[i] = scan.nextInt();\n }\n scan.close();\n\n Arrays.sort(p);\n\n int sum = 0;\n for(int i=0;i<K;i++) {\n sum += p[i];\n }\n\n System.out.println(sum);\n}\n}",
"Main",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int K = scan.nextInt();\n int []p = new int[N];\n for(int i=0;i<N;i++) {\n p[i] = scan.nextInt();\n }\n scan.close();\n\n Arrays.sort(p);\n\n int sum = 0;\n for(int i=0;i<K;i++) {\n sum += p[i];\n }\n\n System.out.println(sum);\n}",
"main",
"{\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int K = scan.nextInt();\n int []p = new int[N];\n for(int i=0;i<N;i++) {\n p[i] = scan.nextInt();\n }\n scan.close();\n\n Arrays.sort(p);\n\n int sum = 0;\n for(int i=0;i<K;i++) {\n sum += p[i];\n }\n\n System.out.println(sum);\n}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int N = scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int K = scan.nextInt();",
"K",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int []p = new int[N];",
"p",
"new int[N]",
"N",
"for(int i=0;i<N;i++) {\n p[i] = scan.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n p[i] = scan.nextInt();\n }",
"{\n p[i] = scan.nextInt();\n }",
"p[i] = scan.nextInt()",
"p[i]",
"p",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"scan.close()",
"scan.close",
"scan",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"int sum = 0;",
"sum",
"0",
"for(int i=0;i<K;i++) {\n sum += p[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n sum += p[i];\n }",
"{\n sum += p[i];\n }",
"sum += p[i]",
"sum",
"p[i]",
"p",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main{\npublic static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int K = scan.nextInt();\n int []p = new int[N];\n for(int i=0;i<N;i++) {\n p[i] = scan.nextInt();\n }\n scan.close();\n\n Arrays.sort(p);\n\n int sum = 0;\n for(int i=0;i<K;i++) {\n sum += p[i];\n }\n\n System.out.println(sum);\n}\n}",
"public class Main{\npublic static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int N = scan.nextInt();\n int K = scan.nextInt();\n int []p = new int[N];\n for(int i=0;i<N;i++) {\n p[i] = scan.nextInt();\n }\n scan.close();\n\n Arrays.sort(p);\n\n int sum = 0;\n for(int i=0;i<K;i++) {\n sum += p[i];\n }\n\n System.out.println(sum);\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 K = scan.nextInt();
int []p = new int[N];
for(int i=0;i<N;i++) {
p[i] = scan.nextInt();
}
scan.close();
Arrays.sort(p);
int sum = 0;
for(int i=0;i<K;i++) {
sum += p[i];
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
0,
18,
13,
13,
13,
4,
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,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
16,
17
],
[
16,
18
],
[
0,
19
],
[
19,
20
],
[
19,
21
],
[
0,
22
],
[
101,
23
],
[
101,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
27,
29
],
[
26,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
26,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
26,
40
],
[
40,
41
],
[
40,
42
],
[
26,
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
],
[
56,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
26,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
26,
71
],
[
71,
72
],
[
71,
73
],
[
26,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
79,
80
],
[
79,
81
],
[
74,
82
],
[
82,
83
],
[
83,
84
],
[
74,
85
],
[
86,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
89,
90
],
[
89,
91
],
[
26,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
24,
98
],
[
98,
99
],
[
0,
100
],
[
100,
101
],
[
100,
102
]
]
| [
"import java.io.*;\nimport java.math.*;\nimport java.security.*;\nimport java.text.*;\nimport java.util.*;\nimport java.util.concurrent.*;\nimport java.util.regex.*;\n\npublic class Main {\n\n\n public static void main(String[] args) throws IOException {\n \n \tScanner scan = new Scanner(System.in);\n\n \t\n \tint n = scan.nextInt(); int k = scan.nextInt();\n \t\n \tint [] price = new int[n];\n \t\n \tfor(int i=0; i<n; i++) {\n \t\tint line = scan.nextInt();\n \t\tprice[i] = line;\n \t}\n \t\n \tArrays.sort(price);\n \tint sum = 0;\n \t\n \tfor(int i=0; i<k; i++) {\n \t\tsum+= price[i];\n \t}\n \t\n \tSystem.out.println(sum);\n \t\n } \t\n}",
"import java.io.*;",
"io.*",
"java",
"import java.math.*;",
"math.*",
"java",
"import java.security.*;",
"security.*",
"java",
"import java.text.*;",
"text.*",
"java",
"import java.util.*;",
"util.*",
"java",
"import java.util.concurrent.*;",
"concurrent.*",
"java.util",
"import java.util.regex.*;",
"regex.*",
"java.util",
"public class Main {\n\n\n public static void main(String[] args) throws IOException {\n \n \tScanner scan = new Scanner(System.in);\n\n \t\n \tint n = scan.nextInt(); int k = scan.nextInt();\n \t\n \tint [] price = new int[n];\n \t\n \tfor(int i=0; i<n; i++) {\n \t\tint line = scan.nextInt();\n \t\tprice[i] = line;\n \t}\n \t\n \tArrays.sort(price);\n \tint sum = 0;\n \t\n \tfor(int i=0; i<k; i++) {\n \t\tsum+= price[i];\n \t}\n \t\n \tSystem.out.println(sum);\n \t\n } \t\n}",
"Main",
"public static void main(String[] args) throws IOException {\n \n \tScanner scan = new Scanner(System.in);\n\n \t\n \tint n = scan.nextInt(); int k = scan.nextInt();\n \t\n \tint [] price = new int[n];\n \t\n \tfor(int i=0; i<n; i++) {\n \t\tint line = scan.nextInt();\n \t\tprice[i] = line;\n \t}\n \t\n \tArrays.sort(price);\n \tint sum = 0;\n \t\n \tfor(int i=0; i<k; i++) {\n \t\tsum+= price[i];\n \t}\n \t\n \tSystem.out.println(sum);\n \t\n }",
"main",
"{\n \n \tScanner scan = new Scanner(System.in);\n\n \t\n \tint n = scan.nextInt(); int k = scan.nextInt();\n \t\n \tint [] price = new int[n];\n \t\n \tfor(int i=0; i<n; i++) {\n \t\tint line = scan.nextInt();\n \t\tprice[i] = line;\n \t}\n \t\n \tArrays.sort(price);\n \tint sum = 0;\n \t\n \tfor(int i=0; i<k; i++) {\n \t\tsum+= price[i];\n \t}\n \t\n \tSystem.out.println(sum);\n \t\n }",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int k = scan.nextInt();",
"k",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int [] price = new int[n];",
"price",
"new int[n]",
"n",
"for(int i=0; i<n; i++) {\n \t\tint line = scan.nextInt();\n \t\tprice[i] = line;\n \t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n \t\tint line = scan.nextInt();\n \t\tprice[i] = line;\n \t}",
"{\n \t\tint line = scan.nextInt();\n \t\tprice[i] = line;\n \t}",
"int line = scan.nextInt();",
"line",
"scan.nextInt()",
"scan.nextInt",
"scan",
"price[i] = line",
"price[i]",
"price",
"i",
"line",
"Arrays.sort(price)",
"Arrays.sort",
"Arrays",
"price",
"int sum = 0;",
"sum",
"0",
"for(int i=0; i<k; i++) {\n \t\tsum+= price[i];\n \t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n \t\tsum+= price[i];\n \t}",
"{\n \t\tsum+= price[i];\n \t}",
"sum+= price[i]",
"sum",
"price[i]",
"price",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n\n\n public static void main(String[] args) throws IOException {\n \n \tScanner scan = new Scanner(System.in);\n\n \t\n \tint n = scan.nextInt(); int k = scan.nextInt();\n \t\n \tint [] price = new int[n];\n \t\n \tfor(int i=0; i<n; i++) {\n \t\tint line = scan.nextInt();\n \t\tprice[i] = line;\n \t}\n \t\n \tArrays.sort(price);\n \tint sum = 0;\n \t\n \tfor(int i=0; i<k; i++) {\n \t\tsum+= price[i];\n \t}\n \t\n \tSystem.out.println(sum);\n \t\n } \t\n}",
"public class Main {\n\n\n public static void main(String[] args) throws IOException {\n \n \tScanner scan = new Scanner(System.in);\n\n \t\n \tint n = scan.nextInt(); int k = scan.nextInt();\n \t\n \tint [] price = new int[n];\n \t\n \tfor(int i=0; i<n; i++) {\n \t\tint line = scan.nextInt();\n \t\tprice[i] = line;\n \t}\n \t\n \tArrays.sort(price);\n \tint sum = 0;\n \t\n \tfor(int i=0; i<k; i++) {\n \t\tsum+= price[i];\n \t}\n \t\n \tSystem.out.println(sum);\n \t\n } \t\n}",
"Main"
]
| import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Main {
public static void main(String[] args) throws IOException {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt(); int k = scan.nextInt();
int [] price = new int[n];
for(int i=0; i<n; i++) {
int line = scan.nextInt();
price[i] = line;
}
Arrays.sort(price);
int sum = 0;
for(int i=0; i<k; i++) {
sum+= price[i];
}
System.out.println(sum);
}
}
|
[
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,
4,
18,
13,
41,
13,
4,
18,
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,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
97,
14
],
[
97,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
24,
25
],
[
23,
26
],
[
26,
27
],
[
27,
28
],
[
17,
29
],
[
29,
30
],
[
29,
31
],
[
31,
32
],
[
32,
33
],
[
31,
34
],
[
34,
35
],
[
35,
36
],
[
17,
37
],
[
37,
38
],
[
37,
39
],
[
17,
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
],
[
53,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
59,
60
],
[
60,
61
],
[
17,
62
],
[
62,
63
],
[
63,
64
],
[
62,
65
],
[
17,
66
],
[
66,
67
],
[
66,
68
],
[
17,
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
],
[
84,
87
],
[
17,
88
],
[
88,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
88,
93
],
[
15,
94
],
[
94,
95
],
[
0,
96
],
[
96,
97
],
[
96,
98
]
]
| [
"import java.util.List;\nimport java.util.Scanner;\nimport java.util.Collections;\nimport java.util.ArrayList;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n\n List<Integer> list = new ArrayList<>();\n for(int i=0; i<n; i++){\n list.add(Integer.parseInt(sc.next()));\n }\n Collections.sort(list);\n int total = 0;\n for(int i=0; i<k; i++){\n total += list.get(i);\n }\n System.out.println(total);\n }\n}",
"import java.util.List;",
"List",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n\n List<Integer> list = new ArrayList<>();\n for(int i=0; i<n; i++){\n list.add(Integer.parseInt(sc.next()));\n }\n Collections.sort(list);\n int total = 0;\n for(int i=0; i<k; i++){\n total += list.get(i);\n }\n System.out.println(total);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n\n List<Integer> list = new ArrayList<>();\n for(int i=0; i<n; i++){\n list.add(Integer.parseInt(sc.next()));\n }\n Collections.sort(list);\n int total = 0;\n for(int i=0; i<k; i++){\n total += list.get(i);\n }\n System.out.println(total);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n\n List<Integer> list = new ArrayList<>();\n for(int i=0; i<n; i++){\n list.add(Integer.parseInt(sc.next()));\n }\n Collections.sort(list);\n int total = 0;\n for(int i=0; i<k; i++){\n total += list.get(i);\n }\n System.out.println(total);\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 k = Integer.parseInt(sc.next());",
"k",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"List<Integer> list = new ArrayList<>();",
"list",
"new ArrayList<>()",
"for(int i=0; i<n; i++){\n list.add(Integer.parseInt(sc.next()));\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n list.add(Integer.parseInt(sc.next()));\n }",
"{\n list.add(Integer.parseInt(sc.next()));\n }",
"list.add(Integer.parseInt(sc.next()))",
"list.add",
"list",
"Integer.parseInt(sc.next())",
"Integer.parseInt",
"Integer",
"sc.next()",
"sc.next",
"sc",
"Collections.sort(list)",
"Collections.sort",
"Collections",
"list",
"int total = 0;",
"total",
"0",
"for(int i=0; i<k; i++){\n total += list.get(i);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n total += list.get(i);\n }",
"{\n total += list.get(i);\n }",
"total += list.get(i)",
"total",
"list.get(i)",
"list.get",
"list",
"i",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n\n List<Integer> list = new ArrayList<>();\n for(int i=0; i<n; i++){\n list.add(Integer.parseInt(sc.next()));\n }\n Collections.sort(list);\n int total = 0;\n for(int i=0; i<k; i++){\n total += list.get(i);\n }\n System.out.println(total);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = Integer.parseInt(sc.next());\n int k = Integer.parseInt(sc.next());\n\n List<Integer> list = new ArrayList<>();\n for(int i=0; i<n; i++){\n list.add(Integer.parseInt(sc.next()));\n }\n Collections.sort(list);\n int total = 0;\n for(int i=0; i<k; i++){\n total += list.get(i);\n }\n System.out.println(total);\n }\n}",
"Main"
]
| import java.util.List;
import java.util.Scanner;
import java.util.Collections;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int k = Integer.parseInt(sc.next());
List<Integer> list = new ArrayList<>();
for(int i=0; i<n; i++){
list.add(Integer.parseInt(sc.next()));
}
Collections.sort(list);
int total = 0;
for(int i=0; i<k; i++){
total += list.get(i);
}
System.out.println(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,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
14,
2,
4,
18,
13,
13,
30,
4,
18,
13,
13,
30,
14,
2,
13,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
42,
40,
4,
18,
13,
30,
0,
13,
4,
18,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
92,
5
],
[
92,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
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
],
[
45,
46
],
[
46,
47
],
[
44,
48
],
[
43,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
43,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
55,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
61,
65
],
[
65,
66
],
[
66,
67
],
[
65,
68
],
[
8,
69
],
[
69,
70
],
[
69,
71
],
[
8,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
72,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
8,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
6,
89
],
[
89,
90
],
[
0,
91
],
[
91,
92
],
[
91,
93
]
]
| [
"import java.util.*;\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 k = sc.nextInt();\n\t\t// top k in maxheap (store min elements)\n\t\tPriorityQueue<Integer> maxHeap = new PriorityQueue<>(k, Collections.reverseOrder());\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint val = sc.nextInt();\n\t\t\t// System.out.println(\"val: \" + val);\n\t\t\tif (maxHeap.size() < k) {\n\t\t\t\tmaxHeap.offer(val);\n\t\t\t} else {\n\t\t\t\tif (val < maxHeap.peek()) {\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint ans = 0;\n\t\twhile (!maxHeap.isEmpty()) {\n\t\t\tans += maxHeap.poll();\n\t\t}\n\t\tSystem.out.println(ans);\n\t}\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\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\t// top k in maxheap (store min elements)\n\t\tPriorityQueue<Integer> maxHeap = new PriorityQueue<>(k, Collections.reverseOrder());\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint val = sc.nextInt();\n\t\t\t// System.out.println(\"val: \" + val);\n\t\t\tif (maxHeap.size() < k) {\n\t\t\t\tmaxHeap.offer(val);\n\t\t\t} else {\n\t\t\t\tif (val < maxHeap.peek()) {\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint ans = 0;\n\t\twhile (!maxHeap.isEmpty()) {\n\t\t\tans += maxHeap.poll();\n\t\t}\n\t\tSystem.out.println(ans);\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 k = sc.nextInt();\n\t\t// top k in maxheap (store min elements)\n\t\tPriorityQueue<Integer> maxHeap = new PriorityQueue<>(k, Collections.reverseOrder());\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint val = sc.nextInt();\n\t\t\t// System.out.println(\"val: \" + val);\n\t\t\tif (maxHeap.size() < k) {\n\t\t\t\tmaxHeap.offer(val);\n\t\t\t} else {\n\t\t\t\tif (val < maxHeap.peek()) {\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint ans = 0;\n\t\twhile (!maxHeap.isEmpty()) {\n\t\t\tans += maxHeap.poll();\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\t// top k in maxheap (store min elements)\n\t\tPriorityQueue<Integer> maxHeap = new PriorityQueue<>(k, Collections.reverseOrder());\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint val = sc.nextInt();\n\t\t\t// System.out.println(\"val: \" + val);\n\t\t\tif (maxHeap.size() < k) {\n\t\t\t\tmaxHeap.offer(val);\n\t\t\t} else {\n\t\t\t\tif (val < maxHeap.peek()) {\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint ans = 0;\n\t\twhile (!maxHeap.isEmpty()) {\n\t\t\tans += maxHeap.poll();\n\t\t}\n\t\tSystem.out.println(ans);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"PriorityQueue<Integer> maxHeap = new PriorityQueue<>(k, Collections.reverseOrder());",
"maxHeap",
"new PriorityQueue<>(k, Collections.reverseOrder())",
"for (int i = 0; i < n; i++) {\n\t\t\tint val = sc.nextInt();\n\t\t\t// System.out.println(\"val: \" + val);\n\t\t\tif (maxHeap.size() < k) {\n\t\t\t\tmaxHeap.offer(val);\n\t\t\t} else {\n\t\t\t\tif (val < maxHeap.peek()) {\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tint val = sc.nextInt();\n\t\t\t// System.out.println(\"val: \" + val);\n\t\t\tif (maxHeap.size() < k) {\n\t\t\t\tmaxHeap.offer(val);\n\t\t\t} else {\n\t\t\t\tif (val < maxHeap.peek()) {\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tint val = sc.nextInt();\n\t\t\t// System.out.println(\"val: \" + val);\n\t\t\tif (maxHeap.size() < k) {\n\t\t\t\tmaxHeap.offer(val);\n\t\t\t} else {\n\t\t\t\tif (val < maxHeap.peek()) {\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int val = sc.nextInt();",
"val",
"sc.nextInt()",
"sc.nextInt",
"sc",
"if (maxHeap.size() < k) {\n\t\t\t\tmaxHeap.offer(val);\n\t\t\t} else {\n\t\t\t\tif (val < maxHeap.peek()) {\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}\n\t\t\t}",
"maxHeap.size() < k",
"maxHeap.size()",
"maxHeap.size",
"maxHeap",
"k",
"{\n\t\t\t\tmaxHeap.offer(val);\n\t\t\t}",
"maxHeap.offer(val)",
"maxHeap.offer",
"maxHeap",
"val",
"{\n\t\t\t\tif (val < maxHeap.peek()) {\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}\n\t\t\t}",
"if (val < maxHeap.peek()) {\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}",
"val < maxHeap.peek()",
"val",
"maxHeap.peek()",
"maxHeap.peek",
"maxHeap",
"{\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}",
"maxHeap.poll()",
"maxHeap.poll",
"maxHeap",
"maxHeap.offer(val)",
"maxHeap.offer",
"maxHeap",
"val",
"int ans = 0;",
"ans",
"0",
"while (!maxHeap.isEmpty()) {\n\t\t\tans += maxHeap.poll();\n\t\t}",
"!maxHeap.isEmpty()",
"maxHeap.isEmpty()",
"maxHeap.isEmpty",
"maxHeap",
"{\n\t\t\tans += maxHeap.poll();\n\t\t}",
"ans += maxHeap.poll()",
"ans",
"maxHeap.poll()",
"maxHeap.poll",
"maxHeap",
"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 sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\t// top k in maxheap (store min elements)\n\t\tPriorityQueue<Integer> maxHeap = new PriorityQueue<>(k, Collections.reverseOrder());\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint val = sc.nextInt();\n\t\t\t// System.out.println(\"val: \" + val);\n\t\t\tif (maxHeap.size() < k) {\n\t\t\t\tmaxHeap.offer(val);\n\t\t\t} else {\n\t\t\t\tif (val < maxHeap.peek()) {\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint ans = 0;\n\t\twhile (!maxHeap.isEmpty()) {\n\t\t\tans += maxHeap.poll();\n\t\t}\n\t\tSystem.out.println(ans);\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 k = sc.nextInt();\n\t\t// top k in maxheap (store min elements)\n\t\tPriorityQueue<Integer> maxHeap = new PriorityQueue<>(k, Collections.reverseOrder());\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint val = sc.nextInt();\n\t\t\t// System.out.println(\"val: \" + val);\n\t\t\tif (maxHeap.size() < k) {\n\t\t\t\tmaxHeap.offer(val);\n\t\t\t} else {\n\t\t\t\tif (val < maxHeap.peek()) {\n\t\t\t\t\tmaxHeap.poll();\n\t\t\t\t\tmaxHeap.offer(val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint ans = 0;\n\t\twhile (!maxHeap.isEmpty()) {\n\t\t\tans += maxHeap.poll();\n\t\t}\n\t\tSystem.out.println(ans);\n\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 k = sc.nextInt();
// top k in maxheap (store min elements)
PriorityQueue<Integer> maxHeap = new PriorityQueue<>(k, Collections.reverseOrder());
for (int i = 0; i < n; i++) {
int val = sc.nextInt();
// System.out.println("val: " + val);
if (maxHeap.size() < k) {
maxHeap.offer(val);
} else {
if (val < maxHeap.peek()) {
maxHeap.poll();
maxHeap.offer(val);
}
}
}
int ans = 0;
while (!maxHeap.isEmpty()) {
ans += maxHeap.poll();
}
System.out.println(ans);
}
}
|
[
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,
4,
18,
13,
41,
13,
20,
42,
4,
18,
13,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
77,
8
],
[
77,
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
],
[
26,
27
],
[
11,
28
],
[
28,
29
],
[
28,
30
],
[
11,
31
],
[
31,
32
],
[
32,
33
],
[
33,
34
],
[
31,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
40,
41
],
[
11,
42
],
[
42,
43
],
[
43,
44
],
[
42,
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
],
[
62,
64
],
[
64,
65
],
[
65,
66
],
[
64,
67
],
[
11,
68
],
[
68,
69
],
[
69,
70
],
[
70,
71
],
[
70,
72
],
[
68,
73
],
[
9,
74
],
[
74,
75
],
[
0,
76
],
[
76,
77
],
[
76,
78
]
]
| [
"import java.io.IOException;\nimport java.util.*;\n\npublic class Main{\n\tpublic static void main(String[] args){\n Scanner scanner = new Scanner(System.in);\n int sell = scanner.nextInt();\n int buy = scanner.nextInt();\n scanner.nextLine();\n ArrayList<Integer> list = new ArrayList<>();\n while(scanner.hasNextInt()){\n \t\tlist.add(scanner.nextInt());\n }\n Collections.sort(list);\n int result = 0;\n for(int i = 0; i < buy; i++){\n \tresult += list.get(i);\n }\n System.out.println(result);\n }\n}",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main{\n\tpublic static void main(String[] args){\n Scanner scanner = new Scanner(System.in);\n int sell = scanner.nextInt();\n int buy = scanner.nextInt();\n scanner.nextLine();\n ArrayList<Integer> list = new ArrayList<>();\n while(scanner.hasNextInt()){\n \t\tlist.add(scanner.nextInt());\n }\n Collections.sort(list);\n int result = 0;\n for(int i = 0; i < buy; i++){\n \tresult += list.get(i);\n }\n System.out.println(result);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner scanner = new Scanner(System.in);\n int sell = scanner.nextInt();\n int buy = scanner.nextInt();\n scanner.nextLine();\n ArrayList<Integer> list = new ArrayList<>();\n while(scanner.hasNextInt()){\n \t\tlist.add(scanner.nextInt());\n }\n Collections.sort(list);\n int result = 0;\n for(int i = 0; i < buy; i++){\n \tresult += list.get(i);\n }\n System.out.println(result);\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n int sell = scanner.nextInt();\n int buy = scanner.nextInt();\n scanner.nextLine();\n ArrayList<Integer> list = new ArrayList<>();\n while(scanner.hasNextInt()){\n \t\tlist.add(scanner.nextInt());\n }\n Collections.sort(list);\n int result = 0;\n for(int i = 0; i < buy; i++){\n \tresult += list.get(i);\n }\n System.out.println(result);\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int sell = scanner.nextInt();",
"sell",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int buy = scanner.nextInt();",
"buy",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"scanner.nextLine()",
"scanner.nextLine",
"scanner",
"ArrayList<Integer> list = new ArrayList<>();",
"list",
"new ArrayList<>()",
"while(scanner.hasNextInt()){\n \t\tlist.add(scanner.nextInt());\n }",
"scanner.hasNextInt()",
"scanner.hasNextInt",
"scanner",
"{\n \t\tlist.add(scanner.nextInt());\n }",
"list.add(scanner.nextInt())",
"list.add",
"list",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"Collections.sort(list)",
"Collections.sort",
"Collections",
"list",
"int result = 0;",
"result",
"0",
"for(int i = 0; i < buy; i++){\n \tresult += list.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < buy",
"i",
"buy",
"i++",
"i++",
"i",
"{\n \tresult += list.get(i);\n }",
"{\n \tresult += list.get(i);\n }",
"result += list.get(i)",
"result",
"list.get(i)",
"list.get",
"list",
"i",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args){\n Scanner scanner = new Scanner(System.in);\n int sell = scanner.nextInt();\n int buy = scanner.nextInt();\n scanner.nextLine();\n ArrayList<Integer> list = new ArrayList<>();\n while(scanner.hasNextInt()){\n \t\tlist.add(scanner.nextInt());\n }\n Collections.sort(list);\n int result = 0;\n for(int i = 0; i < buy; i++){\n \tresult += list.get(i);\n }\n System.out.println(result);\n }\n}",
"public class Main{\n\tpublic static void main(String[] args){\n Scanner scanner = new Scanner(System.in);\n int sell = scanner.nextInt();\n int buy = scanner.nextInt();\n scanner.nextLine();\n ArrayList<Integer> list = new ArrayList<>();\n while(scanner.hasNextInt()){\n \t\tlist.add(scanner.nextInt());\n }\n Collections.sort(list);\n int result = 0;\n for(int i = 0; i < buy; i++){\n \tresult += list.get(i);\n }\n System.out.println(result);\n }\n}",
"Main"
]
| import java.io.IOException;
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int sell = scanner.nextInt();
int buy = scanner.nextInt();
scanner.nextLine();
ArrayList<Integer> list = new ArrayList<>();
while(scanner.hasNextInt()){
list.add(scanner.nextInt());
}
Collections.sort(list);
int result = 0;
for(int i = 0; i < buy; i++){
result += list.get(i);
}
System.out.println(result);
}
} |
[
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,
2,
18,
13,
13,
17,
1,
40,
13,
30,
30,
11,
1,
41,
13,
2,
18,
13,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
18,
13,
13,
18,
13,
2,
13,
17,
30,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
2,
13,
17,
0,
18,
13,
2,
13,
17,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
147,
5
],
[
147,
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
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
56,
60
],
[
49,
61
],
[
61,
62
],
[
62,
63
],
[
49,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
70,
74
],
[
66,
75
],
[
75,
76
],
[
75,
77
],
[
66,
78
],
[
78,
79
],
[
79,
80
],
[
66,
81
],
[
82,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
84,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
83,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
93,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
99,
103
],
[
103,
104
],
[
103,
105
],
[
105,
106
],
[
105,
107
],
[
93,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
111,
113
],
[
108,
114
],
[
8,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
117,
119
],
[
115,
120
],
[
120,
121
],
[
120,
122
],
[
115,
123
],
[
123,
124
],
[
124,
125
],
[
115,
126
],
[
127,
127
],
[
127,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
8,
135
],
[
135,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
135,
140
],
[
8,
141
],
[
141,
142
],
[
142,
143
],
[
6,
144
],
[
144,
145
],
[
0,
146
],
[
146,
147
],
[
146,
148
]
]
| [
"import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint[] data = new int[N];\n\t\tfor (int i=0;i<N;i++) {\n\t\t\tdata[i] = sc.nextInt();\n\t\t}\n\t\tint result = 0;\n\t\tfor(int i=0;i<data.length-1;i++){\n\t\t\tfor(int j=data.length-1;j>i;j--){\n\t\t\t\tif(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\tfor (int i=0;i<K;i++) {\n\t\t\tresult = result + data[i];\n\t\t}\n\t\tSystem.out.println(result);\n\t\tsc.close();\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint[] data = new int[N];\n\t\tfor (int i=0;i<N;i++) {\n\t\t\tdata[i] = sc.nextInt();\n\t\t}\n\t\tint result = 0;\n\t\tfor(int i=0;i<data.length-1;i++){\n\t\t\tfor(int j=data.length-1;j>i;j--){\n\t\t\t\tif(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\tfor (int i=0;i<K;i++) {\n\t\t\tresult = result + data[i];\n\t\t}\n\t\tSystem.out.println(result);\n\t\tsc.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint[] data = new int[N];\n\t\tfor (int i=0;i<N;i++) {\n\t\t\tdata[i] = sc.nextInt();\n\t\t}\n\t\tint result = 0;\n\t\tfor(int i=0;i<data.length-1;i++){\n\t\t\tfor(int j=data.length-1;j>i;j--){\n\t\t\t\tif(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\tfor (int i=0;i<K;i++) {\n\t\t\tresult = result + data[i];\n\t\t}\n\t\tSystem.out.println(result);\n\t\tsc.close();\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint[] data = new int[N];\n\t\tfor (int i=0;i<N;i++) {\n\t\t\tdata[i] = sc.nextInt();\n\t\t}\n\t\tint result = 0;\n\t\tfor(int i=0;i<data.length-1;i++){\n\t\t\tfor(int j=data.length-1;j>i;j--){\n\t\t\t\tif(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\tfor (int i=0;i<K;i++) {\n\t\t\tresult = result + data[i];\n\t\t}\n\t\tSystem.out.println(result);\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 K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] data = new int[N];",
"data",
"new int[N]",
"N",
"for (int i=0;i<N;i++) {\n\t\t\tdata[i] = sc.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tdata[i] = sc.nextInt();\n\t\t}",
"{\n\t\t\tdata[i] = sc.nextInt();\n\t\t}",
"data[i] = sc.nextInt()",
"data[i]",
"data",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int result = 0;",
"result",
"0",
"for(int i=0;i<data.length-1;i++){\n\t\t\tfor(int j=data.length-1;j>i;j--){\n\t\t\t\tif(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<data.length-1",
"i",
"data.length-1",
"data.length",
"data",
"data.length",
"1",
"i++",
"i++",
"i",
"{\n\t\t\tfor(int j=data.length-1;j>i;j--){\n\t\t\t\tif(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"{\n\t\t\tfor(int j=data.length-1;j>i;j--){\n\t\t\t\tif(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"for(int j=data.length-1;j>i;j--){\n\t\t\t\tif(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}\n\t\t\t}",
"int j=data.length-1;",
"int j=data.length-1;",
"j",
"data.length-1",
"data.length",
"data",
"data.length",
"1",
"j>i",
"j",
"i",
"j--",
"j--",
"j",
"{\n\t\t\t\tif(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}\n\t\t\t}",
"if(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}",
"data[j]<data[j-1]",
"data[j]",
"data",
"j",
"data[j-1]",
"data",
"j-1",
"j",
"1",
"{\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}",
"int t=data[j];",
"t",
"data[j]",
"data",
"j",
"data[j]=data[j-1]",
"data[j]",
"data",
"j",
"data[j-1]",
"data",
"j-1",
"j",
"1",
"data[j-1]=t",
"data[j-1]",
"data",
"j-1",
"j",
"1",
"t",
"for (int i=0;i<K;i++) {\n\t\t\tresult = result + data[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tresult = result + data[i];\n\t\t}",
"{\n\t\t\tresult = result + data[i];\n\t\t}",
"result = result + data[i]",
"result",
"result + data[i]",
"result",
"data[i]",
"data",
"i",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"sc.close()",
"sc.close",
"sc",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint[] data = new int[N];\n\t\tfor (int i=0;i<N;i++) {\n\t\t\tdata[i] = sc.nextInt();\n\t\t}\n\t\tint result = 0;\n\t\tfor(int i=0;i<data.length-1;i++){\n\t\t\tfor(int j=data.length-1;j>i;j--){\n\t\t\t\tif(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\tfor (int i=0;i<K;i++) {\n\t\t\tresult = result + data[i];\n\t\t}\n\t\tSystem.out.println(result);\n\t\tsc.close();\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint[] data = new int[N];\n\t\tfor (int i=0;i<N;i++) {\n\t\t\tdata[i] = sc.nextInt();\n\t\t}\n\t\tint result = 0;\n\t\tfor(int i=0;i<data.length-1;i++){\n\t\t\tfor(int j=data.length-1;j>i;j--){\n\t\t\t\tif(data[j]<data[j-1]){\n\t\t\t\t\tint t=data[j];\n\t\t\t\t\tdata[j]=data[j-1];\n\t\t\t\t\tdata[j-1]=t;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\tfor (int i=0;i<K;i++) {\n\t\t\tresult = result + data[i];\n\t\t}\n\t\tSystem.out.println(result);\n\t\tsc.close();\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 K = sc.nextInt();
int[] data = new int[N];
for (int i=0;i<N;i++) {
data[i] = sc.nextInt();
}
int result = 0;
for(int i=0;i<data.length-1;i++){
for(int j=data.length-1;j>i;j--){
if(data[j]<data[j-1]){
int t=data[j];
data[j]=data[j-1];
data[j-1]=t;
}
}
}
for (int i=0;i<K;i++) {
result = result + data[i];
}
System.out.println(result);
sc.close();
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
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,
18,
13,
13,
13,
23,
13,
6,
13,
41,
13,
20,
41,
13,
20,
12,
13,
30,
42,
40,
4,
18,
13,
30,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
20,
29,
4,
18,
13,
12,
13,
30,
41,
13,
17,
38,
5,
13,
30,
4,
18,
13,
30,
0,
13,
4,
18,
13,
29,
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
],
[
172,
17
],
[
172,
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
],
[
31,
32
],
[
32,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
20,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
50,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
20,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
20,
62
],
[
62,
63
],
[
62,
64
],
[
20,
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
],
[
78,
80
],
[
80,
81
],
[
80,
82
],
[
20,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
18,
89
],
[
89,
90
],
[
172,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
91,
96
],
[
96,
97
],
[
96,
98
],
[
91,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
102,
103
],
[
103,
104
],
[
104,
105
],
[
105,
106
],
[
102,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
108,
115
],
[
115,
116
],
[
116,
117
],
[
116,
118
],
[
101,
119
],
[
119,
120
],
[
120,
121
],
[
121,
122
],
[
91,
123
],
[
123,
124
],
[
123,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
125,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
133,
134
],
[
134,
135
],
[
129,
136
],
[
136,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
125,
142
],
[
142,
143
],
[
91,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
148,
149
],
[
149,
150
],
[
148,
151
],
[
151,
152
],
[
91,
153
],
[
153,
154
],
[
153,
155
],
[
155,
156
],
[
156,
157
],
[
157,
158
],
[
158,
159
],
[
157,
160
],
[
160,
161
],
[
91,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
167,
168
],
[
166,
169
],
[
169,
170
],
[
0,
171
],
[
171,
172
],
[
171,
173
]
]
| [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\nimport java.util.StringTokenizer;\n\npublic class Main {\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n System.out.println(sum);\n\n }\n\n static class FastScanner {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n \n String next() {\n while (!st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n String nextLine() {\n String s = \"\";\n try {\n s = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return s;\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\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.Arrays;",
"Arrays",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"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 k = sc.nextInt();\n\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n System.out.println(sum);\n\n }\n\n static class FastScanner {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n \n String next() {\n while (!st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n String nextLine() {\n String s = \"\";\n try {\n s = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return s;\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n }\n}",
"Main",
"public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n System.out.println(sum);\n\n }",
"main",
"{\n FastScanner sc = new FastScanner();\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n System.out.println(sum);\n\n }",
"FastScanner sc = new FastScanner();",
"sc",
"new FastScanner()",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] arr = new int[n];",
"arr",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = sc.nextInt();\n }",
"{\n arr[i] = sc.nextInt();\n }",
"arr[i] = sc.nextInt()",
"arr[i]",
"arr",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < k; i++) {\n sum += arr[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n sum += arr[i];\n }",
"{\n sum += arr[i];\n }",
"sum += arr[i]",
"sum",
"arr[i]",
"arr",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"static class FastScanner {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n \n String next() {\n while (!st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n String nextLine() {\n String s = \"\";\n try {\n s = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return s;\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n }",
"FastScanner",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"StringTokenizer st = new StringTokenizer(\"\");",
"st",
"new StringTokenizer(\"\")",
"String next() {\n while (!st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"next",
"{\n while (!st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }",
"while (!st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"{\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"try {\n st = new StringTokenizer(br.readLine());\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 st = new StringTokenizer(br.readLine());\n }",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"return st.nextToken();",
"st.nextToken()",
"st.nextToken",
"st",
"String nextLine() {\n String s = \"\";\n try {\n s = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return s;\n }",
"nextLine",
"{\n String s = \"\";\n try {\n s = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return s;\n }",
"String s = \"\";",
"s",
"\"\"",
"try {\n s = 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 s = br.readLine();\n }",
"s = br.readLine()",
"s",
"br.readLine()",
"br.readLine",
"br",
"return s;",
"s",
"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",
"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",
"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",
"public class Main {\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n System.out.println(sum);\n\n }\n\n static class FastScanner {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n \n String next() {\n while (!st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n String nextLine() {\n String s = \"\";\n try {\n s = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return s;\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\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 k = sc.nextInt();\n\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = sc.nextInt();\n }\n Arrays.sort(arr);\n int sum = 0;\n for (int i = 0; i < k; i++) {\n sum += arr[i];\n }\n\n System.out.println(sum);\n\n }\n\n static class FastScanner {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st = new StringTokenizer(\"\");\n \n String next() {\n while (!st.hasMoreTokens()) {\n try {\n st = new StringTokenizer(br.readLine());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return st.nextToken();\n }\n\n String nextLine() {\n String s = \"\";\n try {\n s = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return s;\n }\n\n int nextInt() {\n return Integer.parseInt(next());\n }\n\n double nextDouble() {\n return Double.parseDouble(next());\n }\n\n long nextLong() {\n return Long.parseLong(next());\n }\n\n }\n}",
"Main"
]
| import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
FastScanner sc = new FastScanner();
int n = sc.nextInt();
int k = sc.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = sc.nextInt();
}
Arrays.sort(arr);
int sum = 0;
for (int i = 0; i < k; i++) {
sum += arr[i];
}
System.out.println(sum);
}
static class FastScanner {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer("");
String next() {
while (!st.hasMoreTokens()) {
try {
st = new StringTokenizer(br.readLine());
} catch (Exception e) {
e.printStackTrace();
}
}
return st.nextToken();
}
String nextLine() {
String s = "";
try {
s = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return s;
}
int nextInt() {
return Integer.parseInt(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
long nextLong() {
return Long.parseLong(next());
}
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
20,
17,
17,
12,
13,
30,
4,
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,
18,
13,
13,
13,
23,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
20,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
13,
41,
13,
17,
0,
13,
4,
18,
4,
18,
13,
17,
42,
2,
13,
13,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
40,
13,
4,
18,
13,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
139,
17
],
[
139,
18
],
[
18,
19
],
[
139,
20
],
[
20,
21
],
[
20,
22
],
[
139,
25
],
[
25,
26
],
[
25,
27
],
[
27,
28
],
[
28,
29
],
[
29,
30
],
[
28,
31
],
[
27,
32
],
[
32,
33
],
[
32,
34
],
[
27,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
35,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
50,
52
],
[
27,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
25,
59
],
[
59,
60
],
[
25,
61
],
[
61,
62
],
[
25,
63
],
[
63,
64
],
[
139,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
67,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
73,
78
],
[
67,
79
],
[
79,
80
],
[
79,
81
],
[
67,
82
],
[
82,
83
],
[
82,
84
],
[
84,
85
],
[
85,
86
],
[
84,
87
],
[
87,
88
],
[
87,
89
],
[
67,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
93,
94
],
[
92,
95
],
[
95,
96
],
[
95,
97
],
[
67,
98
],
[
98,
99
],
[
98,
100
],
[
67,
102
],
[
102,
103
],
[
102,
104
],
[
67,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
108,
109
],
[
109,
110
],
[
110,
111
],
[
107,
112
],
[
67,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
113,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
122,
123
],
[
123,
124
],
[
122,
125
],
[
125,
126
],
[
125,
127
],
[
117,
128
],
[
128,
129
],
[
67,
130
],
[
130,
131
],
[
131,
132
],
[
130,
133
],
[
130,
134
],
[
130,
135
],
[
65,
136
],
[
136,
137
],
[
0,
138
],
[
138,
139
],
[
138,
140
]
]
| [
"import java.util.*;\nimport java.io.*;\nimport java.math.BigDecimal;\nimport java.nio.file.Files;\nimport java.nio.charset.StandardCharsets;\n//给出两个数a,b 求出[a,b]中各位数字之和能整除原数的数的个数。\npublic class Main {\n\n int mod ;\n //\n int[][] dp = new int[1001][1001];\n void solve(int n, int k , int[] arr) {\n Arrays.sort(arr);\n int res = 0;\n for(int i=0;i<k;i++){\n res+=arr[i];\n }\n System.out.println(res);\n }\n\n\n public static void main(String[] args) throws IOException {\n // Use the Scanner class\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] s = br.readLine().split(\" \");\n Main test = new Main();\n\n int n = Integer.parseInt(s[0]);\n int k = Integer.parseInt(s[1]);\n int[] arr = new int[n];\n int i=0;\n s = br.readLine().split(\" \");\n while(i<n){\n arr[i] = Integer.parseInt(s[i]);\n i++;\n }\n test.solve(n,k,arr);\n //int tot = Integer.parseInt(br.readLine());\n\n\n// int i =1;\n// System.out.println();\n// while(tot>0){\n//\n// String s = br.readLine();\n// String[] sr = s.split(\" \");\n// List<Long> ls = new ArrayList<>();\n// for(String ss:sr){\n// ls.add(Long.parseLong(ss));\n// }\n// Main tt = new Main();\n// tt.sol(ls);\n// // String Buffer to store answer\n// StringBuffer sb = new StringBuffer();\n//// Solution obj = new Solution();\n////\n//// System.out.println(\"Case #\"+i+\": \"+obj.sol());\n// tot--;\n// i++;\n// }\n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.math.BigDecimal;",
"BigDecimal",
"java.math",
"import java.nio.file.Files;",
"Files",
"java.nio.file",
"import java.nio.charset.StandardCharsets;",
"StandardCharsets",
"java.nio.charset",
"public class Main {\n\n int mod ;\n //\n int[][] dp = new int[1001][1001];\n void solve(int n, int k , int[] arr) {\n Arrays.sort(arr);\n int res = 0;\n for(int i=0;i<k;i++){\n res+=arr[i];\n }\n System.out.println(res);\n }\n\n\n public static void main(String[] args) throws IOException {\n // Use the Scanner class\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] s = br.readLine().split(\" \");\n Main test = new Main();\n\n int n = Integer.parseInt(s[0]);\n int k = Integer.parseInt(s[1]);\n int[] arr = new int[n];\n int i=0;\n s = br.readLine().split(\" \");\n while(i<n){\n arr[i] = Integer.parseInt(s[i]);\n i++;\n }\n test.solve(n,k,arr);\n //int tot = Integer.parseInt(br.readLine());\n\n\n// int i =1;\n// System.out.println();\n// while(tot>0){\n//\n// String s = br.readLine();\n// String[] sr = s.split(\" \");\n// List<Long> ls = new ArrayList<>();\n// for(String ss:sr){\n// ls.add(Long.parseLong(ss));\n// }\n// Main tt = new Main();\n// tt.sol(ls);\n// // String Buffer to store answer\n// StringBuffer sb = new StringBuffer();\n//// Solution obj = new Solution();\n////\n//// System.out.println(\"Case #\"+i+\": \"+obj.sol());\n// tot--;\n// i++;\n// }\n }\n\n}",
"Main",
"int mod ;",
"mod",
"//\n int[][] dp = new int[1001][1001];",
"dp",
"new int[1001][1001]",
"1001",
"1001",
"void solve(int n, int k , int[] arr) {\n Arrays.sort(arr);\n int res = 0;\n for(int i=0;i<k;i++){\n res+=arr[i];\n }\n System.out.println(res);\n }",
"solve",
"{\n Arrays.sort(arr);\n int res = 0;\n for(int i=0;i<k;i++){\n res+=arr[i];\n }\n System.out.println(res);\n }",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"int res = 0;",
"res",
"0",
"for(int i=0;i<k;i++){\n res+=arr[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n res+=arr[i];\n }",
"{\n res+=arr[i];\n }",
"res+=arr[i]",
"res",
"arr[i]",
"arr",
"i",
"System.out.println(res)",
"System.out.println",
"System.out",
"System",
"System.out",
"res",
"int n",
"n",
"int k",
"k",
"int[] arr",
"arr",
"public static void main(String[] args) throws IOException {\n // Use the Scanner class\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] s = br.readLine().split(\" \");\n Main test = new Main();\n\n int n = Integer.parseInt(s[0]);\n int k = Integer.parseInt(s[1]);\n int[] arr = new int[n];\n int i=0;\n s = br.readLine().split(\" \");\n while(i<n){\n arr[i] = Integer.parseInt(s[i]);\n i++;\n }\n test.solve(n,k,arr);\n //int tot = Integer.parseInt(br.readLine());\n\n\n// int i =1;\n// System.out.println();\n// while(tot>0){\n//\n// String s = br.readLine();\n// String[] sr = s.split(\" \");\n// List<Long> ls = new ArrayList<>();\n// for(String ss:sr){\n// ls.add(Long.parseLong(ss));\n// }\n// Main tt = new Main();\n// tt.sol(ls);\n// // String Buffer to store answer\n// StringBuffer sb = new StringBuffer();\n//// Solution obj = new Solution();\n////\n//// System.out.println(\"Case #\"+i+\": \"+obj.sol());\n// tot--;\n// i++;\n// }\n }",
"main",
"{\n // Use the Scanner class\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] s = br.readLine().split(\" \");\n Main test = new Main();\n\n int n = Integer.parseInt(s[0]);\n int k = Integer.parseInt(s[1]);\n int[] arr = new int[n];\n int i=0;\n s = br.readLine().split(\" \");\n while(i<n){\n arr[i] = Integer.parseInt(s[i]);\n i++;\n }\n test.solve(n,k,arr);\n //int tot = Integer.parseInt(br.readLine());\n\n\n// int i =1;\n// System.out.println();\n// while(tot>0){\n//\n// String s = br.readLine();\n// String[] sr = s.split(\" \");\n// List<Long> ls = new ArrayList<>();\n// for(String ss:sr){\n// ls.add(Long.parseLong(ss));\n// }\n// Main tt = new Main();\n// tt.sol(ls);\n// // String Buffer to store answer\n// StringBuffer sb = new StringBuffer();\n//// Solution obj = new Solution();\n////\n//// System.out.println(\"Case #\"+i+\": \"+obj.sol());\n// tot--;\n// i++;\n// }\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String[] s = br.readLine().split(\" \");",
"s",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"Main test = new Main();",
"test",
"new Main()",
"int n = Integer.parseInt(s[0]);",
"n",
"Integer.parseInt(s[0])",
"Integer.parseInt",
"Integer",
"s[0]",
"s",
"0",
"int k = Integer.parseInt(s[1]);",
"k",
"Integer.parseInt(s[1])",
"Integer.parseInt",
"Integer",
"s[1]",
"s",
"1",
"int[] arr = new int[n];",
"arr",
"new int[n]",
"n",
"int i=0;",
"i",
"0",
"s = br.readLine().split(\" \")",
"s",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"while(i<n){\n arr[i] = Integer.parseInt(s[i]);\n i++;\n }",
"i<n",
"i",
"n",
"{\n arr[i] = Integer.parseInt(s[i]);\n i++;\n }",
"arr[i] = Integer.parseInt(s[i])",
"arr[i]",
"arr",
"i",
"Integer.parseInt(s[i])",
"Integer.parseInt",
"Integer",
"s[i]",
"s",
"i",
"i++",
"i",
"test.solve(n,k,arr)",
"test.solve",
"test",
"n",
"k",
"arr",
"String[] args",
"args",
"public class Main {\n\n int mod ;\n //\n int[][] dp = new int[1001][1001];\n void solve(int n, int k , int[] arr) {\n Arrays.sort(arr);\n int res = 0;\n for(int i=0;i<k;i++){\n res+=arr[i];\n }\n System.out.println(res);\n }\n\n\n public static void main(String[] args) throws IOException {\n // Use the Scanner class\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] s = br.readLine().split(\" \");\n Main test = new Main();\n\n int n = Integer.parseInt(s[0]);\n int k = Integer.parseInt(s[1]);\n int[] arr = new int[n];\n int i=0;\n s = br.readLine().split(\" \");\n while(i<n){\n arr[i] = Integer.parseInt(s[i]);\n i++;\n }\n test.solve(n,k,arr);\n //int tot = Integer.parseInt(br.readLine());\n\n\n// int i =1;\n// System.out.println();\n// while(tot>0){\n//\n// String s = br.readLine();\n// String[] sr = s.split(\" \");\n// List<Long> ls = new ArrayList<>();\n// for(String ss:sr){\n// ls.add(Long.parseLong(ss));\n// }\n// Main tt = new Main();\n// tt.sol(ls);\n// // String Buffer to store answer\n// StringBuffer sb = new StringBuffer();\n//// Solution obj = new Solution();\n////\n//// System.out.println(\"Case #\"+i+\": \"+obj.sol());\n// tot--;\n// i++;\n// }\n }\n\n}",
"public class Main {\n\n int mod ;\n //\n int[][] dp = new int[1001][1001];\n void solve(int n, int k , int[] arr) {\n Arrays.sort(arr);\n int res = 0;\n for(int i=0;i<k;i++){\n res+=arr[i];\n }\n System.out.println(res);\n }\n\n\n public static void main(String[] args) throws IOException {\n // Use the Scanner class\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n String[] s = br.readLine().split(\" \");\n Main test = new Main();\n\n int n = Integer.parseInt(s[0]);\n int k = Integer.parseInt(s[1]);\n int[] arr = new int[n];\n int i=0;\n s = br.readLine().split(\" \");\n while(i<n){\n arr[i] = Integer.parseInt(s[i]);\n i++;\n }\n test.solve(n,k,arr);\n //int tot = Integer.parseInt(br.readLine());\n\n\n// int i =1;\n// System.out.println();\n// while(tot>0){\n//\n// String s = br.readLine();\n// String[] sr = s.split(\" \");\n// List<Long> ls = new ArrayList<>();\n// for(String ss:sr){\n// ls.add(Long.parseLong(ss));\n// }\n// Main tt = new Main();\n// tt.sol(ls);\n// // String Buffer to store answer\n// StringBuffer sb = new StringBuffer();\n//// Solution obj = new Solution();\n////\n//// System.out.println(\"Case #\"+i+\": \"+obj.sol());\n// tot--;\n// i++;\n// }\n }\n\n}",
"Main"
]
| import java.util.*;
import java.io.*;
import java.math.BigDecimal;
import java.nio.file.Files;
import java.nio.charset.StandardCharsets;
//给出两个数a,b 求出[a,b]中各位数字之和能整除原数的数的个数。
public class Main {
int mod ;
//
int[][] dp = new int[1001][1001];
void solve(int n, int k , int[] arr) {
Arrays.sort(arr);
int res = 0;
for(int i=0;i<k;i++){
res+=arr[i];
}
System.out.println(res);
}
public static void main(String[] args) throws IOException {
// Use the Scanner class
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] s = br.readLine().split(" ");
Main test = new Main();
int n = Integer.parseInt(s[0]);
int k = Integer.parseInt(s[1]);
int[] arr = new int[n];
int i=0;
s = br.readLine().split(" ");
while(i<n){
arr[i] = Integer.parseInt(s[i]);
i++;
}
test.solve(n,k,arr);
//int tot = Integer.parseInt(br.readLine());
// int i =1;
// System.out.println();
// while(tot>0){
//
// String s = br.readLine();
// String[] sr = s.split(" ");
// List<Long> ls = new ArrayList<>();
// for(String ss:sr){
// ls.add(Long.parseLong(ss));
// }
// Main tt = new Main();
// tt.sol(ls);
// // String Buffer to store answer
// StringBuffer sb = new StringBuffer();
//// Solution obj = new Solution();
////
//// System.out.println("Case #"+i+": "+obj.sol());
// tot--;
// i++;
// }
}
}
|
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
17,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
2,
13,
17,
0,
18,
13,
17,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
89,
5
],
[
89,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
8,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
8,
25
],
[
25,
26
],
[
25,
27
],
[
28,
29
],
[
28,
30
],
[
8,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
8,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
38,
40
],
[
36,
41
],
[
41,
42
],
[
41,
43
],
[
36,
44
],
[
44,
45
],
[
45,
46
],
[
36,
47
],
[
48,
48
],
[
48,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
54,
55
],
[
8,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
8,
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
],
[
73,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
77,
79
],
[
8,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
6,
86
],
[
86,
87
],
[
0,
88
],
[
88,
89
],
[
88,
90
]
]
| [
"import java.util.*;\npublic class Main {\n\t//定義関数から参照できる変数定義はこの辺\n\t//static Var_form Var_name;\n\n\tpublic static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n\t\t//long Var_name = sc.nextLong();\n\t\tint ans=0;\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint ary[]=new int[N+1];\n\t\tary[0]=0;\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tary[i]=sc.nextInt();\n\t\t}\n\t\tArrays.sort(ary);\n\t\tfor(int i=1;i<=K;i++){\n\t\t\tans=ans+ary[i];\n\t\t}\n\n\n\n\t\tSystem.out.println(ans);\n\t\t//System.out.print(ans);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\t//定義関数から参照できる変数定義はこの辺\n\t//static Var_form Var_name;\n\n\tpublic static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n\t\t//long Var_name = sc.nextLong();\n\t\tint ans=0;\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint ary[]=new int[N+1];\n\t\tary[0]=0;\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tary[i]=sc.nextInt();\n\t\t}\n\t\tArrays.sort(ary);\n\t\tfor(int i=1;i<=K;i++){\n\t\t\tans=ans+ary[i];\n\t\t}\n\n\n\n\t\tSystem.out.println(ans);\n\t\t//System.out.print(ans);\n }\n}",
"Main",
"public static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n\t\t//long Var_name = sc.nextLong();\n\t\tint ans=0;\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint ary[]=new int[N+1];\n\t\tary[0]=0;\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tary[i]=sc.nextInt();\n\t\t}\n\t\tArrays.sort(ary);\n\t\tfor(int i=1;i<=K;i++){\n\t\t\tans=ans+ary[i];\n\t\t}\n\n\n\n\t\tSystem.out.println(ans);\n\t\t//System.out.print(ans);\n }",
"main",
"{\n \tScanner sc = new Scanner(System.in);\n\t\t//long Var_name = sc.nextLong();\n\t\tint ans=0;\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint ary[]=new int[N+1];\n\t\tary[0]=0;\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tary[i]=sc.nextInt();\n\t\t}\n\t\tArrays.sort(ary);\n\t\tfor(int i=1;i<=K;i++){\n\t\t\tans=ans+ary[i];\n\t\t}\n\n\n\n\t\tSystem.out.println(ans);\n\t\t//System.out.print(ans);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int ans=0;",
"ans",
"0",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int ary[]=new int[N+1];",
"ary",
"new int[N+1]",
"N+1",
"N",
"1",
"ary[0]=0",
"ary[0]",
"ary",
"0",
"0",
"for(int i=1;i<=N;i++){\n\t\t\tary[i]=sc.nextInt();\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tary[i]=sc.nextInt();\n\t\t}",
"{\n\t\t\tary[i]=sc.nextInt();\n\t\t}",
"ary[i]=sc.nextInt()",
"ary[i]",
"ary",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(ary)",
"Arrays.sort",
"Arrays",
"ary",
"for(int i=1;i<=K;i++){\n\t\t\tans=ans+ary[i];\n\t\t}",
"int i=1;",
"int i=1;",
"i",
"1",
"i<=K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tans=ans+ary[i];\n\t\t}",
"{\n\t\t\tans=ans+ary[i];\n\t\t}",
"ans=ans+ary[i]",
"ans",
"ans+ary[i]",
"ans",
"ary[i]",
"ary",
"i",
"System.out.println(ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"ans",
"String[] args",
"args",
"public class Main {\n\t//定義関数から参照できる変数定義はこの辺\n\t//static Var_form Var_name;\n\n\tpublic static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n\t\t//long Var_name = sc.nextLong();\n\t\tint ans=0;\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint ary[]=new int[N+1];\n\t\tary[0]=0;\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tary[i]=sc.nextInt();\n\t\t}\n\t\tArrays.sort(ary);\n\t\tfor(int i=1;i<=K;i++){\n\t\t\tans=ans+ary[i];\n\t\t}\n\n\n\n\t\tSystem.out.println(ans);\n\t\t//System.out.print(ans);\n }\n}",
"public class Main {\n\t//定義関数から参照できる変数定義はこの辺\n\t//static Var_form Var_name;\n\n\tpublic static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n\t\t//long Var_name = sc.nextLong();\n\t\tint ans=0;\n\t\tint N = sc.nextInt();\n\t\tint K = sc.nextInt();\n\t\tint ary[]=new int[N+1];\n\t\tary[0]=0;\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tary[i]=sc.nextInt();\n\t\t}\n\t\tArrays.sort(ary);\n\t\tfor(int i=1;i<=K;i++){\n\t\t\tans=ans+ary[i];\n\t\t}\n\n\n\n\t\tSystem.out.println(ans);\n\t\t//System.out.print(ans);\n }\n}",
"Main"
]
| import java.util.*;
public class Main {
//定義関数から参照できる変数定義はこの辺
//static Var_form Var_name;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
//long Var_name = sc.nextLong();
int ans=0;
int N = sc.nextInt();
int K = sc.nextInt();
int ary[]=new int[N+1];
ary[0]=0;
for(int i=1;i<=N;i++){
ary[i]=sc.nextInt();
}
Arrays.sort(ary);
for(int i=1;i<=K;i++){
ans=ans+ary[i];
}
System.out.println(ans);
//System.out.print(ans);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
2,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
4,
18,
13,
13,
30,
30,
0,
13,
4,
18,
13,
13,
0,
18,
13,
13,
13,
4,
18,
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,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
150,
8
],
[
150,
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
],
[
23,
24
],
[
24,
25
],
[
11,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
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
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
11,
50
],
[
50,
51
],
[
50,
52
],
[
11,
53
],
[
53,
54
],
[
53,
55
],
[
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
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
69,
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
],
[
94,
95
],
[
95,
96
],
[
94,
97
],
[
91,
98
],
[
91,
99
],
[
99,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
69,
106
],
[
106,
107
],
[
107,
108
],
[
107,
109
],
[
106,
110
],
[
69,
111
],
[
111,
112
],
[
112,
113
],
[
111,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
11,
118
],
[
118,
119
],
[
118,
120
],
[
11,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
123,
125
],
[
121,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
128,
130
],
[
121,
131
],
[
131,
132
],
[
132,
133
],
[
121,
134
],
[
135,
135
],
[
135,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
138,
140
],
[
11,
141
],
[
141,
142
],
[
142,
143
],
[
143,
144
],
[
143,
145
],
[
141,
146
],
[
9,
147
],
[
147,
148
],
[
0,
149
],
[
149,
150
],
[
149,
151
]
]
| [
"\nimport java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\t//オブジェクト生成\n\t\tScanner scan = new Scanner(System.in);\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tArrayList<Integer> minNumList = new ArrayList<Integer>();\n\n\t\t//代入作業\n\t\tint num1 = scan.nextInt();\n\t\tint buyCnt = scan.nextInt();\n\t\tfor (int i = 0; i < num1; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tint minNum = 0;\n\t\tint[] minNumArray = new int[buyCnt];\n\t\tfor (int j = 0; j < buyCnt; j++) {\n\t\t\tminNum = list.get(0);\n\t\t\tfor (int i = 1; i < num1 - j; i++) {\n\t\t\t\tif (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tminNumArray[j] = minNum;\n\t\t\tlist.remove(list.indexOf(minNum));\n\t\t}\n\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < minNumArray.length; i++) {\n\t\t\tans += minNumArray[i];\n\t\t}\n\n\t\tSystem.out.println(ans);\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\n\t\t//オブジェクト生成\n\t\tScanner scan = new Scanner(System.in);\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tArrayList<Integer> minNumList = new ArrayList<Integer>();\n\n\t\t//代入作業\n\t\tint num1 = scan.nextInt();\n\t\tint buyCnt = scan.nextInt();\n\t\tfor (int i = 0; i < num1; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tint minNum = 0;\n\t\tint[] minNumArray = new int[buyCnt];\n\t\tfor (int j = 0; j < buyCnt; j++) {\n\t\t\tminNum = list.get(0);\n\t\t\tfor (int i = 1; i < num1 - j; i++) {\n\t\t\t\tif (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tminNumArray[j] = minNum;\n\t\t\tlist.remove(list.indexOf(minNum));\n\t\t}\n\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < minNumArray.length; i++) {\n\t\t\tans += minNumArray[i];\n\t\t}\n\n\t\tSystem.out.println(ans);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\n\t\t//オブジェクト生成\n\t\tScanner scan = new Scanner(System.in);\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tArrayList<Integer> minNumList = new ArrayList<Integer>();\n\n\t\t//代入作業\n\t\tint num1 = scan.nextInt();\n\t\tint buyCnt = scan.nextInt();\n\t\tfor (int i = 0; i < num1; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tint minNum = 0;\n\t\tint[] minNumArray = new int[buyCnt];\n\t\tfor (int j = 0; j < buyCnt; j++) {\n\t\t\tminNum = list.get(0);\n\t\t\tfor (int i = 1; i < num1 - j; i++) {\n\t\t\t\tif (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tminNumArray[j] = minNum;\n\t\t\tlist.remove(list.indexOf(minNum));\n\t\t}\n\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < minNumArray.length; i++) {\n\t\t\tans += minNumArray[i];\n\t\t}\n\n\t\tSystem.out.println(ans);\n\n\t}",
"main",
"{\n\n\t\t//オブジェクト生成\n\t\tScanner scan = new Scanner(System.in);\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tArrayList<Integer> minNumList = new ArrayList<Integer>();\n\n\t\t//代入作業\n\t\tint num1 = scan.nextInt();\n\t\tint buyCnt = scan.nextInt();\n\t\tfor (int i = 0; i < num1; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tint minNum = 0;\n\t\tint[] minNumArray = new int[buyCnt];\n\t\tfor (int j = 0; j < buyCnt; j++) {\n\t\t\tminNum = list.get(0);\n\t\t\tfor (int i = 1; i < num1 - j; i++) {\n\t\t\t\tif (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tminNumArray[j] = minNum;\n\t\t\tlist.remove(list.indexOf(minNum));\n\t\t}\n\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < minNumArray.length; i++) {\n\t\t\tans += minNumArray[i];\n\t\t}\n\n\t\tSystem.out.println(ans);\n\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"ArrayList<Integer> list = new ArrayList<Integer>();",
"list",
"new ArrayList<Integer>()",
"ArrayList<Integer> minNumList = new ArrayList<Integer>();",
"minNumList",
"new ArrayList<Integer>()",
"int num1 = scan.nextInt();",
"num1",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int buyCnt = scan.nextInt();",
"buyCnt",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for (int i = 0; i < num1; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < num1",
"i",
"num1",
"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 minNum = 0;",
"minNum",
"0",
"int[] minNumArray = new int[buyCnt];",
"minNumArray",
"new int[buyCnt]",
"buyCnt",
"for (int j = 0; j < buyCnt; j++) {\n\t\t\tminNum = list.get(0);\n\t\t\tfor (int i = 1; i < num1 - j; i++) {\n\t\t\t\tif (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tminNumArray[j] = minNum;\n\t\t\tlist.remove(list.indexOf(minNum));\n\t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < buyCnt",
"j",
"buyCnt",
"j++",
"j++",
"j",
"{\n\t\t\tminNum = list.get(0);\n\t\t\tfor (int i = 1; i < num1 - j; i++) {\n\t\t\t\tif (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tminNumArray[j] = minNum;\n\t\t\tlist.remove(list.indexOf(minNum));\n\t\t}",
"{\n\t\t\tminNum = list.get(0);\n\t\t\tfor (int i = 1; i < num1 - j; i++) {\n\t\t\t\tif (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tminNumArray[j] = minNum;\n\t\t\tlist.remove(list.indexOf(minNum));\n\t\t}",
"minNum = list.get(0)",
"minNum",
"list.get(0)",
"list.get",
"list",
"0",
"for (int i = 1; i < num1 - j; i++) {\n\t\t\t\tif (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}\n\t\t\t}",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i < num1 - j",
"i",
"num1 - j",
"num1",
"j",
"i++",
"i++",
"i",
"{\n\t\t\t\tif (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}\n\t\t\t}",
"{\n\t\t\t\tif (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}\n\t\t\t}",
"if (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}",
"minNum < list.get(i)",
"minNum",
"list.get(i)",
"list.get",
"list",
"i",
"{\n\t\t\t\t\t//何もしない\n\t\t\t\t}",
"{\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}",
"minNum = list.get(i)",
"minNum",
"list.get(i)",
"list.get",
"list",
"i",
"minNumArray[j] = minNum",
"minNumArray[j]",
"minNumArray",
"j",
"minNum",
"list.remove(list.indexOf(minNum))",
"list.remove",
"list",
"list.indexOf(minNum)",
"list.indexOf",
"list",
"minNum",
"int ans = 0;",
"ans",
"0",
"for (int i = 0; i < minNumArray.length; i++) {\n\t\t\tans += minNumArray[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < minNumArray.length",
"i",
"minNumArray.length",
"minNumArray",
"minNumArray.length",
"i++",
"i++",
"i",
"{\n\t\t\tans += minNumArray[i];\n\t\t}",
"{\n\t\t\tans += minNumArray[i];\n\t\t}",
"ans += minNumArray[i]",
"ans",
"minNumArray[i]",
"minNumArray",
"i",
"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\n\t\t//オブジェクト生成\n\t\tScanner scan = new Scanner(System.in);\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tArrayList<Integer> minNumList = new ArrayList<Integer>();\n\n\t\t//代入作業\n\t\tint num1 = scan.nextInt();\n\t\tint buyCnt = scan.nextInt();\n\t\tfor (int i = 0; i < num1; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tint minNum = 0;\n\t\tint[] minNumArray = new int[buyCnt];\n\t\tfor (int j = 0; j < buyCnt; j++) {\n\t\t\tminNum = list.get(0);\n\t\t\tfor (int i = 1; i < num1 - j; i++) {\n\t\t\t\tif (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tminNumArray[j] = minNum;\n\t\t\tlist.remove(list.indexOf(minNum));\n\t\t}\n\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < minNumArray.length; i++) {\n\t\t\tans += minNumArray[i];\n\t\t}\n\n\t\tSystem.out.println(ans);\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\n\t\t//オブジェクト生成\n\t\tScanner scan = new Scanner(System.in);\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tArrayList<Integer> minNumList = new ArrayList<Integer>();\n\n\t\t//代入作業\n\t\tint num1 = scan.nextInt();\n\t\tint buyCnt = scan.nextInt();\n\t\tfor (int i = 0; i < num1; i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tint minNum = 0;\n\t\tint[] minNumArray = new int[buyCnt];\n\t\tfor (int j = 0; j < buyCnt; j++) {\n\t\t\tminNum = list.get(0);\n\t\t\tfor (int i = 1; i < num1 - j; i++) {\n\t\t\t\tif (minNum < list.get(i)) {\n\t\t\t\t\t//何もしない\n\t\t\t\t} else {\n\t\t\t\t\tminNum = list.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tminNumArray[j] = minNum;\n\t\t\tlist.remove(list.indexOf(minNum));\n\t\t}\n\n\t\tint ans = 0;\n\t\tfor (int i = 0; i < minNumArray.length; i++) {\n\t\t\tans += minNumArray[i];\n\t\t}\n\n\t\tSystem.out.println(ans);\n\n\t}\n\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);
ArrayList<Integer> list = new ArrayList<Integer>();
ArrayList<Integer> minNumList = new ArrayList<Integer>();
//代入作業
int num1 = scan.nextInt();
int buyCnt = scan.nextInt();
for (int i = 0; i < num1; i++) {
list.add(scan.nextInt());
}
int minNum = 0;
int[] minNumArray = new int[buyCnt];
for (int j = 0; j < buyCnt; j++) {
minNum = list.get(0);
for (int i = 1; i < num1 - j; i++) {
if (minNum < list.get(i)) {
//何もしない
} else {
minNum = list.get(i);
}
}
minNumArray[j] = minNum;
list.remove(list.indexOf(minNum));
}
int ans = 0;
for (int i = 0; i < minNumArray.length; i++) {
ans += minNumArray[i];
}
System.out.println(ans);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
85,
8
],
[
85,
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
],
[
43,
43
],
[
43,
44
],
[
44,
45
],
[
44,
46
],
[
46,
47
],
[
47,
48
],
[
43,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
11,
53
],
[
53,
54
],
[
54,
55
],
[
53,
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
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
11,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
9,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
]
| [
"import java.util.*;\nimport java.io.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n List<Integer> list = new ArrayList<Integer>();\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int sum = 0 ;\n for(int i=0;i<n;i++){\n int p = sc.nextInt();\n list.add(p);\n }\n Collections.sort(list);\n for(int i=0;i<k;i++){\n sum+=list.get(i);\n }\n System.out.println(sum);\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 List<Integer> list = new ArrayList<Integer>();\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int sum = 0 ;\n for(int i=0;i<n;i++){\n int p = sc.nextInt();\n list.add(p);\n }\n Collections.sort(list);\n for(int i=0;i<k;i++){\n sum+=list.get(i);\n }\n System.out.println(sum);\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n List<Integer> list = new ArrayList<Integer>();\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int sum = 0 ;\n for(int i=0;i<n;i++){\n int p = sc.nextInt();\n list.add(p);\n }\n Collections.sort(list);\n for(int i=0;i<k;i++){\n sum+=list.get(i);\n }\n System.out.println(sum);\n }",
"main",
"{\n List<Integer> list = new ArrayList<Integer>();\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int sum = 0 ;\n for(int i=0;i<n;i++){\n int p = sc.nextInt();\n list.add(p);\n }\n Collections.sort(list);\n for(int i=0;i<k;i++){\n sum+=list.get(i);\n }\n System.out.println(sum);\n }",
"List<Integer> list = new ArrayList<Integer>();",
"list",
"new ArrayList<Integer>()",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0 ;",
"sum",
"0",
"for(int i=0;i<n;i++){\n int p = sc.nextInt();\n list.add(p);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n int p = sc.nextInt();\n list.add(p);\n }",
"{\n int p = sc.nextInt();\n list.add(p);\n }",
"int p = sc.nextInt();",
"p",
"sc.nextInt()",
"sc.nextInt",
"sc",
"list.add(p)",
"list.add",
"list",
"p",
"Collections.sort(list)",
"Collections.sort",
"Collections",
"list",
"for(int i=0;i<k;i++){\n sum+=list.get(i);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n sum+=list.get(i);\n }",
"{\n sum+=list.get(i);\n }",
"sum+=list.get(i)",
"sum",
"list.get(i)",
"list.get",
"list",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) throws Exception {\n List<Integer> list = new ArrayList<Integer>();\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int sum = 0 ;\n for(int i=0;i<n;i++){\n int p = sc.nextInt();\n list.add(p);\n }\n Collections.sort(list);\n for(int i=0;i<k;i++){\n sum+=list.get(i);\n }\n System.out.println(sum);\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n List<Integer> list = new ArrayList<Integer>();\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int sum = 0 ;\n for(int i=0;i<n;i++){\n int p = sc.nextInt();\n list.add(p);\n }\n Collections.sort(list);\n for(int i=0;i<k;i++){\n sum+=list.get(i);\n }\n System.out.println(sum);\n }\n}",
"Main"
]
| import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
List<Integer> list = new ArrayList<Integer>();
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int sum = 0 ;
for(int i=0;i<n;i++){
int p = sc.nextInt();
list.add(p);
}
Collections.sort(list);
for(int i=0;i<k;i++){
sum+=list.get(i);
}
System.out.println(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,
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,
13,
4,
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,
13,
4,
18,
13,
12,
13,
30,
41,
13,
20,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
40,
17,
37,
20,
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,
40,
17,
29,
18,
13,
40,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
40,
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,
17,
0,
13,
2,
13,
17,
0,
13,
4,
13,
29,
2,
13,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
40,
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,
17,
0,
13,
2,
13,
17,
0,
13,
4,
13,
29,
2,
13,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
2,
13,
17,
29,
4,
18,
13,
13,
29,
2,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
12,
13,
30,
29,
4,
13,
6,
13,
12,
13,
23,
13,
6,
13,
41,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
0,
18,
36,
13,
20,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
17,
4,
18,
13,
17,
4,
18,
13,
18,
13,
13,
23,
13,
12,
13,
30,
4,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
4,
18,
13,
12,
13,
30,
4,
18,
13,
6,
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,
18,
13,
29,
13,
23,
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,
18,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
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
],
[
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
],
[
603,
41
],
[
603,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
45,
47
],
[
44,
48
],
[
48,
49
],
[
48,
50
],
[
44,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
44,
56
],
[
56,
57
],
[
56,
58
],
[
58,
59
],
[
59,
60
],
[
44,
61
],
[
61,
62
],
[
61,
63
],
[
63,
64
],
[
64,
65
],
[
63,
66
],
[
63,
67
],
[
44,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
44,
72
],
[
72,
73
],
[
72,
74
],
[
44,
75
],
[
75,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
75,
80
],
[
80,
81
],
[
80,
82
],
[
75,
83
],
[
83,
84
],
[
84,
85
],
[
75,
86
],
[
87,
87
],
[
87,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
44,
93
],
[
93,
94
],
[
94,
95
],
[
93,
96
],
[
44,
97
],
[
97,
98
],
[
98,
99
],
[
603,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
107,
108
],
[
100,
109
],
[
109,
110
],
[
603,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
111,
115
],
[
115,
116
],
[
115,
117
],
[
111,
119
],
[
119,
120
],
[
111,
121
],
[
121,
122
],
[
111,
123
],
[
123,
124
],
[
111,
125
],
[
125,
126
],
[
125,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
129,
131
],
[
128,
132
],
[
125,
133
],
[
133,
134
],
[
111,
135
],
[
135,
136
],
[
135,
137
],
[
137,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
141,
142
],
[
138,
143
],
[
143,
144
],
[
137,
145
],
[
145,
146
],
[
146,
147
],
[
146,
148
],
[
145,
149
],
[
149,
150
],
[
150,
151
],
[
150,
152
],
[
149,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
157,
158
],
[
153,
159
],
[
159,
160
],
[
160,
161
],
[
160,
162
],
[
162,
163
],
[
163,
164
],
[
162,
165
],
[
149,
166
],
[
166,
167
],
[
167,
168
],
[
167,
169
],
[
166,
170
],
[
170,
171
],
[
171,
172
],
[
137,
173
],
[
173,
174
],
[
174,
175
],
[
174,
176
],
[
176,
177
],
[
111,
178
],
[
178,
179
],
[
178,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
180,
185
],
[
185,
186
],
[
186,
187
],
[
186,
188
],
[
185,
189
],
[
189,
190
],
[
189,
191
],
[
191,
192
],
[
180,
193
],
[
193,
194
],
[
193,
195
],
[
180,
196
],
[
196,
197
],
[
197,
198
],
[
197,
199
],
[
196,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
200,
205
],
[
205,
206
],
[
205,
207
],
[
207,
208
],
[
180,
209
],
[
209,
210
],
[
209,
211
],
[
180,
212
],
[
212,
213
],
[
213,
214
],
[
214,
215
],
[
214,
216
],
[
212,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
220,
222
],
[
219,
223
],
[
223,
224
],
[
223,
225
],
[
218,
226
],
[
226,
227
],
[
217,
228
],
[
228,
229
],
[
228,
230
],
[
217,
231
],
[
231,
232
],
[
231,
233
],
[
233,
234
],
[
233,
235
],
[
217,
236
],
[
236,
237
],
[
236,
238
],
[
238,
239
],
[
180,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
111,
244
],
[
244,
245
],
[
244,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
249,
250
],
[
246,
251
],
[
251,
252
],
[
252,
253
],
[
252,
254
],
[
251,
255
],
[
255,
256
],
[
255,
257
],
[
257,
258
],
[
246,
259
],
[
259,
260
],
[
259,
261
],
[
246,
262
],
[
262,
263
],
[
263,
264
],
[
263,
265
],
[
262,
266
],
[
266,
267
],
[
267,
268
],
[
267,
269
],
[
269,
270
],
[
266,
271
],
[
271,
272
],
[
271,
273
],
[
273,
274
],
[
246,
275
],
[
275,
276
],
[
275,
277
],
[
246,
278
],
[
278,
279
],
[
279,
280
],
[
280,
281
],
[
280,
282
],
[
278,
283
],
[
283,
284
],
[
284,
285
],
[
285,
286
],
[
286,
287
],
[
286,
288
],
[
285,
289
],
[
289,
290
],
[
289,
291
],
[
284,
292
],
[
292,
293
],
[
283,
294
],
[
294,
295
],
[
294,
296
],
[
283,
297
],
[
297,
298
],
[
297,
299
],
[
299,
300
],
[
299,
301
],
[
283,
302
],
[
302,
303
],
[
302,
304
],
[
304,
305
],
[
246,
306
],
[
306,
307
],
[
307,
308
],
[
307,
309
],
[
111,
310
],
[
310,
311
],
[
310,
312
],
[
312,
313
],
[
313,
314
],
[
313,
315
],
[
315,
316
],
[
312,
317
],
[
317,
318
],
[
318,
319
],
[
318,
320
],
[
317,
321
],
[
321,
322
],
[
321,
323
],
[
323,
324
],
[
312,
325
],
[
325,
326
],
[
325,
327
],
[
312,
328
],
[
328,
329
],
[
329,
330
],
[
330,
331
],
[
330,
332
],
[
328,
333
],
[
333,
334
],
[
334,
335
],
[
335,
336
],
[
334,
337
],
[
333,
338
],
[
338,
339
],
[
338,
340
],
[
340,
341
],
[
312,
342
],
[
342,
343
],
[
343,
344
],
[
344,
345
],
[
111,
346
],
[
346,
347
],
[
346,
348
],
[
348,
349
],
[
349,
350
],
[
350,
351
],
[
350,
352
],
[
349,
353
],
[
353,
354
],
[
354,
355
],
[
355,
356
],
[
354,
357
],
[
348,
358
],
[
358,
359
],
[
362,
360
],
[
372,
361
],
[
369,
362
],
[
362,
363
],
[
363,
364
],
[
363,
365
],
[
362,
366
],
[
366,
367
],
[
366,
368
],
[
369,
369
],
[
369,
370
],
[
369,
371
],
[
372,
372
],
[
372,
373
],
[
372,
374
],
[
362,
375
],
[
375,
376
],
[
375,
377
],
[
377,
378
],
[
346,
379
],
[
379,
380
],
[
111,
381
],
[
381,
382
],
[
381,
383
],
[
383,
384
],
[
384,
385
],
[
385,
386
],
[
111,
387
],
[
387,
388
],
[
387,
389
],
[
389,
390
],
[
389,
391
],
[
391,
392
],
[
603,
393
],
[
393,
394
],
[
393,
395
],
[
395,
396
],
[
393,
397
],
[
397,
398
],
[
397,
399
],
[
399,
400
],
[
400,
401
],
[
400,
402
],
[
397,
403
],
[
403,
404
],
[
393,
405
],
[
405,
406
],
[
405,
407
],
[
407,
408
],
[
408,
409
],
[
409,
410
],
[
409,
411
],
[
408,
412
],
[
405,
413
],
[
413,
414
],
[
393,
415
],
[
415,
416
],
[
415,
417
],
[
417,
418
],
[
418,
419
],
[
419,
420
],
[
420,
421
],
[
420,
422
],
[
418,
423
],
[
423,
424
],
[
423,
425
],
[
425,
426
],
[
425,
427
],
[
418,
428
],
[
428,
429
],
[
429,
430
],
[
418,
431
],
[
432,
432
],
[
432,
433
],
[
433,
434
],
[
434,
435
],
[
434,
436
],
[
433,
437
],
[
437,
438
],
[
438,
439
],
[
437,
440
],
[
432,
441
],
[
441,
442
],
[
442,
443
],
[
441,
444
],
[
444,
445
],
[
444,
446
],
[
415,
447
],
[
447,
448
],
[
393,
449
],
[
449,
450
],
[
449,
451
],
[
451,
452
],
[
452,
453
],
[
452,
454
],
[
451,
455
],
[
455,
456
],
[
456,
457
],
[
449,
458
],
[
458,
459
],
[
393,
460
],
[
460,
461
],
[
460,
462
],
[
462,
463
],
[
463,
464
],
[
464,
465
],
[
393,
466
],
[
466,
467
],
[
466,
468
],
[
468,
469
],
[
469,
470
],
[
470,
471
],
[
603,
472
],
[
472,
473
],
[
472,
474
],
[
474,
475
],
[
474,
476
],
[
476,
477
],
[
477,
478
],
[
477,
479
],
[
476,
481
],
[
481,
482
],
[
482,
483
],
[
483,
484
],
[
483,
485
],
[
481,
486
],
[
486,
487
],
[
486,
488
],
[
481,
489
],
[
489,
490
],
[
490,
491
],
[
481,
492
],
[
493,
493
],
[
493,
494
],
[
494,
495
],
[
495,
496
],
[
495,
497
],
[
494,
498
],
[
498,
499
],
[
499,
500
],
[
476,
501
],
[
501,
502
],
[
474,
503
],
[
503,
504
],
[
474,
505
],
[
505,
506
],
[
472,
507
],
[
507,
508
],
[
507,
509
],
[
509,
510
],
[
510,
511
],
[
510,
512
],
[
509,
514
],
[
514,
515
],
[
515,
516
],
[
516,
517
],
[
516,
518
],
[
514,
519
],
[
519,
520
],
[
519,
521
],
[
514,
522
],
[
522,
523
],
[
523,
524
],
[
514,
525
],
[
526,
526
],
[
526,
527
],
[
527,
528
],
[
528,
529
],
[
528,
530
],
[
527,
531
],
[
531,
532
],
[
532,
533
],
[
509,
534
],
[
534,
535
],
[
507,
536
],
[
536,
537
],
[
507,
538
],
[
538,
539
],
[
472,
540
],
[
540,
541
],
[
540,
542
],
[
542,
543
],
[
543,
544
],
[
543,
545
],
[
542,
546
],
[
546,
547
],
[
547,
548
],
[
548,
549
],
[
548,
550
],
[
546,
551
],
[
551,
552
],
[
551,
553
],
[
546,
554
],
[
554,
555
],
[
555,
556
],
[
546,
557
],
[
558,
558
],
[
558,
559
],
[
559,
560
],
[
560,
561
],
[
559,
562
],
[
562,
563
],
[
563,
564
],
[
542,
565
],
[
565,
566
],
[
540,
567
],
[
567,
568
],
[
540,
569
],
[
569,
570
],
[
472,
571
],
[
571,
572
],
[
571,
573
],
[
573,
574
],
[
574,
575
],
[
574,
576
],
[
573,
577
],
[
577,
578
],
[
578,
579
],
[
579,
580
],
[
579,
581
],
[
577,
582
],
[
582,
583
],
[
582,
584
],
[
577,
585
],
[
585,
586
],
[
586,
587
],
[
577,
588
],
[
589,
589
],
[
589,
590
],
[
590,
591
],
[
591,
592
],
[
590,
593
],
[
593,
594
],
[
594,
595
],
[
573,
596
],
[
596,
597
],
[
571,
598
],
[
598,
599
],
[
571,
600
],
[
600,
601
],
[
0,
602
],
[
602,
603
],
[
602,
604
]
]
| [
"import java.io.BufferedWriter;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.io.OutputStreamWriter;\nimport java.io.PrintWriter;\nimport java.io.Writer;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.InputMismatchException;\nimport java.util.List;\nimport java.util.Set;\n\npublic class Main {\n\n public void solve() {\n InputReader in = new InputReader(System.in);\n OutputWriter out = new OutputWriter(System.out);\n int n = in.readInt(), k = in.readInt();\n int ai[] = IOUtils.readIntegerArray(in,n );\n Arrays.sort(ai);\n\n long sum = 0;\n for (int i = 0; i < k; i++) {\n sum+=ai[i];\n }\n out.printLine(sum);\n out.flush();\n }\n\n public static void main(String[] args) {\n Main solver = new Main();\n solver.solve();\n }\n\n static class InputReader {\n\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if ( numChars == -1 )\n throw new InputMismatchException();\n if ( curChar >= numChars ) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if ( numChars <= 0 )\n return -1;\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long readLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if ( filter != null )\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public String next() {\n return readString();\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }\n\n static class OutputWriter {\n private final PrintWriter writer;\n\n public OutputWriter(OutputStream outputStream) {\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }\n\n public OutputWriter(Writer writer) {\n this.writer = new PrintWriter(writer);\n }\n\n public void print(Object... objects) {\n for (int i = 0; i < objects.length; i++) {\n if ( i != 0 )\n writer.print(' ');\n writer.print(objects[i]);\n }\n }\n\n public void printLine(Object... objects) {\n print(objects);\n writer.println();\n }\n\n public void close() {\n writer.close();\n }\n\n public void flush() {\n writer.flush();\n }\n\n }\n\n static class IOUtils {\n\n public static int[] readIntegerArray(InputReader in, int size) {\n int[] array = new int[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readInt();\n }\n return array;\n }\n\n public static long[] readLongArray(InputReader in, int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readLong();\n }\n return array;\n }\n\n public static List<Integer> readIntegerList(InputReader in, int size) {\n List<Integer> set = new ArrayList<>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }\n\n public static Set<Integer> readIntegerSet(InputReader in, int size) {\n Set<Integer> set = new HashSet<Integer>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }\n }\n}",
"import java.io.BufferedWriter;",
"BufferedWriter",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.OutputStream;",
"OutputStream",
"java.io",
"import java.io.OutputStreamWriter;",
"OutputStreamWriter",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.io.Writer;",
"Writer",
"java.io",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.HashSet;",
"HashSet",
"java.util",
"import java.util.InputMismatchException;",
"InputMismatchException",
"java.util",
"import java.util.List;",
"List",
"java.util",
"import java.util.Set;",
"Set",
"java.util",
"public class Main {\n\n public void solve() {\n InputReader in = new InputReader(System.in);\n OutputWriter out = new OutputWriter(System.out);\n int n = in.readInt(), k = in.readInt();\n int ai[] = IOUtils.readIntegerArray(in,n );\n Arrays.sort(ai);\n\n long sum = 0;\n for (int i = 0; i < k; i++) {\n sum+=ai[i];\n }\n out.printLine(sum);\n out.flush();\n }\n\n public static void main(String[] args) {\n Main solver = new Main();\n solver.solve();\n }\n\n static class InputReader {\n\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if ( numChars == -1 )\n throw new InputMismatchException();\n if ( curChar >= numChars ) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if ( numChars <= 0 )\n return -1;\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long readLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if ( filter != null )\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public String next() {\n return readString();\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }\n\n static class OutputWriter {\n private final PrintWriter writer;\n\n public OutputWriter(OutputStream outputStream) {\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }\n\n public OutputWriter(Writer writer) {\n this.writer = new PrintWriter(writer);\n }\n\n public void print(Object... objects) {\n for (int i = 0; i < objects.length; i++) {\n if ( i != 0 )\n writer.print(' ');\n writer.print(objects[i]);\n }\n }\n\n public void printLine(Object... objects) {\n print(objects);\n writer.println();\n }\n\n public void close() {\n writer.close();\n }\n\n public void flush() {\n writer.flush();\n }\n\n }\n\n static class IOUtils {\n\n public static int[] readIntegerArray(InputReader in, int size) {\n int[] array = new int[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readInt();\n }\n return array;\n }\n\n public static long[] readLongArray(InputReader in, int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readLong();\n }\n return array;\n }\n\n public static List<Integer> readIntegerList(InputReader in, int size) {\n List<Integer> set = new ArrayList<>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }\n\n public static Set<Integer> readIntegerSet(InputReader in, int size) {\n Set<Integer> set = new HashSet<Integer>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }\n }\n}",
"Main",
"public void solve() {\n InputReader in = new InputReader(System.in);\n OutputWriter out = new OutputWriter(System.out);\n int n = in.readInt(), k = in.readInt();\n int ai[] = IOUtils.readIntegerArray(in,n );\n Arrays.sort(ai);\n\n long sum = 0;\n for (int i = 0; i < k; i++) {\n sum+=ai[i];\n }\n out.printLine(sum);\n out.flush();\n }",
"solve",
"{\n InputReader in = new InputReader(System.in);\n OutputWriter out = new OutputWriter(System.out);\n int n = in.readInt(), k = in.readInt();\n int ai[] = IOUtils.readIntegerArray(in,n );\n Arrays.sort(ai);\n\n long sum = 0;\n for (int i = 0; i < k; i++) {\n sum+=ai[i];\n }\n out.printLine(sum);\n out.flush();\n }",
"InputReader in = new InputReader(System.in);",
"in",
"new InputReader(System.in)",
"OutputWriter out = new OutputWriter(System.out);",
"out",
"new OutputWriter(System.out)",
"int n = in.readInt()",
"n",
"in.readInt()",
"in.readInt",
"in",
"k = in.readInt();",
"k",
"in.readInt()",
"in.readInt",
"in",
"int ai[] = IOUtils.readIntegerArray(in,n );",
"ai",
"IOUtils.readIntegerArray(in,n )",
"IOUtils.readIntegerArray",
"IOUtils",
"in",
"n",
"Arrays.sort(ai)",
"Arrays.sort",
"Arrays",
"ai",
"long sum = 0;",
"sum",
"0",
"for (int i = 0; i < k; i++) {\n sum+=ai[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n sum+=ai[i];\n }",
"{\n sum+=ai[i];\n }",
"sum+=ai[i]",
"sum",
"ai[i]",
"ai",
"i",
"out.printLine(sum)",
"out.printLine",
"out",
"sum",
"out.flush()",
"out.flush",
"out",
"public static void main(String[] args) {\n Main solver = new Main();\n solver.solve();\n }",
"main",
"{\n Main solver = new Main();\n solver.solve();\n }",
"Main solver = new Main();",
"solver",
"new Main()",
"solver.solve()",
"solver.solve",
"solver",
"String[] args",
"args",
"static class InputReader {\n\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if ( numChars == -1 )\n throw new InputMismatchException();\n if ( curChar >= numChars ) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if ( numChars <= 0 )\n return -1;\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long readLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if ( filter != null )\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public String next() {\n return readString();\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }",
"InputReader",
"private InputStream stream;",
"stream",
"private byte[] buf = new byte[1024];",
"buf",
"new byte[1024]",
"1024",
"private int curChar;",
"curChar",
"private int numChars;",
"numChars",
"private SpaceCharFilter filter;",
"filter",
"public InputReader(InputStream stream) {\n this.stream = stream;\n }",
"InputReader",
"{\n this.stream = stream;\n }",
"this.stream = stream",
"this.stream",
"this",
"this.stream",
"stream",
"InputStream stream",
"stream",
"public int read() {\n if ( numChars == -1 )\n throw new InputMismatchException();\n if ( curChar >= numChars ) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if ( numChars <= 0 )\n return -1;\n }\n return buf[curChar++];\n }",
"read",
"{\n if ( numChars == -1 )\n throw new InputMismatchException();\n if ( curChar >= numChars ) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if ( numChars <= 0 )\n return -1;\n }\n return buf[curChar++];\n }",
"if ( numChars == -1 )\n throw new InputMismatchException();",
"numChars == -1",
"numChars",
"-1",
"1",
"throw new InputMismatchException();",
"new InputMismatchException()",
"if ( curChar >= numChars ) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if ( numChars <= 0 )\n return -1;\n }",
"curChar >= numChars",
"curChar",
"numChars",
"{\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if ( numChars <= 0 )\n return -1;\n }",
"curChar = 0",
"curChar",
"0",
"try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }",
"catch (IOException e) {\n throw new InputMismatchException();\n }",
"IOException e",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n numChars = stream.read(buf);\n }",
"numChars = stream.read(buf)",
"numChars",
"stream.read(buf)",
"stream.read",
"stream",
"buf",
"if ( numChars <= 0 )\n return -1;",
"numChars <= 0",
"numChars",
"0",
"return -1;",
"-1",
"1",
"return buf[curChar++];",
"buf[curChar++]",
"buf",
"curChar++",
"curChar",
"public int readInt() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"readInt",
"{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c))\n c = read();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = read()",
"c",
"read()",
"read",
"int sgn = 1;",
"sgn",
"1",
"if ( c == '-' ) {\n sgn = -1;\n c = read();\n }",
"c == '-'",
"c",
"'-'",
"{\n sgn = -1;\n c = read();\n }",
"sgn = -1",
"sgn",
"-1",
"1",
"c = read()",
"c",
"read()",
"read",
"int res = 0;",
"res",
"0",
"do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }",
"if ( c < '0' || c > '9' )\n throw new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"c = read()",
"c",
"read()",
"read",
"return res * sgn;",
"res * sgn",
"res",
"sgn",
"public long readLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"readLong",
"{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c))\n c = read();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = read()",
"c",
"read()",
"read",
"int sgn = 1;",
"sgn",
"1",
"if ( c == '-' ) {\n sgn = -1;\n c = read();\n }",
"c == '-'",
"c",
"'-'",
"{\n sgn = -1;\n c = read();\n }",
"sgn = -1",
"sgn",
"-1",
"1",
"c = read()",
"c",
"read()",
"read",
"long res = 0;",
"res",
"0",
"do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n }",
"if ( c < '0' || c > '9' )\n throw new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"c = read()",
"c",
"read()",
"read",
"return res * sgn;",
"res * sgn",
"res",
"sgn",
"public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }",
"readString",
"{\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }",
"int c = read();",
"c",
"read()",
"read",
"while (isSpaceChar(c))\n c = read();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = read()",
"c",
"read()",
"read",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n res.appendCodePoint(c);\n c = read();\n }",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = read()",
"c",
"read()",
"read",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"public boolean isSpaceChar(int c) {\n if ( filter != null )\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"isSpaceChar",
"{\n if ( filter != null )\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"if ( filter != null )\n return filter.isSpaceChar(c);",
"filter != null",
"filter",
"null",
"return filter.isSpaceChar(c);",
"filter.isSpaceChar(c)",
"filter.isSpaceChar",
"filter",
"c",
"return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == '\\t'",
"c == '\\r'",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == ' '",
"c",
"' '",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == '\\t'",
"c",
"'\\t'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"public String next() {\n return readString();\n }",
"next",
"{\n return readString();\n }",
"return readString();",
"readString()",
"readString",
"public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }",
"SpaceCharFilter",
"public boolean isSpaceChar(int ch);",
"isSpaceChar",
"int ch",
"ch",
"static class OutputWriter {\n private final PrintWriter writer;\n\n public OutputWriter(OutputStream outputStream) {\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }\n\n public OutputWriter(Writer writer) {\n this.writer = new PrintWriter(writer);\n }\n\n public void print(Object... objects) {\n for (int i = 0; i < objects.length; i++) {\n if ( i != 0 )\n writer.print(' ');\n writer.print(objects[i]);\n }\n }\n\n public void printLine(Object... objects) {\n print(objects);\n writer.println();\n }\n\n public void close() {\n writer.close();\n }\n\n public void flush() {\n writer.flush();\n }\n\n }",
"OutputWriter",
"private final PrintWriter writer;",
"writer",
"public OutputWriter(OutputStream outputStream) {\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }",
"OutputWriter",
"{\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }",
"writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)))",
"writer",
"new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)))",
"OutputStream outputStream",
"outputStream",
"public OutputWriter(Writer writer) {\n this.writer = new PrintWriter(writer);\n }",
"OutputWriter",
"{\n this.writer = new PrintWriter(writer);\n }",
"this.writer = new PrintWriter(writer)",
"this.writer",
"this",
"this.writer",
"new PrintWriter(writer)",
"Writer writer",
"writer",
"public void print(Object... objects) {\n for (int i = 0; i < objects.length; i++) {\n if ( i != 0 )\n writer.print(' ');\n writer.print(objects[i]);\n }\n }",
"print",
"{\n for (int i = 0; i < objects.length; i++) {\n if ( i != 0 )\n writer.print(' ');\n writer.print(objects[i]);\n }\n }",
"for (int i = 0; i < objects.length; i++) {\n if ( i != 0 )\n writer.print(' ');\n writer.print(objects[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < objects.length",
"i",
"objects.length",
"objects",
"objects.length",
"i++",
"i++",
"i",
"{\n if ( i != 0 )\n writer.print(' ');\n writer.print(objects[i]);\n }",
"{\n if ( i != 0 )\n writer.print(' ');\n writer.print(objects[i]);\n }",
"if ( i != 0 )\n writer.print(' ');",
"i != 0",
"i",
"0",
"writer.print(' ')",
"writer.print",
"writer",
"' '",
"writer.print(objects[i])",
"writer.print",
"writer",
"objects[i]",
"objects",
"i",
"Object... objects",
"objects",
"public void printLine(Object... objects) {\n print(objects);\n writer.println();\n }",
"printLine",
"{\n print(objects);\n writer.println();\n }",
"print(objects)",
"print",
"objects",
"writer.println()",
"writer.println",
"writer",
"Object... objects",
"objects",
"public void close() {\n writer.close();\n }",
"close",
"{\n writer.close();\n }",
"writer.close()",
"writer.close",
"writer",
"public void flush() {\n writer.flush();\n }",
"flush",
"{\n writer.flush();\n }",
"writer.flush()",
"writer.flush",
"writer",
"static class IOUtils {\n\n public static int[] readIntegerArray(InputReader in, int size) {\n int[] array = new int[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readInt();\n }\n return array;\n }\n\n public static long[] readLongArray(InputReader in, int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readLong();\n }\n return array;\n }\n\n public static List<Integer> readIntegerList(InputReader in, int size) {\n List<Integer> set = new ArrayList<>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }\n\n public static Set<Integer> readIntegerSet(InputReader in, int size) {\n Set<Integer> set = new HashSet<Integer>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }\n }",
"IOUtils",
"public static int[] readIntegerArray(InputReader in, int size) {\n int[] array = new int[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readInt();\n }\n return array;\n }",
"readIntegerArray",
"{\n int[] array = new int[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readInt();\n }\n return array;\n }",
"int[] array = new int[size];",
"array",
"new int[size]",
"size",
"for (int i = 0; i < size; i++) {\n array[i] = in.readInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < size",
"i",
"size",
"i++",
"i++",
"i",
"{\n array[i] = in.readInt();\n }",
"{\n array[i] = in.readInt();\n }",
"array[i] = in.readInt()",
"array[i]",
"array",
"i",
"in.readInt()",
"in.readInt",
"in",
"return array;",
"array",
"InputReader in",
"in",
"int size",
"size",
"public static long[] readLongArray(InputReader in, int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readLong();\n }\n return array;\n }",
"readLongArray",
"{\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readLong();\n }\n return array;\n }",
"long[] array = new long[size];",
"array",
"new long[size]",
"size",
"for (int i = 0; i < size; i++) {\n array[i] = in.readLong();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < size",
"i",
"size",
"i++",
"i++",
"i",
"{\n array[i] = in.readLong();\n }",
"{\n array[i] = in.readLong();\n }",
"array[i] = in.readLong()",
"array[i]",
"array",
"i",
"in.readLong()",
"in.readLong",
"in",
"return array;",
"array",
"InputReader in",
"in",
"int size",
"size",
"public static List<Integer> readIntegerList(InputReader in, int size) {\n List<Integer> set = new ArrayList<>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }",
"readIntegerList",
"{\n List<Integer> set = new ArrayList<>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }",
"List<Integer> set = new ArrayList<>();",
"set",
"new ArrayList<>()",
"for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < size",
"i",
"size",
"i++",
"i++",
"i",
"{\n set.add(in.readInt());\n }",
"{\n set.add(in.readInt());\n }",
"set.add(in.readInt())",
"set.add",
"set",
"in.readInt()",
"in.readInt",
"in",
"return set;",
"set",
"InputReader in",
"in",
"int size",
"size",
"public static Set<Integer> readIntegerSet(InputReader in, int size) {\n Set<Integer> set = new HashSet<Integer>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }",
"readIntegerSet",
"{\n Set<Integer> set = new HashSet<Integer>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }",
"Set<Integer> set = new HashSet<Integer>();",
"set",
"new HashSet<Integer>()",
"for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < size",
"i",
"size",
"i++",
"i++",
"i",
"{\n set.add(in.readInt());\n }",
"{\n set.add(in.readInt());\n }",
"set.add(in.readInt())",
"set.add",
"set",
"in.readInt()",
"in.readInt",
"in",
"return set;",
"set",
"InputReader in",
"in",
"int size",
"size",
"public class Main {\n\n public void solve() {\n InputReader in = new InputReader(System.in);\n OutputWriter out = new OutputWriter(System.out);\n int n = in.readInt(), k = in.readInt();\n int ai[] = IOUtils.readIntegerArray(in,n );\n Arrays.sort(ai);\n\n long sum = 0;\n for (int i = 0; i < k; i++) {\n sum+=ai[i];\n }\n out.printLine(sum);\n out.flush();\n }\n\n public static void main(String[] args) {\n Main solver = new Main();\n solver.solve();\n }\n\n static class InputReader {\n\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if ( numChars == -1 )\n throw new InputMismatchException();\n if ( curChar >= numChars ) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if ( numChars <= 0 )\n return -1;\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long readLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if ( filter != null )\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public String next() {\n return readString();\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }\n\n static class OutputWriter {\n private final PrintWriter writer;\n\n public OutputWriter(OutputStream outputStream) {\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }\n\n public OutputWriter(Writer writer) {\n this.writer = new PrintWriter(writer);\n }\n\n public void print(Object... objects) {\n for (int i = 0; i < objects.length; i++) {\n if ( i != 0 )\n writer.print(' ');\n writer.print(objects[i]);\n }\n }\n\n public void printLine(Object... objects) {\n print(objects);\n writer.println();\n }\n\n public void close() {\n writer.close();\n }\n\n public void flush() {\n writer.flush();\n }\n\n }\n\n static class IOUtils {\n\n public static int[] readIntegerArray(InputReader in, int size) {\n int[] array = new int[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readInt();\n }\n return array;\n }\n\n public static long[] readLongArray(InputReader in, int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readLong();\n }\n return array;\n }\n\n public static List<Integer> readIntegerList(InputReader in, int size) {\n List<Integer> set = new ArrayList<>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }\n\n public static Set<Integer> readIntegerSet(InputReader in, int size) {\n Set<Integer> set = new HashSet<Integer>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }\n }\n}",
"public class Main {\n\n public void solve() {\n InputReader in = new InputReader(System.in);\n OutputWriter out = new OutputWriter(System.out);\n int n = in.readInt(), k = in.readInt();\n int ai[] = IOUtils.readIntegerArray(in,n );\n Arrays.sort(ai);\n\n long sum = 0;\n for (int i = 0; i < k; i++) {\n sum+=ai[i];\n }\n out.printLine(sum);\n out.flush();\n }\n\n public static void main(String[] args) {\n Main solver = new Main();\n solver.solve();\n }\n\n static class InputReader {\n\n private InputStream stream;\n private byte[] buf = new byte[1024];\n private int curChar;\n private int numChars;\n private SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int read() {\n if ( numChars == -1 )\n throw new InputMismatchException();\n if ( curChar >= numChars ) {\n curChar = 0;\n try {\n numChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if ( numChars <= 0 )\n return -1;\n }\n return buf[curChar++];\n }\n\n public int readInt() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n int res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long readLong() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n int sgn = 1;\n if ( c == '-' ) {\n sgn = -1;\n c = read();\n }\n long res = 0;\n do {\n if ( c < '0' || c > '9' )\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = read();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public String readString() {\n int c = read();\n while (isSpaceChar(c))\n c = read();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = read();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if ( filter != null )\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n public String next() {\n return readString();\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n }\n\n static class OutputWriter {\n private final PrintWriter writer;\n\n public OutputWriter(OutputStream outputStream) {\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n }\n\n public OutputWriter(Writer writer) {\n this.writer = new PrintWriter(writer);\n }\n\n public void print(Object... objects) {\n for (int i = 0; i < objects.length; i++) {\n if ( i != 0 )\n writer.print(' ');\n writer.print(objects[i]);\n }\n }\n\n public void printLine(Object... objects) {\n print(objects);\n writer.println();\n }\n\n public void close() {\n writer.close();\n }\n\n public void flush() {\n writer.flush();\n }\n\n }\n\n static class IOUtils {\n\n public static int[] readIntegerArray(InputReader in, int size) {\n int[] array = new int[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readInt();\n }\n return array;\n }\n\n public static long[] readLongArray(InputReader in, int size) {\n long[] array = new long[size];\n for (int i = 0; i < size; i++) {\n array[i] = in.readLong();\n }\n return array;\n }\n\n public static List<Integer> readIntegerList(InputReader in, int size) {\n List<Integer> set = new ArrayList<>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }\n\n public static Set<Integer> readIntegerSet(InputReader in, int size) {\n Set<Integer> set = new HashSet<Integer>();\n for (int i = 0; i < size; i++) {\n set.add(in.readInt());\n }\n return set;\n }\n }\n}",
"Main"
]
| import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.List;
import java.util.Set;
public class Main {
public void solve() {
InputReader in = new InputReader(System.in);
OutputWriter out = new OutputWriter(System.out);
int n = in.readInt(), k = in.readInt();
int ai[] = IOUtils.readIntegerArray(in,n );
Arrays.sort(ai);
long sum = 0;
for (int i = 0; i < k; i++) {
sum+=ai[i];
}
out.printLine(sum);
out.flush();
}
public static void main(String[] args) {
Main solver = new Main();
solver.solve();
}
static class InputReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
private SpaceCharFilter filter;
public InputReader(InputStream stream) {
this.stream = stream;
}
public int read() {
if ( numChars == -1 )
throw new InputMismatchException();
if ( curChar >= numChars ) {
curChar = 0;
try {
numChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if ( numChars <= 0 )
return -1;
}
return buf[curChar++];
}
public int readInt() {
int c = read();
while (isSpaceChar(c))
c = read();
int sgn = 1;
if ( c == '-' ) {
sgn = -1;
c = read();
}
int res = 0;
do {
if ( c < '0' || c > '9' )
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
public long readLong() {
int c = read();
while (isSpaceChar(c))
c = read();
int sgn = 1;
if ( c == '-' ) {
sgn = -1;
c = read();
}
long res = 0;
do {
if ( c < '0' || c > '9' )
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
public String readString() {
int c = read();
while (isSpaceChar(c))
c = read();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isSpaceChar(c));
return res.toString();
}
public boolean isSpaceChar(int c) {
if ( filter != null )
return filter.isSpaceChar(c);
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
public String next() {
return readString();
}
public interface SpaceCharFilter {
public boolean isSpaceChar(int ch);
}
}
static class OutputWriter {
private final PrintWriter writer;
public OutputWriter(OutputStream outputStream) {
writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
}
public OutputWriter(Writer writer) {
this.writer = new PrintWriter(writer);
}
public void print(Object... objects) {
for (int i = 0; i < objects.length; i++) {
if ( i != 0 )
writer.print(' ');
writer.print(objects[i]);
}
}
public void printLine(Object... objects) {
print(objects);
writer.println();
}
public void close() {
writer.close();
}
public void flush() {
writer.flush();
}
}
static class IOUtils {
public static int[] readIntegerArray(InputReader in, int size) {
int[] array = new int[size];
for (int i = 0; i < size; i++) {
array[i] = in.readInt();
}
return array;
}
public static long[] readLongArray(InputReader in, int size) {
long[] array = new long[size];
for (int i = 0; i < size; i++) {
array[i] = in.readLong();
}
return array;
}
public static List<Integer> readIntegerList(InputReader in, int size) {
List<Integer> set = new ArrayList<>();
for (int i = 0; i < size; i++) {
set.add(in.readInt());
}
return set;
}
public static Set<Integer> readIntegerSet(InputReader in, int size) {
Set<Integer> set = new HashSet<Integer>();
for (int i = 0; i < size; i++) {
set.add(in.readInt());
}
return set;
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
4,
13,
14,
2,
13,
17,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
17,
41,
13,
17,
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,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
29,
13,
6,
13,
12,
13,
30,
41,
13,
20,
11,
1,
41,
13,
17,
2,
2,
13,
13,
13,
1,
40,
13,
30,
30,
14,
2,
2,
13,
13,
17,
30,
4,
18,
13,
13,
14,
2,
2,
13,
13,
13,
4,
18,
13,
2,
13,
13,
4,
18,
13,
13,
29,
13,
23,
13,
6,
13,
12,
13,
30,
29,
4,
18,
13,
13,
23,
13,
12,
13,
30,
29,
2,
17,
2,
13,
2,
17,
13,
23,
13,
23,
13,
12,
13,
30,
29,
0,
13,
2,
17,
13,
23,
13,
23,
13,
12,
13,
30,
29,
0,
13,
40,
2,
17,
13,
23,
13,
23,
13,
12,
13,
30,
29,
8,
4,
13,
13,
13,
4,
13,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
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
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
243,
14
],
[
243,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
17,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
22,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
28,
30
],
[
26,
31
],
[
15,
32
],
[
32,
33
],
[
243,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
38,
42
],
[
42,
43
],
[
42,
44
],
[
38,
45
],
[
45,
46
],
[
45,
47
],
[
38,
48
],
[
48,
49
],
[
48,
50
],
[
50,
51
],
[
51,
52
],
[
38,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
38,
58
],
[
58,
59
],
[
58,
60
],
[
38,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
77,
78
],
[
78,
79
],
[
38,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
38,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
89,
90
],
[
89,
91
],
[
84,
92
],
[
92,
93
],
[
93,
94
],
[
84,
95
],
[
96,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
38,
103
],
[
103,
104
],
[
0,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
110,
111
],
[
110,
112
],
[
109,
113
],
[
113,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
113,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
118,
122
],
[
113,
123
],
[
123,
124
],
[
124,
125
],
[
113,
126
],
[
127,
127
],
[
127,
128
],
[
128,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
129,
133
],
[
128,
134
],
[
134,
135
],
[
135,
136
],
[
136,
137
],
[
135,
138
],
[
134,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
139,
145
],
[
145,
146
],
[
146,
147
],
[
145,
148
],
[
148,
149
],
[
148,
150
],
[
109,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
109,
155
],
[
155,
156
],
[
107,
157
],
[
157,
158
],
[
0,
159
],
[
159,
160
],
[
159,
161
],
[
161,
162
],
[
161,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
165,
168
],
[
161,
169
],
[
169,
170
],
[
159,
171
],
[
171,
172
],
[
171,
173
],
[
173,
174
],
[
174,
175
],
[
175,
176
],
[
175,
177
],
[
177,
178
],
[
177,
179
],
[
179,
180
],
[
179,
181
],
[
171,
182
],
[
182,
183
],
[
171,
184
],
[
184,
185
],
[
159,
186
],
[
186,
187
],
[
186,
188
],
[
188,
189
],
[
189,
190
],
[
190,
191
],
[
190,
192
],
[
192,
193
],
[
192,
194
],
[
186,
195
],
[
195,
196
],
[
186,
197
],
[
197,
198
],
[
159,
199
],
[
199,
200
],
[
199,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
203,
205
],
[
205,
206
],
[
206,
207
],
[
206,
208
],
[
199,
209
],
[
209,
210
],
[
199,
211
],
[
211,
212
],
[
159,
213
],
[
213,
214
],
[
213,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
218,
219
],
[
218,
220
],
[
218,
221
],
[
217,
222
],
[
222,
223
],
[
222,
224
],
[
222,
225
],
[
217,
226
],
[
226,
227
],
[
226,
228
],
[
226,
229
],
[
213,
230
],
[
230,
231
],
[
213,
232
],
[
232,
233
],
[
159,
234
],
[
234,
235
],
[
234,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
234,
240
],
[
240,
241
],
[
0,
242
],
[
242,
243
],
[
242,
244
]
]
| [
"import java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Collections;\n\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args) {\n Object o = run();\n if (o != null)\n System.out.println(o);\n }\n\n static Object run() {\n try (Scanner sc = new Scanner(System.in)) {\n long resultNum = 0;\n String resultStr = \"\";\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> p = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n p.add(sc.nextInt());\n }\n Collections.sort(p);\n for (int i = 0; i < k; i++) {\n resultNum += p.get(i);\n }\n return resultNum;\n }\n }\n}\n\nclass ChenNumberUtil {\n static Collection<Integer> getDivisors(int n) {\n ArrayList<Integer> al = new ArrayList<>();\n for (int i = 1; i * i <= n; i++) {\n if (n % i == 0) {\n al.add(i);\n if (n / i != i)\n al.add(n / i);\n }\n }\n Collections.sort(al);\n return al;\n }\n}\n\nclass ChenBitUtil {\n static int popCount(int bit) {\n return Integer.bitCount(bit);\n }\n\n static boolean isFlag(int bit, int i) {\n return 0 != (bit & (1 << i));\n }\n\n static int setTrue(int bit, int i) {\n return bit |= (1 << i);\n }\n\n static int setFalse(int bit, int i) {\n return bit &= ~(1 << i);\n }\n\n static int setReverse(int bit, int i) {\n return isFlag(bit, i) ? setFalse(bit, i) : setTrue(bit, i);\n }\n\n static int reverseAll(int bit) {\n return ~bit;\n }\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collection;",
"Collection",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args) {\n Object o = run();\n if (o != null)\n System.out.println(o);\n }\n\n static Object run() {\n try (Scanner sc = new Scanner(System.in)) {\n long resultNum = 0;\n String resultStr = \"\";\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> p = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n p.add(sc.nextInt());\n }\n Collections.sort(p);\n for (int i = 0; i < k; i++) {\n resultNum += p.get(i);\n }\n return resultNum;\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n Object o = run();\n if (o != null)\n System.out.println(o);\n }",
"main",
"{\n Object o = run();\n if (o != null)\n System.out.println(o);\n }",
"Object o = run();",
"o",
"run()",
"run",
"if (o != null)\n System.out.println(o);",
"o != null",
"o",
"null",
"System.out.println(o)",
"System.out.println",
"System.out",
"System",
"System.out",
"o",
"String[] args",
"args",
"static Object run() {\n try (Scanner sc = new Scanner(System.in)) {\n long resultNum = 0;\n String resultStr = \"\";\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> p = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n p.add(sc.nextInt());\n }\n Collections.sort(p);\n for (int i = 0; i < k; i++) {\n resultNum += p.get(i);\n }\n return resultNum;\n }\n }",
"run",
"{\n try (Scanner sc = new Scanner(System.in)) {\n long resultNum = 0;\n String resultStr = \"\";\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> p = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n p.add(sc.nextInt());\n }\n Collections.sort(p);\n for (int i = 0; i < k; i++) {\n resultNum += p.get(i);\n }\n return resultNum;\n }\n }",
"try (Scanner sc = new Scanner(System.in)) {\n long resultNum = 0;\n String resultStr = \"\";\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> p = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n p.add(sc.nextInt());\n }\n Collections.sort(p);\n for (int i = 0; i < k; i++) {\n resultNum += p.get(i);\n }\n return resultNum;\n }",
"{\n long resultNum = 0;\n String resultStr = \"\";\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> p = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n p.add(sc.nextInt());\n }\n Collections.sort(p);\n for (int i = 0; i < k; i++) {\n resultNum += p.get(i);\n }\n return resultNum;\n }",
"Scanner sc = new Scanner(System.in)",
"Scanner sc = new Scanner(System.in)",
"new Scanner(System.in)",
"long resultNum = 0;",
"resultNum",
"0",
"String resultStr = \"\";",
"resultStr",
"\"\"",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ArrayList<Integer> p = new ArrayList<>();",
"p",
"new ArrayList<>()",
"for (int i = 0; i < n; i++) {\n p.add(sc.nextInt());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n p.add(sc.nextInt());\n }",
"{\n p.add(sc.nextInt());\n }",
"p.add(sc.nextInt())",
"p.add",
"p",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Collections.sort(p)",
"Collections.sort",
"Collections",
"p",
"for (int i = 0; i < k; i++) {\n resultNum += p.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n resultNum += p.get(i);\n }",
"{\n resultNum += p.get(i);\n }",
"resultNum += p.get(i)",
"resultNum",
"p.get(i)",
"p.get",
"p",
"i",
"return resultNum;",
"resultNum",
"class ChenNumberUtil {\n static Collection<Integer> getDivisors(int n) {\n ArrayList<Integer> al = new ArrayList<>();\n for (int i = 1; i * i <= n; i++) {\n if (n % i == 0) {\n al.add(i);\n if (n / i != i)\n al.add(n / i);\n }\n }\n Collections.sort(al);\n return al;\n }\n}",
"ChenNumberUtil",
"static Collection<Integer> getDivisors(int n) {\n ArrayList<Integer> al = new ArrayList<>();\n for (int i = 1; i * i <= n; i++) {\n if (n % i == 0) {\n al.add(i);\n if (n / i != i)\n al.add(n / i);\n }\n }\n Collections.sort(al);\n return al;\n }",
"getDivisors",
"{\n ArrayList<Integer> al = new ArrayList<>();\n for (int i = 1; i * i <= n; i++) {\n if (n % i == 0) {\n al.add(i);\n if (n / i != i)\n al.add(n / i);\n }\n }\n Collections.sort(al);\n return al;\n }",
"ArrayList<Integer> al = new ArrayList<>();",
"al",
"new ArrayList<>()",
"for (int i = 1; i * i <= n; i++) {\n if (n % i == 0) {\n al.add(i);\n if (n / i != i)\n al.add(n / i);\n }\n }",
"int i = 1;",
"int i = 1;",
"i",
"1",
"i * i <= n",
"i * i",
"i",
"i",
"n",
"i++",
"i++",
"i",
"{\n if (n % i == 0) {\n al.add(i);\n if (n / i != i)\n al.add(n / i);\n }\n }",
"{\n if (n % i == 0) {\n al.add(i);\n if (n / i != i)\n al.add(n / i);\n }\n }",
"if (n % i == 0) {\n al.add(i);\n if (n / i != i)\n al.add(n / i);\n }",
"n % i == 0",
"n % i",
"n",
"i",
"0",
"{\n al.add(i);\n if (n / i != i)\n al.add(n / i);\n }",
"al.add(i)",
"al.add",
"al",
"i",
"if (n / i != i)\n al.add(n / i);",
"n / i != i",
"n / i",
"n",
"i",
"i",
"al.add(n / i)",
"al.add",
"al",
"n / i",
"n",
"i",
"Collections.sort(al)",
"Collections.sort",
"Collections",
"al",
"return al;",
"al",
"int n",
"n",
"class ChenBitUtil {\n static int popCount(int bit) {\n return Integer.bitCount(bit);\n }\n\n static boolean isFlag(int bit, int i) {\n return 0 != (bit & (1 << i));\n }\n\n static int setTrue(int bit, int i) {\n return bit |= (1 << i);\n }\n\n static int setFalse(int bit, int i) {\n return bit &= ~(1 << i);\n }\n\n static int setReverse(int bit, int i) {\n return isFlag(bit, i) ? setFalse(bit, i) : setTrue(bit, i);\n }\n\n static int reverseAll(int bit) {\n return ~bit;\n }\n}",
"ChenBitUtil",
"static int popCount(int bit) {\n return Integer.bitCount(bit);\n }",
"popCount",
"{\n return Integer.bitCount(bit);\n }",
"return Integer.bitCount(bit);",
"Integer.bitCount(bit)",
"Integer.bitCount",
"Integer",
"bit",
"int bit",
"bit",
"static boolean isFlag(int bit, int i) {\n return 0 != (bit & (1 << i));\n }",
"isFlag",
"{\n return 0 != (bit & (1 << i));\n }",
"return 0 != (bit & (1 << i));",
"0 != (bit & (1 << i))",
"0",
"(bit & (1 << i))",
"bit",
"(1 << i)",
"1",
"i",
"int bit",
"bit",
"int i",
"i",
"static int setTrue(int bit, int i) {\n return bit |= (1 << i);\n }",
"setTrue",
"{\n return bit |= (1 << i);\n }",
"return bit |= (1 << i);",
"bit |= (1 << i)",
"bit",
"(1 << i)",
"1",
"i",
"int bit",
"bit",
"int i",
"i",
"static int setFalse(int bit, int i) {\n return bit &= ~(1 << i);\n }",
"setFalse",
"{\n return bit &= ~(1 << i);\n }",
"return bit &= ~(1 << i);",
"bit &= ~(1 << i)",
"bit",
"~(1 << i)",
"(1 << i)",
"1",
"i",
"int bit",
"bit",
"int i",
"i",
"static int setReverse(int bit, int i) {\n return isFlag(bit, i) ? setFalse(bit, i) : setTrue(bit, i);\n }",
"setReverse",
"{\n return isFlag(bit, i) ? setFalse(bit, i) : setTrue(bit, i);\n }",
"return isFlag(bit, i) ? setFalse(bit, i) : setTrue(bit, i);",
"isFlag(bit, i) ? setFalse(bit, i) : setTrue(bit, i)",
"isFlag(bit, i)",
"isFlag",
"bit",
"i",
"setFalse(bit, i)",
"setFalse",
"bit",
"i",
"setTrue(bit, i)",
"setTrue",
"bit",
"i",
"int bit",
"bit",
"int i",
"i",
"static int reverseAll(int bit) {\n return ~bit;\n }",
"reverseAll",
"{\n return ~bit;\n }",
"return ~bit;",
"~bit",
"bit",
"int bit",
"bit",
"public class Main {\n public static void main(String[] args) {\n Object o = run();\n if (o != null)\n System.out.println(o);\n }\n\n static Object run() {\n try (Scanner sc = new Scanner(System.in)) {\n long resultNum = 0;\n String resultStr = \"\";\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> p = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n p.add(sc.nextInt());\n }\n Collections.sort(p);\n for (int i = 0; i < k; i++) {\n resultNum += p.get(i);\n }\n return resultNum;\n }\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Object o = run();\n if (o != null)\n System.out.println(o);\n }\n\n static Object run() {\n try (Scanner sc = new Scanner(System.in)) {\n long resultNum = 0;\n String resultStr = \"\";\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> p = new ArrayList<>();\n for (int i = 0; i < n; i++) {\n p.add(sc.nextInt());\n }\n Collections.sort(p);\n for (int i = 0; i < k; i++) {\n resultNum += p.get(i);\n }\n return resultNum;\n }\n }\n}",
"Main"
]
| import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Object o = run();
if (o != null)
System.out.println(o);
}
static Object run() {
try (Scanner sc = new Scanner(System.in)) {
long resultNum = 0;
String resultStr = "";
int n = sc.nextInt();
int k = sc.nextInt();
ArrayList<Integer> p = new ArrayList<>();
for (int i = 0; i < n; i++) {
p.add(sc.nextInt());
}
Collections.sort(p);
for (int i = 0; i < k; i++) {
resultNum += p.get(i);
}
return resultNum;
}
}
}
class ChenNumberUtil {
static Collection<Integer> getDivisors(int n) {
ArrayList<Integer> al = new ArrayList<>();
for (int i = 1; i * i <= n; i++) {
if (n % i == 0) {
al.add(i);
if (n / i != i)
al.add(n / i);
}
}
Collections.sort(al);
return al;
}
}
class ChenBitUtil {
static int popCount(int bit) {
return Integer.bitCount(bit);
}
static boolean isFlag(int bit, int i) {
return 0 != (bit & (1 << i));
}
static int setTrue(int bit, int i) {
return bit |= (1 << i);
}
static int setFalse(int bit, int i) {
return bit &= ~(1 << i);
}
static int setReverse(int bit, int i) {
return isFlag(bit, i) ? setFalse(bit, i) : setTrue(bit, i);
}
static int reverseAll(int bit) {
return ~bit;
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
86,
8
],
[
86,
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
],
[
28,
30
],
[
11,
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
],
[
11,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
11,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
11,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
11,
80
],
[
80,
81
],
[
81,
82
],
[
9,
83
],
[
83,
84
],
[
0,
85
],
[
85,
86
],
[
85,
87
]
]
| [
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main{\n\tpublic static void main(String[] args)throws Exception {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a = scan.nextInt();\n\t\tint b = scan.nextInt();\n\t\tint sum = 0;\n\t\tint array[] = new int[a];\n\n\t\tfor(int i = 0;i < a; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tArrays.sort(array);\n\t\tfor(int i = 0;i < b;i++) {\n\t\t\tsum += array[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t\tscan.close();\n\t}\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main{\n\tpublic static void main(String[] args)throws Exception {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a = scan.nextInt();\n\t\tint b = scan.nextInt();\n\t\tint sum = 0;\n\t\tint array[] = new int[a];\n\n\t\tfor(int i = 0;i < a; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tArrays.sort(array);\n\t\tfor(int i = 0;i < b;i++) {\n\t\t\tsum += array[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t\tscan.close();\n\t}\n}",
"Main",
"public static void main(String[] args)throws Exception {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a = scan.nextInt();\n\t\tint b = scan.nextInt();\n\t\tint sum = 0;\n\t\tint array[] = new int[a];\n\n\t\tfor(int i = 0;i < a; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tArrays.sort(array);\n\t\tfor(int i = 0;i < b;i++) {\n\t\t\tsum += array[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t\tscan.close();\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a = scan.nextInt();\n\t\tint b = scan.nextInt();\n\t\tint sum = 0;\n\t\tint array[] = new int[a];\n\n\t\tfor(int i = 0;i < a; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tArrays.sort(array);\n\t\tfor(int i = 0;i < b;i++) {\n\t\t\tsum += array[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t\tscan.close();\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int a = scan.nextInt();",
"a",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int b = scan.nextInt();",
"b",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int sum = 0;",
"sum",
"0",
"int array[] = new int[a];",
"array",
"new int[a]",
"a",
"for(int i = 0;i < a; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < a",
"i",
"a",
"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",
"Arrays.sort(array)",
"Arrays.sort",
"Arrays",
"array",
"for(int i = 0;i < b;i++) {\n\t\t\tsum += array[i];\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < b",
"i",
"b",
"i++",
"i++",
"i",
"{\n\t\t\tsum += array[i];\n\t\t}",
"{\n\t\t\tsum += array[i];\n\t\t}",
"sum += array[i]",
"sum",
"array[i]",
"array",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main{\n\tpublic static void main(String[] args)throws Exception {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a = scan.nextInt();\n\t\tint b = scan.nextInt();\n\t\tint sum = 0;\n\t\tint array[] = new int[a];\n\n\t\tfor(int i = 0;i < a; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tArrays.sort(array);\n\t\tfor(int i = 0;i < b;i++) {\n\t\t\tsum += array[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t\tscan.close();\n\t}\n}",
"public class Main{\n\tpublic static void main(String[] args)throws Exception {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint a = scan.nextInt();\n\t\tint b = scan.nextInt();\n\t\tint sum = 0;\n\t\tint array[] = new int[a];\n\n\t\tfor(int i = 0;i < a; i++) {\n\t\t\tarray[i] = scan.nextInt();\n\t\t}\n\t\tArrays.sort(array);\n\t\tfor(int i = 0;i < b;i++) {\n\t\t\tsum += array[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t\tscan.close();\n\t}\n}",
"Main"
]
| import java.util.Arrays;
import java.util.Scanner;
public class Main{
public static void main(String[] args)throws Exception {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int sum = 0;
int array[] = new int[a];
for(int i = 0;i < a; i++) {
array[i] = scan.nextInt();
}
Arrays.sort(array);
for(int i = 0;i < b;i++) {
sum += array[i];
}
System.out.println(sum);
scan.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,
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,
0,
13,
4,
18,
4,
18,
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,
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
],
[
93,
11
],
[
93,
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
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
14,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
52,
59
],
[
59,
60
],
[
60,
61
],
[
14,
62
],
[
62,
63
],
[
62,
64
],
[
14,
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
],
[
78,
80
],
[
80,
81
],
[
81,
82
],
[
80,
83
],
[
14,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
86,
88
],
[
84,
89
],
[
12,
90
],
[
90,
91
],
[
0,
92
],
[
92,
93
],
[
92,
94
]
]
| [
"import java.util.*;\nimport java.util.stream.Collector;\nimport java.util.stream.Collectors;\n\npublic class Main {\n public static void main (String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int K = sc.nextInt();\n\n List<Integer> p = new ArrayList<Integer>();\n for (int i = 0; i < N; i++) {\n p.add(sc.nextInt());\n }\n\n p = p.stream().sorted().collect(Collectors.toList());\n\n int sum = 0;\n for (int i = 0; i < K; i++) {\n sum += p.get(i);\n }\n\n System.out.println(sum);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.util.stream.Collector;",
"Collector",
"java.util.stream",
"import java.util.stream.Collectors;",
"Collectors",
"java.util.stream",
"public class Main {\n public static void main (String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int K = sc.nextInt();\n\n List<Integer> p = new ArrayList<Integer>();\n for (int i = 0; i < N; i++) {\n p.add(sc.nextInt());\n }\n\n p = p.stream().sorted().collect(Collectors.toList());\n\n int sum = 0;\n for (int i = 0; i < K; i++) {\n sum += p.get(i);\n }\n\n System.out.println(sum);\n }\n}",
"Main",
"public static void main (String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int K = sc.nextInt();\n\n List<Integer> p = new ArrayList<Integer>();\n for (int i = 0; i < N; i++) {\n p.add(sc.nextInt());\n }\n\n p = p.stream().sorted().collect(Collectors.toList());\n\n int sum = 0;\n for (int i = 0; i < K; i++) {\n sum += p.get(i);\n }\n\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int N = sc.nextInt();\n int K = sc.nextInt();\n\n List<Integer> p = new ArrayList<Integer>();\n for (int i = 0; i < N; i++) {\n p.add(sc.nextInt());\n }\n\n p = p.stream().sorted().collect(Collectors.toList());\n\n int sum = 0;\n for (int i = 0; i < K; i++) {\n sum += p.get(i);\n }\n\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int N = sc.nextInt();",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int K = sc.nextInt();",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"List<Integer> p = new ArrayList<Integer>();",
"p",
"new ArrayList<Integer>()",
"for (int i = 0; i < N; i++) {\n p.add(sc.nextInt());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n p.add(sc.nextInt());\n }",
"{\n p.add(sc.nextInt());\n }",
"p.add(sc.nextInt())",
"p.add",
"p",
"sc.nextInt()",
"sc.nextInt",
"sc",
"p = p.stream().sorted().collect(Collectors.toList())",
"p",
"p.stream().sorted().collect(Collectors.toList())",
"p.stream().sorted().collect",
"p.stream().sorted()",
"p.stream().sorted",
"p.stream()",
"p.stream",
"p",
"Collectors.toList()",
"Collectors.toList",
"Collectors",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < K; i++) {\n sum += p.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < K",
"i",
"K",
"i++",
"i++",
"i",
"{\n sum += p.get(i);\n }",
"{\n sum += p.get(i);\n }",
"sum += p.get(i)",
"sum",
"p.get(i)",
"p.get",
"p",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"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 int K = sc.nextInt();\n\n List<Integer> p = new ArrayList<Integer>();\n for (int i = 0; i < N; i++) {\n p.add(sc.nextInt());\n }\n\n p = p.stream().sorted().collect(Collectors.toList());\n\n int sum = 0;\n for (int i = 0; i < K; i++) {\n sum += p.get(i);\n }\n\n System.out.println(sum);\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 int K = sc.nextInt();\n\n List<Integer> p = new ArrayList<Integer>();\n for (int i = 0; i < N; i++) {\n p.add(sc.nextInt());\n }\n\n p = p.stream().sorted().collect(Collectors.toList());\n\n int sum = 0;\n for (int i = 0; i < K; i++) {\n sum += p.get(i);\n }\n\n System.out.println(sum);\n }\n}",
"Main"
]
| import java.util.*;
import java.util.stream.Collector;
import java.util.stream.Collectors;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int K = sc.nextInt();
List<Integer> p = new ArrayList<Integer>();
for (int i = 0; i < N; i++) {
p.add(sc.nextInt());
}
p = p.stream().sorted().collect(Collectors.toList());
int sum = 0;
for (int i = 0; i < K; i++) {
sum += p.get(i);
}
System.out.println(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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
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
],
[
47,
48
],
[
46,
49
],
[
8,
50
],
[
50,
51
],
[
50,
52
],
[
8,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
53,
58
],
[
58,
59
],
[
58,
60
],
[
53,
61
],
[
61,
62
],
[
62,
63
],
[
53,
64
],
[
65,
65
],
[
65,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
8,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
6,
79
],
[
79,
80
]
]
| [
"import java.util.*;\n class Main{\n public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n int size=sc.nextInt();\n int num=sc.nextInt();\n int arr[]=new int[size];\n for(int i=0;i<size;i++){\n arr[i]=sc.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int j=0;j<num;j++){\n sum=sum+arr[j];\n\n }\n System.out.println(sum);\n }\n \n}",
"import java.util.*;",
"util.*",
"java",
"class Main{\n public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n int size=sc.nextInt();\n int num=sc.nextInt();\n int arr[]=new int[size];\n for(int i=0;i<size;i++){\n arr[i]=sc.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int j=0;j<num;j++){\n sum=sum+arr[j];\n\n }\n System.out.println(sum);\n }\n \n}",
"Main",
"public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n int size=sc.nextInt();\n int num=sc.nextInt();\n int arr[]=new int[size];\n for(int i=0;i<size;i++){\n arr[i]=sc.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int j=0;j<num;j++){\n sum=sum+arr[j];\n\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc=new Scanner(System.in);\n int size=sc.nextInt();\n int num=sc.nextInt();\n int arr[]=new int[size];\n for(int i=0;i<size;i++){\n arr[i]=sc.nextInt();\n }\n Arrays.sort(arr);\n int sum=0;\n for(int j=0;j<num;j++){\n sum=sum+arr[j];\n\n }\n System.out.println(sum);\n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int size=sc.nextInt();",
"size",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int num=sc.nextInt();",
"num",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int arr[]=new int[size];",
"arr",
"new int[size]",
"size",
"for(int i=0;i<size;i++){\n arr[i]=sc.nextInt();\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<size",
"i",
"size",
"i++",
"i++",
"i",
"{\n arr[i]=sc.nextInt();\n }",
"{\n arr[i]=sc.nextInt();\n }",
"arr[i]=sc.nextInt()",
"arr[i]",
"arr",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"int sum=0;",
"sum",
"0",
"for(int j=0;j<num;j++){\n sum=sum+arr[j];\n\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<num",
"j",
"num",
"j++",
"j++",
"j",
"{\n sum=sum+arr[j];\n\n }",
"{\n sum=sum+arr[j];\n\n }",
"sum=sum+arr[j]",
"sum",
"sum+arr[j]",
"sum",
"arr[j]",
"arr",
"j",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args"
]
| import java.util.*;
class Main{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int size=sc.nextInt();
int num=sc.nextInt();
int arr[]=new int[size];
for(int i=0;i<size;i++){
arr[i]=sc.nextInt();
}
Arrays.sort(arr);
int sum=0;
for(int j=0;j<num;j++){
sum=sum+arr[j];
}
System.out.println(sum);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
0,
13,
4,
18,
4,
18,
13,
17,
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,
18,
13,
13,
4,
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,
4,
18,
13,
13,
4,
18,
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
],
[
127,
17
],
[
127,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
20,
27
],
[
27,
28
],
[
27,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
29,
34
],
[
20,
35
],
[
35,
36
],
[
35,
37
],
[
37,
38
],
[
38,
39
],
[
37,
40
],
[
40,
41
],
[
40,
42
],
[
20,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
45,
48
],
[
48,
49
],
[
48,
50
],
[
20,
51
],
[
51,
52
],
[
51,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
56,
57
],
[
53,
58
],
[
20,
59
],
[
59,
60
],
[
60,
61
],
[
20,
62
],
[
62,
63
],
[
62,
64
],
[
20,
66
],
[
66,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
66,
71
],
[
71,
72
],
[
71,
73
],
[
66,
74
],
[
74,
75
],
[
75,
76
],
[
66,
77
],
[
78,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
84,
85
],
[
83,
86
],
[
86,
87
],
[
86,
88
],
[
20,
89
],
[
89,
90
],
[
90,
91
],
[
89,
92
],
[
20,
93
],
[
93,
94
],
[
93,
95
],
[
20,
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
],
[
109,
111
],
[
111,
112
],
[
111,
113
],
[
20,
114
],
[
114,
115
],
[
115,
116
],
[
114,
117
],
[
117,
118
],
[
118,
119
],
[
117,
120
],
[
20,
121
],
[
121,
122
],
[
122,
123
],
[
18,
124
],
[
124,
125
],
[
0,
126
],
[
126,
127
],
[
126,
128
]
]
| [
"import java.io.BufferedReader;\nimport java.io.BufferedWriter;\nimport java.io.InputStreamReader;\nimport java.io.OutputStreamWriter;\nimport java.util.Arrays;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n String[] in = br.readLine().split(\" \");\n int n = Integer.parseInt(in[0]);\n int k = Integer.parseInt(in[1]);\n in = br.readLine().split(\" \");\n\n br.close();\n\n int[] p = new int[n];\n for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(in[i]);\n }\n Arrays.sort(p);\n int ans = 0;\n for (int i = 0; i < k; i++) {\n ans += p[i];\n }\n\n bw.write(String.valueOf(ans));\n\n bw.flush();\n\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.BufferedWriter;",
"BufferedWriter",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.io.OutputStreamWriter;",
"OutputStreamWriter",
"java.io",
"import java.util.Arrays;",
"Arrays",
"java.util",
"public class Main {\n public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n String[] in = br.readLine().split(\" \");\n int n = Integer.parseInt(in[0]);\n int k = Integer.parseInt(in[1]);\n in = br.readLine().split(\" \");\n\n br.close();\n\n int[] p = new int[n];\n for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(in[i]);\n }\n Arrays.sort(p);\n int ans = 0;\n for (int i = 0; i < k; i++) {\n ans += p[i];\n }\n\n bw.write(String.valueOf(ans));\n\n bw.flush();\n\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n String[] in = br.readLine().split(\" \");\n int n = Integer.parseInt(in[0]);\n int k = Integer.parseInt(in[1]);\n in = br.readLine().split(\" \");\n\n br.close();\n\n int[] p = new int[n];\n for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(in[i]);\n }\n Arrays.sort(p);\n int ans = 0;\n for (int i = 0; i < k; i++) {\n ans += p[i];\n }\n\n bw.write(String.valueOf(ans));\n\n bw.flush();\n\n }",
"main",
"{\n\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n String[] in = br.readLine().split(\" \");\n int n = Integer.parseInt(in[0]);\n int k = Integer.parseInt(in[1]);\n in = br.readLine().split(\" \");\n\n br.close();\n\n int[] p = new int[n];\n for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(in[i]);\n }\n Arrays.sort(p);\n int ans = 0;\n for (int i = 0; i < k; i++) {\n ans += p[i];\n }\n\n bw.write(String.valueOf(ans));\n\n bw.flush();\n\n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));",
"bw",
"new BufferedWriter(new OutputStreamWriter(System.out))",
"String[] in = br.readLine().split(\" \");",
"in",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int n = Integer.parseInt(in[0]);",
"n",
"Integer.parseInt(in[0])",
"Integer.parseInt",
"Integer",
"in[0]",
"in",
"0",
"int k = Integer.parseInt(in[1]);",
"k",
"Integer.parseInt(in[1])",
"Integer.parseInt",
"Integer",
"in[1]",
"in",
"1",
"in = br.readLine().split(\" \")",
"in",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"br.close()",
"br.close",
"br",
"int[] p = new int[n];",
"p",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(in[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n p[i] = Integer.parseInt(in[i]);\n }",
"{\n p[i] = Integer.parseInt(in[i]);\n }",
"p[i] = Integer.parseInt(in[i])",
"p[i]",
"p",
"i",
"Integer.parseInt(in[i])",
"Integer.parseInt",
"Integer",
"in[i]",
"in",
"i",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"int ans = 0;",
"ans",
"0",
"for (int i = 0; i < k; i++) {\n ans += p[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n ans += p[i];\n }",
"{\n ans += p[i];\n }",
"ans += p[i]",
"ans",
"p[i]",
"p",
"i",
"bw.write(String.valueOf(ans))",
"bw.write",
"bw",
"String.valueOf(ans)",
"String.valueOf",
"String",
"ans",
"bw.flush()",
"bw.flush",
"bw",
"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 BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n String[] in = br.readLine().split(\" \");\n int n = Integer.parseInt(in[0]);\n int k = Integer.parseInt(in[1]);\n in = br.readLine().split(\" \");\n\n br.close();\n\n int[] p = new int[n];\n for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(in[i]);\n }\n Arrays.sort(p);\n int ans = 0;\n for (int i = 0; i < k; i++) {\n ans += p[i];\n }\n\n bw.write(String.valueOf(ans));\n\n bw.flush();\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 BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n String[] in = br.readLine().split(\" \");\n int n = Integer.parseInt(in[0]);\n int k = Integer.parseInt(in[1]);\n in = br.readLine().split(\" \");\n\n br.close();\n\n int[] p = new int[n];\n for (int i = 0; i < n; i++) {\n p[i] = Integer.parseInt(in[i]);\n }\n Arrays.sort(p);\n int ans = 0;\n for (int i = 0; i < k; i++) {\n ans += p[i];\n }\n\n bw.write(String.valueOf(ans));\n\n bw.flush();\n\n }\n}",
"Main"
]
| import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
String[] in = br.readLine().split(" ");
int n = Integer.parseInt(in[0]);
int k = Integer.parseInt(in[1]);
in = br.readLine().split(" ");
br.close();
int[] p = new int[n];
for (int i = 0; i < n; i++) {
p[i] = Integer.parseInt(in[i]);
}
Arrays.sort(p);
int ans = 0;
for (int i = 0; i < k; i++) {
ans += p[i];
}
bw.write(String.valueOf(ans));
bw.flush();
}
} |
[
7,
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,
4,
18,
13,
41,
13,
20,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
17,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
105,
5
],
[
105,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
8,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
16,
21
],
[
21,
22
],
[
21,
23
],
[
23,
24
],
[
23,
25
],
[
16,
26
],
[
26,
27
],
[
27,
28
],
[
16,
29
],
[
30,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
31,
35
],
[
35,
36
],
[
36,
37
],
[
8,
38
],
[
38,
39
],
[
39,
40
],
[
8,
41
],
[
41,
42
],
[
41,
43
],
[
44,
45
],
[
44,
46
],
[
8,
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
],
[
63,
64
],
[
63,
65
],
[
62,
66
],
[
66,
67
],
[
67,
68
],
[
8,
69
],
[
69,
70
],
[
70,
71
],
[
69,
72
],
[
8,
73
],
[
73,
74
],
[
73,
75
],
[
8,
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
],
[
91,
93
],
[
93,
94
],
[
93,
95
],
[
8,
96
],
[
96,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
96,
101
],
[
6,
102
],
[
102,
103
],
[
0,
104
],
[
104,
105
],
[
104,
106
]
]
| [
"import java.util.*;\n\npublic class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int[] nk = new int[2];\n for (int i = 0; i < nk.length; i++){\n nk[i] = sc.nextInt();\n }\n sc.nextLine();\n int[] pn = new int[nk[0]];\n\tfor (int i = 0; i < nk[0]; i++){\n pn[i] = sc.nextInt();\n }\n Arrays.sort(pn);\n int answer = 0;\n for (int i = 0; i < nk[1]; i++){\n answer += pn[i];\n }\n System.out.println(answer);\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[] nk = new int[2];\n for (int i = 0; i < nk.length; i++){\n nk[i] = sc.nextInt();\n }\n sc.nextLine();\n int[] pn = new int[nk[0]];\n\tfor (int i = 0; i < nk[0]; i++){\n pn[i] = sc.nextInt();\n }\n Arrays.sort(pn);\n int answer = 0;\n for (int i = 0; i < nk[1]; i++){\n answer += pn[i];\n }\n System.out.println(answer);\n }\n}",
"Main",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int[] nk = new int[2];\n for (int i = 0; i < nk.length; i++){\n nk[i] = sc.nextInt();\n }\n sc.nextLine();\n int[] pn = new int[nk[0]];\n\tfor (int i = 0; i < nk[0]; i++){\n pn[i] = sc.nextInt();\n }\n Arrays.sort(pn);\n int answer = 0;\n for (int i = 0; i < nk[1]; i++){\n answer += pn[i];\n }\n System.out.println(answer);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int[] nk = new int[2];\n for (int i = 0; i < nk.length; i++){\n nk[i] = sc.nextInt();\n }\n sc.nextLine();\n int[] pn = new int[nk[0]];\n\tfor (int i = 0; i < nk[0]; i++){\n pn[i] = sc.nextInt();\n }\n Arrays.sort(pn);\n int answer = 0;\n for (int i = 0; i < nk[1]; i++){\n answer += pn[i];\n }\n System.out.println(answer);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int[] nk = new int[2];",
"nk",
"new int[2]",
"2",
"for (int i = 0; i < nk.length; i++){\n nk[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < nk.length",
"i",
"nk.length",
"nk",
"nk.length",
"i++",
"i++",
"i",
"{\n nk[i] = sc.nextInt();\n }",
"{\n nk[i] = sc.nextInt();\n }",
"nk[i] = sc.nextInt()",
"nk[i]",
"nk",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"sc.nextLine()",
"sc.nextLine",
"sc",
"int[] pn = new int[nk[0]];",
"pn",
"new int[nk[0]]",
"nk[0]",
"nk",
"0",
"for (int i = 0; i < nk[0]; i++){\n pn[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < nk[0]",
"i",
"nk[0]",
"nk",
"0",
"i++",
"i++",
"i",
"{\n pn[i] = sc.nextInt();\n }",
"{\n pn[i] = sc.nextInt();\n }",
"pn[i] = sc.nextInt()",
"pn[i]",
"pn",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(pn)",
"Arrays.sort",
"Arrays",
"pn",
"int answer = 0;",
"answer",
"0",
"for (int i = 0; i < nk[1]; i++){\n answer += pn[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < nk[1]",
"i",
"nk[1]",
"nk",
"1",
"i++",
"i++",
"i",
"{\n answer += pn[i];\n }",
"{\n answer += pn[i];\n }",
"answer += pn[i]",
"answer",
"pn[i]",
"pn",
"i",
"System.out.println(answer)",
"System.out.println",
"System.out",
"System",
"System.out",
"answer",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int[] nk = new int[2];\n for (int i = 0; i < nk.length; i++){\n nk[i] = sc.nextInt();\n }\n sc.nextLine();\n int[] pn = new int[nk[0]];\n\tfor (int i = 0; i < nk[0]; i++){\n pn[i] = sc.nextInt();\n }\n Arrays.sort(pn);\n int answer = 0;\n for (int i = 0; i < nk[1]; i++){\n answer += pn[i];\n }\n System.out.println(answer);\n }\n}",
"public class Main{\n public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int[] nk = new int[2];\n for (int i = 0; i < nk.length; i++){\n nk[i] = sc.nextInt();\n }\n sc.nextLine();\n int[] pn = new int[nk[0]];\n\tfor (int i = 0; i < nk[0]; i++){\n pn[i] = sc.nextInt();\n }\n Arrays.sort(pn);\n int answer = 0;\n for (int i = 0; i < nk[1]; i++){\n answer += pn[i];\n }\n System.out.println(answer);\n }\n}",
"Main"
]
| import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int[] nk = new int[2];
for (int i = 0; i < nk.length; i++){
nk[i] = sc.nextInt();
}
sc.nextLine();
int[] pn = new int[nk[0]];
for (int i = 0; i < nk[0]; i++){
pn[i] = sc.nextInt();
}
Arrays.sort(pn);
int answer = 0;
for (int i = 0; i < nk[1]; i++){
answer += pn[i];
}
System.out.println(answer);
}
}
|
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
85,
8
],
[
85,
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,
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
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
11,
53
],
[
53,
54
],
[
53,
55
],
[
11,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
11,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
9,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
]
| [
"import java.util.Arrays;\nimport java. util.Scanner;\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tInteger a[] = new Integer[n];\n\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t}\n\n\t\tArrays.sort(a);\n\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<k;i++) {\n\t\t\ttotal = total + a[i];\n\t\t}\n\t\tSystem.out.println(total);\n\n\t}\n\n}",
"import java.util.Arrays;",
"Arrays",
"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\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tInteger a[] = new Integer[n];\n\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t}\n\n\t\tArrays.sort(a);\n\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<k;i++) {\n\t\t\ttotal = total + a[i];\n\t\t}\n\t\tSystem.out.println(total);\n\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tInteger a[] = new Integer[n];\n\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t}\n\n\t\tArrays.sort(a);\n\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<k;i++) {\n\t\t\ttotal = total + a[i];\n\t\t}\n\t\tSystem.out.println(total);\n\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tInteger a[] = new Integer[n];\n\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t}\n\n\t\tArrays.sort(a);\n\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<k;i++) {\n\t\t\ttotal = total + a[i];\n\t\t}\n\t\tSystem.out.println(total);\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 k = scan.nextInt();",
"k",
"scan.nextInt()",
"scan.nextInt",
"scan",
"Integer a[] = new Integer[n];",
"a",
"new Integer[n]",
"n",
"for(int i=0;i<n;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\ta[i] = scan.nextInt();\n\t\t}",
"{\n\t\t\ta[i] = scan.nextInt();\n\t\t}",
"a[i] = scan.nextInt()",
"a[i]",
"a",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"Arrays.sort(a)",
"Arrays.sort",
"Arrays",
"a",
"int total = 0;",
"total",
"0",
"for(int i=0;i<k;i++) {\n\t\t\ttotal = total + a[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\ttotal = total + a[i];\n\t\t}",
"{\n\t\t\ttotal = total + a[i];\n\t\t}",
"total = total + a[i]",
"total",
"total + a[i]",
"total",
"a[i]",
"a",
"i",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tInteger a[] = new Integer[n];\n\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t}\n\n\t\tArrays.sort(a);\n\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<k;i++) {\n\t\t\ttotal = total + a[i];\n\t\t}\n\t\tSystem.out.println(total);\n\n\t}\n\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tInteger a[] = new Integer[n];\n\n\t\tfor(int i=0;i<n;i++) {\n\t\t\ta[i] = scan.nextInt();\n\t\t}\n\n\t\tArrays.sort(a);\n\n\t\tint total = 0;\n\n\t\tfor(int i=0;i<k;i++) {\n\t\t\ttotal = total + a[i];\n\t\t}\n\t\tSystem.out.println(total);\n\n\t}\n\n}",
"Main"
]
| import java.util.Arrays;
import java. util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int k = scan.nextInt();
Integer a[] = new Integer[n];
for(int i=0;i<n;i++) {
a[i] = scan.nextInt();
}
Arrays.sort(a);
int total = 0;
for(int i=0;i<k;i++) {
total = total + a[i];
}
System.out.println(total);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
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,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
82,
8
],
[
82,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
14,
15
],
[
14,
16
],
[
13,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
13,
22
],
[
22,
23
],
[
22,
24
],
[
24,
25
],
[
25,
26
],
[
13,
27
],
[
27,
28
],
[
27,
29
],
[
13,
30
],
[
30,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
30,
35
],
[
35,
36
],
[
35,
37
],
[
30,
38
],
[
38,
39
],
[
39,
40
],
[
30,
41
],
[
42,
42
],
[
42,
43
],
[
43,
44
],
[
43,
45
],
[
45,
46
],
[
46,
47
],
[
42,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
13,
52
],
[
52,
53
],
[
52,
54
],
[
13,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
71,
72
],
[
13,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
9,
79
],
[
79,
80
],
[
0,
81
],
[
81,
82
],
[
81,
83
]
]
| [
"import java.util.PriorityQueue;\nimport java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\t\t\n\t\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tint p = sc.nextInt();\n\t\t\t\tpq.add(p);\n\t\t\t}\n\t\t\t\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0 ; i < k ; i++ ) {\n\t\t\t\tsum += pq.remove();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t\t\n\t\t}\n\t}\n\n}",
"import java.util.PriorityQueue;",
"PriorityQueue",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\t\t\n\t\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tint p = sc.nextInt();\n\t\t\t\tpq.add(p);\n\t\t\t}\n\t\t\t\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0 ; i < k ; i++ ) {\n\t\t\t\tsum += pq.remove();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t\t\n\t\t}\n\t}\n\n}",
"Main",
"public static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\t\t\n\t\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tint p = sc.nextInt();\n\t\t\t\tpq.add(p);\n\t\t\t}\n\t\t\t\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0 ; i < k ; i++ ) {\n\t\t\t\tsum += pq.remove();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t\t\n\t\t}\n\t}",
"main",
"{\n\t\ttry(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\t\t\n\t\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tint p = sc.nextInt();\n\t\t\t\tpq.add(p);\n\t\t\t}\n\t\t\t\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0 ; i < k ; i++ ) {\n\t\t\t\tsum += pq.remove();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t\t\n\t\t}\n\t}",
"try(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\t\t\n\t\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tint p = sc.nextInt();\n\t\t\t\tpq.add(p);\n\t\t\t}\n\t\t\t\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0 ; i < k ; i++ ) {\n\t\t\t\tsum += pq.remove();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t\t\n\t\t}",
"{\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\t\t\n\t\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tint p = sc.nextInt();\n\t\t\t\tpq.add(p);\n\t\t\t}\n\t\t\t\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0 ; i < k ; i++ ) {\n\t\t\t\tsum += pq.remove();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t\t\n\t\t}",
"Scanner sc = new Scanner(System.in)",
"Scanner sc = new Scanner(System.in)",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"PriorityQueue<Integer> pq = new PriorityQueue<>();",
"pq",
"new PriorityQueue<>()",
"for(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tint p = sc.nextInt();\n\t\t\t\tpq.add(p);\n\t\t\t}",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\t\tint p = sc.nextInt();\n\t\t\t\tpq.add(p);\n\t\t\t}",
"{\n\t\t\t\tint p = sc.nextInt();\n\t\t\t\tpq.add(p);\n\t\t\t}",
"int p = sc.nextInt();",
"p",
"sc.nextInt()",
"sc.nextInt",
"sc",
"pq.add(p)",
"pq.add",
"pq",
"p",
"int sum = 0;",
"sum",
"0",
"for(int i = 0 ; i < k ; i++ ) {\n\t\t\t\tsum += pq.remove();\n\t\t\t}",
"int i = 0 ;",
"int i = 0 ;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\t\tsum += pq.remove();\n\t\t\t}",
"{\n\t\t\t\tsum += pq.remove();\n\t\t\t}",
"sum += pq.remove()",
"sum",
"pq.remove()",
"pq.remove",
"pq",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main {\n\tpublic static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\t\t\n\t\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tint p = sc.nextInt();\n\t\t\t\tpq.add(p);\n\t\t\t}\n\t\t\t\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0 ; i < k ; i++ ) {\n\t\t\t\tsum += pq.remove();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t\t\n\t\t}\n\t}\n\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\ttry(Scanner sc = new Scanner(System.in)) {\n\t\t\t\n\t\t\tint n = sc.nextInt();\n\t\t\tint k = sc.nextInt();\n\t\t\n\t\t\tPriorityQueue<Integer> pq = new PriorityQueue<>();\n\t\t\t\n\t\t\tfor(int i = 0 ; i < n ; i++ ) {\n\t\t\t\tint p = sc.nextInt();\n\t\t\t\tpq.add(p);\n\t\t\t}\n\t\t\t\n\t\t\tint sum = 0;\n\t\t\tfor(int i = 0 ; i < k ; i++ ) {\n\t\t\t\tsum += pq.remove();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(sum);\n\t\t\t\n\t\t}\n\t}\n\n}",
"Main"
]
| import java.util.PriorityQueue;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
try(Scanner sc = new Scanner(System.in)) {
int n = sc.nextInt();
int k = sc.nextInt();
PriorityQueue<Integer> pq = new PriorityQueue<>();
for(int i = 0 ; i < n ; i++ ) {
int p = sc.nextInt();
pq.add(p);
}
int sum = 0;
for(int i = 0 ; i < k ; i++ ) {
sum += pq.remove();
}
System.out.println(sum);
}
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
4,
18,
13,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
4,
18,
13,
0,
13,
4,
18,
13,
0,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
23,
13,
12,
13,
30,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
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,
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,
41,
13,
4,
13,
14,
2,
2,
13,
18,
13,
13,
2,
13,
18,
13,
13,
30,
37,
20,
29,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
367,
8
],
[
367,
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
],
[
22,
23
],
[
21,
24
],
[
11,
25
],
[
25,
26
],
[
26,
27
],
[
9,
28
],
[
28,
29
],
[
0,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
30,
34
],
[
34,
35
],
[
30,
36
],
[
36,
37
],
[
30,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
43,
44
],
[
44,
45
],
[
40,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
49,
50
],
[
40,
51
],
[
51,
52
],
[
51,
53
],
[
40,
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
],
[
67,
70
],
[
70,
71
],
[
71,
72
],
[
38,
73
],
[
73,
74
],
[
30,
75
],
[
75,
76
],
[
75,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
78,
81
],
[
77,
82
],
[
82,
83
],
[
82,
84
],
[
77,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
87,
89
],
[
85,
90
],
[
90,
91
],
[
90,
92
],
[
85,
93
],
[
93,
94
],
[
94,
95
],
[
85,
96
],
[
97,
97
],
[
97,
98
],
[
98,
99
],
[
98,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
77,
104
],
[
104,
105
],
[
105,
106
],
[
104,
107
],
[
75,
108
],
[
108,
109
],
[
0,
110
],
[
110,
111
],
[
110,
112
],
[
112,
113
],
[
112,
114
],
[
114,
115
],
[
114,
116
],
[
110,
117
],
[
117,
118
],
[
117,
119
],
[
110,
121
],
[
121,
122
],
[
121,
123
],
[
110,
124
],
[
124,
125
],
[
124,
126
],
[
110,
127
],
[
127,
128
],
[
127,
129
],
[
129,
130
],
[
130,
131
],
[
131,
132
],
[
131,
133
],
[
130,
134
],
[
134,
135
],
[
135,
136
],
[
130,
137
],
[
137,
138
],
[
138,
139
],
[
138,
140
],
[
137,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
144,
145
],
[
145,
146
],
[
146,
147
],
[
141,
148
],
[
148,
149
],
[
149,
150
],
[
149,
151
],
[
151,
152
],
[
152,
153
],
[
151,
154
],
[
137,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
159,
160
],
[
160,
161
],
[
129,
162
],
[
162,
163
],
[
110,
164
],
[
164,
165
],
[
164,
166
],
[
166,
167
],
[
167,
168
],
[
168,
169
],
[
167,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
172,
174
],
[
174,
175
],
[
167,
176
],
[
176,
177
],
[
177,
178
],
[
178,
179
],
[
110,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
188,
189
],
[
188,
190
],
[
180,
191
],
[
191,
192
],
[
110,
193
],
[
193,
194
],
[
193,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
197,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
203,
205
],
[
196,
206
],
[
206,
207
],
[
207,
208
],
[
195,
209
],
[
209,
210
],
[
210,
211
],
[
110,
212
],
[
212,
213
],
[
212,
214
],
[
214,
215
],
[
215,
216
],
[
216,
217
],
[
217,
218
],
[
215,
219
],
[
219,
220
],
[
220,
221
],
[
214,
222
],
[
222,
223
],
[
222,
224
],
[
214,
225
],
[
225,
226
],
[
225,
227
],
[
227,
228
],
[
214,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
229,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
234,
237
],
[
233,
238
],
[
238,
239
],
[
238,
240
],
[
240,
241
],
[
214,
242
],
[
242,
243
],
[
243,
244
],
[
244,
245
],
[
110,
246
],
[
246,
247
],
[
246,
248
],
[
248,
249
],
[
249,
250
],
[
250,
251
],
[
251,
252
],
[
249,
253
],
[
253,
254
],
[
254,
255
],
[
248,
256
],
[
256,
257
],
[
256,
258
],
[
248,
259
],
[
259,
260
],
[
259,
261
],
[
248,
262
],
[
262,
263
],
[
262,
264
],
[
264,
265
],
[
248,
266
],
[
266,
267
],
[
267,
268
],
[
267,
269
],
[
266,
270
],
[
270,
271
],
[
271,
272
],
[
271,
273
],
[
270,
274
],
[
274,
275
],
[
274,
276
],
[
276,
277
],
[
248,
278
],
[
278,
279
],
[
279,
280
],
[
280,
281
],
[
280,
282
],
[
279,
283
],
[
283,
284
],
[
283,
285
],
[
278,
286
],
[
286,
287
],
[
287,
288
],
[
248,
289
],
[
289,
290
],
[
289,
291
],
[
291,
292
],
[
292,
293
],
[
293,
294
],
[
294,
295
],
[
294,
296
],
[
293,
297
],
[
297,
298
],
[
297,
299
],
[
292,
300
],
[
300,
301
],
[
301,
302
],
[
301,
303
],
[
300,
304
],
[
304,
305
],
[
304,
306
],
[
306,
307
],
[
306,
308
],
[
292,
309
],
[
309,
310
],
[
310,
311
],
[
311,
312
],
[
311,
313
],
[
313,
314
],
[
310,
315
],
[
315,
316
],
[
316,
317
],
[
316,
318
],
[
309,
319
],
[
319,
320
],
[
320,
321
],
[
321,
322
],
[
321,
323
],
[
323,
324
],
[
321,
325
],
[
309,
326
],
[
326,
327
],
[
327,
328
],
[
291,
329
],
[
329,
330
],
[
329,
331
],
[
331,
332
],
[
110,
333
],
[
333,
334
],
[
333,
335
],
[
335,
336
],
[
336,
337
],
[
336,
338
],
[
338,
339
],
[
335,
340
],
[
340,
341
],
[
341,
342
],
[
342,
343
],
[
342,
344
],
[
344,
345
],
[
344,
346
],
[
341,
347
],
[
347,
348
],
[
347,
349
],
[
349,
350
],
[
349,
351
],
[
340,
352
],
[
352,
353
],
[
353,
354
],
[
335,
355
],
[
355,
356
],
[
110,
357
],
[
357,
358
],
[
357,
359
],
[
359,
360
],
[
360,
361
],
[
361,
362
],
[
362,
363
],
[
361,
364
],
[
364,
365
],
[
0,
366
],
[
366,
367
],
[
366,
368
]
]
| [
"import java.io.*;\nimport java.util.*;\n\npublic class Main {\n\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n PrintWriter out = new PrintWriter(System.out);\n\n AtCoder problem = new AtCoder(sc);\n problem.solve(out);\n\n out.flush();\n }\n\n}\n\nclass AtCoder {\n\n /* 変数宣言 */\n final int N, K;\n final List<Integer> p;\n\n AtCoder(FastScanner sc) {\n N = sc.nextInt();\n K = sc.nextInt();\n\n p = new ArrayList<>();\n for (int i = 0; i < N; i++) {\n p.add(sc.nextInt());\n }\n }\n\n void solve(PrintWriter out) {\n Collections.sort(p);\n int sum = 0;\n for (int i = 0; i < K; i++) {\n sum += p.get(i);\n }\n\n out.println(sum);\n }\n}\n // https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4\nclass FastScanner {\n \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 public boolean hasNext() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) {\n ptr++;\n }\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 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 \n public int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {\n throw new NumberFormatException();\n }\n return (int) nl;\n }\n \n public double nextDouble() {\n return Double.parseDouble(next());\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n PrintWriter out = new PrintWriter(System.out);\n\n AtCoder problem = new AtCoder(sc);\n problem.solve(out);\n\n out.flush();\n }\n\n}",
"Main",
"public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n PrintWriter out = new PrintWriter(System.out);\n\n AtCoder problem = new AtCoder(sc);\n problem.solve(out);\n\n out.flush();\n }",
"main",
"{\n FastScanner sc = new FastScanner();\n PrintWriter out = new PrintWriter(System.out);\n\n AtCoder problem = new AtCoder(sc);\n problem.solve(out);\n\n out.flush();\n }",
"FastScanner sc = new FastScanner();",
"sc",
"new FastScanner()",
"PrintWriter out = new PrintWriter(System.out);",
"out",
"new PrintWriter(System.out)",
"AtCoder problem = new AtCoder(sc);",
"problem",
"new AtCoder(sc)",
"problem.solve(out)",
"problem.solve",
"problem",
"out",
"out.flush()",
"out.flush",
"out",
"String[] args",
"args",
"class AtCoder {\n\n /* 変数宣言 */\n final int N, K;\n final List<Integer> p;\n\n AtCoder(FastScanner sc) {\n N = sc.nextInt();\n K = sc.nextInt();\n\n p = new ArrayList<>();\n for (int i = 0; i < N; i++) {\n p.add(sc.nextInt());\n }\n }\n\n void solve(PrintWriter out) {\n Collections.sort(p);\n int sum = 0;\n for (int i = 0; i < K; i++) {\n sum += p.get(i);\n }\n\n out.println(sum);\n }\n}",
"AtCoder",
"/* 変数宣言 */\n final int N",
"N",
"K;",
"K",
"final List<Integer> p;",
"p",
"AtCoder(FastScanner sc) {\n N = sc.nextInt();\n K = sc.nextInt();\n\n p = new ArrayList<>();\n for (int i = 0; i < N; i++) {\n p.add(sc.nextInt());\n }\n }",
"AtCoder",
"{\n N = sc.nextInt();\n K = sc.nextInt();\n\n p = new ArrayList<>();\n for (int i = 0; i < N; i++) {\n p.add(sc.nextInt());\n }\n }",
"N = sc.nextInt()",
"N",
"sc.nextInt()",
"sc.nextInt",
"sc",
"K = sc.nextInt()",
"K",
"sc.nextInt()",
"sc.nextInt",
"sc",
"p = new ArrayList<>()",
"p",
"new ArrayList<>()",
"for (int i = 0; i < N; i++) {\n p.add(sc.nextInt());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n p.add(sc.nextInt());\n }",
"{\n p.add(sc.nextInt());\n }",
"p.add(sc.nextInt())",
"p.add",
"p",
"sc.nextInt()",
"sc.nextInt",
"sc",
"FastScanner sc",
"sc",
"void solve(PrintWriter out) {\n Collections.sort(p);\n int sum = 0;\n for (int i = 0; i < K; i++) {\n sum += p.get(i);\n }\n\n out.println(sum);\n }",
"solve",
"{\n Collections.sort(p);\n int sum = 0;\n for (int i = 0; i < K; i++) {\n sum += p.get(i);\n }\n\n out.println(sum);\n }",
"Collections.sort(p)",
"Collections.sort",
"Collections",
"p",
"int sum = 0;",
"sum",
"0",
"for (int i = 0; i < K; i++) {\n sum += p.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < K",
"i",
"K",
"i++",
"i++",
"i",
"{\n sum += p.get(i);\n }",
"{\n sum += p.get(i);\n }",
"sum += p.get(i)",
"sum",
"p.get(i)",
"p.get",
"p",
"i",
"out.println(sum)",
"out.println",
"out",
"sum",
"PrintWriter out",
"out",
"s FastScanner {\n \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 public boolean hasNext() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) {\n ptr++;\n }\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 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 \n public int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {\n throw new NumberFormatException();\n }\n return (int) nl;\n }\n \n public double nextDouble() {\n return Double.parseDouble(next());\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",
"public boolean hasNext() {\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) {\n ptr++;\n }\n return hasNextByte();\n }",
"hasNext",
"{\n while (hasNextByte() && !isPrintableChar(buffer[ptr])) {\n ptr++;\n }\n return hasNextByte();\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",
"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 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 int nextInt() {\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {\n throw new NumberFormatException();\n }\n return (int) nl;\n }",
"nextInt",
"{\n long nl = nextLong();\n if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {\n throw new NumberFormatException();\n }\n return (int) nl;\n }",
"long nl = nextLong();",
"nl",
"nextLong()",
"nextLong",
"if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {\n throw new NumberFormatException();\n }",
"nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE",
"nl < Integer.MIN_VALUE",
"nl",
"Integer.MIN_VALUE",
"Integer",
"Integer.MIN_VALUE",
"nl > Integer.MAX_VALUE",
"nl",
"Integer.MAX_VALUE",
"Integer",
"Integer.MAX_VALUE",
"{\n throw new NumberFormatException();\n }",
"throw new NumberFormatException();",
"new NumberFormatException()",
"return (int) nl;",
"(int) nl",
"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 public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n PrintWriter out = new PrintWriter(System.out);\n\n AtCoder problem = new AtCoder(sc);\n problem.solve(out);\n\n out.flush();\n }\n\n}",
"public class Main {\n\n public static void main(String[] args) {\n FastScanner sc = new FastScanner();\n PrintWriter out = new PrintWriter(System.out);\n\n AtCoder problem = new AtCoder(sc);\n problem.solve(out);\n\n out.flush();\n }\n\n}",
"Main"
]
| import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
FastScanner sc = new FastScanner();
PrintWriter out = new PrintWriter(System.out);
AtCoder problem = new AtCoder(sc);
problem.solve(out);
out.flush();
}
}
class AtCoder {
/* 変数宣言 */
final int N, K;
final List<Integer> p;
AtCoder(FastScanner sc) {
N = sc.nextInt();
K = sc.nextInt();
p = new ArrayList<>();
for (int i = 0; i < N; i++) {
p.add(sc.nextInt());
}
}
void solve(PrintWriter out) {
Collections.sort(p);
int sum = 0;
for (int i = 0; i < K; i++) {
sum += p.get(i);
}
out.println(sum);
}
}
// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
class FastScanner {
private final InputStream in = System.in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
private boolean hasNextByte() {
if (ptr < buflen) {
return true;
} else {
ptr = 0;
try {
buflen = in.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
if (buflen <= 0) {
return false;
}
}
return true;
}
private int readByte() {
if (hasNextByte()) {
return buffer[ptr++];
} else {
return -1;
}
}
private static boolean isPrintableChar(int c) {
return 33 <= c && c <= 126;
}
public boolean hasNext() {
while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
ptr++;
}
return hasNextByte();
}
public String next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
StringBuilder sb = new StringBuilder();
int b = readByte();
while (isPrintableChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public long nextLong() {
if (!hasNext()) {
throw new NoSuchElementException();
}
long n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
if (b < '0' || '9' < b) {
throw new NumberFormatException();
}
while (true) {
if ('0' <= b && b <= '9') {
n *= 10;
n += b - '0';
} else if (b == -1 || !isPrintableChar(b)) {
return minus ? -n : n;
} else {
throw new NumberFormatException();
}
b = readByte();
}
}
public int nextInt() {
long nl = nextLong();
if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
throw new NumberFormatException();
}
return (int) nl;
}
public double nextDouble() {
return Double.parseDouble(next());
}
} |
[
7,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
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
],
[
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
],
[
39,
40
],
[
38,
41
],
[
41,
42
],
[
42,
43
],
[
8,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
8,
48
],
[
48,
49
],
[
48,
50
],
[
8,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
8,
70
],
[
70,
71
],
[
71,
72
],
[
72,
73
],
[
72,
74
],
[
70,
75
],
[
6,
76
],
[
76,
77
],
[
0,
78
],
[
78,
79
],
[
78,
80
]
]
| [
"import java.util.*;\n\npublic class Main {\n\n public static void main(String[] args) {\n\n Scanner scanner = new Scanner(System.in);\n int all = scanner.nextInt();\n int num = scanner.nextInt();\n\n ArrayList<Integer> priceList = new ArrayList<>();\n for(int i = 0; i < all; i++) {\n priceList.add(scanner.nextInt());\n }\n Collections.sort(priceList);\n int cost = 0;\n for (int i = 0; i < num; i++) {\n cost += priceList.get(i);\n }\n System.out.println(cost);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner scanner = new Scanner(System.in);\n int all = scanner.nextInt();\n int num = scanner.nextInt();\n\n ArrayList<Integer> priceList = new ArrayList<>();\n for(int i = 0; i < all; i++) {\n priceList.add(scanner.nextInt());\n }\n Collections.sort(priceList);\n int cost = 0;\n for (int i = 0; i < num; i++) {\n cost += priceList.get(i);\n }\n System.out.println(cost);\n }\n}",
"Main",
"public static void main(String[] args) {\n\n Scanner scanner = new Scanner(System.in);\n int all = scanner.nextInt();\n int num = scanner.nextInt();\n\n ArrayList<Integer> priceList = new ArrayList<>();\n for(int i = 0; i < all; i++) {\n priceList.add(scanner.nextInt());\n }\n Collections.sort(priceList);\n int cost = 0;\n for (int i = 0; i < num; i++) {\n cost += priceList.get(i);\n }\n System.out.println(cost);\n }",
"main",
"{\n\n Scanner scanner = new Scanner(System.in);\n int all = scanner.nextInt();\n int num = scanner.nextInt();\n\n ArrayList<Integer> priceList = new ArrayList<>();\n for(int i = 0; i < all; i++) {\n priceList.add(scanner.nextInt());\n }\n Collections.sort(priceList);\n int cost = 0;\n for (int i = 0; i < num; i++) {\n cost += priceList.get(i);\n }\n System.out.println(cost);\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int all = scanner.nextInt();",
"all",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int num = scanner.nextInt();",
"num",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"ArrayList<Integer> priceList = new ArrayList<>();",
"priceList",
"new ArrayList<>()",
"for(int i = 0; i < all; i++) {\n priceList.add(scanner.nextInt());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < all",
"i",
"all",
"i++",
"i++",
"i",
"{\n priceList.add(scanner.nextInt());\n }",
"{\n priceList.add(scanner.nextInt());\n }",
"priceList.add(scanner.nextInt())",
"priceList.add",
"priceList",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"Collections.sort(priceList)",
"Collections.sort",
"Collections",
"priceList",
"int cost = 0;",
"cost",
"0",
"for (int i = 0; i < num; i++) {\n cost += priceList.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < num",
"i",
"num",
"i++",
"i++",
"i",
"{\n cost += priceList.get(i);\n }",
"{\n cost += priceList.get(i);\n }",
"cost += priceList.get(i)",
"cost",
"priceList.get(i)",
"priceList.get",
"priceList",
"i",
"System.out.println(cost)",
"System.out.println",
"System.out",
"System",
"System.out",
"cost",
"String[] args",
"args",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner scanner = new Scanner(System.in);\n int all = scanner.nextInt();\n int num = scanner.nextInt();\n\n ArrayList<Integer> priceList = new ArrayList<>();\n for(int i = 0; i < all; i++) {\n priceList.add(scanner.nextInt());\n }\n Collections.sort(priceList);\n int cost = 0;\n for (int i = 0; i < num; i++) {\n cost += priceList.get(i);\n }\n System.out.println(cost);\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n\n Scanner scanner = new Scanner(System.in);\n int all = scanner.nextInt();\n int num = scanner.nextInt();\n\n ArrayList<Integer> priceList = new ArrayList<>();\n for(int i = 0; i < all; i++) {\n priceList.add(scanner.nextInt());\n }\n Collections.sort(priceList);\n int cost = 0;\n for (int i = 0; i < num; i++) {\n cost += priceList.get(i);\n }\n System.out.println(cost);\n }\n}",
"Main"
]
| import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int all = scanner.nextInt();
int num = scanner.nextInt();
ArrayList<Integer> priceList = new ArrayList<>();
for(int i = 0; i < all; i++) {
priceList.add(scanner.nextInt());
}
Collections.sort(priceList);
int cost = 0;
for (int i = 0; i < num; i++) {
cost += priceList.get(i);
}
System.out.println(cost);
}
} |
[
7,
15,
13,
17,
6,
13,
41,
13,
2,
4,
18,
13,
17,
17,
17,
41,
13,
17,
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,
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,
18,
13,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
13,
14,
2,
13,
17,
29,
13,
14,
2,
13,
13,
29,
13,
14,
2,
13,
13,
29,
4,
13,
2,
13,
13,
13,
29,
4,
13,
13,
2,
13,
13,
23,
13,
23,
13,
12,
13,
30,
29,
2,
2,
13,
13,
4,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
2,
2,
4,
18,
13,
17,
17,
1,
40,
13,
30,
30,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
2,
2,
4,
18,
13,
13,
17,
0,
18,
13,
2,
2,
4,
18,
13,
13,
17,
13,
41,
13,
20,
29,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
17,
14,
2,
13,
17,
29,
13,
30,
41,
13,
4,
13,
13,
2,
13,
17,
14,
2,
2,
13,
17,
17,
30,
29,
2,
13,
13,
30,
29,
2,
2,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
14,
2,
13,
17,
29,
17,
14,
2,
13,
17,
29,
2,
13,
13,
30,
41,
13,
2,
4,
13,
13,
2,
13,
17,
13,
0,
13,
13,
0,
13,
13,
14,
2,
2,
13,
17,
17,
30,
0,
13,
13,
0,
13,
13,
29,
2,
13,
13,
23,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
317,
5
],
[
317,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
10,
11
],
[
9,
12
],
[
9,
13
],
[
8,
14
],
[
317,
15
],
[
15,
16
],
[
15,
17
],
[
317,
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
],
[
31,
32
],
[
32,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
20,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
50,
50
],
[
50,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
51,
55
],
[
55,
56
],
[
56,
57
],
[
20,
58
],
[
58,
59
],
[
59,
60
],
[
58,
61
],
[
20,
62
],
[
62,
63
],
[
62,
64
],
[
20,
65
],
[
65,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
65,
70
],
[
70,
71
],
[
70,
72
],
[
65,
73
],
[
73,
74
],
[
74,
75
],
[
65,
76
],
[
76,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
79,
81
],
[
20,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
84,
86
],
[
82,
87
],
[
20,
88
],
[
88,
89
],
[
89,
90
],
[
18,
91
],
[
91,
92
],
[
317,
93
],
[
93,
94
],
[
93,
95
],
[
95,
96
],
[
96,
97
],
[
97,
98
],
[
97,
99
],
[
96,
100
],
[
100,
101
],
[
95,
102
],
[
102,
103
],
[
103,
104
],
[
103,
105
],
[
102,
106
],
[
106,
107
],
[
95,
108
],
[
108,
109
],
[
109,
110
],
[
109,
111
],
[
108,
112
],
[
112,
113
],
[
95,
114
],
[
114,
115
],
[
115,
116
],
[
115,
117
],
[
114,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
121,
123
],
[
119,
124
],
[
95,
125
],
[
125,
126
],
[
126,
127
],
[
126,
128
],
[
126,
129
],
[
129,
130
],
[
129,
131
],
[
93,
132
],
[
132,
133
],
[
93,
134
],
[
134,
135
],
[
317,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
141,
143
],
[
140,
144
],
[
144,
145
],
[
144,
146
],
[
144,
147
],
[
136,
148
],
[
148,
149
],
[
136,
150
],
[
150,
151
],
[
317,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
155,
157
],
[
157,
158
],
[
158,
159
],
[
154,
160
],
[
160,
161
],
[
161,
162
],
[
162,
163
],
[
162,
164
],
[
160,
165
],
[
165,
166
],
[
165,
167
],
[
167,
168
],
[
168,
169
],
[
169,
170
],
[
170,
171
],
[
168,
172
],
[
167,
173
],
[
160,
174
],
[
174,
175
],
[
175,
176
],
[
160,
177
],
[
178,
178
],
[
178,
179
],
[
179,
180
],
[
179,
181
],
[
181,
182
],
[
181,
183
],
[
178,
184
],
[
184,
185
],
[
185,
186
],
[
185,
187
],
[
184,
188
],
[
188,
189
],
[
188,
190
],
[
191,
191
],
[
191,
192
],
[
192,
193
],
[
193,
194
],
[
191,
195
],
[
191,
196
],
[
178,
197
],
[
197,
198
],
[
198,
199
],
[
198,
200
],
[
201,
201
],
[
201,
202
],
[
202,
203
],
[
203,
204
],
[
201,
205
],
[
201,
206
],
[
197,
207
],
[
154,
208
],
[
208,
209
],
[
208,
210
],
[
154,
211
],
[
211,
212
],
[
152,
213
],
[
213,
214
],
[
317,
215
],
[
215,
216
],
[
215,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
219,
221
],
[
218,
222
],
[
222,
223
],
[
218,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
224,
228
],
[
228,
229
],
[
224,
230
],
[
230,
231
],
[
231,
232
],
[
231,
233
],
[
233,
234
],
[
233,
235
],
[
233,
236
],
[
236,
237
],
[
236,
238
],
[
230,
239
],
[
239,
240
],
[
240,
241
],
[
241,
242
],
[
241,
243
],
[
240,
244
],
[
239,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
247,
249
],
[
239,
250
],
[
250,
251
],
[
251,
252
],
[
253,
253
],
[
253,
254
],
[
253,
255
],
[
253,
256
],
[
215,
257
],
[
257,
258
],
[
215,
259
],
[
259,
260
],
[
317,
261
],
[
261,
262
],
[
261,
263
],
[
263,
264
],
[
264,
265
],
[
265,
266
],
[
265,
267
],
[
264,
268
],
[
268,
269
],
[
264,
270
],
[
270,
271
],
[
271,
272
],
[
271,
273
],
[
270,
274
],
[
274,
275
],
[
275,
276
],
[
275,
277
],
[
270,
278
],
[
278,
279
],
[
279,
280
],
[
279,
281
],
[
281,
282
],
[
282,
283
],
[
282,
284
],
[
282,
285
],
[
285,
286
],
[
285,
287
],
[
281,
288
],
[
278,
289
],
[
289,
290
],
[
289,
291
],
[
278,
292
],
[
292,
293
],
[
292,
294
],
[
278,
295
],
[
295,
296
],
[
296,
297
],
[
297,
298
],
[
297,
299
],
[
296,
300
],
[
295,
301
],
[
301,
302
],
[
302,
303
],
[
302,
304
],
[
301,
305
],
[
305,
306
],
[
305,
307
],
[
278,
308
],
[
308,
309
],
[
309,
310
],
[
309,
311
],
[
261,
312
],
[
312,
313
],
[
261,
314
],
[
314,
315
],
[
0,
316
],
[
316,
317
],
[
316,
318
]
]
| [
"\n\nimport java.util.*;\n/*\nNOTES:\n-more than 10 digits (10^10), use long\n-prefix sum of 1's and -1's to control flow of highlighting a region\n-log(a)/log(b) = log base b of a\n-create a position array if trying to see if elements show up next to each other sequentially\n i.e. elements 1,2,3 are within 3 spots of each other in an array\n arr[scannedInt - 1] = i; (position of i at p[i] in original)\n- use a freq array when counting instances of an element occurring\n- increment the counter first before simulating anything turn-based (two player game)\n\n */\n\npublic class Main {\n static long mod = (long)(Math.pow(10, 9) + 7);\n public static String alpha = \"zabcdefghijklmnopqrstuvwxy\";\n public static void main(String[] args) {\n Scanner scan =new Scanner(System.in);\n int n = scan.nextInt();\n int k = scan.nextInt();\n int[] arr = new int[n];\n for(int i = 0; i<n; i++){\n arr[i] = scan.nextInt();\n }\n Arrays.sort(arr);\n long sum = 0;\n for(int i= 0; i<k; i++) sum += arr[i];\n System.out.println(sum);\n\n\n scan.close();\n }\n\n\n\n\n\n static int GCD(int a, int b) {\n // Everything divides 0\n if (a == 0) return b;\n if (b == 0) return a;\n\n // base case\n if (a == b) return a;\n\n // a is greater\n if (a > b) return GCD(a-b, b);\n return GCD(a, b-a);\n }\n static int LCM(int a, int b){\n return (a*b)/(GCD(a,b));\n }\n static String rev(String s){\n char[] arr = s.toCharArray();\n for(int i = 0; i<(s.length()+1)/2; i++){\n char temp = arr[i];\n arr[i] = arr[s.length()-i-1];\n arr[s.length()-i-1] = temp;\n }\n String fin = new String(arr);\n return fin;\n }\n static long pow(long a, long N) {\n if (N == 0) return 1;\n else if (N == 1) return a;\n else {\n long R = pow(a,N/2);\n if (N % 2 == 0) {\n return R*R;\n }\n else {\n return R*R*a;\n }\n }\n }\n\n static long powMod(long a, long N) {\n if (N == 0) return 1;\n else if (N == 1) return a % mod;\n else {\n long R = powMod(a,N/2) % mod;\n R *= R;\n R %= mod;\n if (N % 2 == 1) {\n R *= a;\n R %= mod;\n }\n return R % mod;\n }\n }\n\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n static long mod = (long)(Math.pow(10, 9) + 7);\n public static String alpha = \"zabcdefghijklmnopqrstuvwxy\";\n public static void main(String[] args) {\n Scanner scan =new Scanner(System.in);\n int n = scan.nextInt();\n int k = scan.nextInt();\n int[] arr = new int[n];\n for(int i = 0; i<n; i++){\n arr[i] = scan.nextInt();\n }\n Arrays.sort(arr);\n long sum = 0;\n for(int i= 0; i<k; i++) sum += arr[i];\n System.out.println(sum);\n\n\n scan.close();\n }\n\n\n\n\n\n static int GCD(int a, int b) {\n // Everything divides 0\n if (a == 0) return b;\n if (b == 0) return a;\n\n // base case\n if (a == b) return a;\n\n // a is greater\n if (a > b) return GCD(a-b, b);\n return GCD(a, b-a);\n }\n static int LCM(int a, int b){\n return (a*b)/(GCD(a,b));\n }\n static String rev(String s){\n char[] arr = s.toCharArray();\n for(int i = 0; i<(s.length()+1)/2; i++){\n char temp = arr[i];\n arr[i] = arr[s.length()-i-1];\n arr[s.length()-i-1] = temp;\n }\n String fin = new String(arr);\n return fin;\n }\n static long pow(long a, long N) {\n if (N == 0) return 1;\n else if (N == 1) return a;\n else {\n long R = pow(a,N/2);\n if (N % 2 == 0) {\n return R*R;\n }\n else {\n return R*R*a;\n }\n }\n }\n\n static long powMod(long a, long N) {\n if (N == 0) return 1;\n else if (N == 1) return a % mod;\n else {\n long R = powMod(a,N/2) % mod;\n R *= R;\n R %= mod;\n if (N % 2 == 1) {\n R *= a;\n R %= mod;\n }\n return R % mod;\n }\n }\n\n}",
"Main",
"static long mod = (long)(Math.pow(10, 9) + 7);",
"mod",
"(long)(Math.pow(10, 9) + 7)",
"Math.pow(10, 9)",
"Math.pow",
"Math",
"10",
"9",
"7",
"public static String alpha = \"zabcdefghijklmnopqrstuvwxy\";",
"alpha",
"\"zabcdefghijklmnopqrstuvwxy\"",
"public static void main(String[] args) {\n Scanner scan =new Scanner(System.in);\n int n = scan.nextInt();\n int k = scan.nextInt();\n int[] arr = new int[n];\n for(int i = 0; i<n; i++){\n arr[i] = scan.nextInt();\n }\n Arrays.sort(arr);\n long sum = 0;\n for(int i= 0; i<k; i++) sum += arr[i];\n System.out.println(sum);\n\n\n scan.close();\n }",
"main",
"{\n Scanner scan =new Scanner(System.in);\n int n = scan.nextInt();\n int k = scan.nextInt();\n int[] arr = new int[n];\n for(int i = 0; i<n; i++){\n arr[i] = scan.nextInt();\n }\n Arrays.sort(arr);\n long sum = 0;\n for(int i= 0; i<k; i++) sum += arr[i];\n System.out.println(sum);\n\n\n scan.close();\n }",
"Scanner scan =new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int k = scan.nextInt();",
"k",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] arr = new int[n];",
"arr",
"new int[n]",
"n",
"for(int i = 0; i<n; i++){\n arr[i] = scan.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = scan.nextInt();\n }",
"{\n arr[i] = scan.nextInt();\n }",
"arr[i] = scan.nextInt()",
"arr[i]",
"arr",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"long sum = 0;",
"sum",
"0",
"for(int i= 0; i<k; i++) sum += arr[i];",
"int i= 0;",
"int i= 0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"sum += arr[i];",
"sum += arr[i]",
"sum",
"arr[i]",
"arr",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"static int GCD(int a, int b) {\n // Everything divides 0\n if (a == 0) return b;\n if (b == 0) return a;\n\n // base case\n if (a == b) return a;\n\n // a is greater\n if (a > b) return GCD(a-b, b);\n return GCD(a, b-a);\n }",
"GCD",
"{\n // Everything divides 0\n if (a == 0) return b;\n if (b == 0) return a;\n\n // base case\n if (a == b) return a;\n\n // a is greater\n if (a > b) return GCD(a-b, b);\n return GCD(a, b-a);\n }",
"if (a == 0) return b;",
"a == 0",
"a",
"0",
"return b;",
"b",
"if (b == 0) return a;",
"b == 0",
"b",
"0",
"return a;",
"a",
"if (a == b) return a;",
"a == b",
"a",
"b",
"return a;",
"a",
"if (a > b) return GCD(a-b, b);",
"a > b",
"a",
"b",
"return GCD(a-b, b);",
"GCD(a-b, b)",
"GCD",
"a-b",
"a",
"b",
"b",
"return GCD(a, b-a);",
"GCD(a, b-a)",
"GCD",
"a",
"b-a",
"b",
"a",
"int a",
"a",
"int b",
"b",
"static int LCM(int a, int b){\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",
"int a",
"a",
"int b",
"b",
"static String rev(String s){\n char[] arr = s.toCharArray();\n for(int i = 0; i<(s.length()+1)/2; i++){\n char temp = arr[i];\n arr[i] = arr[s.length()-i-1];\n arr[s.length()-i-1] = temp;\n }\n String fin = new String(arr);\n return fin;\n }",
"rev",
"{\n char[] arr = s.toCharArray();\n for(int i = 0; i<(s.length()+1)/2; i++){\n char temp = arr[i];\n arr[i] = arr[s.length()-i-1];\n arr[s.length()-i-1] = temp;\n }\n String fin = new String(arr);\n return fin;\n }",
"char[] arr = s.toCharArray();",
"arr",
"s.toCharArray()",
"s.toCharArray",
"s",
"for(int i = 0; i<(s.length()+1)/2; i++){\n char temp = arr[i];\n arr[i] = arr[s.length()-i-1];\n arr[s.length()-i-1] = temp;\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<(s.length()+1)/2",
"i",
"(s.length()+1)/2",
"(s.length()+1)",
"s.length()",
"s.length",
"s",
"1",
"2",
"i++",
"i++",
"i",
"{\n char temp = arr[i];\n arr[i] = arr[s.length()-i-1];\n arr[s.length()-i-1] = temp;\n }",
"{\n char temp = arr[i];\n arr[i] = arr[s.length()-i-1];\n arr[s.length()-i-1] = temp;\n }",
"char temp = arr[i];",
"temp",
"arr[i]",
"arr",
"i",
"arr[i] = arr[s.length()-i-1]",
"arr[i]",
"arr",
"i",
"arr[s.length()-i-1]",
"arr",
"s.length()-i-1",
"s.length()-i-1",
"s.length()",
"s.length",
"s",
"i",
"1",
"arr[s.length()-i-1] = temp",
"arr[s.length()-i-1]",
"arr",
"s.length()-i-1",
"s.length()-i-1",
"s.length()",
"s.length",
"s",
"i",
"1",
"temp",
"String fin = new String(arr);",
"fin",
"new String(arr)",
"return fin;",
"fin",
"String s",
"s",
"static long pow(long a, long N) {\n if (N == 0) return 1;\n else if (N == 1) return a;\n else {\n long R = pow(a,N/2);\n if (N % 2 == 0) {\n return R*R;\n }\n else {\n return R*R*a;\n }\n }\n }",
"pow",
"{\n if (N == 0) return 1;\n else if (N == 1) return a;\n else {\n long R = pow(a,N/2);\n if (N % 2 == 0) {\n return R*R;\n }\n else {\n return R*R*a;\n }\n }\n }",
"if (N == 0) return 1;\n else if (N == 1) return a;\n else {\n long R = pow(a,N/2);\n if (N % 2 == 0) {\n return R*R;\n }\n else {\n return R*R*a;\n }\n }",
"N == 0",
"N",
"0",
"return 1;",
"1",
"if (N == 1) return a;\n else {\n long R = pow(a,N/2);\n if (N % 2 == 0) {\n return R*R;\n }\n else {\n return R*R*a;\n }\n }",
"N == 1",
"N",
"1",
"return a;",
"a",
"{\n long R = pow(a,N/2);\n if (N % 2 == 0) {\n return R*R;\n }\n else {\n return R*R*a;\n }\n }",
"long R = pow(a,N/2);",
"R",
"pow(a,N/2)",
"pow",
"a",
"N/2",
"N",
"2",
"if (N % 2 == 0) {\n return R*R;\n }\n else {\n return R*R*a;\n }",
"N % 2 == 0",
"N % 2",
"N",
"2",
"0",
"{\n return R*R;\n }",
"return R*R;",
"R*R",
"R",
"R",
"{\n return R*R*a;\n }",
"return R*R*a;",
"R*R*a",
"R*R*a",
"R",
"R",
"a",
"long a",
"a",
"long N",
"N",
"static long powMod(long a, long N) {\n if (N == 0) return 1;\n else if (N == 1) return a % mod;\n else {\n long R = powMod(a,N/2) % mod;\n R *= R;\n R %= mod;\n if (N % 2 == 1) {\n R *= a;\n R %= mod;\n }\n return R % mod;\n }\n }",
"powMod",
"{\n if (N == 0) return 1;\n else if (N == 1) return a % mod;\n else {\n long R = powMod(a,N/2) % mod;\n R *= R;\n R %= mod;\n if (N % 2 == 1) {\n R *= a;\n R %= mod;\n }\n return R % mod;\n }\n }",
"if (N == 0) return 1;\n else if (N == 1) return a % mod;\n else {\n long R = powMod(a,N/2) % mod;\n R *= R;\n R %= mod;\n if (N % 2 == 1) {\n R *= a;\n R %= mod;\n }\n return R % mod;\n }",
"N == 0",
"N",
"0",
"return 1;",
"1",
"if (N == 1) return a % mod;\n else {\n long R = powMod(a,N/2) % mod;\n R *= R;\n R %= mod;\n if (N % 2 == 1) {\n R *= a;\n R %= mod;\n }\n return R % mod;\n }",
"N == 1",
"N",
"1",
"return a % mod;",
"a % mod",
"a",
"mod",
"{\n long R = powMod(a,N/2) % mod;\n R *= R;\n R %= mod;\n if (N % 2 == 1) {\n R *= a;\n R %= mod;\n }\n return R % mod;\n }",
"long R = powMod(a,N/2) % mod;",
"R",
"powMod(a,N/2) % mod",
"powMod(a,N/2)",
"powMod",
"a",
"N/2",
"N",
"2",
"mod",
"R *= R",
"R",
"R",
"R %= mod",
"R",
"mod",
"if (N % 2 == 1) {\n R *= a;\n R %= mod;\n }",
"N % 2 == 1",
"N % 2",
"N",
"2",
"1",
"{\n R *= a;\n R %= mod;\n }",
"R *= a",
"R",
"a",
"R %= mod",
"R",
"mod",
"return R % mod;",
"R % mod",
"R",
"mod",
"long a",
"a",
"long N",
"N",
"public class Main {\n static long mod = (long)(Math.pow(10, 9) + 7);\n public static String alpha = \"zabcdefghijklmnopqrstuvwxy\";\n public static void main(String[] args) {\n Scanner scan =new Scanner(System.in);\n int n = scan.nextInt();\n int k = scan.nextInt();\n int[] arr = new int[n];\n for(int i = 0; i<n; i++){\n arr[i] = scan.nextInt();\n }\n Arrays.sort(arr);\n long sum = 0;\n for(int i= 0; i<k; i++) sum += arr[i];\n System.out.println(sum);\n\n\n scan.close();\n }\n\n\n\n\n\n static int GCD(int a, int b) {\n // Everything divides 0\n if (a == 0) return b;\n if (b == 0) return a;\n\n // base case\n if (a == b) return a;\n\n // a is greater\n if (a > b) return GCD(a-b, b);\n return GCD(a, b-a);\n }\n static int LCM(int a, int b){\n return (a*b)/(GCD(a,b));\n }\n static String rev(String s){\n char[] arr = s.toCharArray();\n for(int i = 0; i<(s.length()+1)/2; i++){\n char temp = arr[i];\n arr[i] = arr[s.length()-i-1];\n arr[s.length()-i-1] = temp;\n }\n String fin = new String(arr);\n return fin;\n }\n static long pow(long a, long N) {\n if (N == 0) return 1;\n else if (N == 1) return a;\n else {\n long R = pow(a,N/2);\n if (N % 2 == 0) {\n return R*R;\n }\n else {\n return R*R*a;\n }\n }\n }\n\n static long powMod(long a, long N) {\n if (N == 0) return 1;\n else if (N == 1) return a % mod;\n else {\n long R = powMod(a,N/2) % mod;\n R *= R;\n R %= mod;\n if (N % 2 == 1) {\n R *= a;\n R %= mod;\n }\n return R % mod;\n }\n }\n\n}",
"public class Main {\n static long mod = (long)(Math.pow(10, 9) + 7);\n public static String alpha = \"zabcdefghijklmnopqrstuvwxy\";\n public static void main(String[] args) {\n Scanner scan =new Scanner(System.in);\n int n = scan.nextInt();\n int k = scan.nextInt();\n int[] arr = new int[n];\n for(int i = 0; i<n; i++){\n arr[i] = scan.nextInt();\n }\n Arrays.sort(arr);\n long sum = 0;\n for(int i= 0; i<k; i++) sum += arr[i];\n System.out.println(sum);\n\n\n scan.close();\n }\n\n\n\n\n\n static int GCD(int a, int b) {\n // Everything divides 0\n if (a == 0) return b;\n if (b == 0) return a;\n\n // base case\n if (a == b) return a;\n\n // a is greater\n if (a > b) return GCD(a-b, b);\n return GCD(a, b-a);\n }\n static int LCM(int a, int b){\n return (a*b)/(GCD(a,b));\n }\n static String rev(String s){\n char[] arr = s.toCharArray();\n for(int i = 0; i<(s.length()+1)/2; i++){\n char temp = arr[i];\n arr[i] = arr[s.length()-i-1];\n arr[s.length()-i-1] = temp;\n }\n String fin = new String(arr);\n return fin;\n }\n static long pow(long a, long N) {\n if (N == 0) return 1;\n else if (N == 1) return a;\n else {\n long R = pow(a,N/2);\n if (N % 2 == 0) {\n return R*R;\n }\n else {\n return R*R*a;\n }\n }\n }\n\n static long powMod(long a, long N) {\n if (N == 0) return 1;\n else if (N == 1) return a % mod;\n else {\n long R = powMod(a,N/2) % mod;\n R *= R;\n R %= mod;\n if (N % 2 == 1) {\n R *= a;\n R %= mod;\n }\n return R % mod;\n }\n }\n\n}",
"Main"
]
|
import java.util.*;
/*
NOTES:
-more than 10 digits (10^10), use long
-prefix sum of 1's and -1's to control flow of highlighting a region
-log(a)/log(b) = log base b of a
-create a position array if trying to see if elements show up next to each other sequentially
i.e. elements 1,2,3 are within 3 spots of each other in an array
arr[scannedInt - 1] = i; (position of i at p[i] in original)
- use a freq array when counting instances of an element occurring
- increment the counter first before simulating anything turn-based (two player game)
*/
public class Main {
static long mod = (long)(Math.pow(10, 9) + 7);
public static String alpha = "zabcdefghijklmnopqrstuvwxy";
public static void main(String[] args) {
Scanner scan =new Scanner(System.in);
int n = scan.nextInt();
int k = scan.nextInt();
int[] arr = new int[n];
for(int i = 0; i<n; i++){
arr[i] = scan.nextInt();
}
Arrays.sort(arr);
long sum = 0;
for(int i= 0; i<k; i++) sum += arr[i];
System.out.println(sum);
scan.close();
}
static int GCD(int a, int b) {
// Everything divides 0
if (a == 0) return b;
if (b == 0) return a;
// base case
if (a == b) return a;
// a is greater
if (a > b) return GCD(a-b, b);
return GCD(a, b-a);
}
static int LCM(int a, int b){
return (a*b)/(GCD(a,b));
}
static String rev(String s){
char[] arr = s.toCharArray();
for(int i = 0; i<(s.length()+1)/2; i++){
char temp = arr[i];
arr[i] = arr[s.length()-i-1];
arr[s.length()-i-1] = temp;
}
String fin = new String(arr);
return fin;
}
static long pow(long a, long N) {
if (N == 0) return 1;
else if (N == 1) return a;
else {
long R = pow(a,N/2);
if (N % 2 == 0) {
return R*R;
}
else {
return R*R*a;
}
}
}
static long powMod(long a, long N) {
if (N == 0) return 1;
else if (N == 1) return a % mod;
else {
long R = powMod(a,N/2) % mod;
R *= R;
R %= mod;
if (N % 2 == 1) {
R *= a;
R %= mod;
}
return R % mod;
}
}
} |
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
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,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
83,
8
],
[
83,
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,
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
],
[
11,
49
],
[
49,
50
],
[
50,
51
],
[
49,
52
],
[
11,
53
],
[
53,
54
],
[
53,
55
],
[
11,
56
],
[
56,
57
],
[
57,
58
],
[
58,
59
],
[
58,
60
],
[
56,
61
],
[
61,
62
],
[
61,
63
],
[
56,
64
],
[
64,
65
],
[
65,
66
],
[
56,
67
],
[
68,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
71,
72
],
[
71,
73
],
[
11,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
74,
79
],
[
9,
80
],
[
80,
81
],
[
0,
82
],
[
82,
83
],
[
82,
84
]
]
| [
"import java.util.Scanner;\nimport java.util.Arrays;\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 k = scan.nextInt();\n\t\tint[] p = new int[n];\n\t\tfor(int i=0; i<n; i++){\n\t\t\tp[i] = scan.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint sum = 0;\n\t\tfor(int i=0; i<k; i++){\n\t\t\tsum += p[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Arrays;",
"Arrays",
"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 k = scan.nextInt();\n\t\tint[] p = new int[n];\n\t\tfor(int i=0; i<n; i++){\n\t\t\tp[i] = scan.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint sum = 0;\n\t\tfor(int i=0; i<k; i++){\n\t\t\tsum += p[i];\n\t\t}\n\t\tSystem.out.println(sum);\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 k = scan.nextInt();\n\t\tint[] p = new int[n];\n\t\tfor(int i=0; i<n; i++){\n\t\t\tp[i] = scan.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint sum = 0;\n\t\tfor(int i=0; i<k; i++){\n\t\t\tsum += p[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tint[] p = new int[n];\n\t\tfor(int i=0; i<n; i++){\n\t\t\tp[i] = scan.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint sum = 0;\n\t\tfor(int i=0; i<k; i++){\n\t\t\tsum += p[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int k = scan.nextInt();",
"k",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] p = new int[n];",
"p",
"new int[n]",
"n",
"for(int i=0; i<n; i++){\n\t\t\tp[i] = scan.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tp[i] = scan.nextInt();\n\t\t}",
"{\n\t\t\tp[i] = scan.nextInt();\n\t\t}",
"p[i] = scan.nextInt()",
"p[i]",
"p",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"Arrays.sort(p)",
"Arrays.sort",
"Arrays",
"p",
"int sum = 0;",
"sum",
"0",
"for(int i=0; i<k; i++){\n\t\t\tsum += p[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tsum += p[i];\n\t\t}",
"{\n\t\t\tsum += p[i];\n\t\t}",
"sum += p[i]",
"sum",
"p[i]",
"p",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"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 k = scan.nextInt();\n\t\tint[] p = new int[n];\n\t\tfor(int i=0; i<n; i++){\n\t\t\tp[i] = scan.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint sum = 0;\n\t\tfor(int i=0; i<k; i++){\n\t\t\tsum += p[i];\n\t\t}\n\t\tSystem.out.println(sum);\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 k = scan.nextInt();\n\t\tint[] p = new int[n];\n\t\tfor(int i=0; i<n; i++){\n\t\t\tp[i] = scan.nextInt();\n\t\t}\n\t\tArrays.sort(p);\n\t\tint sum = 0;\n\t\tfor(int i=0; i<k; i++){\n\t\t\tsum += p[i];\n\t\t}\n\t\tSystem.out.println(sum);\n\t}\n}",
"Main"
]
| import java.util.Scanner;
import java.util.Arrays;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int k = scan.nextInt();
int[] p = new int[n];
for(int i=0; i<n; i++){
p[i] = scan.nextInt();
}
Arrays.sort(p);
int sum = 0;
for(int i=0; i<k; i++){
sum += p[i];
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
2,
17,
17,
12,
13,
30,
14,
2,
13,
17,
29,
13,
29,
4,
13,
2,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
17,
42,
2,
13,
17,
30,
14,
2,
2,
13,
17,
17,
30,
0,
13,
2,
2,
13,
13,
13,
0,
13,
2,
2,
13,
13,
13,
0,
13,
2,
13,
17,
29,
13,
23,
13,
23,
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,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
18,
13,
13,
4,
18,
13,
13,
4,
18,
13,
4,
18,
13,
23,
13,
6,
13,
41,
13,
41,
13,
20,
17,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
18,
36,
13,
13,
23,
13,
12,
13,
30,
14,
2,
13,
40,
17,
37,
20,
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,
40,
17,
29,
18,
13,
40,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
30,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
40,
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,
17,
0,
13,
2,
13,
17,
0,
13,
4,
13,
29,
2,
13,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
30,
0,
13,
4,
13,
41,
13,
17,
14,
2,
13,
17,
30,
0,
13,
40,
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,
17,
0,
13,
2,
13,
17,
0,
13,
4,
13,
29,
2,
13,
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,
4,
13,
42,
4,
13,
13,
30,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
41,
13,
4,
13,
42,
4,
13,
13,
0,
13,
4,
13,
41,
13,
20,
42,
40,
4,
13,
13,
30,
4,
18,
13,
13,
0,
13,
4,
13,
29,
4,
18,
13,
12,
13,
30,
14,
2,
13,
17,
29,
4,
18,
13,
13,
29,
2,
2,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
12,
13,
30,
29,
2,
2,
2,
13,
17,
2,
13,
17,
2,
13,
40,
17,
23,
13,
6,
13,
12,
13,
23,
13,
6,
13,
41,
13,
12,
13,
30,
0,
13,
20,
23,
13,
12,
13,
30,
0,
18,
36,
13,
20,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
2,
13,
17,
4,
18,
13,
17,
4,
18,
13,
18,
13,
13,
23,
13,
12,
13,
30,
4,
13,
13,
4,
18,
13,
23,
13,
12,
13,
30,
4,
18,
13,
12,
13,
30,
4,
18,
13,
6,
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,
18,
13,
29,
13,
23,
13,
23,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
11,
13
],
[
7,
14
],
[
14,
15
],
[
14,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
17,
21
],
[
21,
22
],
[
16,
23
],
[
23,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
26,
28
],
[
24,
29
],
[
14,
30
],
[
30,
31
],
[
14,
32
],
[
32,
33
],
[
7,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
36,
40
],
[
40,
41
],
[
41,
42
],
[
41,
43
],
[
40,
44
],
[
44,
45
],
[
45,
46
],
[
46,
47
],
[
47,
48
],
[
47,
49
],
[
46,
50
],
[
45,
51
],
[
51,
52
],
[
52,
53
],
[
52,
54
],
[
54,
55
],
[
55,
56
],
[
55,
57
],
[
54,
58
],
[
44,
59
],
[
59,
60
],
[
59,
61
],
[
61,
62
],
[
62,
63
],
[
62,
64
],
[
61,
65
],
[
44,
66
],
[
66,
67
],
[
66,
68
],
[
68,
69
],
[
68,
70
],
[
36,
71
],
[
71,
72
],
[
34,
73
],
[
73,
74
],
[
34,
75
],
[
75,
76
],
[
7,
77
],
[
77,
78
],
[
77,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
79,
83
],
[
83,
84
],
[
83,
85
],
[
79,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
89,
90
],
[
79,
91
],
[
91,
92
],
[
91,
93
],
[
93,
94
],
[
94,
95
],
[
79,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
99,
100
],
[
98,
101
],
[
79,
102
],
[
102,
103
],
[
102,
104
],
[
79,
105
],
[
105,
106
],
[
106,
107
],
[
105,
108
],
[
79,
109
],
[
109,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
109,
114
],
[
114,
115
],
[
114,
116
],
[
109,
117
],
[
117,
118
],
[
118,
119
],
[
109,
120
],
[
120,
121
],
[
121,
122
],
[
121,
123
],
[
123,
124
],
[
123,
125
],
[
79,
126
],
[
126,
127
],
[
127,
128
],
[
126,
129
],
[
79,
130
],
[
130,
131
],
[
131,
132
],
[
79,
133
],
[
133,
134
],
[
134,
135
],
[
77,
136
],
[
136,
137
],
[
7,
138
],
[
138,
139
],
[
138,
140
],
[
140,
141
],
[
138,
142
],
[
142,
143
],
[
142,
144
],
[
138,
146
],
[
146,
147
],
[
138,
148
],
[
148,
149
],
[
138,
150
],
[
150,
151
],
[
138,
152
],
[
152,
153
],
[
152,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
152,
160
],
[
160,
161
],
[
138,
162
],
[
162,
163
],
[
162,
164
],
[
164,
165
],
[
165,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
165,
170
],
[
170,
171
],
[
164,
172
],
[
172,
173
],
[
173,
174
],
[
173,
175
],
[
172,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
180,
181
],
[
181,
182
],
[
181,
183
],
[
183,
184
],
[
184,
185
],
[
180,
186
],
[
186,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
190,
191
],
[
189,
192
],
[
176,
193
],
[
193,
194
],
[
194,
195
],
[
194,
196
],
[
193,
197
],
[
197,
198
],
[
198,
199
],
[
164,
200
],
[
200,
201
],
[
201,
202
],
[
201,
203
],
[
203,
204
],
[
138,
205
],
[
205,
206
],
[
205,
207
],
[
207,
208
],
[
208,
209
],
[
208,
210
],
[
210,
211
],
[
207,
212
],
[
212,
213
],
[
213,
214
],
[
213,
215
],
[
212,
216
],
[
216,
217
],
[
217,
218
],
[
217,
219
],
[
219,
220
],
[
207,
221
],
[
221,
222
],
[
221,
223
],
[
207,
224
],
[
224,
225
],
[
225,
226
],
[
225,
227
],
[
224,
228
],
[
228,
229
],
[
229,
230
],
[
229,
231
],
[
231,
232
],
[
228,
233
],
[
233,
234
],
[
233,
235
],
[
235,
236
],
[
207,
237
],
[
237,
238
],
[
237,
239
],
[
207,
240
],
[
240,
241
],
[
241,
242
],
[
242,
243
],
[
242,
244
],
[
240,
245
],
[
245,
246
],
[
246,
247
],
[
247,
248
],
[
248,
249
],
[
248,
250
],
[
247,
251
],
[
251,
252
],
[
251,
253
],
[
246,
254
],
[
254,
255
],
[
245,
256
],
[
256,
257
],
[
256,
258
],
[
245,
259
],
[
259,
260
],
[
259,
261
],
[
261,
262
],
[
261,
263
],
[
245,
264
],
[
264,
265
],
[
264,
266
],
[
266,
267
],
[
207,
268
],
[
268,
269
],
[
269,
270
],
[
269,
271
],
[
138,
272
],
[
272,
273
],
[
272,
274
],
[
274,
275
],
[
275,
276
],
[
275,
277
],
[
277,
278
],
[
274,
279
],
[
279,
280
],
[
280,
281
],
[
280,
282
],
[
279,
283
],
[
283,
284
],
[
284,
285
],
[
284,
286
],
[
286,
287
],
[
274,
288
],
[
288,
289
],
[
288,
290
],
[
274,
291
],
[
291,
292
],
[
292,
293
],
[
292,
294
],
[
291,
295
],
[
295,
296
],
[
296,
297
],
[
296,
298
],
[
298,
299
],
[
295,
300
],
[
300,
301
],
[
300,
302
],
[
302,
303
],
[
274,
304
],
[
304,
305
],
[
304,
306
],
[
274,
307
],
[
307,
308
],
[
308,
309
],
[
309,
310
],
[
309,
311
],
[
307,
312
],
[
312,
313
],
[
313,
314
],
[
314,
315
],
[
315,
316
],
[
315,
317
],
[
314,
318
],
[
318,
319
],
[
318,
320
],
[
313,
321
],
[
321,
322
],
[
312,
323
],
[
323,
324
],
[
323,
325
],
[
312,
326
],
[
326,
327
],
[
326,
328
],
[
328,
329
],
[
328,
330
],
[
312,
331
],
[
331,
332
],
[
331,
333
],
[
333,
334
],
[
274,
335
],
[
335,
336
],
[
336,
337
],
[
336,
338
],
[
138,
339
],
[
339,
340
],
[
339,
341
],
[
341,
342
],
[
342,
343
],
[
342,
344
],
[
341,
346
],
[
346,
347
],
[
347,
348
],
[
348,
349
],
[
348,
350
],
[
346,
351
],
[
351,
352
],
[
351,
353
],
[
346,
354
],
[
354,
355
],
[
355,
356
],
[
346,
357
],
[
358,
358
],
[
358,
359
],
[
359,
360
],
[
360,
361
],
[
360,
362
],
[
359,
363
],
[
363,
364
],
[
341,
365
],
[
365,
366
],
[
339,
367
],
[
367,
368
],
[
138,
369
],
[
369,
370
],
[
369,
371
],
[
371,
372
],
[
372,
373
],
[
372,
374
],
[
374,
375
],
[
371,
376
],
[
376,
377
],
[
377,
378
],
[
377,
379
],
[
376,
380
],
[
380,
381
],
[
381,
382
],
[
381,
383
],
[
383,
384
],
[
371,
385
],
[
385,
386
],
[
385,
387
],
[
371,
388
],
[
388,
389
],
[
389,
390
],
[
390,
391
],
[
390,
392
],
[
388,
393
],
[
393,
394
],
[
394,
395
],
[
395,
396
],
[
394,
397
],
[
393,
398
],
[
398,
399
],
[
398,
400
],
[
400,
401
],
[
371,
402
],
[
402,
403
],
[
403,
404
],
[
404,
405
],
[
138,
406
],
[
406,
407
],
[
406,
408
],
[
408,
409
],
[
409,
410
],
[
409,
411
],
[
411,
412
],
[
408,
413
],
[
413,
414
],
[
414,
415
],
[
414,
416
],
[
413,
417
],
[
417,
418
],
[
417,
419
],
[
419,
420
],
[
408,
421
],
[
421,
422
],
[
421,
423
],
[
408,
424
],
[
424,
425
],
[
425,
426
],
[
426,
427
],
[
426,
428
],
[
424,
429
],
[
429,
430
],
[
430,
431
],
[
431,
432
],
[
430,
433
],
[
429,
434
],
[
434,
435
],
[
434,
436
],
[
436,
437
],
[
408,
438
],
[
438,
439
],
[
439,
440
],
[
440,
441
],
[
138,
442
],
[
442,
443
],
[
442,
444
],
[
444,
445
],
[
445,
446
],
[
446,
447
],
[
446,
448
],
[
445,
449
],
[
449,
450
],
[
450,
451
],
[
451,
452
],
[
450,
453
],
[
444,
454
],
[
454,
455
],
[
458,
456
],
[
468,
457
],
[
465,
458
],
[
458,
459
],
[
459,
460
],
[
459,
461
],
[
458,
462
],
[
462,
463
],
[
462,
464
],
[
465,
465
],
[
465,
466
],
[
465,
467
],
[
468,
468
],
[
468,
469
],
[
468,
470
],
[
458,
471
],
[
471,
472
],
[
471,
473
],
[
473,
474
],
[
442,
475
],
[
475,
476
],
[
138,
477
],
[
477,
478
],
[
477,
479
],
[
479,
480
],
[
480,
481
],
[
482,
482
],
[
482,
483
],
[
483,
484
],
[
483,
485
],
[
482,
486
],
[
486,
487
],
[
486,
488
],
[
482,
489
],
[
489,
490
],
[
489,
491
],
[
491,
492
],
[
477,
493
],
[
493,
494
],
[
138,
495
],
[
495,
496
],
[
495,
497
],
[
497,
498
],
[
497,
499
],
[
499,
500
],
[
7,
501
],
[
501,
502
],
[
501,
503
],
[
503,
504
],
[
501,
505
],
[
505,
506
],
[
505,
507
],
[
507,
508
],
[
508,
509
],
[
508,
510
],
[
505,
511
],
[
511,
512
],
[
501,
513
],
[
513,
514
],
[
513,
515
],
[
515,
516
],
[
516,
517
],
[
517,
518
],
[
517,
519
],
[
516,
520
],
[
513,
521
],
[
521,
522
],
[
501,
523
],
[
523,
524
],
[
523,
525
],
[
525,
526
],
[
526,
527
],
[
527,
528
],
[
528,
529
],
[
528,
530
],
[
526,
531
],
[
531,
532
],
[
531,
533
],
[
533,
534
],
[
533,
535
],
[
526,
536
],
[
536,
537
],
[
537,
538
],
[
526,
539
],
[
540,
540
],
[
540,
541
],
[
541,
542
],
[
542,
543
],
[
542,
544
],
[
541,
545
],
[
545,
546
],
[
546,
547
],
[
545,
548
],
[
540,
549
],
[
549,
550
],
[
550,
551
],
[
549,
552
],
[
552,
553
],
[
552,
554
],
[
523,
555
],
[
555,
556
],
[
501,
557
],
[
557,
558
],
[
557,
559
],
[
559,
560
],
[
560,
561
],
[
560,
562
],
[
559,
563
],
[
563,
564
],
[
564,
565
],
[
557,
566
],
[
566,
567
],
[
501,
568
],
[
568,
569
],
[
568,
570
],
[
570,
571
],
[
571,
572
],
[
572,
573
],
[
501,
574
],
[
574,
575
],
[
574,
576
],
[
576,
577
],
[
577,
578
],
[
578,
579
],
[
7,
580
],
[
580,
581
],
[
580,
582
],
[
582,
583
],
[
582,
584
],
[
584,
585
],
[
585,
586
],
[
585,
587
],
[
584,
589
],
[
589,
590
],
[
590,
591
],
[
591,
592
],
[
591,
593
],
[
589,
594
],
[
594,
595
],
[
594,
596
],
[
589,
597
],
[
597,
598
],
[
598,
599
],
[
589,
600
],
[
600,
601
],
[
601,
602
],
[
602,
603
],
[
602,
604
],
[
601,
605
],
[
605,
606
],
[
606,
607
],
[
584,
608
],
[
608,
609
],
[
582,
610
],
[
610,
611
],
[
582,
612
],
[
612,
613
]
]
| [
"import java.util.*;\nimport java.io.*;\nclass Main{\n static class InputReader {\n\n private final InputStream stream;\n private final byte[] buf = new byte[8192];\n private int curChar, snumChars;\n private SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int snext() {\n if (snumChars == -1)\n throw new InputMismatchException();\n if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = snext();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long nextLong() {\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = snext();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public int[] nextIntArray(int n) {\n int a[] = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public String readString() {\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = snext();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public String nextLine() {\n int c = snext();\n while (isSpaceChar(c))\n c = snext();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = snext();\n } while (!isEndOfLine(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n private boolean isEndOfLine(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n\n }\n static class OutputWriter {\n\t\tprivate final PrintWriter writer;\n \n\t\tpublic OutputWriter(OutputStream outputStream) {\n\t\t\twriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n\t\t}\n \n\t\tpublic OutputWriter(Writer writer) {\n\t\t\tthis.writer = new PrintWriter(writer);\n\t\t}\n \n\t\tpublic void print(Object...objects) {\n\t\t\tfor (int i = 0; i < objects.length; i++) {\n\t\t\t\tif (i != 0)\n\t\t\t\t\twriter.print(' ');\n\t\t\t\twriter.print(objects[i]);\n\t\t\t}\n\t\t}\n \n\t\tpublic void printLine(Object...objects) {\n\t\t\tprint(objects);\n\t\t\twriter.println();\n\t\t}\n \n\t\tpublic void close() {\n\t\t\twriter.close();\n\t\t}\n \n\t\tpublic void flush() {\n\t\t\twriter.flush();\n\t\t}\n \n\t\t}\n \n static class IOUtils {\n \n\t\tpublic static int[] readIntArray(InputReader in, int size) {\n int[] array = new int[size];\n for (int i = 0; i < size; i++)\n array[i] = in.nextInt();\n return array;\n }\n\n }\n static int gcd(int a, int b) \n { \n if (a == 0) \n return b; \n return gcd(b % a, a); \n } \n static int mod = (int)(1e9+7);\n public static long pow(long a,long b)\n {\n long ans = 1;\n while(b> 0)\n {\n if((b & 1)==1){\n ans = (ans*a) % mod; \n }\n a = (a*a) % mod;\n b = b>>1;\n }\n return ans;\n }\n\n public static void main(String[] args) {\n InputReader in = new InputReader(System.in);\n OutputWriter out = new OutputWriter(System.out);\n //IOUtils io = new IOUtils();\n int n = in.nextInt(),k = in.nextInt();\n int[] arr = in.nextIntArray(n);\n long res = 0;\n Arrays.sort(arr);\n for(int i=0;i<k;i++)\n res+=arr[i];\n out.printLine(res);\n out.flush();\n out.close();\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"class Main{\n static class InputReader {\n\n private final InputStream stream;\n private final byte[] buf = new byte[8192];\n private int curChar, snumChars;\n private SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int snext() {\n if (snumChars == -1)\n throw new InputMismatchException();\n if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = snext();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long nextLong() {\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = snext();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public int[] nextIntArray(int n) {\n int a[] = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public String readString() {\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = snext();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public String nextLine() {\n int c = snext();\n while (isSpaceChar(c))\n c = snext();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = snext();\n } while (!isEndOfLine(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n private boolean isEndOfLine(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n\n }\n static class OutputWriter {\n\t\tprivate final PrintWriter writer;\n \n\t\tpublic OutputWriter(OutputStream outputStream) {\n\t\t\twriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n\t\t}\n \n\t\tpublic OutputWriter(Writer writer) {\n\t\t\tthis.writer = new PrintWriter(writer);\n\t\t}\n \n\t\tpublic void print(Object...objects) {\n\t\t\tfor (int i = 0; i < objects.length; i++) {\n\t\t\t\tif (i != 0)\n\t\t\t\t\twriter.print(' ');\n\t\t\t\twriter.print(objects[i]);\n\t\t\t}\n\t\t}\n \n\t\tpublic void printLine(Object...objects) {\n\t\t\tprint(objects);\n\t\t\twriter.println();\n\t\t}\n \n\t\tpublic void close() {\n\t\t\twriter.close();\n\t\t}\n \n\t\tpublic void flush() {\n\t\t\twriter.flush();\n\t\t}\n \n\t\t}\n \n static class IOUtils {\n \n\t\tpublic static int[] readIntArray(InputReader in, int size) {\n int[] array = new int[size];\n for (int i = 0; i < size; i++)\n array[i] = in.nextInt();\n return array;\n }\n\n }\n static int gcd(int a, int b) \n { \n if (a == 0) \n return b; \n return gcd(b % a, a); \n } \n static int mod = (int)(1e9+7);\n public static long pow(long a,long b)\n {\n long ans = 1;\n while(b> 0)\n {\n if((b & 1)==1){\n ans = (ans*a) % mod; \n }\n a = (a*a) % mod;\n b = b>>1;\n }\n return ans;\n }\n\n public static void main(String[] args) {\n InputReader in = new InputReader(System.in);\n OutputWriter out = new OutputWriter(System.out);\n //IOUtils io = new IOUtils();\n int n = in.nextInt(),k = in.nextInt();\n int[] arr = in.nextIntArray(n);\n long res = 0;\n Arrays.sort(arr);\n for(int i=0;i<k;i++)\n res+=arr[i];\n out.printLine(res);\n out.flush();\n out.close();\n }\n}",
"Main",
"static int mod = (int)(1e9+7);",
"mod",
"(int)(1e9+7)",
"1e9",
"7",
"static int gcd(int a, int b) \n { \n if (a == 0) \n return b; \n return gcd(b % a, a); \n }",
"gcd",
"{ \n if (a == 0) \n return b; \n return gcd(b % a, a); \n }",
"if (a == 0) \n return b;",
"a == 0",
"a",
"0",
"return b;",
"b",
"return gcd(b % a, a);",
"gcd(b % a, a)",
"gcd",
"b % a",
"b",
"a",
"a",
"int a",
"a",
"int b",
"b",
"public static long pow(long a,long b)\n {\n long ans = 1;\n while(b> 0)\n {\n if((b & 1)==1){\n ans = (ans*a) % mod; \n }\n a = (a*a) % mod;\n b = b>>1;\n }\n return ans;\n }",
"pow",
"{\n long ans = 1;\n while(b> 0)\n {\n if((b & 1)==1){\n ans = (ans*a) % mod; \n }\n a = (a*a) % mod;\n b = b>>1;\n }\n return ans;\n }",
"long ans = 1;",
"ans",
"1",
"while(b> 0)\n {\n if((b & 1)==1){\n ans = (ans*a) % mod; \n }\n a = (a*a) % mod;\n b = b>>1;\n }",
"b> 0",
"b",
"0",
"{\n if((b & 1)==1){\n ans = (ans*a) % mod; \n }\n a = (a*a) % mod;\n b = b>>1;\n }",
"if((b & 1)==1){\n ans = (ans*a) % mod; \n }",
"(b & 1)==1",
"(b & 1)",
"b",
"1",
"1",
"{\n ans = (ans*a) % mod; \n }",
"ans = (ans*a) % mod",
"ans",
"(ans*a) % mod",
"(ans*a)",
"ans",
"a",
"mod",
"a = (a*a) % mod",
"a",
"(a*a) % mod",
"(a*a)",
"a",
"a",
"mod",
"b = b>>1",
"b",
"b>>1",
"b",
"1",
"return ans;",
"ans",
"long a",
"a",
"long b",
"b",
"public static void main(String[] args) {\n InputReader in = new InputReader(System.in);\n OutputWriter out = new OutputWriter(System.out);\n //IOUtils io = new IOUtils();\n int n = in.nextInt(),k = in.nextInt();\n int[] arr = in.nextIntArray(n);\n long res = 0;\n Arrays.sort(arr);\n for(int i=0;i<k;i++)\n res+=arr[i];\n out.printLine(res);\n out.flush();\n out.close();\n }",
"main",
"{\n InputReader in = new InputReader(System.in);\n OutputWriter out = new OutputWriter(System.out);\n //IOUtils io = new IOUtils();\n int n = in.nextInt(),k = in.nextInt();\n int[] arr = in.nextIntArray(n);\n long res = 0;\n Arrays.sort(arr);\n for(int i=0;i<k;i++)\n res+=arr[i];\n out.printLine(res);\n out.flush();\n out.close();\n }",
"InputReader in = new InputReader(System.in);",
"in",
"new InputReader(System.in)",
"OutputWriter out = new OutputWriter(System.out);",
"out",
"new OutputWriter(System.out)",
"int n = in.nextInt()",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"k = in.nextInt();",
"k",
"in.nextInt()",
"in.nextInt",
"in",
"int[] arr = in.nextIntArray(n);",
"arr",
"in.nextIntArray(n)",
"in.nextIntArray",
"in",
"n",
"long res = 0;",
"res",
"0",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"for(int i=0;i<k;i++)\n res+=arr[i];",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"res+=arr[i];",
"res+=arr[i]",
"res",
"arr[i]",
"arr",
"i",
"out.printLine(res)",
"out.printLine",
"out",
"res",
"out.flush()",
"out.flush",
"out",
"out.close()",
"out.close",
"out",
"String[] args",
"args",
"static class InputReader {\n\n private final InputStream stream;\n private final byte[] buf = new byte[8192];\n private int curChar, snumChars;\n private SpaceCharFilter filter;\n\n public InputReader(InputStream stream) {\n this.stream = stream;\n }\n\n public int snext() {\n if (snumChars == -1)\n throw new InputMismatchException();\n if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }\n\n public int nextInt() {\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = snext();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public long nextLong() {\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = snext();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n } while (!isSpaceChar(c));\n return res * sgn;\n }\n\n public int[] nextIntArray(int n) {\n int a[] = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }\n\n public String readString() {\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = snext();\n } while (!isSpaceChar(c));\n return res.toString();\n }\n\n public String nextLine() {\n int c = snext();\n while (isSpaceChar(c))\n c = snext();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = snext();\n } while (!isEndOfLine(c));\n return res.toString();\n }\n\n public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }\n\n private boolean isEndOfLine(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }\n\n public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }\n\n }",
"InputReader",
"private final InputStream stream;",
"stream",
"private final byte[] buf = new byte[8192];",
"buf",
"new byte[8192]",
"8192",
"private int curChar",
"curChar",
"snumChars;",
"snumChars",
"private SpaceCharFilter filter;",
"filter",
"public InputReader(InputStream stream) {\n this.stream = stream;\n }",
"InputReader",
"{\n this.stream = stream;\n }",
"this.stream = stream",
"this.stream",
"this",
"this.stream",
"stream",
"InputStream stream",
"stream",
"public int snext() {\n if (snumChars == -1)\n throw new InputMismatchException();\n if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }",
"snext",
"{\n if (snumChars == -1)\n throw new InputMismatchException();\n if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }\n return buf[curChar++];\n }",
"if (snumChars == -1)\n throw new InputMismatchException();",
"snumChars == -1",
"snumChars",
"-1",
"1",
"throw new InputMismatchException();",
"new InputMismatchException()",
"if (curChar >= snumChars) {\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }",
"curChar >= snumChars",
"curChar",
"snumChars",
"{\n curChar = 0;\n try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }\n if (snumChars <= 0)\n return -1;\n }",
"curChar = 0",
"curChar",
"0",
"try {\n snumChars = stream.read(buf);\n } catch (IOException e) {\n throw new InputMismatchException();\n }",
"catch (IOException e) {\n throw new InputMismatchException();\n }",
"IOException e",
"{\n throw new InputMismatchException();\n }",
"throw new InputMismatchException();",
"new InputMismatchException()",
"{\n snumChars = stream.read(buf);\n }",
"snumChars = stream.read(buf)",
"snumChars",
"stream.read(buf)",
"stream.read",
"stream",
"buf",
"if (snumChars <= 0)\n return -1;",
"snumChars <= 0",
"snumChars",
"0",
"return -1;",
"-1",
"1",
"return buf[curChar++];",
"buf[curChar++]",
"buf",
"curChar++",
"curChar",
"public int nextInt() {\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = snext();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"nextInt",
"{\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = snext();\n }\n int res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"int c = snext();",
"c",
"snext()",
"snext",
"while (isSpaceChar(c)) {\n c = snext();\n }",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n c = snext();\n }",
"c = snext()",
"c",
"snext()",
"snext",
"int sgn = 1;",
"sgn",
"1",
"if (c == '-') {\n sgn = -1;\n c = snext();\n }",
"c == '-'",
"c",
"'-'",
"{\n sgn = -1;\n c = snext();\n }",
"sgn = -1",
"sgn",
"-1",
"1",
"c = snext()",
"c",
"snext()",
"snext",
"int res = 0;",
"res",
"0",
"do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n }",
"if (c < '0' || c > '9')\n throw new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"c = snext()",
"c",
"snext()",
"snext",
"return res * sgn;",
"res * sgn",
"res",
"sgn",
"public long nextLong() {\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = snext();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"nextLong",
"{\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n int sgn = 1;\n if (c == '-') {\n sgn = -1;\n c = snext();\n }\n long res = 0;\n do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n } while (!isSpaceChar(c));\n return res * sgn;\n }",
"int c = snext();",
"c",
"snext()",
"snext",
"while (isSpaceChar(c)) {\n c = snext();\n }",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n c = snext();\n }",
"c = snext()",
"c",
"snext()",
"snext",
"int sgn = 1;",
"sgn",
"1",
"if (c == '-') {\n sgn = -1;\n c = snext();\n }",
"c == '-'",
"c",
"'-'",
"{\n sgn = -1;\n c = snext();\n }",
"sgn = -1",
"sgn",
"-1",
"1",
"c = snext()",
"c",
"snext()",
"snext",
"long res = 0;",
"res",
"0",
"do {\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n if (c < '0' || c > '9')\n throw new InputMismatchException();\n res *= 10;\n res += c - '0';\n c = snext();\n }",
"if (c < '0' || c > '9')\n throw new InputMismatchException();",
"c < '0' || c > '9'",
"c < '0'",
"c",
"'0'",
"c > '9'",
"c",
"'9'",
"throw new InputMismatchException();",
"new InputMismatchException()",
"res *= 10",
"res",
"10",
"res += c - '0'",
"res",
"c - '0'",
"c",
"'0'",
"c = snext()",
"c",
"snext()",
"snext",
"return res * sgn;",
"res * sgn",
"res",
"sgn",
"public int[] nextIntArray(int n) {\n int a[] = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }",
"nextIntArray",
"{\n int a[] = new int[n];\n for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }\n return a;\n }",
"int a[] = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n a[i] = nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n a[i] = nextInt();\n }",
"{\n a[i] = nextInt();\n }",
"a[i] = nextInt()",
"a[i]",
"a",
"i",
"nextInt()",
"nextInt",
"return a;",
"a",
"int n",
"n",
"public String readString() {\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = snext();\n } while (!isSpaceChar(c));\n return res.toString();\n }",
"readString",
"{\n int c = snext();\n while (isSpaceChar(c)) {\n c = snext();\n }\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = snext();\n } while (!isSpaceChar(c));\n return res.toString();\n }",
"int c = snext();",
"c",
"snext()",
"snext",
"while (isSpaceChar(c)) {\n c = snext();\n }",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n c = snext();\n }",
"c = snext()",
"c",
"snext()",
"snext",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do {\n res.appendCodePoint(c);\n c = snext();\n } while (!isSpaceChar(c));",
"!isSpaceChar(c)",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"{\n res.appendCodePoint(c);\n c = snext();\n }",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = snext()",
"c",
"snext()",
"snext",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"public String nextLine() {\n int c = snext();\n while (isSpaceChar(c))\n c = snext();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = snext();\n } while (!isEndOfLine(c));\n return res.toString();\n }",
"nextLine",
"{\n int c = snext();\n while (isSpaceChar(c))\n c = snext();\n StringBuilder res = new StringBuilder();\n do {\n res.appendCodePoint(c);\n c = snext();\n } while (!isEndOfLine(c));\n return res.toString();\n }",
"int c = snext();",
"c",
"snext()",
"snext",
"while (isSpaceChar(c))\n c = snext();",
"isSpaceChar(c)",
"isSpaceChar",
"c",
"c = snext()",
"c",
"snext()",
"snext",
"StringBuilder res = new StringBuilder();",
"res",
"new StringBuilder()",
"do {\n res.appendCodePoint(c);\n c = snext();\n } while (!isEndOfLine(c));",
"!isEndOfLine(c)",
"isEndOfLine(c)",
"isEndOfLine",
"c",
"{\n res.appendCodePoint(c);\n c = snext();\n }",
"res.appendCodePoint(c)",
"res.appendCodePoint",
"res",
"c",
"c = snext()",
"c",
"snext()",
"snext",
"return res.toString();",
"res.toString()",
"res.toString",
"res",
"public boolean isSpaceChar(int c) {\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"isSpaceChar",
"{\n if (filter != null)\n return filter.isSpaceChar(c);\n return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;\n }",
"if (filter != null)\n return filter.isSpaceChar(c);",
"filter != null",
"filter",
"null",
"return filter.isSpaceChar(c);",
"filter.isSpaceChar(c)",
"filter.isSpaceChar",
"filter",
"c",
"return c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1;",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == '\\t'",
"c == '\\r'",
"c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' || c == -1",
"c == ' '",
"c",
"' '",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == '\\t'",
"c",
"'\\t'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"private boolean isEndOfLine(int c) {\n return c == '\\n' || c == '\\r' || c == -1;\n }",
"isEndOfLine",
"{\n return c == '\\n' || c == '\\r' || c == -1;\n }",
"return c == '\\n' || c == '\\r' || c == -1;",
"c == '\\n' || c == '\\r' || c == -1",
"c == '\\n' || c == '\\r' || c == -1",
"c == '\\n'",
"c",
"'\\n'",
"c == '\\r'",
"c",
"'\\r'",
"c == -1",
"c",
"-1",
"1",
"int c",
"c",
"public interface SpaceCharFilter {\n public boolean isSpaceChar(int ch);\n }",
"SpaceCharFilter",
"public boolean isSpaceChar(int ch);",
"isSpaceChar",
"int ch",
"ch",
"static class OutputWriter {\n\t\tprivate final PrintWriter writer;\n \n\t\tpublic OutputWriter(OutputStream outputStream) {\n\t\t\twriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n\t\t}\n \n\t\tpublic OutputWriter(Writer writer) {\n\t\t\tthis.writer = new PrintWriter(writer);\n\t\t}\n \n\t\tpublic void print(Object...objects) {\n\t\t\tfor (int i = 0; i < objects.length; i++) {\n\t\t\t\tif (i != 0)\n\t\t\t\t\twriter.print(' ');\n\t\t\t\twriter.print(objects[i]);\n\t\t\t}\n\t\t}\n \n\t\tpublic void printLine(Object...objects) {\n\t\t\tprint(objects);\n\t\t\twriter.println();\n\t\t}\n \n\t\tpublic void close() {\n\t\t\twriter.close();\n\t\t}\n \n\t\tpublic void flush() {\n\t\t\twriter.flush();\n\t\t}\n \n\t\t}",
"OutputWriter",
"private final PrintWriter writer;",
"writer",
"public OutputWriter(OutputStream outputStream) {\n\t\t\twriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n\t\t}",
"OutputWriter",
"{\n\t\t\twriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\n\t\t}",
"writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)))",
"writer",
"new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)))",
"OutputStream outputStream",
"outputStream",
"public OutputWriter(Writer writer) {\n\t\t\tthis.writer = new PrintWriter(writer);\n\t\t}",
"OutputWriter",
"{\n\t\t\tthis.writer = new PrintWriter(writer);\n\t\t}",
"this.writer = new PrintWriter(writer)",
"this.writer",
"this",
"this.writer",
"new PrintWriter(writer)",
"Writer writer",
"writer",
"public void print(Object...objects) {\n\t\t\tfor (int i = 0; i < objects.length; i++) {\n\t\t\t\tif (i != 0)\n\t\t\t\t\twriter.print(' ');\n\t\t\t\twriter.print(objects[i]);\n\t\t\t}\n\t\t}",
"print",
"{\n\t\t\tfor (int i = 0; i < objects.length; i++) {\n\t\t\t\tif (i != 0)\n\t\t\t\t\twriter.print(' ');\n\t\t\t\twriter.print(objects[i]);\n\t\t\t}\n\t\t}",
"for (int i = 0; i < objects.length; i++) {\n\t\t\t\tif (i != 0)\n\t\t\t\t\twriter.print(' ');\n\t\t\t\twriter.print(objects[i]);\n\t\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < objects.length",
"i",
"objects.length",
"objects",
"objects.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tif (i != 0)\n\t\t\t\t\twriter.print(' ');\n\t\t\t\twriter.print(objects[i]);\n\t\t\t}",
"{\n\t\t\t\tif (i != 0)\n\t\t\t\t\twriter.print(' ');\n\t\t\t\twriter.print(objects[i]);\n\t\t\t}",
"if (i != 0)\n\t\t\t\t\twriter.print(' ');",
"i != 0",
"i",
"0",
"writer.print(' ')",
"writer.print",
"writer",
"' '",
"writer.print(objects[i])",
"writer.print",
"writer",
"objects[i]",
"objects",
"i",
"Object...objects",
"objects",
"public void printLine(Object...objects) {\n\t\t\tprint(objects);\n\t\t\twriter.println();\n\t\t}",
"printLine",
"{\n\t\t\tprint(objects);\n\t\t\twriter.println();\n\t\t}",
"print(objects)",
"print",
"objects",
"writer.println()",
"writer.println",
"writer",
"Object...objects",
"objects",
"public void close() {\n\t\t\twriter.close();\n\t\t}",
"close",
"{\n\t\t\twriter.close();\n\t\t}",
"writer.close()",
"writer.close",
"writer",
"public void flush() {\n\t\t\twriter.flush();\n\t\t}",
"flush",
"{\n\t\t\twriter.flush();\n\t\t}",
"writer.flush()",
"writer.flush",
"writer",
"static class IOUtils {\n \n\t\tpublic static int[] readIntArray(InputReader in, int size) {\n int[] array = new int[size];\n for (int i = 0; i < size; i++)\n array[i] = in.nextInt();\n return array;\n }\n\n }",
"IOUtils",
"public static int[] readIntArray(InputReader in, int size) {\n int[] array = new int[size];\n for (int i = 0; i < size; i++)\n array[i] = in.nextInt();\n return array;\n }",
"readIntArray",
"{\n int[] array = new int[size];\n for (int i = 0; i < size; i++)\n array[i] = in.nextInt();\n return array;\n }",
"int[] array = new int[size];",
"array",
"new int[size]",
"size",
"for (int i = 0; i < size; i++)\n array[i] = in.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < size",
"i",
"size",
"i++",
"i++",
"i",
"array[i] = in.nextInt();",
"array[i] = in.nextInt()",
"array[i]",
"array",
"i",
"in.nextInt()",
"in.nextInt",
"in",
"return array;",
"array",
"InputReader in",
"in",
"int size",
"size"
]
| import java.util.*;
import java.io.*;
class Main{
static class InputReader {
private final InputStream stream;
private final byte[] buf = new byte[8192];
private int curChar, snumChars;
private SpaceCharFilter filter;
public InputReader(InputStream stream) {
this.stream = stream;
}
public int snext() {
if (snumChars == -1)
throw new InputMismatchException();
if (curChar >= snumChars) {
curChar = 0;
try {
snumChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (snumChars <= 0)
return -1;
}
return buf[curChar++];
}
public int nextInt() {
int c = snext();
while (isSpaceChar(c)) {
c = snext();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = snext();
}
int res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = snext();
} while (!isSpaceChar(c));
return res * sgn;
}
public long nextLong() {
int c = snext();
while (isSpaceChar(c)) {
c = snext();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = snext();
}
long res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = snext();
} while (!isSpaceChar(c));
return res * sgn;
}
public int[] nextIntArray(int n) {
int a[] = new int[n];
for (int i = 0; i < n; i++) {
a[i] = nextInt();
}
return a;
}
public String readString() {
int c = snext();
while (isSpaceChar(c)) {
c = snext();
}
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = snext();
} while (!isSpaceChar(c));
return res.toString();
}
public String nextLine() {
int c = snext();
while (isSpaceChar(c))
c = snext();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = snext();
} while (!isEndOfLine(c));
return res.toString();
}
public boolean isSpaceChar(int c) {
if (filter != null)
return filter.isSpaceChar(c);
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
private boolean isEndOfLine(int c) {
return c == '\n' || c == '\r' || c == -1;
}
public interface SpaceCharFilter {
public boolean isSpaceChar(int ch);
}
}
static class OutputWriter {
private final PrintWriter writer;
public OutputWriter(OutputStream outputStream) {
writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
}
public OutputWriter(Writer writer) {
this.writer = new PrintWriter(writer);
}
public void print(Object...objects) {
for (int i = 0; i < objects.length; i++) {
if (i != 0)
writer.print(' ');
writer.print(objects[i]);
}
}
public void printLine(Object...objects) {
print(objects);
writer.println();
}
public void close() {
writer.close();
}
public void flush() {
writer.flush();
}
}
static class IOUtils {
public static int[] readIntArray(InputReader in, int size) {
int[] array = new int[size];
for (int i = 0; i < size; i++)
array[i] = in.nextInt();
return array;
}
}
static int gcd(int a, int b)
{
if (a == 0)
return b;
return gcd(b % a, a);
}
static int mod = (int)(1e9+7);
public static long pow(long a,long b)
{
long ans = 1;
while(b> 0)
{
if((b & 1)==1){
ans = (ans*a) % mod;
}
a = (a*a) % mod;
b = b>>1;
}
return ans;
}
public static void main(String[] args) {
InputReader in = new InputReader(System.in);
OutputWriter out = new OutputWriter(System.out);
//IOUtils io = new IOUtils();
int n = in.nextInt(),k = in.nextInt();
int[] arr = in.nextIntArray(n);
long res = 0;
Arrays.sort(arr);
for(int i=0;i<k;i++)
res+=arr[i];
out.printLine(res);
out.flush();
out.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,
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,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
85,
11
],
[
85,
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
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
48,
49
],
[
14,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
14,
54
],
[
54,
55
],
[
54,
56
],
[
14,
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
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
14,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
12,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
]
| [
"import java.util.*;\nimport java.io.*;\nimport java.lang.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n\n ArrayList<Integer> arr = new ArrayList<Integer>();\n\n for (int i = 0; i<n; i++){\n arr.add(sc.nextInt());\n }\n\n Collections.sort(arr);\n int ans = 0;\n for (int i = 0; i<k; i++){\n ans += arr.get(i);\n }\n\n System.out.println(ans);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"import java.lang.*;",
"lang.*",
"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 int k = sc.nextInt();\n\n ArrayList<Integer> arr = new ArrayList<Integer>();\n\n for (int i = 0; i<n; i++){\n arr.add(sc.nextInt());\n }\n\n Collections.sort(arr);\n int ans = 0;\n for (int i = 0; i<k; i++){\n ans += arr.get(i);\n }\n\n System.out.println(ans);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n\n ArrayList<Integer> arr = new ArrayList<Integer>();\n\n for (int i = 0; i<n; i++){\n arr.add(sc.nextInt());\n }\n\n Collections.sort(arr);\n int ans = 0;\n for (int i = 0; i<k; i++){\n ans += arr.get(i);\n }\n\n System.out.println(ans);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n\n int n = sc.nextInt();\n int k = sc.nextInt();\n\n ArrayList<Integer> arr = new ArrayList<Integer>();\n\n for (int i = 0; i<n; i++){\n arr.add(sc.nextInt());\n }\n\n Collections.sort(arr);\n int ans = 0;\n for (int i = 0; i<k; i++){\n ans += arr.get(i);\n }\n\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 k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ArrayList<Integer> arr = new ArrayList<Integer>();",
"arr",
"new ArrayList<Integer>()",
"for (int i = 0; i<n; i++){\n arr.add(sc.nextInt());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr.add(sc.nextInt());\n }",
"{\n arr.add(sc.nextInt());\n }",
"arr.add(sc.nextInt())",
"arr.add",
"arr",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Collections.sort(arr)",
"Collections.sort",
"Collections",
"arr",
"int ans = 0;",
"ans",
"0",
"for (int i = 0; i<k; i++){\n ans += arr.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n ans += arr.get(i);\n }",
"{\n ans += arr.get(i);\n }",
"ans += arr.get(i)",
"ans",
"arr.get(i)",
"arr.get",
"arr",
"i",
"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\n int n = sc.nextInt();\n int k = sc.nextInt();\n\n ArrayList<Integer> arr = new ArrayList<Integer>();\n\n for (int i = 0; i<n; i++){\n arr.add(sc.nextInt());\n }\n\n Collections.sort(arr);\n int ans = 0;\n for (int i = 0; i<k; i++){\n ans += arr.get(i);\n }\n\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\n int n = sc.nextInt();\n int k = sc.nextInt();\n\n ArrayList<Integer> arr = new ArrayList<Integer>();\n\n for (int i = 0; i<n; i++){\n arr.add(sc.nextInt());\n }\n\n Collections.sort(arr);\n int ans = 0;\n for (int i = 0; i<k; i++){\n ans += arr.get(i);\n }\n\n System.out.println(ans);\n }\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 k = sc.nextInt();
ArrayList<Integer> arr = new ArrayList<Integer>();
for (int i = 0; i<n; i++){
arr.add(sc.nextInt());
}
Collections.sort(arr);
int ans = 0;
for (int i = 0; i<k; i++){
ans += arr.get(i);
}
System.out.println(ans);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
4,
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,
18,
13,
13,
13,
23,
13,
23,
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,
4,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
94,
8
],
[
94,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
12,
15
],
[
11,
16
],
[
16,
17
],
[
16,
18
],
[
11,
19
],
[
19,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
19,
24
],
[
24,
25
],
[
24,
26
],
[
19,
27
],
[
27,
28
],
[
28,
29
],
[
19,
30
],
[
31,
31
],
[
31,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
34,
36
],
[
11,
37
],
[
37,
38
],
[
38,
39
],
[
39,
40
],
[
39,
41
],
[
37,
42
],
[
9,
43
],
[
43,
44
],
[
9,
45
],
[
45,
46
],
[
94,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
50,
52
],
[
49,
53
],
[
53,
54
],
[
53,
55
],
[
55,
56
],
[
56,
57
],
[
49,
58
],
[
58,
59
],
[
58,
60
],
[
60,
61
],
[
61,
62
],
[
49,
63
],
[
63,
64
],
[
63,
65
],
[
49,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
69,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
67,
75
],
[
75,
76
],
[
76,
77
],
[
67,
78
],
[
79,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
84,
85
],
[
85,
86
],
[
49,
87
],
[
87,
88
],
[
87,
89
],
[
87,
90
],
[
47,
91
],
[
91,
92
],
[
0,
93
],
[
93,
94
],
[
93,
95
]
]
| [
"\nimport java.util.Arrays;\nimport java.util.Scanner;\npublic class Main {\n\n static void solve(int[] arr, int numberOfBrokeAss) {\n Arrays.sort(arr);\n int result = 0;\n for(int i = 0; i<numberOfBrokeAss; i++){\n result+=arr[i];\n }\n System.out.println(result);\n }\n\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int parameter = in.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n ; i++) {\n \tarr[i] = in.nextInt();\n \t}\n \t\tsolve(arr,parameter);\n\n }\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n static void solve(int[] arr, int numberOfBrokeAss) {\n Arrays.sort(arr);\n int result = 0;\n for(int i = 0; i<numberOfBrokeAss; i++){\n result+=arr[i];\n }\n System.out.println(result);\n }\n\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int parameter = in.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n ; i++) {\n \tarr[i] = in.nextInt();\n \t}\n \t\tsolve(arr,parameter);\n\n }\n}",
"Main",
"static void solve(int[] arr, int numberOfBrokeAss) {\n Arrays.sort(arr);\n int result = 0;\n for(int i = 0; i<numberOfBrokeAss; i++){\n result+=arr[i];\n }\n System.out.println(result);\n }",
"solve",
"{\n Arrays.sort(arr);\n int result = 0;\n for(int i = 0; i<numberOfBrokeAss; i++){\n result+=arr[i];\n }\n System.out.println(result);\n }",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"int result = 0;",
"result",
"0",
"for(int i = 0; i<numberOfBrokeAss; i++){\n result+=arr[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<numberOfBrokeAss",
"i",
"numberOfBrokeAss",
"i++",
"i++",
"i",
"{\n result+=arr[i];\n }",
"{\n result+=arr[i];\n }",
"result+=arr[i]",
"result",
"arr[i]",
"arr",
"i",
"System.out.println(result)",
"System.out.println",
"System.out",
"System",
"System.out",
"result",
"int[] arr",
"arr",
"int numberOfBrokeAss",
"numberOfBrokeAss",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int parameter = in.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n ; i++) {\n \tarr[i] = in.nextInt();\n \t}\n \t\tsolve(arr,parameter);\n\n }",
"main",
"{\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int parameter = in.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n ; i++) {\n \tarr[i] = in.nextInt();\n \t}\n \t\tsolve(arr,parameter);\n\n }",
"Scanner in = new Scanner(System.in);",
"in",
"new Scanner(System.in)",
"int n = in.nextInt();",
"n",
"in.nextInt()",
"in.nextInt",
"in",
"int parameter = in.nextInt();",
"parameter",
"in.nextInt()",
"in.nextInt",
"in",
"int[] arr = new int[n];",
"arr",
"new int[n]",
"n",
"for (int i = 0; i < n ; i++) {\n \tarr[i] = in.nextInt();\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n \tarr[i] = in.nextInt();\n \t}",
"{\n \tarr[i] = in.nextInt();\n \t}",
"arr[i] = in.nextInt()",
"arr[i]",
"arr",
"i",
"in.nextInt()",
"in.nextInt",
"in",
"solve(arr,parameter)",
"solve",
"arr",
"parameter",
"String[] args",
"args",
"public class Main {\n\n static void solve(int[] arr, int numberOfBrokeAss) {\n Arrays.sort(arr);\n int result = 0;\n for(int i = 0; i<numberOfBrokeAss; i++){\n result+=arr[i];\n }\n System.out.println(result);\n }\n\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int parameter = in.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n ; i++) {\n \tarr[i] = in.nextInt();\n \t}\n \t\tsolve(arr,parameter);\n\n }\n}",
"public class Main {\n\n static void solve(int[] arr, int numberOfBrokeAss) {\n Arrays.sort(arr);\n int result = 0;\n for(int i = 0; i<numberOfBrokeAss; i++){\n result+=arr[i];\n }\n System.out.println(result);\n }\n\n public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int parameter = in.nextInt();\n int[] arr = new int[n];\n for (int i = 0; i < n ; i++) {\n \tarr[i] = in.nextInt();\n \t}\n \t\tsolve(arr,parameter);\n\n }\n}",
"Main"
]
|
import java.util.Arrays;
import java.util.Scanner;
public class Main {
static void solve(int[] arr, int numberOfBrokeAss) {
Arrays.sort(arr);
int result = 0;
for(int i = 0; i<numberOfBrokeAss; i++){
result+=arr[i];
}
System.out.println(result);
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int parameter = in.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n ; i++) {
arr[i] = in.nextInt();
}
solve(arr,parameter);
}
} |
[
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,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
4,
18,
13,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
91,
11
],
[
91,
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,
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
],
[
46,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
14,
56
],
[
56,
57
],
[
57,
58
],
[
56,
59
],
[
14,
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
],
[
73,
75
],
[
75,
76
],
[
76,
77
],
[
75,
78
],
[
14,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
14,
85
],
[
85,
86
],
[
86,
87
],
[
12,
88
],
[
88,
89
],
[
0,
90
],
[
90,
91
],
[
90,
92
]
]
| [
"import java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tint n = kb.nextInt();\n\t\tint k = kb.nextInt();\n\t\tint count = 0;\n\t\tArrayList<Integer> a = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint p = kb.nextInt();\n\t\t\ta.add(p);\n\t\t}\n\t\tCollections.sort(a);\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tcount += a.get(i);\n\t\t}\n\n\t\tSystem.out.println(count);\n\n\t\tkb.close();\n\t}\n\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tint n = kb.nextInt();\n\t\tint k = kb.nextInt();\n\t\tint count = 0;\n\t\tArrayList<Integer> a = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint p = kb.nextInt();\n\t\t\ta.add(p);\n\t\t}\n\t\tCollections.sort(a);\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tcount += a.get(i);\n\t\t}\n\n\t\tSystem.out.println(count);\n\n\t\tkb.close();\n\t}\n\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tint n = kb.nextInt();\n\t\tint k = kb.nextInt();\n\t\tint count = 0;\n\t\tArrayList<Integer> a = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint p = kb.nextInt();\n\t\t\ta.add(p);\n\t\t}\n\t\tCollections.sort(a);\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tcount += a.get(i);\n\t\t}\n\n\t\tSystem.out.println(count);\n\n\t\tkb.close();\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\tScanner kb = new Scanner(System.in);\n\t\tint n = kb.nextInt();\n\t\tint k = kb.nextInt();\n\t\tint count = 0;\n\t\tArrayList<Integer> a = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint p = kb.nextInt();\n\t\t\ta.add(p);\n\t\t}\n\t\tCollections.sort(a);\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tcount += a.get(i);\n\t\t}\n\n\t\tSystem.out.println(count);\n\n\t\tkb.close();\n\t}",
"Scanner kb = new Scanner(System.in);",
"kb",
"new Scanner(System.in)",
"int n = kb.nextInt();",
"n",
"kb.nextInt()",
"kb.nextInt",
"kb",
"int k = kb.nextInt();",
"k",
"kb.nextInt()",
"kb.nextInt",
"kb",
"int count = 0;",
"count",
"0",
"ArrayList<Integer> a = new ArrayList<>();",
"a",
"new ArrayList<>()",
"for (int i = 0; i < n; i++) {\n\t\t\tint p = kb.nextInt();\n\t\t\ta.add(p);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t\t\tint p = kb.nextInt();\n\t\t\ta.add(p);\n\t\t}",
"{\n\t\t\tint p = kb.nextInt();\n\t\t\ta.add(p);\n\t\t}",
"int p = kb.nextInt();",
"p",
"kb.nextInt()",
"kb.nextInt",
"kb",
"a.add(p)",
"a.add",
"a",
"p",
"Collections.sort(a)",
"Collections.sort",
"Collections",
"a",
"for (int i = 0; i < k; i++) {\n\t\t\tcount += a.get(i);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tcount += a.get(i);\n\t\t}",
"{\n\t\t\tcount += a.get(i);\n\t\t}",
"count += a.get(i)",
"count",
"a.get(i)",
"a.get",
"a",
"i",
"System.out.println(count)",
"System.out.println",
"System.out",
"System",
"System.out",
"count",
"kb.close()",
"kb.close",
"kb",
"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 kb = new Scanner(System.in);\n\t\tint n = kb.nextInt();\n\t\tint k = kb.nextInt();\n\t\tint count = 0;\n\t\tArrayList<Integer> a = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint p = kb.nextInt();\n\t\t\ta.add(p);\n\t\t}\n\t\tCollections.sort(a);\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tcount += a.get(i);\n\t\t}\n\n\t\tSystem.out.println(count);\n\n\t\tkb.close();\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 kb = new Scanner(System.in);\n\t\tint n = kb.nextInt();\n\t\tint k = kb.nextInt();\n\t\tint count = 0;\n\t\tArrayList<Integer> a = new ArrayList<>();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint p = kb.nextInt();\n\t\t\ta.add(p);\n\t\t}\n\t\tCollections.sort(a);\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tcount += a.get(i);\n\t\t}\n\n\t\tSystem.out.println(count);\n\n\t\tkb.close();\n\t}\n\n}",
"Main"
]
| import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner kb = new Scanner(System.in);
int n = kb.nextInt();
int k = kb.nextInt();
int count = 0;
ArrayList<Integer> a = new ArrayList<>();
for (int i = 0; i < n; i++) {
int p = kb.nextInt();
a.add(p);
}
Collections.sort(a);
for (int i = 0; i < k; i++) {
count += a.get(i);
}
System.out.println(count);
kb.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
13,
41,
13,
20,
28,
13,
13,
30,
30,
4,
18,
13,
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,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
13,
41,
13,
13,
42,
17,
30,
40,
13,
0,
13,
17,
40,
13,
14,
2,
13,
18,
13,
13,
30,
29,
40,
17,
14,
2,
18,
13,
13,
18,
13,
13,
30,
3,
29,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
17,
41,
13,
17,
42,
17,
30,
0,
13,
17,
40,
13,
14,
2,
13,
18,
13,
13,
30,
29,
40,
17,
14,
2,
18,
13,
13,
18,
13,
13,
30,
3,
0,
13,
17,
42,
17,
30,
40,
13,
40,
13,
14,
2,
13,
18,
13,
13,
30,
29,
40,
17,
14,
2,
18,
13,
13,
18,
13,
13,
30,
3,
29,
13,
23,
13,
12,
13,
30,
29,
4,
18,
13,
18,
13,
13,
2,
4,
18,
13,
13,
13,
23,
13,
23,
13,
12,
13,
30,
41,
13,
20,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
1,
40,
13,
30,
30,
0,
13,
2,
2,
2,
13,
13,
4,
18,
13,
4,
18,
13,
13,
13,
14,
2,
13,
17,
30,
29,
17,
29,
17,
23,
13,
23,
13,
23,
13,
6,
13,
41,
13,
17,
41,
13,
17,
12,
13,
30,
0,
13,
20,
0,
13,
17,
23,
13,
12,
13,
30,
14,
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,
14,
2,
2,
13,
17,
40,
4,
18,
13,
30,
38,
5,
13,
30,
37,
20,
30,
29,
4,
18,
13,
29,
4,
18,
13,
17,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
29,
4,
18,
13,
4,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
13,
29,
13,
23,
13,
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
],
[
475,
17
],
[
475,
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
],
[
31,
32
],
[
32,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
20,
40
],
[
40,
41
],
[
40,
42
],
[
20,
43
],
[
43,
44
],
[
43,
45
],
[
43,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
20,
52
],
[
52,
53
],
[
53,
54
],
[
52,
55
],
[
55,
56
],
[
56,
57
],
[
20,
58
],
[
58,
59
],
[
58,
60
],
[
20,
61
],
[
61,
62
],
[
62,
63
],
[
63,
64
],
[
63,
65
],
[
61,
66
],
[
66,
67
],
[
66,
68
],
[
61,
69
],
[
69,
70
],
[
70,
71
],
[
61,
72
],
[
73,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
76,
79
],
[
20,
80
],
[
80,
81
],
[
81,
82
],
[
82,
83
],
[
82,
84
],
[
80,
85
],
[
18,
86
],
[
86,
87
],
[
475,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
91,
92
],
[
91,
93
],
[
90,
94
],
[
94,
95
],
[
94,
96
],
[
90,
97
],
[
97,
98
],
[
97,
99
],
[
90,
100
],
[
100,
101
],
[
100,
102
],
[
102,
103
],
[
103,
104
],
[
102,
105
],
[
105,
106
],
[
105,
107
],
[
102,
108
],
[
108,
109
],
[
102,
110
],
[
110,
111
],
[
111,
112
],
[
111,
113
],
[
113,
114
],
[
113,
115
],
[
110,
116
],
[
116,
117
],
[
117,
118
],
[
118,
119
],
[
102,
120
],
[
120,
121
],
[
121,
122
],
[
122,
123
],
[
122,
124
],
[
121,
125
],
[
125,
126
],
[
125,
127
],
[
120,
128
],
[
128,
129
],
[
90,
130
],
[
130,
131
],
[
88,
132
],
[
132,
133
],
[
88,
134
],
[
134,
135
],
[
475,
136
],
[
136,
137
],
[
136,
138
],
[
138,
139
],
[
139,
140
],
[
139,
141
],
[
138,
142
],
[
142,
143
],
[
142,
144
],
[
138,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
148,
149
],
[
148,
150
],
[
147,
151
],
[
151,
152
],
[
147,
153
],
[
153,
154
],
[
154,
155
],
[
154,
156
],
[
156,
157
],
[
156,
158
],
[
153,
159
],
[
159,
160
],
[
160,
161
],
[
161,
162
],
[
147,
163
],
[
163,
164
],
[
164,
165
],
[
165,
166
],
[
165,
167
],
[
164,
168
],
[
168,
169
],
[
168,
170
],
[
163,
171
],
[
171,
172
],
[
138,
173
],
[
173,
174
],
[
173,
175
],
[
138,
176
],
[
176,
177
],
[
176,
178
],
[
178,
179
],
[
179,
180
],
[
178,
181
],
[
181,
182
],
[
178,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
186,
187
],
[
186,
188
],
[
183,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
178,
193
],
[
193,
194
],
[
194,
195
],
[
195,
196
],
[
195,
197
],
[
194,
198
],
[
198,
199
],
[
198,
200
],
[
193,
201
],
[
201,
202
],
[
138,
203
],
[
203,
204
],
[
136,
205
],
[
205,
206
],
[
475,
207
],
[
207,
208
],
[
207,
209
],
[
209,
210
],
[
210,
211
],
[
211,
212
],
[
212,
213
],
[
211,
214
],
[
214,
215
],
[
214,
216
],
[
211,
217
],
[
217,
218
],
[
218,
219
],
[
219,
220
],
[
218,
221
],
[
217,
222
],
[
207,
223
],
[
223,
224
],
[
207,
225
],
[
225,
226
],
[
475,
227
],
[
227,
228
],
[
227,
229
],
[
229,
230
],
[
230,
231
],
[
230,
232
],
[
233,
234
],
[
234,
235
],
[
229,
236
],
[
236,
237
],
[
237,
238
],
[
238,
239
],
[
238,
240
],
[
236,
241
],
[
241,
242
],
[
241,
243
],
[
243,
244
],
[
243,
245
],
[
236,
246
],
[
246,
247
],
[
247,
248
],
[
236,
249
],
[
250,
250
],
[
250,
251
],
[
251,
252
],
[
252,
253
],
[
252,
254
],
[
251,
255
],
[
255,
256
],
[
256,
257
],
[
255,
258
],
[
229,
259
],
[
259,
260
],
[
227,
261
],
[
261,
262
],
[
475,
263
],
[
263,
264
],
[
263,
265
],
[
265,
266
],
[
266,
267
],
[
266,
268
],
[
265,
269
],
[
269,
270
],
[
270,
271
],
[
271,
272
],
[
271,
273
],
[
269,
274
],
[
274,
275
],
[
274,
276
],
[
276,
277
],
[
277,
278
],
[
269,
279
],
[
279,
280
],
[
280,
281
],
[
269,
282
],
[
283,
283
],
[
283,
284
],
[
284,
285
],
[
284,
286
],
[
286,
287
],
[
287,
288
],
[
288,
289
],
[
288,
290
],
[
287,
291
],
[
291,
292
],
[
292,
293
],
[
291,
294
],
[
294,
295
],
[
295,
296
],
[
294,
297
],
[
286,
298
],
[
265,
299
],
[
299,
300
],
[
300,
301
],
[
300,
302
],
[
299,
303
],
[
303,
304
],
[
304,
305
],
[
265,
306
],
[
306,
307
],
[
263,
308
],
[
308,
309
],
[
263,
310
],
[
310,
311
],
[
263,
312
],
[
312,
313
],
[
475,
314
],
[
314,
315
],
[
314,
316
],
[
316,
317
],
[
316,
318
],
[
314,
319
],
[
319,
320
],
[
319,
321
],
[
314,
322
],
[
322,
323
],
[
322,
324
],
[
324,
325
],
[
325,
326
],
[
325,
327
],
[
324,
328
],
[
328,
329
],
[
328,
330
],
[
322,
331
],
[
331,
332
],
[
314,
333
],
[
333,
334
],
[
333,
335
],
[
335,
336
],
[
336,
337
],
[
337,
338
],
[
338,
339
],
[
338,
340
],
[
337,
341
],
[
341,
342
],
[
342,
343
],
[
343,
344
],
[
336,
345
],
[
345,
346
],
[
346,
347
],
[
347,
348
],
[
347,
349
],
[
349,
350
],
[
350,
351
],
[
346,
352
],
[
352,
353
],
[
353,
354
],
[
353,
355
],
[
335,
356
],
[
356,
357
],
[
357,
358
],
[
358,
359
],
[
314,
360
],
[
360,
361
],
[
360,
362
],
[
362,
363
],
[
363,
364
],
[
364,
365
],
[
365,
366
],
[
365,
367
],
[
364,
368
],
[
368,
369
],
[
369,
370
],
[
370,
371
],
[
363,
372
],
[
372,
373
],
[
373,
374
],
[
374,
375
],
[
374,
376
],
[
376,
377
],
[
377,
378
],
[
373,
379
],
[
379,
380
],
[
380,
381
],
[
381,
382
],
[
382,
383
],
[
362,
384
],
[
384,
385
],
[
385,
386
],
[
386,
387
],
[
385,
388
],
[
314,
389
],
[
389,
390
],
[
389,
391
],
[
391,
392
],
[
392,
393
],
[
393,
394
],
[
394,
395
],
[
393,
396
],
[
396,
397
],
[
314,
398
],
[
398,
399
],
[
398,
400
],
[
400,
401
],
[
401,
402
],
[
402,
403
],
[
403,
404
],
[
402,
405
],
[
405,
406
],
[
314,
407
],
[
407,
408
],
[
407,
409
],
[
409,
410
],
[
410,
411
],
[
411,
412
],
[
412,
413
],
[
411,
414
],
[
414,
415
],
[
314,
416
],
[
416,
417
],
[
416,
418
],
[
418,
419
],
[
419,
420
],
[
419,
421
],
[
418,
423
],
[
423,
424
],
[
424,
425
],
[
425,
426
],
[
425,
427
],
[
423,
428
],
[
428,
429
],
[
428,
430
],
[
423,
431
],
[
431,
432
],
[
432,
433
],
[
423,
434
],
[
434,
435
],
[
435,
436
],
[
436,
437
],
[
436,
438
],
[
435,
439
],
[
439,
440
],
[
418,
441
],
[
441,
442
],
[
416,
443
],
[
443,
444
],
[
314,
445
],
[
445,
446
],
[
445,
447
],
[
447,
448
],
[
448,
449
],
[
448,
450
],
[
447,
452
],
[
452,
453
],
[
453,
454
],
[
454,
455
],
[
454,
456
],
[
452,
457
],
[
457,
458
],
[
457,
459
],
[
452,
460
],
[
460,
461
],
[
461,
462
],
[
452,
463
],
[
463,
464
],
[
464,
465
],
[
465,
466
],
[
465,
467
],
[
464,
468
],
[
468,
469
],
[
447,
470
],
[
470,
471
],
[
445,
472
],
[
472,
473
],
[
0,
474
],
[
474,
475
],
[
474,
476
]
]
| [
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.util.*;\n\n\npublic class Main {\n\n public static void main(String[] args) {\n FastScanner sc = new FastScanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] prices = sc.nextIntArray(n);\n\t\tList<Integer> pricesList = new ArrayList<>();\n\t\tfor(int i : prices){\n\t\t\tpricesList.add(i);\n\t\t}\n\t\tpricesList.sort(Comparator.naturalOrder());\n\t\tint sum = 0;\n\t\tfor(int i = 0; i<k ; i++){\n\t\t\tsum += pricesList.get(i);\n\t\t}\n\t\tSystem.out.println(sum);\n }\n /**\n\t * 循環の長さを返します。\n\t *\n\t * @param arr\n\t * 数列\n\t * @param startPos\n\t * 循環の開始位置\n\t *\n\t * @return 循環の長さを返します。循環を検出できなかった場合は-1を返します。\n\t */\n\tprivate static int getCycle(int[] arr, int startPos) {\n\t\tint cycle = 0;\n\t\tint a = startPos;\n\t\tint b = startPos;\n\t\twhile (true) {\n\t\t\tcycle++;\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn cycle;\n\t}\n /**\n\t * 循環の開始位置を返します。\n\t *\n\t * @param arr\n\t * 数列\n\t *\n\t * @return 循環開始位置。循環を検出できない場合は-1を返します。\n\t */\n\tprivate static int getStartPosition(int[] arr) {\n\t\tint a = 0;\n\t\tint b = 0;\n\t\twhile (true) {\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\ta = 0;\n\t\twhile (true) {\n\t\t\ta++;\n\t\t\tb++;\n\t\t\tif (b >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n public static Double calculate(Double base, Double n) {\n return Math.pow(Math.E, Math.log(base)/n);\n }\n\n public static int[] toArray(List<Integer> target) {\n\n final int[] result = new int[target.size()];\n for (int i = 0; i < result.length; i++) {\n result[i] = target.get(i);\n }\n\n return result;\n }\n public static boolean isMultiple (String s, int base, int m) {\n\tint temp = 0;\n\tfor (int i=0; i<s.length(); i++) {\n\t\ttemp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;\n\t}\n\tif (temp==0) {return true;}\n\treturn false;\n}\nstatic class FastScanner {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public FastScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }\n\n public String next() {\n if (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 String nextLine() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int[] nextIntArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n public static void main(String[] args) {\n FastScanner sc = new FastScanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] prices = sc.nextIntArray(n);\n\t\tList<Integer> pricesList = new ArrayList<>();\n\t\tfor(int i : prices){\n\t\t\tpricesList.add(i);\n\t\t}\n\t\tpricesList.sort(Comparator.naturalOrder());\n\t\tint sum = 0;\n\t\tfor(int i = 0; i<k ; i++){\n\t\t\tsum += pricesList.get(i);\n\t\t}\n\t\tSystem.out.println(sum);\n }\n /**\n\t * 循環の長さを返します。\n\t *\n\t * @param arr\n\t * 数列\n\t * @param startPos\n\t * 循環の開始位置\n\t *\n\t * @return 循環の長さを返します。循環を検出できなかった場合は-1を返します。\n\t */\n\tprivate static int getCycle(int[] arr, int startPos) {\n\t\tint cycle = 0;\n\t\tint a = startPos;\n\t\tint b = startPos;\n\t\twhile (true) {\n\t\t\tcycle++;\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn cycle;\n\t}\n /**\n\t * 循環の開始位置を返します。\n\t *\n\t * @param arr\n\t * 数列\n\t *\n\t * @return 循環開始位置。循環を検出できない場合は-1を返します。\n\t */\n\tprivate static int getStartPosition(int[] arr) {\n\t\tint a = 0;\n\t\tint b = 0;\n\t\twhile (true) {\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\ta = 0;\n\t\twhile (true) {\n\t\t\ta++;\n\t\t\tb++;\n\t\t\tif (b >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n public static Double calculate(Double base, Double n) {\n return Math.pow(Math.E, Math.log(base)/n);\n }\n\n public static int[] toArray(List<Integer> target) {\n\n final int[] result = new int[target.size()];\n for (int i = 0; i < result.length; i++) {\n result[i] = target.get(i);\n }\n\n return result;\n }\n public static boolean isMultiple (String s, int base, int m) {\n\tint temp = 0;\n\tfor (int i=0; i<s.length(); i++) {\n\t\ttemp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;\n\t}\n\tif (temp==0) {return true;}\n\treturn false;\n}\nstatic class FastScanner {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public FastScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }\n\n public String next() {\n if (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 String nextLine() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int[] nextIntArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }\n}",
"Main",
"public static void main(String[] args) {\n FastScanner sc = new FastScanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] prices = sc.nextIntArray(n);\n\t\tList<Integer> pricesList = new ArrayList<>();\n\t\tfor(int i : prices){\n\t\t\tpricesList.add(i);\n\t\t}\n\t\tpricesList.sort(Comparator.naturalOrder());\n\t\tint sum = 0;\n\t\tfor(int i = 0; i<k ; i++){\n\t\t\tsum += pricesList.get(i);\n\t\t}\n\t\tSystem.out.println(sum);\n }",
"main",
"{\n FastScanner sc = new FastScanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] prices = sc.nextIntArray(n);\n\t\tList<Integer> pricesList = new ArrayList<>();\n\t\tfor(int i : prices){\n\t\t\tpricesList.add(i);\n\t\t}\n\t\tpricesList.sort(Comparator.naturalOrder());\n\t\tint sum = 0;\n\t\tfor(int i = 0; i<k ; i++){\n\t\t\tsum += pricesList.get(i);\n\t\t}\n\t\tSystem.out.println(sum);\n }",
"FastScanner sc = new FastScanner(System.in);",
"sc",
"new FastScanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] prices = sc.nextIntArray(n);",
"prices",
"sc.nextIntArray(n)",
"sc.nextIntArray",
"sc",
"n",
"List<Integer> pricesList = new ArrayList<>();",
"pricesList",
"new ArrayList<>()",
"for(int i : prices){\n\t\t\tpricesList.add(i);\n\t\t}",
"int i",
"prices",
"{\n\t\t\tpricesList.add(i);\n\t\t}",
"{\n\t\t\tpricesList.add(i);\n\t\t}",
"pricesList.add(i)",
"pricesList.add",
"pricesList",
"i",
"pricesList.sort(Comparator.naturalOrder())",
"pricesList.sort",
"pricesList",
"Comparator.naturalOrder()",
"Comparator.naturalOrder",
"Comparator",
"int sum = 0;",
"sum",
"0",
"for(int i = 0; i<k ; i++){\n\t\t\tsum += pricesList.get(i);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tsum += pricesList.get(i);\n\t\t}",
"{\n\t\t\tsum += pricesList.get(i);\n\t\t}",
"sum += pricesList.get(i)",
"sum",
"pricesList.get(i)",
"pricesList.get",
"pricesList",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"/**\n\t * 循環の長さを返します。\n\t *\n\t * @param arr\n\t * 数列\n\t * @param startPos\n\t * 循環の開始位置\n\t *\n\t * @return 循環の長さを返します。循環を検出できなかった場合は-1を返します。\n\t */\n\tprivate static int getCycle(int[] arr, int startPos) {\n\t\tint cycle = 0;\n\t\tint a = startPos;\n\t\tint b = startPos;\n\t\twhile (true) {\n\t\t\tcycle++;\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn cycle;\n\t}",
"getCycle",
"{\n\t\tint cycle = 0;\n\t\tint a = startPos;\n\t\tint b = startPos;\n\t\twhile (true) {\n\t\t\tcycle++;\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn cycle;\n\t}",
"int cycle = 0;",
"cycle",
"0",
"int a = startPos;",
"a",
"startPos",
"int b = startPos;",
"b",
"startPos",
"while (true) {\n\t\t\tcycle++;\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"true",
"{\n\t\t\tcycle++;\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"cycle++",
"cycle",
"a += 2",
"a",
"2",
"b++",
"b",
"if (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}",
"a >= arr.length",
"a",
"arr.length",
"arr",
"arr.length",
"{\n\t\t\t\treturn -1;\n\t\t\t}",
"return -1;",
"-1",
"1",
"if (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}",
"arr[a] == arr[b]",
"arr[a]",
"arr",
"a",
"arr[b]",
"arr",
"b",
"{\n\t\t\t\tbreak;\n\t\t\t}",
"break;",
"return cycle;",
"cycle",
"int[] arr",
"arr",
"int startPos",
"startPos",
"/**\n\t * 循環の開始位置を返します。\n\t *\n\t * @param arr\n\t * 数列\n\t *\n\t * @return 循環開始位置。循環を検出できない場合は-1を返します。\n\t */\n\tprivate static int getStartPosition(int[] arr) {\n\t\tint a = 0;\n\t\tint b = 0;\n\t\twhile (true) {\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\ta = 0;\n\t\twhile (true) {\n\t\t\ta++;\n\t\t\tb++;\n\t\t\tif (b >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}",
"getStartPosition",
"{\n\t\tint a = 0;\n\t\tint b = 0;\n\t\twhile (true) {\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\ta = 0;\n\t\twhile (true) {\n\t\t\ta++;\n\t\t\tb++;\n\t\t\tif (b >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}",
"int a = 0;",
"a",
"0",
"int b = 0;",
"b",
"0",
"while (true) {\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"true",
"{\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"a += 2",
"a",
"2",
"b++",
"b",
"if (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}",
"a >= arr.length",
"a",
"arr.length",
"arr",
"arr.length",
"{\n\t\t\t\treturn -1;\n\t\t\t}",
"return -1;",
"-1",
"1",
"if (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}",
"arr[a] == arr[b]",
"arr[a]",
"arr",
"a",
"arr[b]",
"arr",
"b",
"{\n\t\t\t\tbreak;\n\t\t\t}",
"break;",
"a = 0",
"a",
"0",
"while (true) {\n\t\t\ta++;\n\t\t\tb++;\n\t\t\tif (b >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"true",
"{\n\t\t\ta++;\n\t\t\tb++;\n\t\t\tif (b >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"a++",
"a",
"b++",
"b",
"if (b >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}",
"b >= arr.length",
"b",
"arr.length",
"arr",
"arr.length",
"{\n\t\t\t\treturn -1;\n\t\t\t}",
"return -1;",
"-1",
"1",
"if (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}",
"arr[a] == arr[b]",
"arr[a]",
"arr",
"a",
"arr[b]",
"arr",
"b",
"{\n\t\t\t\tbreak;\n\t\t\t}",
"break;",
"return a;",
"a",
"int[] arr",
"arr",
"public static Double calculate(Double base, Double n) {\n return Math.pow(Math.E, Math.log(base)/n);\n }",
"calculate",
"{\n return Math.pow(Math.E, Math.log(base)/n);\n }",
"return Math.pow(Math.E, Math.log(base)/n);",
"Math.pow(Math.E, Math.log(base)/n)",
"Math.pow",
"Math",
"Math.E",
"Math",
"Math.E",
"Math.log(base)/n",
"Math.log(base)",
"Math.log",
"Math",
"base",
"n",
"Double base",
"base",
"Double n",
"n",
"public static int[] toArray(List<Integer> target) {\n\n final int[] result = new int[target.size()];\n for (int i = 0; i < result.length; i++) {\n result[i] = target.get(i);\n }\n\n return result;\n }",
"toArray",
"{\n\n final int[] result = new int[target.size()];\n for (int i = 0; i < result.length; i++) {\n result[i] = target.get(i);\n }\n\n return result;\n }",
"final int[] result = new int[target.size()];",
"result",
"new int[target.size()]",
"target.size()",
"target.size",
"target",
"for (int i = 0; i < result.length; i++) {\n result[i] = target.get(i);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < result.length",
"i",
"result.length",
"result",
"result.length",
"i++",
"i++",
"i",
"{\n result[i] = target.get(i);\n }",
"{\n result[i] = target.get(i);\n }",
"result[i] = target.get(i)",
"result[i]",
"result",
"i",
"target.get(i)",
"target.get",
"target",
"i",
"return result;",
"result",
"List<Integer> target",
"target",
"public static boolean isMultiple (String s, int base, int m) {\n\tint temp = 0;\n\tfor (int i=0; i<s.length(); i++) {\n\t\ttemp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;\n\t}\n\tif (temp==0) {return true;}\n\treturn false;\n}",
"isMultiple",
"{\n\tint temp = 0;\n\tfor (int i=0; i<s.length(); i++) {\n\t\ttemp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;\n\t}\n\tif (temp==0) {return true;}\n\treturn false;\n}",
"int temp = 0;",
"temp",
"0",
"for (int i=0; i<s.length(); i++) {\n\t\ttemp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;\n\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<s.length()",
"i",
"s.length()",
"s.length",
"s",
"i++",
"i++",
"i",
"{\n\t\ttemp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;\n\t}",
"{\n\t\ttemp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;\n\t}",
"temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m",
"temp",
"(temp*base+Character.getNumericValue(s.charAt(i)))%m",
"(temp*base+Character.getNumericValue(s.charAt(i)))",
"temp*base",
"temp",
"base",
"Character.getNumericValue(s.charAt(i))",
"Character.getNumericValue",
"Character",
"s.charAt(i)",
"s.charAt",
"s",
"i",
"m",
"if (temp==0) {return true;}",
"temp==0",
"temp",
"0",
"{return true;}",
"return true;",
"true",
"return false;",
"false",
"String s",
"s",
"int base",
"base",
"int m",
"m",
"static class FastScanner {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public FastScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }\n\n public String next() {\n if (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 String nextLine() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int[] nextIntArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }",
"FastScanner",
"private BufferedReader reader = null;",
"reader",
"null",
"private StringTokenizer tokenizer = null;",
"tokenizer",
"null",
"public FastScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }",
"FastScanner",
"{\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }",
"reader = new BufferedReader(new InputStreamReader(in))",
"reader",
"new BufferedReader(new InputStreamReader(in))",
"tokenizer = null",
"tokenizer",
"null",
"InputStream in",
"in",
"public String next() {\n if (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 if (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 }",
"if (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 String nextLine() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }",
"nextLine",
"{\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }",
"if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return 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 return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"try {\n return 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 return reader.readLine();\n }",
"return reader.readLine();",
"reader.readLine()",
"reader.readLine",
"reader",
"return tokenizer.nextToken(\"\\n\");",
"tokenizer.nextToken(\"\\n\")",
"tokenizer.nextToken",
"tokenizer",
"\"\\n\"",
"public 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",
"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 int[] nextIntArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }",
"nextIntArray",
"{\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n a[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 long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }",
"nextLongArray",
"{\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }",
"long[] a = new long[n];",
"a",
"new long[n]",
"n",
"for (int i = 0; i < n; i++)\n a[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 class Main {\n\n public static void main(String[] args) {\n FastScanner sc = new FastScanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] prices = sc.nextIntArray(n);\n\t\tList<Integer> pricesList = new ArrayList<>();\n\t\tfor(int i : prices){\n\t\t\tpricesList.add(i);\n\t\t}\n\t\tpricesList.sort(Comparator.naturalOrder());\n\t\tint sum = 0;\n\t\tfor(int i = 0; i<k ; i++){\n\t\t\tsum += pricesList.get(i);\n\t\t}\n\t\tSystem.out.println(sum);\n }\n /**\n\t * 循環の長さを返します。\n\t *\n\t * @param arr\n\t * 数列\n\t * @param startPos\n\t * 循環の開始位置\n\t *\n\t * @return 循環の長さを返します。循環を検出できなかった場合は-1を返します。\n\t */\n\tprivate static int getCycle(int[] arr, int startPos) {\n\t\tint cycle = 0;\n\t\tint a = startPos;\n\t\tint b = startPos;\n\t\twhile (true) {\n\t\t\tcycle++;\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn cycle;\n\t}\n /**\n\t * 循環の開始位置を返します。\n\t *\n\t * @param arr\n\t * 数列\n\t *\n\t * @return 循環開始位置。循環を検出できない場合は-1を返します。\n\t */\n\tprivate static int getStartPosition(int[] arr) {\n\t\tint a = 0;\n\t\tint b = 0;\n\t\twhile (true) {\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\ta = 0;\n\t\twhile (true) {\n\t\t\ta++;\n\t\t\tb++;\n\t\t\tif (b >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n public static Double calculate(Double base, Double n) {\n return Math.pow(Math.E, Math.log(base)/n);\n }\n\n public static int[] toArray(List<Integer> target) {\n\n final int[] result = new int[target.size()];\n for (int i = 0; i < result.length; i++) {\n result[i] = target.get(i);\n }\n\n return result;\n }\n public static boolean isMultiple (String s, int base, int m) {\n\tint temp = 0;\n\tfor (int i=0; i<s.length(); i++) {\n\t\ttemp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;\n\t}\n\tif (temp==0) {return true;}\n\treturn false;\n}\nstatic class FastScanner {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public FastScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }\n\n public String next() {\n if (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 String nextLine() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int[] nextIntArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }\n}",
"public class Main {\n\n public static void main(String[] args) {\n FastScanner sc = new FastScanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint k = sc.nextInt();\n\t\tint[] prices = sc.nextIntArray(n);\n\t\tList<Integer> pricesList = new ArrayList<>();\n\t\tfor(int i : prices){\n\t\t\tpricesList.add(i);\n\t\t}\n\t\tpricesList.sort(Comparator.naturalOrder());\n\t\tint sum = 0;\n\t\tfor(int i = 0; i<k ; i++){\n\t\t\tsum += pricesList.get(i);\n\t\t}\n\t\tSystem.out.println(sum);\n }\n /**\n\t * 循環の長さを返します。\n\t *\n\t * @param arr\n\t * 数列\n\t * @param startPos\n\t * 循環の開始位置\n\t *\n\t * @return 循環の長さを返します。循環を検出できなかった場合は-1を返します。\n\t */\n\tprivate static int getCycle(int[] arr, int startPos) {\n\t\tint cycle = 0;\n\t\tint a = startPos;\n\t\tint b = startPos;\n\t\twhile (true) {\n\t\t\tcycle++;\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn cycle;\n\t}\n /**\n\t * 循環の開始位置を返します。\n\t *\n\t * @param arr\n\t * 数列\n\t *\n\t * @return 循環開始位置。循環を検出できない場合は-1を返します。\n\t */\n\tprivate static int getStartPosition(int[] arr) {\n\t\tint a = 0;\n\t\tint b = 0;\n\t\twhile (true) {\n\t\t\ta += 2;\n\t\t\tb++;\n\t\t\tif (a >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\ta = 0;\n\t\twhile (true) {\n\t\t\ta++;\n\t\t\tb++;\n\t\t\tif (b >= arr.length) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (arr[a] == arr[b]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n public static Double calculate(Double base, Double n) {\n return Math.pow(Math.E, Math.log(base)/n);\n }\n\n public static int[] toArray(List<Integer> target) {\n\n final int[] result = new int[target.size()];\n for (int i = 0; i < result.length; i++) {\n result[i] = target.get(i);\n }\n\n return result;\n }\n public static boolean isMultiple (String s, int base, int m) {\n\tint temp = 0;\n\tfor (int i=0; i<s.length(); i++) {\n\t\ttemp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;\n\t}\n\tif (temp==0) {return true;}\n\treturn false;\n}\nstatic class FastScanner {\n private BufferedReader reader = null;\n private StringTokenizer tokenizer = null;\n\n public FastScanner(InputStream in) {\n reader = new BufferedReader(new InputStreamReader(in));\n tokenizer = null;\n }\n\n public String next() {\n if (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 String nextLine() {\n if (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n return reader.readLine();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n\n return tokenizer.nextToken(\"\\n\");\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n\n public int[] nextIntArray(int n) {\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = nextInt();\n return a;\n }\n\n public long[] nextLongArray(int n) {\n long[] a = new long[n];\n for (int i = 0; i < n; i++)\n a[i] = nextLong();\n return a;\n }\n }\n}",
"Main"
]
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
public static void main(String[] args) {
FastScanner sc = new FastScanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int[] prices = sc.nextIntArray(n);
List<Integer> pricesList = new ArrayList<>();
for(int i : prices){
pricesList.add(i);
}
pricesList.sort(Comparator.naturalOrder());
int sum = 0;
for(int i = 0; i<k ; i++){
sum += pricesList.get(i);
}
System.out.println(sum);
}
/**
* 循環の長さを返します。
*
* @param arr
* 数列
* @param startPos
* 循環の開始位置
*
* @return 循環の長さを返します。循環を検出できなかった場合は-1を返します。
*/
private static int getCycle(int[] arr, int startPos) {
int cycle = 0;
int a = startPos;
int b = startPos;
while (true) {
cycle++;
a += 2;
b++;
if (a >= arr.length) {
return -1;
}
if (arr[a] == arr[b]) {
break;
}
}
return cycle;
}
/**
* 循環の開始位置を返します。
*
* @param arr
* 数列
*
* @return 循環開始位置。循環を検出できない場合は-1を返します。
*/
private static int getStartPosition(int[] arr) {
int a = 0;
int b = 0;
while (true) {
a += 2;
b++;
if (a >= arr.length) {
return -1;
}
if (arr[a] == arr[b]) {
break;
}
}
a = 0;
while (true) {
a++;
b++;
if (b >= arr.length) {
return -1;
}
if (arr[a] == arr[b]) {
break;
}
}
return a;
}
public static Double calculate(Double base, Double n) {
return Math.pow(Math.E, Math.log(base)/n);
}
public static int[] toArray(List<Integer> target) {
final int[] result = new int[target.size()];
for (int i = 0; i < result.length; i++) {
result[i] = target.get(i);
}
return result;
}
public static boolean isMultiple (String s, int base, int m) {
int temp = 0;
for (int i=0; i<s.length(); i++) {
temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
}
if (temp==0) {return true;}
return false;
}
static class FastScanner {
private BufferedReader reader = null;
private StringTokenizer tokenizer = null;
public FastScanner(InputStream in) {
reader = new BufferedReader(new InputStreamReader(in));
tokenizer = null;
}
public String next() {
if (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public String nextLine() {
if (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
return reader.readLine();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken("\n");
}
public long nextLong() {
return Long.parseLong(next());
}
public int nextInt() {
return Integer.parseInt(next());
}
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;
}
}
}
|
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
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,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
81,
8
],
[
81,
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,
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
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
11,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
11,
52
],
[
52,
53
],
[
52,
54
],
[
11,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
11,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
9,
78
],
[
78,
79
],
[
0,
80
],
[
80,
81
],
[
80,
82
]
]
| [
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n public static void main(String[] args)\n {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n int[] fruits = new int[N];\n for(int i=0;i<N;i++)\n fruits[i] = scanner.nextInt();\n Arrays.sort(fruits);\n int total = 0;\n for(int i=0;i<K;i++)\n total += fruits[i];\n System.out.println(total);\n }\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n public static void main(String[] args)\n {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n int[] fruits = new int[N];\n for(int i=0;i<N;i++)\n fruits[i] = scanner.nextInt();\n Arrays.sort(fruits);\n int total = 0;\n for(int i=0;i<K;i++)\n total += fruits[i];\n System.out.println(total);\n }\n}",
"Main",
"public static void main(String[] args)\n {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n int[] fruits = new int[N];\n for(int i=0;i<N;i++)\n fruits[i] = scanner.nextInt();\n Arrays.sort(fruits);\n int total = 0;\n for(int i=0;i<K;i++)\n total += fruits[i];\n System.out.println(total);\n }",
"main",
"{\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n int[] fruits = new int[N];\n for(int i=0;i<N;i++)\n fruits[i] = scanner.nextInt();\n Arrays.sort(fruits);\n int total = 0;\n for(int i=0;i<K;i++)\n total += fruits[i];\n System.out.println(total);\n }",
"Scanner scanner = new Scanner(System.in);",
"scanner",
"new Scanner(System.in)",
"int N = scanner.nextInt();",
"N",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int K = scanner.nextInt();",
"K",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"int[] fruits = new int[N];",
"fruits",
"new int[N]",
"N",
"for(int i=0;i<N;i++)\n fruits[i] = scanner.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"fruits[i] = scanner.nextInt();",
"fruits[i] = scanner.nextInt()",
"fruits[i]",
"fruits",
"i",
"scanner.nextInt()",
"scanner.nextInt",
"scanner",
"Arrays.sort(fruits)",
"Arrays.sort",
"Arrays",
"fruits",
"int total = 0;",
"total",
"0",
"for(int i=0;i<K;i++)\n total += fruits[i];",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"total += fruits[i];",
"total += fruits[i]",
"total",
"fruits[i]",
"fruits",
"i",
"System.out.println(total)",
"System.out.println",
"System.out",
"System",
"System.out",
"total",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args)\n {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n int[] fruits = new int[N];\n for(int i=0;i<N;i++)\n fruits[i] = scanner.nextInt();\n Arrays.sort(fruits);\n int total = 0;\n for(int i=0;i<K;i++)\n total += fruits[i];\n System.out.println(total);\n }\n}",
"public class Main {\n public static void main(String[] args)\n {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n int K = scanner.nextInt();\n int[] fruits = new int[N];\n for(int i=0;i<N;i++)\n fruits[i] = scanner.nextInt();\n Arrays.sort(fruits);\n int total = 0;\n for(int i=0;i<K;i++)\n total += fruits[i];\n System.out.println(total);\n }\n}",
"Main"
]
| import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int K = scanner.nextInt();
int[] fruits = new int[N];
for(int i=0;i<N;i++)
fruits[i] = scanner.nextInt();
Arrays.sort(fruits);
int total = 0;
for(int i=0;i<K;i++)
total += fruits[i];
System.out.println(total);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
41,
13,
17,
41,
13,
17,
42,
2,
40,
13,
17,
0,
13,
18,
13,
40,
13,
4,
18,
18,
13,
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,
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,
41,
13,
4,
13,
41,
13,
20,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
41,
13,
17,
14,
2,
4,
18,
13,
17,
17,
30,
0,
13,
17,
40,
13,
11,
1,
41,
13,
13,
2,
13,
4,
18,
13,
1,
40,
13,
30,
14,
2,
4,
18,
13,
13,
17,
30,
0,
13,
4,
18,
13,
4,
18,
13,
0,
13,
20,
0,
13,
17,
30,
4,
18,
13,
4,
18,
13,
13,
14,
13,
0,
13,
17,
0,
13,
2,
4,
18,
13,
4,
18,
13,
13,
29,
2,
13,
8,
13,
40,
17,
17,
12,
13,
30,
29,
4,
18,
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
],
[
257,
17
],
[
257,
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
],
[
31,
32
],
[
32,
33
],
[
20,
34
],
[
34,
35
],
[
34,
36
],
[
20,
38
],
[
38,
39
],
[
39,
40
],
[
40,
41
],
[
40,
42
],
[
38,
43
],
[
43,
44
],
[
43,
45
],
[
38,
46
],
[
46,
47
],
[
47,
48
],
[
38,
49
],
[
49,
50
],
[
50,
51
],
[
51,
52
],
[
51,
53
],
[
50,
54
],
[
54,
55
],
[
55,
56
],
[
20,
57
],
[
57,
58
],
[
58,
59
],
[
57,
60
],
[
20,
61
],
[
61,
62
],
[
61,
63
],
[
20,
64
],
[
64,
65
],
[
64,
66
],
[
20,
67
],
[
67,
68
],
[
68,
69
],
[
69,
70
],
[
68,
71
],
[
67,
72
],
[
72,
73
],
[
72,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
20,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
80,
82
],
[
78,
83
],
[
18,
84
],
[
84,
85
],
[
0,
86
],
[
86,
87
],
[
86,
88
],
[
88,
89
],
[
86,
90
],
[
90,
91
],
[
86,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
95,
97
],
[
92,
98
],
[
98,
99
],
[
86,
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
],
[
112,
114
],
[
102,
115
],
[
115,
116
],
[
116,
117
],
[
117,
118
],
[
86,
119
],
[
119,
120
],
[
119,
121
],
[
121,
122
],
[
122,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
126,
127
],
[
86,
128
],
[
128,
129
],
[
128,
130
],
[
130,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
132,
135
],
[
135,
136
],
[
86,
137
],
[
137,
138
],
[
137,
139
],
[
139,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
86,
144
],
[
144,
145
],
[
144,
146
],
[
146,
147
],
[
147,
148
],
[
147,
149
],
[
149,
150
],
[
146,
151
],
[
151,
152
],
[
151,
153
],
[
146,
154
],
[
154,
155
],
[
154,
156
],
[
146,
157
],
[
157,
158
],
[
157,
159
],
[
146,
160
],
[
160,
161
],
[
160,
162
],
[
146,
163
],
[
163,
164
],
[
163,
165
],
[
146,
166
],
[
166,
167
],
[
166,
168
],
[
146,
169
],
[
169,
170
],
[
170,
171
],
[
171,
172
],
[
172,
173
],
[
171,
174
],
[
170,
175
],
[
169,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
176,
180
],
[
180,
181
],
[
146,
182
],
[
182,
183
],
[
183,
184
],
[
184,
185
],
[
184,
186
],
[
182,
187
],
[
187,
188
],
[
187,
189
],
[
189,
190
],
[
190,
191
],
[
182,
192
],
[
192,
193
],
[
193,
194
],
[
182,
195
],
[
195,
196
],
[
196,
197
],
[
197,
198
],
[
198,
199
],
[
199,
200
],
[
198,
201
],
[
197,
202
],
[
196,
203
],
[
203,
204
],
[
204,
205
],
[
204,
206
],
[
206,
207
],
[
207,
208
],
[
206,
209
],
[
209,
210
],
[
210,
211
],
[
203,
212
],
[
212,
213
],
[
212,
214
],
[
203,
215
],
[
215,
216
],
[
215,
217
],
[
196,
218
],
[
218,
219
],
[
219,
220
],
[
220,
221
],
[
219,
222
],
[
222,
223
],
[
223,
224
],
[
222,
225
],
[
218,
226
],
[
226,
227
],
[
226,
228
],
[
228,
229
],
[
228,
230
],
[
146,
231
],
[
231,
232
],
[
231,
233
],
[
233,
234
],
[
234,
235
],
[
235,
236
],
[
234,
237
],
[
237,
238
],
[
238,
239
],
[
233,
240
],
[
146,
241
],
[
241,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
244,
246
],
[
246,
247
],
[
244,
248
],
[
86,
249
],
[
249,
250
],
[
249,
251
],
[
251,
252
],
[
252,
253
],
[
253,
254
],
[
254,
255
],
[
0,
256
],
[
256,
257
],
[
256,
258
]
]
| [
"\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.util.*;\n\n\npublic class Main {\n\n public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int n = s.nextInt(),k=s.nextInt();\n int arr[] = new int[n];\n for(int i=0;i<n;i++)arr[i]=s.nextInt();\n Arrays.sort(arr);\n int i=0,sum=0;\n while(k--!=0)sum+=arr[i++];\n System.out.println(sum);\n\n }\n}\n\n\n\n\nclass Scanner\n{\n StringTokenizer st;\n BufferedReader br;\n\n public Scanner(InputStream s){\tbr = new BufferedReader(new InputStreamReader(s));}\n\n public String next() throws IOException\n {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine());\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 double nextDouble() throws IOException\n {\n String x = next();\n StringBuilder sb = new StringBuilder(\"0\");\n double res = 0, f = 1;\n boolean dec = false, neg = false;\n int start = 0;\n if(x.charAt(0) == '-')\n {\n neg = true;\n start++;\n }\n for(int i = start; i < x.length(); i++)\n if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }\n res += Long.parseLong(sb.toString()) / f;\n return res * (neg?-1:1);\n }\n\n public boolean ready() throws IOException {return br.ready();}\n\n\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.InputStream;",
"InputStream",
"java.io",
"import java.io.InputStreamReader;",
"InputStreamReader",
"java.io",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int n = s.nextInt(),k=s.nextInt();\n int arr[] = new int[n];\n for(int i=0;i<n;i++)arr[i]=s.nextInt();\n Arrays.sort(arr);\n int i=0,sum=0;\n while(k--!=0)sum+=arr[i++];\n System.out.println(sum);\n\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int n = s.nextInt(),k=s.nextInt();\n int arr[] = new int[n];\n for(int i=0;i<n;i++)arr[i]=s.nextInt();\n Arrays.sort(arr);\n int i=0,sum=0;\n while(k--!=0)sum+=arr[i++];\n System.out.println(sum);\n\n }",
"main",
"{\n Scanner s = new Scanner(System.in);\n int n = s.nextInt(),k=s.nextInt();\n int arr[] = new int[n];\n for(int i=0;i<n;i++)arr[i]=s.nextInt();\n Arrays.sort(arr);\n int i=0,sum=0;\n while(k--!=0)sum+=arr[i++];\n System.out.println(sum);\n\n }",
"Scanner s = new Scanner(System.in);",
"s",
"new Scanner(System.in)",
"int n = s.nextInt()",
"n",
"s.nextInt()",
"s.nextInt",
"s",
"k=s.nextInt();",
"k",
"s.nextInt()",
"s.nextInt",
"s",
"int arr[] = new int[n];",
"arr",
"new int[n]",
"n",
"for(int i=0;i<n;i++)arr[i]=s.nextInt();",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"arr[i]=s.nextInt();",
"arr[i]=s.nextInt()",
"arr[i]",
"arr",
"i",
"s.nextInt()",
"s.nextInt",
"s",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"int i=0",
"i",
"0",
"sum=0;",
"sum",
"0",
"while(k--!=0)sum+=arr[i++];",
"k--!=0",
"k--",
"k",
"0",
"sum+=arr[i++]",
"sum",
"arr[i++]",
"arr",
"i++",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"class Scanner\n{\n StringTokenizer st;\n BufferedReader br;\n\n public Scanner(InputStream s){\tbr = new BufferedReader(new InputStreamReader(s));}\n\n public String next() throws IOException\n {\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine());\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 double nextDouble() throws IOException\n {\n String x = next();\n StringBuilder sb = new StringBuilder(\"0\");\n double res = 0, f = 1;\n boolean dec = false, neg = false;\n int start = 0;\n if(x.charAt(0) == '-')\n {\n neg = true;\n start++;\n }\n for(int i = start; i < x.length(); i++)\n if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }\n res += Long.parseLong(sb.toString()) / f;\n return res * (neg?-1:1);\n }\n\n public boolean ready() throws IOException {return br.ready();}\n\n\n}",
"Scanner",
"StringTokenizer st;",
"st",
"BufferedReader br;",
"br",
"public Scanner(InputStream s){\tbr = new BufferedReader(new InputStreamReader(s));}",
"Scanner",
"{\tbr = 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 st = new StringTokenizer(br.readLine());\n return st.nextToken();\n }",
"next",
"{\n while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine());\n return st.nextToken();\n }",
"while (st == null || !st.hasMoreTokens())\n st = new StringTokenizer(br.readLine());",
"st == null || !st.hasMoreTokens()",
"st == null",
"st",
"null",
"!st.hasMoreTokens()",
"st.hasMoreTokens()",
"st.hasMoreTokens",
"st",
"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 double nextDouble() throws IOException\n {\n String x = next();\n StringBuilder sb = new StringBuilder(\"0\");\n double res = 0, f = 1;\n boolean dec = false, neg = false;\n int start = 0;\n if(x.charAt(0) == '-')\n {\n neg = true;\n start++;\n }\n for(int i = start; i < x.length(); i++)\n if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }\n res += Long.parseLong(sb.toString()) / f;\n return res * (neg?-1:1);\n }",
"nextDouble",
"{\n String x = next();\n StringBuilder sb = new StringBuilder(\"0\");\n double res = 0, f = 1;\n boolean dec = false, neg = false;\n int start = 0;\n if(x.charAt(0) == '-')\n {\n neg = true;\n start++;\n }\n for(int i = start; i < x.length(); i++)\n if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }\n res += Long.parseLong(sb.toString()) / f;\n return res * (neg?-1:1);\n }",
"String x = next();",
"x",
"next()",
"next",
"StringBuilder sb = new StringBuilder(\"0\");",
"sb",
"new StringBuilder(\"0\")",
"double res = 0",
"res",
"0",
"f = 1;",
"f",
"1",
"boolean dec = false",
"dec",
"false",
"neg = false;",
"neg",
"false",
"int start = 0;",
"start",
"0",
"if(x.charAt(0) == '-')\n {\n neg = true;\n start++;\n }",
"x.charAt(0) == '-'",
"x.charAt(0)",
"x.charAt",
"x",
"0",
"'-'",
"{\n neg = true;\n start++;\n }",
"neg = true",
"neg",
"true",
"start++",
"start",
"for(int i = start; i < x.length(); i++)\n if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }",
"int i = start;",
"int i = start;",
"i",
"start",
"i < x.length()",
"i",
"x.length()",
"x.length",
"x",
"i++",
"i++",
"i",
"if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }",
"if(x.charAt(i) == '.')\n {\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }\n else\n {\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }",
"x.charAt(i) == '.'",
"x.charAt(i)",
"x.charAt",
"x",
"i",
"'.'",
"{\n res = Long.parseLong(sb.toString());\n sb = new StringBuilder(\"0\");\n dec = true;\n }",
"res = Long.parseLong(sb.toString())",
"res",
"Long.parseLong(sb.toString())",
"Long.parseLong",
"Long",
"sb.toString()",
"sb.toString",
"sb",
"sb = new StringBuilder(\"0\")",
"sb",
"new StringBuilder(\"0\")",
"dec = true",
"dec",
"true",
"{\n sb.append(x.charAt(i));\n if(dec)\n f *= 10;\n }",
"sb.append(x.charAt(i))",
"sb.append",
"sb",
"x.charAt(i)",
"x.charAt",
"x",
"i",
"if(dec)\n f *= 10;",
"dec",
"f *= 10",
"f",
"10",
"res += Long.parseLong(sb.toString()) / f",
"res",
"Long.parseLong(sb.toString()) / f",
"Long.parseLong(sb.toString())",
"Long.parseLong",
"Long",
"sb.toString()",
"sb.toString",
"sb",
"f",
"return res * (neg?-1:1);",
"res * (neg?-1:1)",
"res",
"(neg?-1:1)",
"neg",
"-1",
"1",
"1",
"public boolean ready() throws IOException {return br.ready();}",
"ready",
"{return br.ready();}",
"return br.ready();",
"br.ready()",
"br.ready",
"br",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int n = s.nextInt(),k=s.nextInt();\n int arr[] = new int[n];\n for(int i=0;i<n;i++)arr[i]=s.nextInt();\n Arrays.sort(arr);\n int i=0,sum=0;\n while(k--!=0)sum+=arr[i++];\n System.out.println(sum);\n\n }\n}",
"public class Main {\n\n public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int n = s.nextInt(),k=s.nextInt();\n int arr[] = new int[n];\n for(int i=0;i<n;i++)arr[i]=s.nextInt();\n Arrays.sort(arr);\n int i=0,sum=0;\n while(k--!=0)sum+=arr[i++];\n System.out.println(sum);\n\n }\n}",
"Main"
]
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
Scanner s = new Scanner(System.in);
int n = s.nextInt(),k=s.nextInt();
int arr[] = new int[n];
for(int i=0;i<n;i++)arr[i]=s.nextInt();
Arrays.sort(arr);
int i=0,sum=0;
while(k--!=0)sum+=arr[i++];
System.out.println(sum);
}
}
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 double nextDouble() throws IOException
{
String x = next();
StringBuilder sb = new StringBuilder("0");
double res = 0, f = 1;
boolean dec = false, neg = false;
int start = 0;
if(x.charAt(0) == '-')
{
neg = true;
start++;
}
for(int i = start; i < x.length(); i++)
if(x.charAt(i) == '.')
{
res = Long.parseLong(sb.toString());
sb = new StringBuilder("0");
dec = true;
}
else
{
sb.append(x.charAt(i));
if(dec)
f *= 10;
}
res += Long.parseLong(sb.toString()) / f;
return res * (neg?-1:1);
}
public boolean ready() throws IOException {return br.ready();}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
20,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
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,
18,
13,
13,
13,
4,
18,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
84,
8
],
[
84,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
11,
24
],
[
24,
25
],
[
24,
26
],
[
26,
27
],
[
27,
28
],
[
11,
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
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
11,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
11,
52
],
[
52,
53
],
[
52,
54
],
[
11,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
11,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
11,
78
],
[
78,
79
],
[
79,
80
],
[
9,
81
],
[
81,
82
],
[
0,
83
],
[
83,
84
],
[
83,
85
]
]
| [
"import java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint t = scan.nextInt();\n\t\tint[] arr = new int[t];\n\t\tint type = scan.nextInt();\n\t\tfor (int count = 0; count < t; count++)\n\t\t\tarr[count] = scan.nextInt();\n\t\tArrays.sort(arr); int sum = 0;\n\t\tfor (int count = 0; count < type; count++)\n\t\t\tsum += arr[count];\n\t\tSystem.out.println(sum);\n\t\tscan.close();\n\t}\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint t = scan.nextInt();\n\t\tint[] arr = new int[t];\n\t\tint type = scan.nextInt();\n\t\tfor (int count = 0; count < t; count++)\n\t\t\tarr[count] = scan.nextInt();\n\t\tArrays.sort(arr); int sum = 0;\n\t\tfor (int count = 0; count < type; count++)\n\t\t\tsum += arr[count];\n\t\tSystem.out.println(sum);\n\t\tscan.close();\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint t = scan.nextInt();\n\t\tint[] arr = new int[t];\n\t\tint type = scan.nextInt();\n\t\tfor (int count = 0; count < t; count++)\n\t\t\tarr[count] = scan.nextInt();\n\t\tArrays.sort(arr); int sum = 0;\n\t\tfor (int count = 0; count < type; count++)\n\t\t\tsum += arr[count];\n\t\tSystem.out.println(sum);\n\t\tscan.close();\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint t = scan.nextInt();\n\t\tint[] arr = new int[t];\n\t\tint type = scan.nextInt();\n\t\tfor (int count = 0; count < t; count++)\n\t\t\tarr[count] = scan.nextInt();\n\t\tArrays.sort(arr); int sum = 0;\n\t\tfor (int count = 0; count < type; count++)\n\t\t\tsum += arr[count];\n\t\tSystem.out.println(sum);\n\t\tscan.close();\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int t = scan.nextInt();",
"t",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] arr = new int[t];",
"arr",
"new int[t]",
"t",
"int type = scan.nextInt();",
"type",
"scan.nextInt()",
"scan.nextInt",
"scan",
"for (int count = 0; count < t; count++)\n\t\t\tarr[count] = scan.nextInt();",
"int count = 0;",
"int count = 0;",
"count",
"0",
"count < t",
"count",
"t",
"count++",
"count++",
"count",
"arr[count] = scan.nextInt();",
"arr[count] = scan.nextInt()",
"arr[count]",
"arr",
"count",
"scan.nextInt()",
"scan.nextInt",
"scan",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"int sum = 0;",
"sum",
"0",
"for (int count = 0; count < type; count++)\n\t\t\tsum += arr[count];",
"int count = 0;",
"int count = 0;",
"count",
"0",
"count < type",
"count",
"type",
"count++",
"count++",
"count",
"sum += arr[count];",
"sum += arr[count]",
"sum",
"arr[count]",
"arr",
"count",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"scan.close()",
"scan.close",
"scan",
"String[] args",
"args",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint t = scan.nextInt();\n\t\tint[] arr = new int[t];\n\t\tint type = scan.nextInt();\n\t\tfor (int count = 0; count < t; count++)\n\t\t\tarr[count] = scan.nextInt();\n\t\tArrays.sort(arr); int sum = 0;\n\t\tfor (int count = 0; count < type; count++)\n\t\t\tsum += arr[count];\n\t\tSystem.out.println(sum);\n\t\tscan.close();\n\t}\n}",
"public class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint t = scan.nextInt();\n\t\tint[] arr = new int[t];\n\t\tint type = scan.nextInt();\n\t\tfor (int count = 0; count < t; count++)\n\t\t\tarr[count] = scan.nextInt();\n\t\tArrays.sort(arr); int sum = 0;\n\t\tfor (int count = 0; count < type; count++)\n\t\t\tsum += arr[count];\n\t\tSystem.out.println(sum);\n\t\tscan.close();\n\t}\n}",
"Main"
]
| import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
int[] arr = new int[t];
int type = scan.nextInt();
for (int count = 0; count < t; count++)
arr[count] = scan.nextInt();
Arrays.sort(arr); int sum = 0;
for (int count = 0; count < type; count++)
sum += arr[count];
System.out.println(sum);
scan.close();
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
0,
13,
20,
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,
4,
18,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
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
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
10,
11
],
[
10,
12
],
[
0,
13
],
[
13,
14
],
[
13,
15
],
[
0,
16
],
[
114,
17
],
[
114,
18
],
[
18,
19
],
[
18,
20
],
[
20,
21
],
[
21,
22
],
[
21,
23
],
[
20,
24
],
[
24,
25
],
[
24,
26
],
[
20,
27
],
[
27,
28
],
[
27,
29
],
[
20,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
35,
36
],
[
36,
37
],
[
20,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
43,
44
],
[
44,
45
],
[
20,
46
],
[
46,
47
],
[
46,
48
],
[
20,
49
],
[
49,
50
],
[
49,
51
],
[
20,
53
],
[
53,
54
],
[
53,
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
],
[
70,
72
],
[
69,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
76,
77
],
[
77,
78
],
[
20,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
20,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
83,
91
],
[
91,
92
],
[
92,
93
],
[
83,
94
],
[
95,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
98,
99
],
[
98,
100
],
[
20,
101
],
[
101,
102
],
[
102,
103
],
[
101,
104
],
[
20,
105
],
[
105,
106
],
[
106,
107
],
[
20,
108
],
[
108,
109
],
[
109,
110
],
[
18,
111
],
[
111,
112
],
[
0,
113
],
[
113,
114
],
[
113,
115
]
]
| [
"import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.util.Arrays;\nimport java.util.StringTokenizer;\n\npublic class Main {\n \n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));\n PrintWriter pw = new PrintWriter(System.out);\n StringTokenizer st = new StringTokenizer(br.readLine());\n\n int N = Integer.parseInt(st.nextToken());\n int K = Integer.parseInt(st.nextToken());\n\n st = new StringTokenizer(br.readLine());\n int[] price_array = new int[N];\n\n int result = 0;\n\n for(int i = 0; i < N; i++) {\n price_array[i] = Integer.parseInt(st.nextToken());\n }\n\n Arrays.sort(price_array);\n\n for(int j = 0; j < K; j++) {\n result += price_array[j];\n }\n \n pw.println(result);\n br.close();\n pw.close();\n }\n}",
"import java.io.BufferedReader;",
"BufferedReader",
"java.io",
"import java.io.IOException;",
"IOException",
"java.io",
"import java.io.PrintWriter;",
"PrintWriter",
"java.io",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n \n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));\n PrintWriter pw = new PrintWriter(System.out);\n StringTokenizer st = new StringTokenizer(br.readLine());\n\n int N = Integer.parseInt(st.nextToken());\n int K = Integer.parseInt(st.nextToken());\n\n st = new StringTokenizer(br.readLine());\n int[] price_array = new int[N];\n\n int result = 0;\n\n for(int i = 0; i < N; i++) {\n price_array[i] = Integer.parseInt(st.nextToken());\n }\n\n Arrays.sort(price_array);\n\n for(int j = 0; j < K; j++) {\n result += price_array[j];\n }\n \n pw.println(result);\n br.close();\n pw.close();\n }\n}",
"Main",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));\n PrintWriter pw = new PrintWriter(System.out);\n StringTokenizer st = new StringTokenizer(br.readLine());\n\n int N = Integer.parseInt(st.nextToken());\n int K = Integer.parseInt(st.nextToken());\n\n st = new StringTokenizer(br.readLine());\n int[] price_array = new int[N];\n\n int result = 0;\n\n for(int i = 0; i < N; i++) {\n price_array[i] = Integer.parseInt(st.nextToken());\n }\n\n Arrays.sort(price_array);\n\n for(int j = 0; j < K; j++) {\n result += price_array[j];\n }\n \n pw.println(result);\n br.close();\n pw.close();\n }",
"main",
"{\n BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));\n PrintWriter pw = new PrintWriter(System.out);\n StringTokenizer st = new StringTokenizer(br.readLine());\n\n int N = Integer.parseInt(st.nextToken());\n int K = Integer.parseInt(st.nextToken());\n\n st = new StringTokenizer(br.readLine());\n int[] price_array = new int[N];\n\n int result = 0;\n\n for(int i = 0; i < N; i++) {\n price_array[i] = Integer.parseInt(st.nextToken());\n }\n\n Arrays.sort(price_array);\n\n for(int j = 0; j < K; j++) {\n result += price_array[j];\n }\n \n pw.println(result);\n br.close();\n pw.close();\n }",
"BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));",
"br",
"new BufferedReader(new java.io.InputStreamReader(System.in))",
"PrintWriter pw = new PrintWriter(System.out);",
"pw",
"new PrintWriter(System.out)",
"StringTokenizer st = new StringTokenizer(br.readLine());",
"st",
"new StringTokenizer(br.readLine())",
"int N = Integer.parseInt(st.nextToken());",
"N",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"int K = Integer.parseInt(st.nextToken());",
"K",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"int[] price_array = new int[N];",
"price_array",
"new int[N]",
"N",
"int result = 0;",
"result",
"0",
"for(int i = 0; i < N; i++) {\n price_array[i] = Integer.parseInt(st.nextToken());\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n price_array[i] = Integer.parseInt(st.nextToken());\n }",
"{\n price_array[i] = Integer.parseInt(st.nextToken());\n }",
"price_array[i] = Integer.parseInt(st.nextToken())",
"price_array[i]",
"price_array",
"i",
"Integer.parseInt(st.nextToken())",
"Integer.parseInt",
"Integer",
"st.nextToken()",
"st.nextToken",
"st",
"Arrays.sort(price_array)",
"Arrays.sort",
"Arrays",
"price_array",
"for(int j = 0; j < K; j++) {\n result += price_array[j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < K",
"j",
"K",
"j++",
"j++",
"j",
"{\n result += price_array[j];\n }",
"{\n result += price_array[j];\n }",
"result += price_array[j]",
"result",
"price_array[j]",
"price_array",
"j",
"pw.println(result)",
"pw.println",
"pw",
"result",
"br.close()",
"br.close",
"br",
"pw.close()",
"pw.close",
"pw",
"String[] args",
"args",
"public class Main {\n \n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));\n PrintWriter pw = new PrintWriter(System.out);\n StringTokenizer st = new StringTokenizer(br.readLine());\n\n int N = Integer.parseInt(st.nextToken());\n int K = Integer.parseInt(st.nextToken());\n\n st = new StringTokenizer(br.readLine());\n int[] price_array = new int[N];\n\n int result = 0;\n\n for(int i = 0; i < N; i++) {\n price_array[i] = Integer.parseInt(st.nextToken());\n }\n\n Arrays.sort(price_array);\n\n for(int j = 0; j < K; j++) {\n result += price_array[j];\n }\n \n pw.println(result);\n br.close();\n pw.close();\n }\n}",
"public class Main {\n \n public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));\n PrintWriter pw = new PrintWriter(System.out);\n StringTokenizer st = new StringTokenizer(br.readLine());\n\n int N = Integer.parseInt(st.nextToken());\n int K = Integer.parseInt(st.nextToken());\n\n st = new StringTokenizer(br.readLine());\n int[] price_array = new int[N];\n\n int result = 0;\n\n for(int i = 0; i < N; i++) {\n price_array[i] = Integer.parseInt(st.nextToken());\n }\n\n Arrays.sort(price_array);\n\n for(int j = 0; j < K; j++) {\n result += price_array[j];\n }\n \n pw.println(result);\n br.close();\n pw.close();\n }\n}",
"Main"
]
| import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(System.out);
StringTokenizer st = new StringTokenizer(br.readLine());
int N = Integer.parseInt(st.nextToken());
int K = Integer.parseInt(st.nextToken());
st = new StringTokenizer(br.readLine());
int[] price_array = new int[N];
int result = 0;
for(int i = 0; i < N; i++) {
price_array[i] = Integer.parseInt(st.nextToken());
}
Arrays.sort(price_array);
for(int j = 0; j < K; j++) {
result += price_array[j];
}
pw.println(result);
br.close();
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,
41,
13,
4,
18,
13,
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
0,
10
],
[
85,
11
],
[
85,
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,
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
],
[
47,
50
],
[
50,
51
],
[
51,
52
],
[
14,
53
],
[
53,
54
],
[
54,
55
],
[
53,
56
],
[
14,
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
],
[
70,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
14,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
12,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
]
| [
"import java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Scanner ;\n\npublic class Main {\n\tpublic static void main(String[] ragas) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tint count = 0;\n\n\t\tfor(int i = 0;i < n;i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tCollections.sort(list);\n\n\t\tfor(int i = 0;i < k;i++) {\n\t\t\tcount += list.get(i);\n\t\t}\n\n\t\tSystem.out.println(count);\n\t}\n}",
"import java.util.ArrayList;",
"ArrayList",
"java.util",
"import java.util.Collections;",
"Collections",
"java.util",
"import java.util.Scanner ;",
"Scanner",
"java.util",
"public class Main {\n\tpublic static void main(String[] ragas) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tint count = 0;\n\n\t\tfor(int i = 0;i < n;i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tCollections.sort(list);\n\n\t\tfor(int i = 0;i < k;i++) {\n\t\t\tcount += list.get(i);\n\t\t}\n\n\t\tSystem.out.println(count);\n\t}\n}",
"Main",
"public static void main(String[] ragas) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tint count = 0;\n\n\t\tfor(int i = 0;i < n;i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tCollections.sort(list);\n\n\t\tfor(int i = 0;i < k;i++) {\n\t\t\tcount += list.get(i);\n\t\t}\n\n\t\tSystem.out.println(count);\n\t}",
"main",
"{\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tint count = 0;\n\n\t\tfor(int i = 0;i < n;i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tCollections.sort(list);\n\n\t\tfor(int i = 0;i < k;i++) {\n\t\t\tcount += list.get(i);\n\t\t}\n\n\t\tSystem.out.println(count);\n\t}",
"Scanner scan = new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int n = scan.nextInt();",
"n",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int k = scan.nextInt();",
"k",
"scan.nextInt()",
"scan.nextInt",
"scan",
"ArrayList<Integer> list = new ArrayList<Integer>();",
"list",
"new ArrayList<Integer>()",
"int count = 0;",
"count",
"0",
"for(int i = 0;i < n;i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"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",
"Collections.sort(list)",
"Collections.sort",
"Collections",
"list",
"for(int i = 0;i < k;i++) {\n\t\t\tcount += list.get(i);\n\t\t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n\t\t\tcount += list.get(i);\n\t\t}",
"{\n\t\t\tcount += list.get(i);\n\t\t}",
"count += list.get(i)",
"count",
"list.get(i)",
"list.get",
"list",
"i",
"System.out.println(count)",
"System.out.println",
"System.out",
"System",
"System.out",
"count",
"String[] ragas",
"ragas",
"public class Main {\n\tpublic static void main(String[] ragas) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tint count = 0;\n\n\t\tfor(int i = 0;i < n;i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tCollections.sort(list);\n\n\t\tfor(int i = 0;i < k;i++) {\n\t\t\tcount += list.get(i);\n\t\t}\n\n\t\tSystem.out.println(count);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] ragas) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n\t\tint k = scan.nextInt();\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tint count = 0;\n\n\t\tfor(int i = 0;i < n;i++) {\n\t\t\tlist.add(scan.nextInt());\n\t\t}\n\n\t\tCollections.sort(list);\n\n\t\tfor(int i = 0;i < k;i++) {\n\t\t\tcount += list.get(i);\n\t\t}\n\n\t\tSystem.out.println(count);\n\t}\n}",
"Main"
]
| import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner ;
public class Main {
public static void main(String[] ragas) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int k = scan.nextInt();
ArrayList<Integer> list = new ArrayList<Integer>();
int count = 0;
for(int i = 0;i < n;i++) {
list.add(scan.nextInt());
}
Collections.sort(list);
for(int i = 0;i < k;i++) {
count += list.get(i);
}
System.out.println(count);
}
}
|
[
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,
41,
13,
17,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
1,
40,
13,
30,
30,
14,
2,
4,
18,
13,
13,
13,
30,
0,
13,
13,
0,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
120,
8
],
[
120,
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
],
[
62,
66
],
[
66,
67
],
[
66,
68
],
[
62,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
74,
75
],
[
74,
76
],
[
76,
77
],
[
77,
78
],
[
69,
79
],
[
79,
80
],
[
80,
81
],
[
69,
82
],
[
83,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
86,
89
],
[
85,
90
],
[
84,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
91,
95
],
[
95,
96
],
[
95,
97
],
[
97,
98
],
[
98,
99
],
[
97,
100
],
[
62,
101
],
[
101,
102
],
[
101,
103
],
[
103,
104
],
[
104,
105
],
[
103,
106
],
[
62,
107
],
[
107,
108
],
[
108,
109
],
[
107,
110
],
[
11,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
9,
117
],
[
117,
118
],
[
0,
119
],
[
119,
120
],
[
119,
121
]
]
| [
"import java.util.ArrayList;\nimport 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 k = sc.nextInt();\n ArrayList<Integer> arrayList = new ArrayList<Integer>();\n for(int i=0;i<n;i++){\n arrayList.add(sc.nextInt());\n }\n int sum = 0;\n for(int i=0;i<k;i++){\n int idx = 0;\n int min = 999999;\n for(int j=0;j<arrayList.size();j++){\n if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }\n }\n sum += arrayList.get(idx);\n arrayList.remove(idx);\n }\n\n System.out.println(sum);\n }\n\n}",
"import java.util.ArrayList;",
"ArrayList",
"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 int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> arrayList = new ArrayList<Integer>();\n for(int i=0;i<n;i++){\n arrayList.add(sc.nextInt());\n }\n int sum = 0;\n for(int i=0;i<k;i++){\n int idx = 0;\n int min = 999999;\n for(int j=0;j<arrayList.size();j++){\n if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }\n }\n sum += arrayList.get(idx);\n arrayList.remove(idx);\n }\n\n System.out.println(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 k = sc.nextInt();\n ArrayList<Integer> arrayList = new ArrayList<Integer>();\n for(int i=0;i<n;i++){\n arrayList.add(sc.nextInt());\n }\n int sum = 0;\n for(int i=0;i<k;i++){\n int idx = 0;\n int min = 999999;\n for(int j=0;j<arrayList.size();j++){\n if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }\n }\n sum += arrayList.get(idx);\n arrayList.remove(idx);\n }\n\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n ArrayList<Integer> arrayList = new ArrayList<Integer>();\n for(int i=0;i<n;i++){\n arrayList.add(sc.nextInt());\n }\n int sum = 0;\n for(int i=0;i<k;i++){\n int idx = 0;\n int min = 999999;\n for(int j=0;j<arrayList.size();j++){\n if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }\n }\n sum += arrayList.get(idx);\n arrayList.remove(idx);\n }\n\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ArrayList<Integer> arrayList = new ArrayList<Integer>();",
"arrayList",
"new ArrayList<Integer>()",
"for(int i=0;i<n;i++){\n arrayList.add(sc.nextInt());\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arrayList.add(sc.nextInt());\n }",
"{\n arrayList.add(sc.nextInt());\n }",
"arrayList.add(sc.nextInt())",
"arrayList.add",
"arrayList",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum = 0;",
"sum",
"0",
"for(int i=0;i<k;i++){\n int idx = 0;\n int min = 999999;\n for(int j=0;j<arrayList.size();j++){\n if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }\n }\n sum += arrayList.get(idx);\n arrayList.remove(idx);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n int idx = 0;\n int min = 999999;\n for(int j=0;j<arrayList.size();j++){\n if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }\n }\n sum += arrayList.get(idx);\n arrayList.remove(idx);\n }",
"{\n int idx = 0;\n int min = 999999;\n for(int j=0;j<arrayList.size();j++){\n if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }\n }\n sum += arrayList.get(idx);\n arrayList.remove(idx);\n }",
"int idx = 0;",
"idx",
"0",
"int min = 999999;",
"min",
"999999",
"for(int j=0;j<arrayList.size();j++){\n if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }\n }",
"int j=0;",
"int j=0;",
"j",
"0",
"j<arrayList.size()",
"j",
"arrayList.size()",
"arrayList.size",
"arrayList",
"j++",
"j++",
"j",
"{\n if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }\n }",
"{\n if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }\n }",
"if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }",
"arrayList.get(j)<min",
"arrayList.get(j)",
"arrayList.get",
"arrayList",
"j",
"min",
"{\n idx = j;\n min = arrayList.get(j);\n }",
"idx = j",
"idx",
"j",
"min = arrayList.get(j)",
"min",
"arrayList.get(j)",
"arrayList.get",
"arrayList",
"j",
"sum += arrayList.get(idx)",
"sum",
"arrayList.get(idx)",
"arrayList.get",
"arrayList",
"idx",
"arrayList.remove(idx)",
"arrayList.remove",
"arrayList",
"idx",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"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 k = sc.nextInt();\n ArrayList<Integer> arrayList = new ArrayList<Integer>();\n for(int i=0;i<n;i++){\n arrayList.add(sc.nextInt());\n }\n int sum = 0;\n for(int i=0;i<k;i++){\n int idx = 0;\n int min = 999999;\n for(int j=0;j<arrayList.size();j++){\n if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }\n }\n sum += arrayList.get(idx);\n arrayList.remove(idx);\n }\n\n System.out.println(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 k = sc.nextInt();\n ArrayList<Integer> arrayList = new ArrayList<Integer>();\n for(int i=0;i<n;i++){\n arrayList.add(sc.nextInt());\n }\n int sum = 0;\n for(int i=0;i<k;i++){\n int idx = 0;\n int min = 999999;\n for(int j=0;j<arrayList.size();j++){\n if(arrayList.get(j)<min){\n idx = j;\n min = arrayList.get(j);\n }\n }\n sum += arrayList.get(idx);\n arrayList.remove(idx);\n }\n\n System.out.println(sum);\n }\n\n}",
"Main"
]
| import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
ArrayList<Integer> arrayList = new ArrayList<Integer>();
for(int i=0;i<n;i++){
arrayList.add(sc.nextInt());
}
int sum = 0;
for(int i=0;i<k;i++){
int idx = 0;
int min = 999999;
for(int j=0;j<arrayList.size();j++){
if(arrayList.get(j)<min){
idx = j;
min = arrayList.get(j);
}
}
sum += arrayList.get(idx);
arrayList.remove(idx);
}
System.out.println(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,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
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,
18,
13,
13,
13,
23,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
6,
7
],
[
6,
8
],
[
8,
9
],
[
9,
10
],
[
9,
11
],
[
8,
12
],
[
12,
13
],
[
12,
14
],
[
14,
15
],
[
15,
16
],
[
8,
17
],
[
17,
18
],
[
17,
19
],
[
19,
20
],
[
20,
21
],
[
8,
22
],
[
22,
23
],
[
22,
24
],
[
8,
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
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
8,
52
],
[
52,
53
],
[
52,
54
],
[
8,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
67,
67
],
[
67,
68
],
[
68,
69
],
[
68,
70
],
[
70,
71
],
[
70,
72
],
[
8,
73
],
[
73,
74
],
[
74,
75
],
[
75,
76
],
[
75,
77
],
[
73,
78
],
[
6,
79
],
[
79,
80
]
]
| [
"import java.util.*;\n\nclass Main\n{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int n = sc.nextInt();\n int k = sc.nextInt();\n \n int[] array = new int[n];\n for (int i = 0; i < array.length; i++) {\n array[i] = sc.nextInt();\n }\n \n Arrays.sort(array);\n \n int money = 0;\n for (int i = 0; i < k; i++) {\n money += array[i];\n }\n \n System.out.println(money);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"class Main\n{\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int n = sc.nextInt();\n int k = sc.nextInt();\n \n int[] array = new int[n];\n for (int i = 0; i < array.length; i++) {\n array[i] = sc.nextInt();\n }\n \n Arrays.sort(array);\n \n int money = 0;\n for (int i = 0; i < k; i++) {\n money += array[i];\n }\n \n System.out.println(money);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n int n = sc.nextInt();\n int k = sc.nextInt();\n \n int[] array = new int[n];\n for (int i = 0; i < array.length; i++) {\n array[i] = sc.nextInt();\n }\n \n Arrays.sort(array);\n \n int money = 0;\n for (int i = 0; i < k; i++) {\n money += array[i];\n }\n \n System.out.println(money);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n \n int n = sc.nextInt();\n int k = sc.nextInt();\n \n int[] array = new int[n];\n for (int i = 0; i < array.length; i++) {\n array[i] = sc.nextInt();\n }\n \n Arrays.sort(array);\n \n int money = 0;\n for (int i = 0; i < k; i++) {\n money += array[i];\n }\n \n System.out.println(money);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int[] array = new int[n];",
"array",
"new int[n]",
"n",
"for (int i = 0; i < array.length; i++) {\n array[i] = sc.nextInt();\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < array.length",
"i",
"array.length",
"array",
"array.length",
"i++",
"i++",
"i",
"{\n array[i] = sc.nextInt();\n }",
"{\n array[i] = sc.nextInt();\n }",
"array[i] = sc.nextInt()",
"array[i]",
"array",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Arrays.sort(array)",
"Arrays.sort",
"Arrays",
"array",
"int money = 0;",
"money",
"0",
"for (int i = 0; i < k; i++) {\n money += array[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"{\n money += array[i];\n }",
"{\n money += array[i];\n }",
"money += array[i]",
"money",
"array[i]",
"array",
"i",
"System.out.println(money)",
"System.out.println",
"System.out",
"System",
"System.out",
"money",
"String[] args",
"args"
]
| import java.util.*;
class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int[] array = new int[n];
for (int i = 0; i < array.length; i++) {
array[i] = sc.nextInt();
}
Arrays.sort(array);
int money = 0;
for (int i = 0; i < k; i++) {
money += array[i];
}
System.out.println(money);
}
} |
[
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,
11,
1,
41,
13,
17,
2,
13,
2,
13,
17,
1,
40,
13,
30,
11,
1,
41,
13,
17,
2,
13,
2,
2,
13,
13,
17,
1,
40,
13,
30,
14,
2,
18,
13,
13,
18,
13,
2,
13,
17,
30,
41,
13,
18,
13,
13,
0,
18,
13,
13,
18,
13,
2,
13,
17,
0,
18,
13,
2,
13,
17,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
140,
5
],
[
140,
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
],
[
8,
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
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
63,
68
],
[
68,
69
],
[
68,
70
],
[
71,
71
],
[
71,
72
],
[
71,
73
],
[
71,
74
],
[
63,
75
],
[
75,
76
],
[
76,
77
],
[
63,
78
],
[
78,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
80,
84
],
[
84,
85
],
[
84,
86
],
[
86,
87
],
[
86,
88
],
[
79,
89
],
[
89,
90
],
[
90,
91
],
[
90,
92
],
[
92,
93
],
[
92,
94
],
[
89,
95
],
[
95,
96
],
[
96,
97
],
[
96,
98
],
[
95,
99
],
[
99,
100
],
[
99,
101
],
[
101,
102
],
[
101,
103
],
[
89,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
104,
110
],
[
8,
111
],
[
111,
112
],
[
112,
113
],
[
113,
114
],
[
113,
115
],
[
111,
116
],
[
116,
117
],
[
116,
118
],
[
111,
119
],
[
119,
120
],
[
120,
121
],
[
111,
122
],
[
123,
123
],
[
123,
124
],
[
124,
125
],
[
124,
126
],
[
126,
127
],
[
126,
128
],
[
128,
129
],
[
128,
130
],
[
8,
131
],
[
131,
132
],
[
132,
133
],
[
133,
134
],
[
133,
135
],
[
131,
136
],
[
6,
137
],
[
137,
138
],
[
0,
139
],
[
139,
140
],
[
139,
141
]
]
| [
"import java.util.*;\npublic class Main\n{\n\tpublic static void main(String[] args) {\n\t Scanner sc=new Scanner(System.in);\n\t int n=sc.nextInt();\n\t int steps=sc.nextInt();\n\t int price[]=new int[n];\n\t int sum=0;\n\t for(int i=0;i<n;i++){\n\t price[i]=sc.nextInt(); \n\t }\n\t for (int i = 0; i < n-1; i++) \n for (int j = 0; j < n-i-1; j++) \n if (price[j] > price[j+1]) \n { \n int temp = price[j]; \n price[j] = price[j+1]; \n price[j+1] = temp; \n }\n for(int i = 0; i < steps; i++){\n sum=sum+price[i];\n } \n\t System.out.println(sum); \n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main\n{\n\tpublic static void main(String[] args) {\n\t Scanner sc=new Scanner(System.in);\n\t int n=sc.nextInt();\n\t int steps=sc.nextInt();\n\t int price[]=new int[n];\n\t int sum=0;\n\t for(int i=0;i<n;i++){\n\t price[i]=sc.nextInt(); \n\t }\n\t for (int i = 0; i < n-1; i++) \n for (int j = 0; j < n-i-1; j++) \n if (price[j] > price[j+1]) \n { \n int temp = price[j]; \n price[j] = price[j+1]; \n price[j+1] = temp; \n }\n for(int i = 0; i < steps; i++){\n sum=sum+price[i];\n } \n\t System.out.println(sum); \n }\n}",
"Main",
"public static void main(String[] args) {\n\t Scanner sc=new Scanner(System.in);\n\t int n=sc.nextInt();\n\t int steps=sc.nextInt();\n\t int price[]=new int[n];\n\t int sum=0;\n\t for(int i=0;i<n;i++){\n\t price[i]=sc.nextInt(); \n\t }\n\t for (int i = 0; i < n-1; i++) \n for (int j = 0; j < n-i-1; j++) \n if (price[j] > price[j+1]) \n { \n int temp = price[j]; \n price[j] = price[j+1]; \n price[j+1] = temp; \n }\n for(int i = 0; i < steps; i++){\n sum=sum+price[i];\n } \n\t System.out.println(sum); \n }",
"main",
"{\n\t Scanner sc=new Scanner(System.in);\n\t int n=sc.nextInt();\n\t int steps=sc.nextInt();\n\t int price[]=new int[n];\n\t int sum=0;\n\t for(int i=0;i<n;i++){\n\t price[i]=sc.nextInt(); \n\t }\n\t for (int i = 0; i < n-1; i++) \n for (int j = 0; j < n-i-1; j++) \n if (price[j] > price[j+1]) \n { \n int temp = price[j]; \n price[j] = price[j+1]; \n price[j+1] = temp; \n }\n for(int i = 0; i < steps; i++){\n sum=sum+price[i];\n } \n\t System.out.println(sum); \n }",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int steps=sc.nextInt();",
"steps",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int price[]=new int[n];",
"price",
"new int[n]",
"n",
"int sum=0;",
"sum",
"0",
"for(int i=0;i<n;i++){\n\t price[i]=sc.nextInt(); \n\t }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n\t price[i]=sc.nextInt(); \n\t }",
"{\n\t price[i]=sc.nextInt(); \n\t }",
"price[i]=sc.nextInt()",
"price[i]",
"price",
"i",
"sc.nextInt()",
"sc.nextInt",
"sc",
"for (int i = 0; i < n-1; i++) \n for (int j = 0; j < n-i-1; j++) \n if (price[j] > price[j+1]) \n { \n int temp = price[j]; \n price[j] = price[j+1]; \n price[j+1] = temp; \n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n-1",
"i",
"n-1",
"n",
"1",
"i++",
"i++",
"i",
"for (int j = 0; j < n-i-1; j++) \n if (price[j] > price[j+1]) \n { \n int temp = price[j]; \n price[j] = price[j+1]; \n price[j+1] = temp; \n }",
"for (int j = 0; j < n-i-1; j++) \n if (price[j] > price[j+1]) \n { \n int temp = price[j]; \n price[j] = price[j+1]; \n price[j+1] = temp; \n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < n-i-1",
"j",
"n-i-1",
"n-i-1",
"n",
"i",
"1",
"j++",
"j++",
"j",
"if (price[j] > price[j+1]) \n { \n int temp = price[j]; \n price[j] = price[j+1]; \n price[j+1] = temp; \n }",
"if (price[j] > price[j+1]) \n { \n int temp = price[j]; \n price[j] = price[j+1]; \n price[j+1] = temp; \n }",
"price[j] > price[j+1]",
"price[j]",
"price",
"j",
"price[j+1]",
"price",
"j+1",
"j",
"1",
"{ \n int temp = price[j]; \n price[j] = price[j+1]; \n price[j+1] = temp; \n }",
"int temp = price[j];",
"temp",
"price[j]",
"price",
"j",
"price[j] = price[j+1]",
"price[j]",
"price",
"j",
"price[j+1]",
"price",
"j+1",
"j",
"1",
"price[j+1] = temp",
"price[j+1]",
"price",
"j+1",
"j",
"1",
"temp",
"for(int i = 0; i < steps; i++){\n sum=sum+price[i];\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < steps",
"i",
"steps",
"i++",
"i++",
"i",
"{\n sum=sum+price[i];\n }",
"{\n sum=sum+price[i];\n }",
"sum=sum+price[i]",
"sum",
"sum+price[i]",
"sum",
"price[i]",
"price",
"i",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main\n{\n\tpublic static void main(String[] args) {\n\t Scanner sc=new Scanner(System.in);\n\t int n=sc.nextInt();\n\t int steps=sc.nextInt();\n\t int price[]=new int[n];\n\t int sum=0;\n\t for(int i=0;i<n;i++){\n\t price[i]=sc.nextInt(); \n\t }\n\t for (int i = 0; i < n-1; i++) \n for (int j = 0; j < n-i-1; j++) \n if (price[j] > price[j+1]) \n { \n int temp = price[j]; \n price[j] = price[j+1]; \n price[j+1] = temp; \n }\n for(int i = 0; i < steps; i++){\n sum=sum+price[i];\n } \n\t System.out.println(sum); \n }\n}",
"public class Main\n{\n\tpublic static void main(String[] args) {\n\t Scanner sc=new Scanner(System.in);\n\t int n=sc.nextInt();\n\t int steps=sc.nextInt();\n\t int price[]=new int[n];\n\t int sum=0;\n\t for(int i=0;i<n;i++){\n\t price[i]=sc.nextInt(); \n\t }\n\t for (int i = 0; i < n-1; i++) \n for (int j = 0; j < n-i-1; j++) \n if (price[j] > price[j+1]) \n { \n int temp = price[j]; \n price[j] = price[j+1]; \n price[j+1] = temp; \n }\n for(int i = 0; i < steps; i++){\n sum=sum+price[i];\n } \n\t System.out.println(sum); \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 steps=sc.nextInt();
int price[]=new int[n];
int sum=0;
for(int i=0;i<n;i++){
price[i]=sc.nextInt();
}
for (int i = 0; i < n-1; i++)
for (int j = 0; j < n-i-1; j++)
if (price[j] > price[j+1])
{
int temp = price[j];
price[j] = price[j+1];
price[j+1] = temp;
}
for(int i = 0; i < steps; i++){
sum=sum+price[i];
}
System.out.println(sum);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
13,
41,
13,
4,
18,
13,
41,
13,
17,
41,
13,
41,
13,
41,
13,
20,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
4,
18,
13,
13,
11,
1,
0,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
11,
20
],
[
20,
21
],
[
20,
22
],
[
22,
23
],
[
23,
24
],
[
11,
25
],
[
25,
26
],
[
25,
27
],
[
11,
28
],
[
28,
29
],
[
11,
30
],
[
30,
31
],
[
11,
32
],
[
32,
33
],
[
32,
34
],
[
11,
35
],
[
35,
36
],
[
36,
37
],
[
37,
38
],
[
37,
39
],
[
35,
40
],
[
40,
41
],
[
40,
42
],
[
35,
43
],
[
43,
44
],
[
44,
45
],
[
35,
46
],
[
47,
47
],
[
47,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
51,
52
],
[
52,
53
],
[
11,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
11,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
58,
66
],
[
66,
67
],
[
67,
68
],
[
58,
69
],
[
70,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
74,
75
],
[
73,
76
],
[
11,
77
],
[
77,
78
],
[
78,
79
],
[
79,
80
],
[
79,
81
],
[
77,
82
],
[
9,
83
],
[
83,
84
]
]
| [
"import java.util.*;\nimport java.io.*;\nclass Main{\n\tpublic static void main(String[] args) {\n\tScanner sc=new Scanner(System.in);\n\t int c=sc.nextInt();\n\t int n=sc.nextInt();\n\t int sum=0;\n\t int i,j;\n\t ArrayList<Integer> arl = new ArrayList<Integer>();\n\t for(i=0;i<c;i++)\n\t {\n\t \tarl.add(sc.nextInt());\n\t }\n\t Collections.sort(arl);\n\n\t\n\tfor(j=0;j<n;j++)\n\t{\n\t\tsum+=arl.get(j);\n\t}\n\tSystem.out.println(sum);\n\t\n\t\t\t\t\n\t\t\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"import java.io.*;",
"io.*",
"java",
"class Main{\n\tpublic static void main(String[] args) {\n\tScanner sc=new Scanner(System.in);\n\t int c=sc.nextInt();\n\t int n=sc.nextInt();\n\t int sum=0;\n\t int i,j;\n\t ArrayList<Integer> arl = new ArrayList<Integer>();\n\t for(i=0;i<c;i++)\n\t {\n\t \tarl.add(sc.nextInt());\n\t }\n\t Collections.sort(arl);\n\n\t\n\tfor(j=0;j<n;j++)\n\t{\n\t\tsum+=arl.get(j);\n\t}\n\tSystem.out.println(sum);\n\t\n\t\t\t\t\n\t\t\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\tScanner sc=new Scanner(System.in);\n\t int c=sc.nextInt();\n\t int n=sc.nextInt();\n\t int sum=0;\n\t int i,j;\n\t ArrayList<Integer> arl = new ArrayList<Integer>();\n\t for(i=0;i<c;i++)\n\t {\n\t \tarl.add(sc.nextInt());\n\t }\n\t Collections.sort(arl);\n\n\t\n\tfor(j=0;j<n;j++)\n\t{\n\t\tsum+=arl.get(j);\n\t}\n\tSystem.out.println(sum);\n\t\n\t\t\t\t\n\t\t\n\t}",
"main",
"{\n\tScanner sc=new Scanner(System.in);\n\t int c=sc.nextInt();\n\t int n=sc.nextInt();\n\t int sum=0;\n\t int i,j;\n\t ArrayList<Integer> arl = new ArrayList<Integer>();\n\t for(i=0;i<c;i++)\n\t {\n\t \tarl.add(sc.nextInt());\n\t }\n\t Collections.sort(arl);\n\n\t\n\tfor(j=0;j<n;j++)\n\t{\n\t\tsum+=arl.get(j);\n\t}\n\tSystem.out.println(sum);\n\t\n\t\t\t\t\n\t\t\n\t}",
"Scanner sc=new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int c=sc.nextInt();",
"c",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int n=sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int sum=0;",
"sum",
"0",
"int i",
"i",
"j;",
"j",
"ArrayList<Integer> arl = new ArrayList<Integer>();",
"arl",
"new ArrayList<Integer>()",
"for(i=0;i<c;i++)\n\t {\n\t \tarl.add(sc.nextInt());\n\t }",
"i=0;",
"i=0",
"i",
"0",
"i<c",
"i",
"c",
"i++",
"i++",
"i",
"{\n\t \tarl.add(sc.nextInt());\n\t }",
"{\n\t \tarl.add(sc.nextInt());\n\t }",
"arl.add(sc.nextInt())",
"arl.add",
"arl",
"sc.nextInt()",
"sc.nextInt",
"sc",
"Collections.sort(arl)",
"Collections.sort",
"Collections",
"arl",
"for(j=0;j<n;j++)\n\t{\n\t\tsum+=arl.get(j);\n\t}",
"j=0;",
"j=0",
"j",
"0",
"j<n",
"j",
"n",
"j++",
"j++",
"j",
"{\n\t\tsum+=arl.get(j);\n\t}",
"{\n\t\tsum+=arl.get(j);\n\t}",
"sum+=arl.get(j)",
"sum",
"arl.get(j)",
"arl.get",
"arl",
"j",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args"
]
| import java.util.*;
import java.io.*;
class Main{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int c=sc.nextInt();
int n=sc.nextInt();
int sum=0;
int i,j;
ArrayList<Integer> arl = new ArrayList<Integer>();
for(i=0;i<c;i++)
{
arl.add(sc.nextInt());
}
Collections.sort(arl);
for(j=0;j<n;j++)
{
sum+=arl.get(j);
}
System.out.println(sum);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
20,
41,
13,
20,
41,
13,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
4,
18,
13,
0,
13,
20,
41,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
4,
18,
13,
4,
18,
13,
4,
18,
13,
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,
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
],
[
20,
27
],
[
27,
28
],
[
27,
29
],
[
20,
30
],
[
30,
31
],
[
30,
32
],
[
32,
33
],
[
33,
34
],
[
32,
35
],
[
35,
36
],
[
36,
37
],
[
20,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
41,
42
],
[
40,
43
],
[
43,
44
],
[
44,
45
],
[
20,
46
],
[
46,
47
],
[
46,
48
],
[
20,
49
],
[
49,
50
],
[
20,
51
],
[
51,
52
],
[
52,
53
],
[
53,
54
],
[
53,
55
],
[
51,
56
],
[
56,
57
],
[
56,
58
],
[
51,
59
],
[
59,
60
],
[
60,
61
],
[
51,
62
],
[
63,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
67,
68
],
[
66,
69
],
[
69,
70
],
[
70,
71
],
[
63,
72
],
[
72,
73
],
[
73,
74
],
[
72,
75
],
[
20,
76
],
[
76,
77
],
[
76,
78
],
[
20,
79
],
[
79,
80
],
[
80,
81
],
[
81,
82
],
[
81,
83
],
[
79,
84
],
[
84,
85
],
[
84,
86
],
[
79,
87
],
[
87,
88
],
[
88,
89
],
[
79,
90
],
[
91,
91
],
[
91,
92
],
[
92,
93
],
[
92,
94
],
[
94,
95
],
[
95,
96
],
[
20,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
99,
101
],
[
97,
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.PriorityQueue;\nimport java.util.StringTokenizer;\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\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tPriorityQueue<Short> pq = new PriorityQueue<Short>();\n\t\tshort N = Short.parseShort(st.nextToken());\n\t\tshort T = Short.parseShort(st.nextToken());\n\t\tst = new StringTokenizer(br.readLine());\n\t\tshort p;\n\t\tfor (short i = 0; i < N; i++) {\n\t\t\tp = Short.parseShort(st.nextToken());\n\t\t\tpq.add(p);\n\t\t}\n\t\tint sum = 0;\n\t\tfor (short i = 0; i < T; i++) {\n\t\t\tsum += pq.poll();\n\t\t}\n\t\tSystem.out.print(sum);\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.PriorityQueue;",
"PriorityQueue",
"java.util",
"import java.util.StringTokenizer;",
"StringTokenizer",
"java.util",
"public class Main {\n\tpublic static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tPriorityQueue<Short> pq = new PriorityQueue<Short>();\n\t\tshort N = Short.parseShort(st.nextToken());\n\t\tshort T = Short.parseShort(st.nextToken());\n\t\tst = new StringTokenizer(br.readLine());\n\t\tshort p;\n\t\tfor (short i = 0; i < N; i++) {\n\t\t\tp = Short.parseShort(st.nextToken());\n\t\t\tpq.add(p);\n\t\t}\n\t\tint sum = 0;\n\t\tfor (short i = 0; i < T; i++) {\n\t\t\tsum += pq.poll();\n\t\t}\n\t\tSystem.out.print(sum);\n\t}\n}",
"Main",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tPriorityQueue<Short> pq = new PriorityQueue<Short>();\n\t\tshort N = Short.parseShort(st.nextToken());\n\t\tshort T = Short.parseShort(st.nextToken());\n\t\tst = new StringTokenizer(br.readLine());\n\t\tshort p;\n\t\tfor (short i = 0; i < N; i++) {\n\t\t\tp = Short.parseShort(st.nextToken());\n\t\t\tpq.add(p);\n\t\t}\n\t\tint sum = 0;\n\t\tfor (short i = 0; i < T; i++) {\n\t\t\tsum += pq.poll();\n\t\t}\n\t\tSystem.out.print(sum);\n\t}",
"main",
"{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tPriorityQueue<Short> pq = new PriorityQueue<Short>();\n\t\tshort N = Short.parseShort(st.nextToken());\n\t\tshort T = Short.parseShort(st.nextToken());\n\t\tst = new StringTokenizer(br.readLine());\n\t\tshort p;\n\t\tfor (short i = 0; i < N; i++) {\n\t\t\tp = Short.parseShort(st.nextToken());\n\t\t\tpq.add(p);\n\t\t}\n\t\tint sum = 0;\n\t\tfor (short i = 0; i < T; i++) {\n\t\t\tsum += pq.poll();\n\t\t}\n\t\tSystem.out.print(sum);\n\t}",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"StringTokenizer st = new StringTokenizer(br.readLine());",
"st",
"new StringTokenizer(br.readLine())",
"PriorityQueue<Short> pq = new PriorityQueue<Short>();",
"pq",
"new PriorityQueue<Short>()",
"short N = Short.parseShort(st.nextToken());",
"N",
"Short.parseShort(st.nextToken())",
"Short.parseShort",
"Short",
"st.nextToken()",
"st.nextToken",
"st",
"short T = Short.parseShort(st.nextToken());",
"T",
"Short.parseShort(st.nextToken())",
"Short.parseShort",
"Short",
"st.nextToken()",
"st.nextToken",
"st",
"st = new StringTokenizer(br.readLine())",
"st",
"new StringTokenizer(br.readLine())",
"short p;",
"p",
"for (short i = 0; i < N; i++) {\n\t\t\tp = Short.parseShort(st.nextToken());\n\t\t\tpq.add(p);\n\t\t}",
"short i = 0;",
"short i = 0;",
"i",
"0",
"i < N",
"i",
"N",
"i++",
"i++",
"i",
"{\n\t\t\tp = Short.parseShort(st.nextToken());\n\t\t\tpq.add(p);\n\t\t}",
"{\n\t\t\tp = Short.parseShort(st.nextToken());\n\t\t\tpq.add(p);\n\t\t}",
"p = Short.parseShort(st.nextToken())",
"p",
"Short.parseShort(st.nextToken())",
"Short.parseShort",
"Short",
"st.nextToken()",
"st.nextToken",
"st",
"pq.add(p)",
"pq.add",
"pq",
"p",
"int sum = 0;",
"sum",
"0",
"for (short i = 0; i < T; i++) {\n\t\t\tsum += pq.poll();\n\t\t}",
"short i = 0;",
"short i = 0;",
"i",
"0",
"i < T",
"i",
"T",
"i++",
"i++",
"i",
"{\n\t\t\tsum += pq.poll();\n\t\t}",
"{\n\t\t\tsum += pq.poll();\n\t\t}",
"sum += pq.poll()",
"sum",
"pq.poll()",
"pq.poll",
"pq",
"System.out.print(sum)",
"System.out.print",
"System.out",
"System",
"System.out",
"sum",
"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\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tPriorityQueue<Short> pq = new PriorityQueue<Short>();\n\t\tshort N = Short.parseShort(st.nextToken());\n\t\tshort T = Short.parseShort(st.nextToken());\n\t\tst = new StringTokenizer(br.readLine());\n\t\tshort p;\n\t\tfor (short i = 0; i < N; i++) {\n\t\t\tp = Short.parseShort(st.nextToken());\n\t\t\tpq.add(p);\n\t\t}\n\t\tint sum = 0;\n\t\tfor (short i = 0; i < T; i++) {\n\t\t\tsum += pq.poll();\n\t\t}\n\t\tSystem.out.print(sum);\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\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tPriorityQueue<Short> pq = new PriorityQueue<Short>();\n\t\tshort N = Short.parseShort(st.nextToken());\n\t\tshort T = Short.parseShort(st.nextToken());\n\t\tst = new StringTokenizer(br.readLine());\n\t\tshort p;\n\t\tfor (short i = 0; i < N; i++) {\n\t\t\tp = Short.parseShort(st.nextToken());\n\t\t\tpq.add(p);\n\t\t}\n\t\tint sum = 0;\n\t\tfor (short i = 0; i < T; i++) {\n\t\t\tsum += pq.poll();\n\t\t}\n\t\tSystem.out.print(sum);\n\t}\n}",
"Main"
]
| import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
PriorityQueue<Short> pq = new PriorityQueue<Short>();
short N = Short.parseShort(st.nextToken());
short T = Short.parseShort(st.nextToken());
st = new StringTokenizer(br.readLine());
short p;
for (short i = 0; i < N; i++) {
p = Short.parseShort(st.nextToken());
pq.add(p);
}
int sum = 0;
for (short i = 0; i < T; i++) {
sum += pq.poll();
}
System.out.print(sum);
}
}
|
[
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,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
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,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
81,
8
],
[
81,
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,
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
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
11,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
11,
52
],
[
52,
53
],
[
52,
54
],
[
11,
55
],
[
55,
56
],
[
56,
57
],
[
57,
58
],
[
57,
59
],
[
55,
60
],
[
60,
61
],
[
60,
62
],
[
55,
63
],
[
63,
64
],
[
64,
65
],
[
55,
66
],
[
66,
67
],
[
67,
68
],
[
67,
69
],
[
69,
70
],
[
69,
71
],
[
11,
72
],
[
72,
73
],
[
73,
74
],
[
74,
75
],
[
74,
76
],
[
72,
77
],
[
9,
78
],
[
78,
79
],
[
0,
80
],
[
80,
81
],
[
80,
82
]
]
| [
"import java.util.Scanner;\nimport java.util.Arrays;\n\npublic class Main{\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int k = input.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = input.nextInt();\n Arrays.sort(a);\n int sum = 0;\n for(int j = 0; j < k; j++)\n sum+=a[j];\n System.out.println(sum);\n }\n}",
"import java.util.Scanner;",
"Scanner",
"java.util",
"import java.util.Arrays;",
"Arrays",
"java.util",
"public class Main{\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int k = input.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = input.nextInt();\n Arrays.sort(a);\n int sum = 0;\n for(int j = 0; j < k; j++)\n sum+=a[j];\n System.out.println(sum);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int k = input.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = input.nextInt();\n Arrays.sort(a);\n int sum = 0;\n for(int j = 0; j < k; j++)\n sum+=a[j];\n System.out.println(sum);\n }",
"main",
"{\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int k = input.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = input.nextInt();\n Arrays.sort(a);\n int sum = 0;\n for(int j = 0; j < k; j++)\n sum+=a[j];\n System.out.println(sum);\n }",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"int n = input.nextInt();",
"n",
"input.nextInt()",
"input.nextInt",
"input",
"int k = input.nextInt();",
"k",
"input.nextInt()",
"input.nextInt",
"input",
"int[] a = new int[n];",
"a",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n a[i] = input.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"a[i] = input.nextInt();",
"a[i] = input.nextInt()",
"a[i]",
"a",
"i",
"input.nextInt()",
"input.nextInt",
"input",
"Arrays.sort(a)",
"Arrays.sort",
"Arrays",
"a",
"int sum = 0;",
"sum",
"0",
"for(int j = 0; j < k; j++)\n sum+=a[j];",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < k",
"j",
"k",
"j++",
"j++",
"j",
"sum+=a[j];",
"sum+=a[j]",
"sum",
"a[j]",
"a",
"j",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args",
"public class Main{\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int k = input.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = input.nextInt();\n Arrays.sort(a);\n int sum = 0;\n for(int j = 0; j < k; j++)\n sum+=a[j];\n System.out.println(sum);\n }\n}",
"public class Main{\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int k = input.nextInt();\n int[] a = new int[n];\n for (int i = 0; i < n; i++)\n a[i] = input.nextInt();\n Arrays.sort(a);\n int sum = 0;\n for(int j = 0; j < k; j++)\n sum+=a[j];\n System.out.println(sum);\n }\n}",
"Main"
]
| import java.util.Scanner;
import java.util.Arrays;
public class Main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int k = input.nextInt();
int[] a = new int[n];
for (int i = 0; i < n; i++)
a[i] = input.nextInt();
Arrays.sort(a);
int sum = 0;
for(int j = 0; j < k; j++)
sum+=a[j];
System.out.println(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,
41,
13,
20,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
4,
18,
13,
4,
18,
13,
41,
13,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
41,
13,
4,
18,
13,
17,
11,
1,
41,
13,
17,
2,
13,
4,
18,
13,
1,
40,
13,
30,
30,
14,
2,
4,
18,
13,
13,
13,
30,
0,
13,
4,
18,
13,
13,
4,
18,
13,
13,
41,
13,
4,
18,
13,
13,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
4,
18,
13,
13,
4,
18,
18,
13,
13,
2,
17,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
149,
5
],
[
149,
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
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
45,
46
],
[
8,
47
],
[
47,
48
],
[
47,
49
],
[
49,
50
],
[
50,
51
],
[
8,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
64,
64
],
[
64,
65
],
[
65,
66
],
[
65,
67
],
[
67,
68
],
[
68,
69
],
[
67,
70
],
[
64,
71
],
[
71,
72
],
[
72,
73
],
[
73,
74
],
[
73,
75
],
[
71,
76
],
[
76,
77
],
[
76,
78
],
[
78,
79
],
[
79,
80
],
[
71,
81
],
[
81,
82
],
[
82,
83
],
[
71,
84
],
[
85,
85
],
[
85,
86
],
[
86,
87
],
[
87,
88
],
[
88,
89
],
[
89,
90
],
[
88,
91
],
[
87,
92
],
[
86,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
96,
97
],
[
97,
98
],
[
96,
99
],
[
64,
100
],
[
100,
101
],
[
101,
102
],
[
100,
103
],
[
64,
104
],
[
104,
105
],
[
104,
106
],
[
106,
107
],
[
107,
108
],
[
106,
109
],
[
64,
110
],
[
110,
111
],
[
111,
112
],
[
110,
113
],
[
8,
114
],
[
114,
115
],
[
114,
116
],
[
8,
117
],
[
117,
118
],
[
118,
119
],
[
119,
120
],
[
119,
121
],
[
117,
122
],
[
122,
123
],
[
122,
124
],
[
117,
125
],
[
125,
126
],
[
126,
127
],
[
117,
128
],
[
129,
129
],
[
129,
130
],
[
130,
131
],
[
130,
132
],
[
132,
133
],
[
132,
134
],
[
134,
135
],
[
135,
136
],
[
134,
137
],
[
8,
138
],
[
138,
139
],
[
139,
140
],
[
140,
141
],
[
140,
142
],
[
138,
143
],
[
143,
144
],
[
143,
145
],
[
6,
146
],
[
146,
147
],
[
0,
148
],
[
148,
149
],
[
148,
150
]
]
| [
"import java.util.*;\npublic class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n \tint k = sc.nextInt();\n \tArrayList<Integer> p = new ArrayList<Integer>();\n\t\tArrayList<Integer> min = new ArrayList<Integer>();\n for(int i=0;i<n;i++){\n \tp.add(sc.nextInt());}\n int plen = p.size();\n for(int i = 0;i<plen;i++){\n int minint=p.get(0);\n for(int j = 0;j<p.size();j++){\n \tif(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}\n \t\t}\n \tmin.add(minint);\n \tint num = p.indexOf(minint);\n \tp.remove(num);\n \t}\n int ans=0;\n for(int i=0;i<k;i++){\n ans=ans+min.get(i);\n }\n System.out.println(\"\"+ans);\n\t}\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n \tint k = sc.nextInt();\n \tArrayList<Integer> p = new ArrayList<Integer>();\n\t\tArrayList<Integer> min = new ArrayList<Integer>();\n for(int i=0;i<n;i++){\n \tp.add(sc.nextInt());}\n int plen = p.size();\n for(int i = 0;i<plen;i++){\n int minint=p.get(0);\n for(int j = 0;j<p.size();j++){\n \tif(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}\n \t\t}\n \tmin.add(minint);\n \tint num = p.indexOf(minint);\n \tp.remove(num);\n \t}\n int ans=0;\n for(int i=0;i<k;i++){\n ans=ans+min.get(i);\n }\n System.out.println(\"\"+ans);\n\t}\n}",
"Main",
"public static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n \tint k = sc.nextInt();\n \tArrayList<Integer> p = new ArrayList<Integer>();\n\t\tArrayList<Integer> min = new ArrayList<Integer>();\n for(int i=0;i<n;i++){\n \tp.add(sc.nextInt());}\n int plen = p.size();\n for(int i = 0;i<plen;i++){\n int minint=p.get(0);\n for(int j = 0;j<p.size();j++){\n \tif(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}\n \t\t}\n \tmin.add(minint);\n \tint num = p.indexOf(minint);\n \tp.remove(num);\n \t}\n int ans=0;\n for(int i=0;i<k;i++){\n ans=ans+min.get(i);\n }\n System.out.println(\"\"+ans);\n\t}",
"main",
"{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n \tint k = sc.nextInt();\n \tArrayList<Integer> p = new ArrayList<Integer>();\n\t\tArrayList<Integer> min = new ArrayList<Integer>();\n for(int i=0;i<n;i++){\n \tp.add(sc.nextInt());}\n int plen = p.size();\n for(int i = 0;i<plen;i++){\n int minint=p.get(0);\n for(int j = 0;j<p.size();j++){\n \tif(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}\n \t\t}\n \tmin.add(minint);\n \tint num = p.indexOf(minint);\n \tp.remove(num);\n \t}\n int ans=0;\n for(int i=0;i<k;i++){\n ans=ans+min.get(i);\n }\n System.out.println(\"\"+ans);\n\t}",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"int n = sc.nextInt();",
"n",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int k = sc.nextInt();",
"k",
"sc.nextInt()",
"sc.nextInt",
"sc",
"ArrayList<Integer> p = new ArrayList<Integer>();",
"p",
"new ArrayList<Integer>()",
"ArrayList<Integer> min = new ArrayList<Integer>();",
"min",
"new ArrayList<Integer>()",
"for(int i=0;i<n;i++){\n \tp.add(sc.nextInt());}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<n",
"i",
"n",
"i++",
"i++",
"i",
"{\n \tp.add(sc.nextInt());}",
"{\n \tp.add(sc.nextInt());}",
"p.add(sc.nextInt())",
"p.add",
"p",
"sc.nextInt()",
"sc.nextInt",
"sc",
"int plen = p.size();",
"plen",
"p.size()",
"p.size",
"p",
"for(int i = 0;i<plen;i++){\n int minint=p.get(0);\n for(int j = 0;j<p.size();j++){\n \tif(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}\n \t\t}\n \tmin.add(minint);\n \tint num = p.indexOf(minint);\n \tp.remove(num);\n \t}",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i<plen",
"i",
"plen",
"i++",
"i++",
"i",
"{\n int minint=p.get(0);\n for(int j = 0;j<p.size();j++){\n \tif(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}\n \t\t}\n \tmin.add(minint);\n \tint num = p.indexOf(minint);\n \tp.remove(num);\n \t}",
"{\n int minint=p.get(0);\n for(int j = 0;j<p.size();j++){\n \tif(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}\n \t\t}\n \tmin.add(minint);\n \tint num = p.indexOf(minint);\n \tp.remove(num);\n \t}",
"int minint=p.get(0);",
"minint",
"p.get(0)",
"p.get",
"p",
"0",
"for(int j = 0;j<p.size();j++){\n \tif(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}\n \t\t}",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j<p.size()",
"j",
"p.size()",
"p.size",
"p",
"j++",
"j++",
"j",
"{\n \tif(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}\n \t\t}",
"{\n \tif(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}\n \t\t}",
"if(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}",
"p.get(j)<minint",
"p.get(j)",
"p.get",
"p",
"j",
"minint",
"{\n \t\tminint=p.get(j);\n \t\t}",
"minint=p.get(j)",
"minint",
"p.get(j)",
"p.get",
"p",
"j",
"min.add(minint)",
"min.add",
"min",
"minint",
"int num = p.indexOf(minint);",
"num",
"p.indexOf(minint)",
"p.indexOf",
"p",
"minint",
"p.remove(num)",
"p.remove",
"p",
"num",
"int ans=0;",
"ans",
"0",
"for(int i=0;i<k;i++){\n ans=ans+min.get(i);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<k",
"i",
"k",
"i++",
"i++",
"i",
"{\n ans=ans+min.get(i);\n }",
"{\n ans=ans+min.get(i);\n }",
"ans=ans+min.get(i)",
"ans",
"ans+min.get(i)",
"ans",
"min.get(i)",
"min.get",
"min",
"i",
"System.out.println(\"\"+ans)",
"System.out.println",
"System.out",
"System",
"System.out",
"\"\"+ans",
"\"\"",
"ans",
"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 \tint k = sc.nextInt();\n \tArrayList<Integer> p = new ArrayList<Integer>();\n\t\tArrayList<Integer> min = new ArrayList<Integer>();\n for(int i=0;i<n;i++){\n \tp.add(sc.nextInt());}\n int plen = p.size();\n for(int i = 0;i<plen;i++){\n int minint=p.get(0);\n for(int j = 0;j<p.size();j++){\n \tif(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}\n \t\t}\n \tmin.add(minint);\n \tint num = p.indexOf(minint);\n \tp.remove(num);\n \t}\n int ans=0;\n for(int i=0;i<k;i++){\n ans=ans+min.get(i);\n }\n System.out.println(\"\"+ans);\n\t}\n}",
"public class Main {\n\tpublic static void main(String[] args){\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n \tint k = sc.nextInt();\n \tArrayList<Integer> p = new ArrayList<Integer>();\n\t\tArrayList<Integer> min = new ArrayList<Integer>();\n for(int i=0;i<n;i++){\n \tp.add(sc.nextInt());}\n int plen = p.size();\n for(int i = 0;i<plen;i++){\n int minint=p.get(0);\n for(int j = 0;j<p.size();j++){\n \tif(p.get(j)<minint){\n \t\tminint=p.get(j);\n \t\t}\n \t\t}\n \tmin.add(minint);\n \tint num = p.indexOf(minint);\n \tp.remove(num);\n \t}\n int ans=0;\n for(int i=0;i<k;i++){\n ans=ans+min.get(i);\n }\n System.out.println(\"\"+ans);\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 k = sc.nextInt();
ArrayList<Integer> p = new ArrayList<Integer>();
ArrayList<Integer> min = new ArrayList<Integer>();
for(int i=0;i<n;i++){
p.add(sc.nextInt());}
int plen = p.size();
for(int i = 0;i<plen;i++){
int minint=p.get(0);
for(int j = 0;j<p.size();j++){
if(p.get(j)<minint){
minint=p.get(j);
}
}
min.add(minint);
int num = p.indexOf(minint);
p.remove(num);
}
int ans=0;
for(int i=0;i<k;i++){
ans=ans+min.get(i);
}
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,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
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,
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
],
[
40,
41
],
[
41,
42
],
[
42,
43
],
[
42,
44
],
[
41,
45
],
[
45,
46
],
[
46,
47
],
[
8,
48
],
[
48,
49
],
[
49,
50
],
[
48,
51
],
[
8,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
54,
56
],
[
52,
57
],
[
57,
58
],
[
57,
59
],
[
52,
60
],
[
60,
61
],
[
61,
62
],
[
52,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
66,
67
],
[
66,
68
],
[
8,
69
],
[
69,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
69,
74
],
[
6,
75
],
[
75,
76
],
[
0,
77
],
[
77,
78
],
[
77,
79
]
]
| [
"import java.util.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int k = input.nextInt();\n int answer = 0;\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = input.nextInt();\n Arrays.sort(array);\n for (int i = 0; i < k; i++)\n answer += array[i];\n System.out.println(answer);\n }\n}",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int k = input.nextInt();\n int answer = 0;\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = input.nextInt();\n Arrays.sort(array);\n for (int i = 0; i < k; i++)\n answer += array[i];\n System.out.println(answer);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int k = input.nextInt();\n int answer = 0;\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = input.nextInt();\n Arrays.sort(array);\n for (int i = 0; i < k; i++)\n answer += array[i];\n System.out.println(answer);\n }",
"main",
"{\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int k = input.nextInt();\n int answer = 0;\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = input.nextInt();\n Arrays.sort(array);\n for (int i = 0; i < k; i++)\n answer += array[i];\n System.out.println(answer);\n }",
"Scanner input = new Scanner(System.in);",
"input",
"new Scanner(System.in)",
"int n = input.nextInt();",
"n",
"input.nextInt()",
"input.nextInt",
"input",
"int k = input.nextInt();",
"k",
"input.nextInt()",
"input.nextInt",
"input",
"int answer = 0;",
"answer",
"0",
"int[] array = new int[n];",
"array",
"new int[n]",
"n",
"for (int i = 0; i < n; i++)\n array[i] = input.nextInt();",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"array[i] = input.nextInt();",
"array[i] = input.nextInt()",
"array[i]",
"array",
"i",
"input.nextInt()",
"input.nextInt",
"input",
"Arrays.sort(array)",
"Arrays.sort",
"Arrays",
"array",
"for (int i = 0; i < k; i++)\n answer += array[i];",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < k",
"i",
"k",
"i++",
"i++",
"i",
"answer += array[i];",
"answer += array[i]",
"answer",
"array[i]",
"array",
"i",
"System.out.println(answer)",
"System.out.println",
"System.out",
"System",
"System.out",
"answer",
"String[] args",
"args",
"public class Main {\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int k = input.nextInt();\n int answer = 0;\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = input.nextInt();\n Arrays.sort(array);\n for (int i = 0; i < k; i++)\n answer += array[i];\n System.out.println(answer);\n }\n}",
"public class Main {\n public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int n = input.nextInt();\n int k = input.nextInt();\n int answer = 0;\n int[] array = new int[n];\n for (int i = 0; i < n; i++)\n array[i] = input.nextInt();\n Arrays.sort(array);\n for (int i = 0; i < k; i++)\n answer += array[i];\n System.out.println(answer);\n }\n}",
"Main"
]
| import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int k = input.nextInt();
int answer = 0;
int[] array = new int[n];
for (int i = 0; i < n; i++)
array[i] = input.nextInt();
Arrays.sort(array);
for (int i = 0; i < k; i++)
answer += array[i];
System.out.println(answer);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
18,
13,
13,
13,
30,
41,
13,
20,
41,
13,
4,
18,
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,
4,
18,
13,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
2,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
121,
8
],
[
121,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
13,
14
],
[
13,
15
],
[
15,
16
],
[
16,
17
],
[
17,
18
],
[
18,
19
],
[
18,
20
],
[
16,
21
],
[
12,
22
],
[
22,
23
],
[
23,
24
],
[
23,
25
],
[
22,
26
],
[
26,
27
],
[
26,
28
],
[
28,
29
],
[
29,
30
],
[
30,
31
],
[
31,
32
],
[
28,
33
],
[
22,
34
],
[
34,
35
],
[
34,
36
],
[
36,
37
],
[
37,
38
],
[
36,
39
],
[
39,
40
],
[
39,
41
],
[
22,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
45,
46
],
[
44,
47
],
[
47,
48
],
[
47,
49
],
[
22,
50
],
[
50,
51
],
[
50,
52
],
[
52,
53
],
[
53,
54
],
[
54,
55
],
[
55,
56
],
[
52,
57
],
[
22,
58
],
[
58,
59
],
[
58,
60
],
[
22,
62
],
[
62,
63
],
[
63,
64
],
[
64,
65
],
[
64,
66
],
[
62,
67
],
[
67,
68
],
[
67,
69
],
[
62,
70
],
[
70,
71
],
[
71,
72
],
[
62,
73
],
[
74,
74
],
[
74,
75
],
[
75,
76
],
[
76,
77
],
[
76,
78
],
[
75,
79
],
[
79,
80
],
[
80,
81
],
[
79,
82
],
[
82,
83
],
[
82,
84
],
[
22,
85
],
[
85,
86
],
[
86,
87
],
[
85,
88
],
[
22,
89
],
[
89,
90
],
[
89,
91
],
[
22,
92
],
[
92,
93
],
[
93,
94
],
[
94,
95
],
[
94,
96
],
[
92,
97
],
[
97,
98
],
[
97,
99
],
[
92,
100
],
[
100,
101
],
[
101,
102
],
[
92,
103
],
[
104,
104
],
[
104,
105
],
[
105,
106
],
[
105,
107
],
[
107,
108
],
[
107,
109
],
[
109,
110
],
[
109,
111
],
[
22,
112
],
[
112,
113
],
[
113,
114
],
[
114,
115
],
[
114,
116
],
[
112,
117
],
[
9,
118
],
[
118,
119
],
[
0,
120
],
[
120,
121
],
[
120,
122
]
]
| [
"import java.io.*;\nimport java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String strSplit[] = br.readLine().split(\" \");\n int N = Integer.parseInt(strSplit[0]);\n int K = Integer.parseInt(strSplit[1]);\n \n String strSplitFruitsPrice[] = br.readLine().split(\" \");\n int fruitsPrice[] = new int[N];\n for(int i=0; i<N; i++){\n fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i]);\n }\n \n Arrays.sort(fruitsPrice);\n \n int ans = 0;\n \n for(int i=0; i<K; i++){\n ans = ans + fruitsPrice[i];\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }\n }\n}",
"import java.io.*;",
"io.*",
"java",
"import java.util.*;",
"util.*",
"java",
"public class Main {\n public static void main(String[] args) throws Exception {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String strSplit[] = br.readLine().split(\" \");\n int N = Integer.parseInt(strSplit[0]);\n int K = Integer.parseInt(strSplit[1]);\n \n String strSplitFruitsPrice[] = br.readLine().split(\" \");\n int fruitsPrice[] = new int[N];\n for(int i=0; i<N; i++){\n fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i]);\n }\n \n Arrays.sort(fruitsPrice);\n \n int ans = 0;\n \n for(int i=0; i<K; i++){\n ans = ans + fruitsPrice[i];\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }\n }\n}",
"Main",
"public static void main(String[] args) throws Exception {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String strSplit[] = br.readLine().split(\" \");\n int N = Integer.parseInt(strSplit[0]);\n int K = Integer.parseInt(strSplit[1]);\n \n String strSplitFruitsPrice[] = br.readLine().split(\" \");\n int fruitsPrice[] = new int[N];\n for(int i=0; i<N; i++){\n fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i]);\n }\n \n Arrays.sort(fruitsPrice);\n \n int ans = 0;\n \n for(int i=0; i<K; i++){\n ans = ans + fruitsPrice[i];\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }\n }",
"main",
"{\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String strSplit[] = br.readLine().split(\" \");\n int N = Integer.parseInt(strSplit[0]);\n int K = Integer.parseInt(strSplit[1]);\n \n String strSplitFruitsPrice[] = br.readLine().split(\" \");\n int fruitsPrice[] = new int[N];\n for(int i=0; i<N; i++){\n fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i]);\n }\n \n Arrays.sort(fruitsPrice);\n \n int ans = 0;\n \n for(int i=0; i<K; i++){\n ans = ans + fruitsPrice[i];\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }\n }",
"try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String strSplit[] = br.readLine().split(\" \");\n int N = Integer.parseInt(strSplit[0]);\n int K = Integer.parseInt(strSplit[1]);\n \n String strSplitFruitsPrice[] = br.readLine().split(\" \");\n int fruitsPrice[] = new int[N];\n for(int i=0; i<N; i++){\n fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i]);\n }\n \n Arrays.sort(fruitsPrice);\n \n int ans = 0;\n \n for(int i=0; i<K; i++){\n ans = ans + fruitsPrice[i];\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }",
"catch(Exception e){\n System.out.println(e);\n }",
"Exception e",
"{\n System.out.println(e);\n }",
"System.out.println(e)",
"System.out.println",
"System.out",
"System",
"System.out",
"e",
"{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String strSplit[] = br.readLine().split(\" \");\n int N = Integer.parseInt(strSplit[0]);\n int K = Integer.parseInt(strSplit[1]);\n \n String strSplitFruitsPrice[] = br.readLine().split(\" \");\n int fruitsPrice[] = new int[N];\n for(int i=0; i<N; i++){\n fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i]);\n }\n \n Arrays.sort(fruitsPrice);\n \n int ans = 0;\n \n for(int i=0; i<K; i++){\n ans = ans + fruitsPrice[i];\n }\n \n System.out.println(ans);\n \n }",
"BufferedReader br = new BufferedReader(new InputStreamReader(System.in));",
"br",
"new BufferedReader(new InputStreamReader(System.in))",
"String strSplit[] = br.readLine().split(\" \");",
"strSplit",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int N = Integer.parseInt(strSplit[0]);",
"N",
"Integer.parseInt(strSplit[0])",
"Integer.parseInt",
"Integer",
"strSplit[0]",
"strSplit",
"0",
"int K = Integer.parseInt(strSplit[1]);",
"K",
"Integer.parseInt(strSplit[1])",
"Integer.parseInt",
"Integer",
"strSplit[1]",
"strSplit",
"1",
"String strSplitFruitsPrice[] = br.readLine().split(\" \");",
"strSplitFruitsPrice",
"br.readLine().split(\" \")",
"br.readLine().split",
"br.readLine()",
"br.readLine",
"br",
"\" \"",
"int fruitsPrice[] = new int[N];",
"fruitsPrice",
"new int[N]",
"N",
"for(int i=0; i<N; i++){\n fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i]);\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<N",
"i",
"N",
"i++",
"i++",
"i",
"{\n fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i]);\n }",
"{\n fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i]);\n }",
"fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i])",
"fruitsPrice[i]",
"fruitsPrice",
"i",
"Integer.parseInt(strSplitFruitsPrice[i])",
"Integer.parseInt",
"Integer",
"strSplitFruitsPrice[i]",
"strSplitFruitsPrice",
"i",
"Arrays.sort(fruitsPrice)",
"Arrays.sort",
"Arrays",
"fruitsPrice",
"int ans = 0;",
"ans",
"0",
"for(int i=0; i<K; i++){\n ans = ans + fruitsPrice[i];\n }",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n ans = ans + fruitsPrice[i];\n }",
"{\n ans = ans + fruitsPrice[i];\n }",
"ans = ans + fruitsPrice[i]",
"ans",
"ans + fruitsPrice[i]",
"ans",
"fruitsPrice[i]",
"fruitsPrice",
"i",
"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) throws Exception {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String strSplit[] = br.readLine().split(\" \");\n int N = Integer.parseInt(strSplit[0]);\n int K = Integer.parseInt(strSplit[1]);\n \n String strSplitFruitsPrice[] = br.readLine().split(\" \");\n int fruitsPrice[] = new int[N];\n for(int i=0; i<N; i++){\n fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i]);\n }\n \n Arrays.sort(fruitsPrice);\n \n int ans = 0;\n \n for(int i=0; i<K; i++){\n ans = ans + fruitsPrice[i];\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }\n }\n}",
"public class Main {\n public static void main(String[] args) throws Exception {\n try{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \n String strSplit[] = br.readLine().split(\" \");\n int N = Integer.parseInt(strSplit[0]);\n int K = Integer.parseInt(strSplit[1]);\n \n String strSplitFruitsPrice[] = br.readLine().split(\" \");\n int fruitsPrice[] = new int[N];\n for(int i=0; i<N; i++){\n fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i]);\n }\n \n Arrays.sort(fruitsPrice);\n \n int ans = 0;\n \n for(int i=0; i<K; i++){\n ans = ans + fruitsPrice[i];\n }\n \n System.out.println(ans);\n \n }catch(Exception e){\n System.out.println(e);\n }\n }\n}",
"Main"
]
| import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String strSplit[] = br.readLine().split(" ");
int N = Integer.parseInt(strSplit[0]);
int K = Integer.parseInt(strSplit[1]);
String strSplitFruitsPrice[] = br.readLine().split(" ");
int fruitsPrice[] = new int[N];
for(int i=0; i<N; i++){
fruitsPrice[i] = Integer.parseInt(strSplitFruitsPrice[i]);
}
Arrays.sort(fruitsPrice);
int ans = 0;
for(int i=0; i<K; i++){
ans = ans + fruitsPrice[i];
}
System.out.println(ans);
}catch(Exception e){
System.out.println(e);
}
}
} |
[
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,
13,
41,
13,
17,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
4,
18,
13,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
13,
18,
13,
13,
4,
18,
18,
13,
13,
13,
23,
13,
10,
6,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
85,
8
],
[
85,
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,
29
],
[
29,
30
],
[
29,
31
],
[
11,
32
],
[
32,
33
],
[
33,
34
],
[
34,
35
],
[
34,
36
],
[
32,
37
],
[
37,
38
],
[
37,
39
],
[
39,
40
],
[
39,
41
],
[
32,
42
],
[
42,
43
],
[
43,
44
],
[
32,
45
],
[
46,
46
],
[
46,
47
],
[
47,
48
],
[
48,
49
],
[
48,
50
],
[
47,
51
],
[
51,
52
],
[
52,
53
],
[
11,
54
],
[
54,
55
],
[
55,
56
],
[
54,
57
],
[
11,
58
],
[
58,
59
],
[
59,
60
],
[
60,
61
],
[
60,
62
],
[
58,
63
],
[
63,
64
],
[
63,
65
],
[
58,
66
],
[
66,
67
],
[
67,
68
],
[
58,
69
],
[
70,
70
],
[
70,
71
],
[
71,
72
],
[
71,
73
],
[
73,
74
],
[
73,
75
],
[
11,
76
],
[
76,
77
],
[
77,
78
],
[
78,
79
],
[
78,
80
],
[
76,
81
],
[
9,
82
],
[
82,
83
],
[
0,
84
],
[
84,
85
],
[
84,
86
]
]
| [
"import java.util.Arrays;\nimport java.util.Scanner;\npublic class Main{\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan =new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint K=scan.nextInt();\n\t\tint[] kingaku=new int[N];\n\t\tint goukei=0;\n\t\tfor(int i=0;i<kingaku.length;i++) {\n\t\t\tkingaku[i]=scan.nextInt();\n\t\t}\n\t\tArrays.sort(kingaku);\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tgoukei+=kingaku[i];\n\t\t}\n\t\tSystem.out.println(goukei);\n\t}\n}",
"import java.util.Arrays;",
"Arrays",
"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\tScanner scan =new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint K=scan.nextInt();\n\t\tint[] kingaku=new int[N];\n\t\tint goukei=0;\n\t\tfor(int i=0;i<kingaku.length;i++) {\n\t\t\tkingaku[i]=scan.nextInt();\n\t\t}\n\t\tArrays.sort(kingaku);\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tgoukei+=kingaku[i];\n\t\t}\n\t\tSystem.out.println(goukei);\n\t}\n}",
"Main",
"public static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan =new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint K=scan.nextInt();\n\t\tint[] kingaku=new int[N];\n\t\tint goukei=0;\n\t\tfor(int i=0;i<kingaku.length;i++) {\n\t\t\tkingaku[i]=scan.nextInt();\n\t\t}\n\t\tArrays.sort(kingaku);\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tgoukei+=kingaku[i];\n\t\t}\n\t\tSystem.out.println(goukei);\n\t}",
"main",
"{\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan =new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint K=scan.nextInt();\n\t\tint[] kingaku=new int[N];\n\t\tint goukei=0;\n\t\tfor(int i=0;i<kingaku.length;i++) {\n\t\t\tkingaku[i]=scan.nextInt();\n\t\t}\n\t\tArrays.sort(kingaku);\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tgoukei+=kingaku[i];\n\t\t}\n\t\tSystem.out.println(goukei);\n\t}",
"Scanner scan =new Scanner(System.in);",
"scan",
"new Scanner(System.in)",
"int N=scan.nextInt();",
"N",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int K=scan.nextInt();",
"K",
"scan.nextInt()",
"scan.nextInt",
"scan",
"int[] kingaku=new int[N];",
"kingaku",
"new int[N]",
"N",
"int goukei=0;",
"goukei",
"0",
"for(int i=0;i<kingaku.length;i++) {\n\t\t\tkingaku[i]=scan.nextInt();\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<kingaku.length",
"i",
"kingaku.length",
"kingaku",
"kingaku.length",
"i++",
"i++",
"i",
"{\n\t\t\tkingaku[i]=scan.nextInt();\n\t\t}",
"{\n\t\t\tkingaku[i]=scan.nextInt();\n\t\t}",
"kingaku[i]=scan.nextInt()",
"kingaku[i]",
"kingaku",
"i",
"scan.nextInt()",
"scan.nextInt",
"scan",
"Arrays.sort(kingaku)",
"Arrays.sort",
"Arrays",
"kingaku",
"for(int i=0;i<K;i++) {\n\t\t\tgoukei+=kingaku[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tgoukei+=kingaku[i];\n\t\t}",
"{\n\t\t\tgoukei+=kingaku[i];\n\t\t}",
"goukei+=kingaku[i]",
"goukei",
"kingaku[i]",
"kingaku",
"i",
"System.out.println(goukei)",
"System.out.println",
"System.out",
"System",
"System.out",
"goukei",
"String[] args",
"args",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan =new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint K=scan.nextInt();\n\t\tint[] kingaku=new int[N];\n\t\tint goukei=0;\n\t\tfor(int i=0;i<kingaku.length;i++) {\n\t\t\tkingaku[i]=scan.nextInt();\n\t\t}\n\t\tArrays.sort(kingaku);\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tgoukei+=kingaku[i];\n\t\t}\n\t\tSystem.out.println(goukei);\n\t}\n}",
"public class Main{\n\n\tpublic static void main(String[] args) {\n\t\t// TODO 自動生成されたメソッド・スタブ\n\t\tScanner scan =new Scanner(System.in);\n\t\tint N=scan.nextInt();\n\t\tint K=scan.nextInt();\n\t\tint[] kingaku=new int[N];\n\t\tint goukei=0;\n\t\tfor(int i=0;i<kingaku.length;i++) {\n\t\t\tkingaku[i]=scan.nextInt();\n\t\t}\n\t\tArrays.sort(kingaku);\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tgoukei+=kingaku[i];\n\t\t}\n\t\tSystem.out.println(goukei);\n\t}\n}",
"Main"
]
| import java.util.Arrays;
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scan =new Scanner(System.in);
int N=scan.nextInt();
int K=scan.nextInt();
int[] kingaku=new int[N];
int goukei=0;
for(int i=0;i<kingaku.length;i++) {
kingaku[i]=scan.nextInt();
}
Arrays.sort(kingaku);
for(int i=0;i<K;i++) {
goukei+=kingaku[i];
}
System.out.println(goukei);
}
} |
[
7,
15,
13,
17,
15,
13,
17,
6,
13,
12,
13,
30,
41,
13,
20,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
4,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
4,
18,
13,
18,
13,
17,
41,
13,
20,
13,
11,
1,
41,
13,
17,
2,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
18,
13,
13,
4,
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,
18,
13,
13,
13,
23,
13
]
| [
[
0,
1
],
[
1,
2
],
[
1,
3
],
[
0,
4
],
[
4,
5
],
[
4,
6
],
[
0,
7
],
[
7,
8
],
[
7,
9
],
[
9,
10
],
[
9,
11
],
[
11,
12
],
[
12,
13
],
[
12,
14
],
[
11,
15
],
[
15,
16
],
[
15,
17
],
[
17,
18
],
[
18,
19
],
[
19,
20
],
[
20,
21
],
[
17,
22
],
[
11,
23
],
[
23,
24
],
[
23,
25
],
[
25,
26
],
[
26,
27
],
[
27,
28
],
[
28,
29
],
[
25,
30
],
[
11,
31
],
[
31,
32
],
[
31,
33
],
[
33,
34
],
[
34,
35
],
[
33,
36
],
[
36,
37
],
[
36,
38
],
[
11,
39
],
[
39,
40
],
[
39,
41
],
[
41,
42
],
[
42,
43
],
[
41,
44
],
[
44,
45
],
[
44,
46
],
[
11,
47
],
[
47,
48
],
[
47,
49
],
[
11,
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
],
[
11,
74
],
[
74,
75
],
[
75,
76
],
[
74,
77
],
[
11,
78
],
[
78,
79
],
[
78,
80
],
[
11,
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
],
[
94,
96
],
[
96,
97
],
[
96,
98
],
[
11,
99
],
[
99,
100
],
[
100,
101
],
[
101,
102
],
[
101,
103
],
[
99,
104
],
[
9,
105
],
[
105,
106
]
]
| [
"import java.util.Arrays;\nimport java.util.Scanner;\n\nclass Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] nums = sc.nextLine().split(\" \");\n String[] ps = sc.nextLine().split(\" \");\n\n int n = Integer.parseInt(nums[0]);\n int k = Integer.parseInt(nums[1]);\n\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = Integer.parseInt(ps[i]);\n }\n Arrays.sort(arr);\n int sum = 0;\n for (int j = 0; j < k; j++) {\n sum += arr[j];\n }\n System.out.println(sum);\n }\n}",
"import java.util.Arrays;",
"Arrays",
"java.util",
"import java.util.Scanner;",
"Scanner",
"java.util",
"class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] nums = sc.nextLine().split(\" \");\n String[] ps = sc.nextLine().split(\" \");\n\n int n = Integer.parseInt(nums[0]);\n int k = Integer.parseInt(nums[1]);\n\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = Integer.parseInt(ps[i]);\n }\n Arrays.sort(arr);\n int sum = 0;\n for (int j = 0; j < k; j++) {\n sum += arr[j];\n }\n System.out.println(sum);\n }\n}",
"Main",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] nums = sc.nextLine().split(\" \");\n String[] ps = sc.nextLine().split(\" \");\n\n int n = Integer.parseInt(nums[0]);\n int k = Integer.parseInt(nums[1]);\n\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = Integer.parseInt(ps[i]);\n }\n Arrays.sort(arr);\n int sum = 0;\n for (int j = 0; j < k; j++) {\n sum += arr[j];\n }\n System.out.println(sum);\n }",
"main",
"{\n Scanner sc = new Scanner(System.in);\n String[] nums = sc.nextLine().split(\" \");\n String[] ps = sc.nextLine().split(\" \");\n\n int n = Integer.parseInt(nums[0]);\n int k = Integer.parseInt(nums[1]);\n\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = Integer.parseInt(ps[i]);\n }\n Arrays.sort(arr);\n int sum = 0;\n for (int j = 0; j < k; j++) {\n sum += arr[j];\n }\n System.out.println(sum);\n }",
"Scanner sc = new Scanner(System.in);",
"sc",
"new Scanner(System.in)",
"String[] nums = sc.nextLine().split(\" \");",
"nums",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"String[] ps = sc.nextLine().split(\" \");",
"ps",
"sc.nextLine().split(\" \")",
"sc.nextLine().split",
"sc.nextLine()",
"sc.nextLine",
"sc",
"\" \"",
"int n = Integer.parseInt(nums[0]);",
"n",
"Integer.parseInt(nums[0])",
"Integer.parseInt",
"Integer",
"nums[0]",
"nums",
"0",
"int k = Integer.parseInt(nums[1]);",
"k",
"Integer.parseInt(nums[1])",
"Integer.parseInt",
"Integer",
"nums[1]",
"nums",
"1",
"int[] arr = new int[n];",
"arr",
"new int[n]",
"n",
"for (int i = 0; i < n; i++) {\n arr[i] = Integer.parseInt(ps[i]);\n }",
"int i = 0;",
"int i = 0;",
"i",
"0",
"i < n",
"i",
"n",
"i++",
"i++",
"i",
"{\n arr[i] = Integer.parseInt(ps[i]);\n }",
"{\n arr[i] = Integer.parseInt(ps[i]);\n }",
"arr[i] = Integer.parseInt(ps[i])",
"arr[i]",
"arr",
"i",
"Integer.parseInt(ps[i])",
"Integer.parseInt",
"Integer",
"ps[i]",
"ps",
"i",
"Arrays.sort(arr)",
"Arrays.sort",
"Arrays",
"arr",
"int sum = 0;",
"sum",
"0",
"for (int j = 0; j < k; j++) {\n sum += arr[j];\n }",
"int j = 0;",
"int j = 0;",
"j",
"0",
"j < k",
"j",
"k",
"j++",
"j++",
"j",
"{\n sum += arr[j];\n }",
"{\n sum += arr[j];\n }",
"sum += arr[j]",
"sum",
"arr[j]",
"arr",
"j",
"System.out.println(sum)",
"System.out.println",
"System.out",
"System",
"System.out",
"sum",
"String[] args",
"args"
]
| import java.util.Arrays;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] nums = sc.nextLine().split(" ");
String[] ps = sc.nextLine().split(" ");
int n = Integer.parseInt(nums[0]);
int k = Integer.parseInt(nums[1]);
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = Integer.parseInt(ps[i]);
}
Arrays.sort(arr);
int sum = 0;
for (int j = 0; j < k; j++) {
sum += arr[j];
}
System.out.println(sum);
}
}
|
[
7,
15,
13,
17,
15,
13,
17,
15,
13,
17,
15,
13,
17,
6,
13,
41,
13,
41,
13,
17,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
41,
13,
12,
13,
30,
0,
13,
20,
41,
13,
4,
13,
41,
13,
4,
13,
41,
13,
4,
13,
4,
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,
13,
13,
23,
13,
12,
13,
30,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
14,
4,
18,
13,
18,
13,
13,
30,
29,
13,
29,
40,
17,
23,
13,
23,
13,
12,
13,
30,
41,
13,
4,
13,
13,
4,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
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,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
41,
13,
20,
4,
18,
13,
11,
1,
41,
13,
17,
2,
13,
18,
13,
13,
1,
40,
13,
30,
30,
0,
18,
13,
13,
4,
18,
13,
13,
29,
13,
23,
13,
12,
13,
30,
14,
2,
2,
13,
17,
2,
13,
18,
13,
13,
30,
0,
13,
4,
13,
0,
13,
17,
29,
18,
13,
40,
13,
12,
13,
30,
14,
2,
2,
13,
17,
2,
13,
18,
13,
13,
30,
0,
13,
4,
13,
0,
13,
17,
29,
18,
13,
40,
13,
12,
13,
30,
14,
2,
2,
13,
17,
2,
13,
18,
13,
13,
30,
0,
13,
4,
13,
0,
13,
17,
29,
18,
13,
40,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
29,
20,
30,
29,
4,
18,
4,
18,
13,
17,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
29,
17,
30,
41,
13,
4,
13,
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,
29,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
29,
17,
30,
41,
13,
4,
13,
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,
29,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
29,
17,
30,
41,
13,
4,
13,
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,
29,
13,
12,
13,
30,
38,
5,
13,
30,
4,
18,
13,
29,
17,
30,
41,
13,
4,
13,
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,
29,
13,
12,
13,
30,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
4,
18,
18,
13,
13,
12,
13,
30,
14,
13,
4,
18,
18,
13,
13,
13,
23,
13,
12,
13,
30,
14,
13,
4,
18,
18,
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
],
[
543,
14
],
[
543,
15
],
[
15,
16
],
[
543,
17
],
[
17,
18
],
[
17,
19
],
[
543,
20
],
[
20,
21
],
[
543,
22
],
[
22,
23
],
[
543,
24
],
[
24,
25
],
[
543,
26
],
[
26,
27
],
[
543,
28
],
[
28,
29
],
[
543,
30
],
[
30,
31
],
[
543,
32
],
[
32,
33
],
[
32,
34
],
[
34,
35
],
[
35,
36
],
[
35,
37
],
[
34,
38
],
[
38,
39
],
[
38,
40
],
[
40,
41
],
[
34,
42
],
[
42,
43
],
[
42,
44
],
[
44,
45
],
[
34,
46
],
[
46,
47
],
[
46,
48
],
[
48,
49
],
[
34,
50
],
[
50,
51
],
[
51,
52
],
[
50,
53
],
[
34,
54
],
[
54,
55
],
[
54,
56
],
[
34,
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
],
[
70,
72
],
[
72,
73
],
[
72,
74
],
[
34,
75
],
[
75,
76
],
[
75,
77
],
[
32,
78
],
[
78,
79
],
[
543,
80
],
[
80,
81
],
[
80,
82
],
[
82,
83
],
[
83,
84
],
[
84,
85
],
[
85,
86
],
[
85,
87
],
[
83,
88
],
[
88,
89
],
[
88,
90
],
[
90,
91
],
[
90,
92
],
[
83,
93
],
[
93,
94
],
[
94,
95
],
[
83,
96
],
[
97,
97
],
[
97,
98
],
[
98,
99
],
[
99,
100
],
[
100,
101
],
[
99,
102
],
[
102,
103
],
[
102,
104
],
[
98,
105
],
[
105,
106
],
[
106,
107
],
[
82,
108
],
[
108,
109
],
[
109,
110
],
[
80,
111
],
[
111,
112
],
[
80,
113
],
[
113,
114
],
[
543,
115
],
[
115,
116
],
[
115,
117
],
[
117,
118
],
[
118,
119
],
[
118,
120
],
[
120,
121
],
[
120,
122
],
[
117,
123
],
[
123,
124
],
[
124,
125
],
[
123,
126
],
[
117,
127
],
[
127,
128
],
[
115,
129
],
[
129,
130
],
[
543,
131
],
[
131,
132
],
[
131,
133
],
[
133,
134
],
[
134,
135
],
[
134,
136
],
[
137,
138
],
[
137,
139
],
[
133,
140
],
[
140,
141
],
[
141,
142
],
[
142,
143
],
[
142,
144
],
[
140,
145
],
[
145,
146
],
[
145,
147
],
[
147,
148
],
[
147,
149
],
[
140,
150
],
[
150,
151
],
[
151,
152
],
[
140,
153
],
[
154,
154
],
[
154,
155
],
[
155,
156
],
[
156,
157
],
[
156,
158
],
[
155,
159
],
[
159,
160
],
[
159,
161
],
[
133,
162
],
[
162,
163
],
[
131,
164
],
[
164,
165
],
[
543,
166
],
[
166,
167
],
[
166,
168
],
[
168,
169
],
[
169,
170
],
[
169,
171
],
[
172,
173
],
[
173,
174
],
[
168,
175
],
[
175,
176
],
[
176,
177
],
[
177,
178
],
[
177,
179
],
[
175,
180
],
[
180,
181
],
[
180,
182
],
[
182,
183
],
[
182,
184
],
[
175,
185
],
[
185,
186
],
[
186,
187
],
[
175,
188
],
[
189,
189
],
[
189,
190
],
[
190,
191
],
[
191,
192
],
[
191,
193
],
[
190,
194
],
[
194,
195
],
[
195,
196
],
[
194,
197
],
[
168,
198
],
[
198,
199
],
[
166,
200
],
[
200,
201
],
[
543,
202
],
[
202,
203
],
[
202,
204
],
[
204,
205
],
[
205,
206
],
[
206,
207
],
[
207,
208
],
[
207,
209
],
[
206,
210
],
[
210,
211
],
[
210,
212
],
[
212,
213
],
[
212,
214
],
[
205,
215
],
[
215,
216
],
[
216,
217
],
[
216,
218
],
[
218,
219
],
[
215,
220
],
[
220,
221
],
[
220,
222
],
[
204,
223
],
[
223,
224
],
[
224,
225
],
[
224,
226
],
[
226,
227
],
[
543,
228
],
[
228,
229
],
[
228,
230
],
[
230,
231
],
[
231,
232
],
[
232,
233
],
[
233,
234
],
[
233,
235
],
[
232,
236
],
[
236,
237
],
[
236,
238
],
[
238,
239
],
[
238,
240
],
[
231,
241
],
[
241,
242
],
[
242,
243
],
[
242,
244
],
[
244,
245
],
[
241,
246
],
[
246,
247
],
[
246,
248
],
[
230,
249
],
[
249,
250
],
[
250,
251
],
[
250,
252
],
[
252,
253
],
[
543,
254
],
[
254,
255
],
[
254,
256
],
[
256,
257
],
[
257,
258
],
[
258,
259
],
[
259,
260
],
[
259,
261
],
[
258,
262
],
[
262,
263
],
[
262,
264
],
[
264,
265
],
[
264,
266
],
[
257,
267
],
[
267,
268
],
[
268,
269
],
[
268,
270
],
[
270,
271
],
[
267,
272
],
[
272,
273
],
[
272,
274
],
[
256,
275
],
[
275,
276
],
[
276,
277
],
[
276,
278
],
[
278,
279
],
[
543,
280
],
[
280,
281
],
[
280,
282
],
[
282,
283
],
[
283,
284
],
[
284,
285
],
[
284,
286
],
[
286,
287
],
[
287,
288
],
[
288,
289
],
[
286,
290
],
[
290,
291
],
[
283,
292
],
[
292,
293
],
[
293,
294
],
[
294,
295
],
[
295,
296
],
[
296,
297
],
[
297,
298
],
[
294,
299
],
[
543,
300
],
[
300,
301
],
[
300,
302
],
[
302,
303
],
[
303,
304
],
[
304,
305
],
[
304,
306
],
[
306,
307
],
[
307,
308
],
[
308,
309
],
[
306,
310
],
[
310,
311
],
[
303,
312
],
[
312,
313
],
[
313,
314
],
[
313,
315
],
[
315,
316
],
[
312,
317
],
[
317,
318
],
[
317,
319
],
[
320,
321
],
[
320,
322
],
[
312,
323
],
[
323,
324
],
[
324,
325
],
[
325,
326
],
[
325,
327
],
[
323,
328
],
[
328,
329
],
[
328,
330
],
[
330,
331
],
[
330,
332
],
[
323,
333
],
[
333,
334
],
[
334,
335
],
[
323,
336
],
[
337,
337
],
[
337,
338
],
[
338,
339
],
[
339,
340
],
[
339,
341
],
[
338,
342
],
[
342,
343
],
[
343,
344
],
[
342,
345
],
[
345,
346
],
[
345,
347
],
[
312,
348
],
[
348,
349
],
[
543,
350
],
[
350,
351
],
[
350,
352
],
[
352,
353
],
[
353,
354
],
[
354,
355
],
[
354,
356
],
[
356,
357
],
[
357,
358
],
[
358,
359
],
[
356,
360
],
[
360,
361
],
[
353,
362
],
[
362,
363
],
[
363,
364
],
[
363,
365
],
[
365,
366
],
[
362,
367
],
[
367,
368
],
[
367,
369
],
[
370,
371
],
[
370,
372
],
[
362,
373
],
[
373,
374
],
[
374,
375
],
[
375,
376
],
[
375,
377
],
[
373,
378
],
[
378,
379
],
[
378,
380
],
[
380,
381
],
[
380,
382
],
[
373,
383
],
[
383,
384
],
[
384,
385
],
[
373,
386
],
[
387,
387
],
[
387,
388
],
[
388,
389
],
[
389,
390
],
[
389,
391
],
[
388,
392
],
[
392,
393
],
[
393,
394
],
[
392,
395
],
[
395,
396
],
[
395,
397
],
[
362,
398
],
[
398,
399
],
[
543,
400
],
[
400,
401
],
[
400,
402
],
[
402,
403
],
[
403,
404
],
[
404,
405
],
[
404,
406
],
[
406,
407
],
[
407,
408
],
[
408,
409
],
[
406,
410
],
[
410,
411
],
[
403,
412
],
[
412,
413
],
[
413,
414
],
[
413,
415
],
[
415,
416
],
[
412,
417
],
[
417,
418
],
[
417,
419
],
[
420,
421
],
[
420,
422
],
[
412,
423
],
[
423,
424
],
[
424,
425
],
[
425,
426
],
[
425,
427
],
[
423,
428
],
[
428,
429
],
[
428,
430
],
[
430,
431
],
[
430,
432
],
[
423,
433
],
[
433,
434
],
[
434,
435
],
[
423,
436
],
[
437,
437
],
[
437,
438
],
[
438,
439
],
[
439,
440
],
[
439,
441
],
[
438,
442
],
[
442,
443
],
[
443,
444
],
[
442,
445
],
[
445,
446
],
[
445,
447
],
[
412,
448
],
[
448,
449
],
[
543,
450
],
[
450,
451
],
[
450,
452
],
[
452,
453
],
[
453,
454
],
[
454,
455
],
[
454,
456
],
[
456,
457
],
[
457,
458
],
[
458,
459
],
[
456,
460
],
[
460,
461
],
[
453,
462
],
[
462,
463
],
[
463,
464
],
[
463,
465
],
[
465,
466
],
[
462,
467
],
[
467,
468
],
[
467,
469
],
[
470,
471
],
[
470,
472
],
[
462,
473
],
[
473,
474
],
[
474,
475
],
[
475,
476
],
[
475,
477
],
[
473,
478
],
[
478,
479
],
[
478,
480
],
[
480,
481
],
[
480,
482
],
[
473,
483
],
[
483,
484
],
[
484,
485
],
[
473,
486
],
[
487,
487
],
[
487,
488
],
[
488,
489
],
[
489,
490
],
[
489,
491
],
[
488,
492
],
[
492,
493
],
[
493,
494
],
[
492,
495
],
[
495,
496
],
[
495,
497
],
[
462,
498
],
[
498,
499
],
[
543,
500
],
[
500,
501
],
[
500,
502
],
[
502,
503
],
[
503,
504
],
[
504,
505
],
[
505,
506
],
[
505,
507
],
[
503,
508
],
[
500,
509
],
[
509,
510
],
[
543,
511
],
[
511,
512
],
[
511,
513
],
[
513,
514
],
[
514,
515
],
[
515,
516
],
[
516,
517
],
[
516,
518
],
[
543,
519
],
[
519,
520
],
[
519,
521
],
[
521,
522
],
[
522,
523
],
[
522,
524
],
[
524,
525
],
[
525,
526
],
[
526,
527
],
[
526,
528
],
[
524,
529
],
[
519,
530
],
[
530,
531
],
[
543,
532
],
[
532,
533
],
[
532,
534
],
[
534,
535
],
[
535,
536
],
[
535,
537
],
[
537,
538
],
[
538,
539
],
[
539,
540
],
[
539,
541
],
[
0,
542
],
[
542,
543
],
[
542,
544
]
]
| [
"import java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.ArrayList;\nimport java.util.Arrays;\n\npublic class Main {\n\n\tstatic BufferedReader reader;\n\tfinal static boolean MODE_DEBUG = false;\n\tstatic int[] read_line_int;\n\tstatic int read_line_int_ptr;\n\tstatic long[] read_line_long;\n\tstatic int read_line_long_ptr;\n\tstatic String[] read_line;\n\tstatic int read_line_ptr;\n\t//static field here\n\t\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t//code here\n\t\tint N = readInt();\n\t\tint K = readInt();\n\t\tint[] a = readLineInt();\n\t\tArrays.sort(a);\n\t\tint ans = 0;\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tans+=a[i];\n\t\t}\n\t\t\n\t\tprint(ans);\n\t}\n\t\n\t//functions here\n\t//note that all methods should be STATIC\n\n\n\tprivate static <T> int arraySearch(T needle, T[] heystack) {\n\t\tfor(int i=0;i<heystack.length;i++) {\n\t\t\tif(needle.equals(heystack[i])) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tprivate static int[] sort(int[] base) {\n\t\tint[] copy = array_copy(base);\n\t\tArrays.sort(copy);\n\t\treturn copy;\n\t}\n\tprivate static int[] array_copy(int[] base) {\n\t\tint[] copy = new int[base.length];\n\t\tfor(int i=0;i<base.length;i++) {\n\t\t\tcopy[i] = base[i];\n\t\t}\n\t\treturn copy;\n\t}\n\tprivate static int[] asArray(ArrayList<Integer> ints) {\n\t\tint[] intlist = new int[ints.size()];\n\t\tfor(int i=0;i<intlist.length;i++) {\n\t\t\tintlist[i] = ints.get(i);\n\t\t}\n\t\treturn intlist;\n\t}\n\tprivate static int readInt() {\n\t\tif(read_line_int==null||read_line_int_ptr==read_line_int.length) {\n\t\t\tread_line_int = readLineInt();\n\t\t\tread_line_int_ptr=0;\n\t\t}\n\t\treturn read_line_int[read_line_int_ptr++];\n\t}\n\tprivate static long readLong() {\n\t\tif(read_line_long==null||read_line_long_ptr==read_line_long.length) {\n\t\t\tread_line_long = readLineLong();\n\t\t\tread_line_long_ptr=0;\n\t\t}\n\t\treturn read_line_long[read_line_long_ptr++];\n\t}\n\tprivate static String readString() {\n\t\tif(read_line==null||read_line_int_ptr==read_line.length) {\n\t\t\tread_line = readLine();\n\t\t\tread_line_ptr=0;\n\t\t}\n\t\treturn read_line[read_line_ptr++];\n\t}\n\tprivate static String[] readLine(){\n\t\ttry{\n\t\t\treturn reader.readLine().split(\" \");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn new String[]{e.getMessage()};\n\t\t}\n\t}\n\tprivate static int[] readLineInt(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tint[] ints = new int[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static long[] readLineLong(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tlong[] ints = new long[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Long.parseLong(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static byte[] readLineByte(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tbyte[] bytes = new byte[s.length];\n\t\t\tfor(int i=0;i<bytes.length;i++) {\n\t\t\t\tbytes[i] = Byte.parseByte(s[i]);\n\t\t\t}\n\t\t\treturn bytes;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static char[] readLineChar(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tchar[] chars = new char[s.length];\n\t\t\tfor(int i=0;i<chars.length;i++) {\n\t\t\t\tchars[i] = (char)Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn chars;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static void print(Object o){\n\t\tSystem.out.println(o);\n\t}\n\tprivate static void print(){\n\t\tSystem.out.println();\n\t}\n\tprivate static void printd(Object o){\n\t\tif(MODE_DEBUG)System.err.println(o);\n\t}\n\tprivate static void printd(){\n\t\tif(MODE_DEBUG)System.err.println();\n\t}\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.Arrays;",
"Arrays",
"java.util",
"public class Main {\n\n\tstatic BufferedReader reader;\n\tfinal static boolean MODE_DEBUG = false;\n\tstatic int[] read_line_int;\n\tstatic int read_line_int_ptr;\n\tstatic long[] read_line_long;\n\tstatic int read_line_long_ptr;\n\tstatic String[] read_line;\n\tstatic int read_line_ptr;\n\t//static field here\n\t\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t//code here\n\t\tint N = readInt();\n\t\tint K = readInt();\n\t\tint[] a = readLineInt();\n\t\tArrays.sort(a);\n\t\tint ans = 0;\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tans+=a[i];\n\t\t}\n\t\t\n\t\tprint(ans);\n\t}\n\t\n\t//functions here\n\t//note that all methods should be STATIC\n\n\n\tprivate static <T> int arraySearch(T needle, T[] heystack) {\n\t\tfor(int i=0;i<heystack.length;i++) {\n\t\t\tif(needle.equals(heystack[i])) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tprivate static int[] sort(int[] base) {\n\t\tint[] copy = array_copy(base);\n\t\tArrays.sort(copy);\n\t\treturn copy;\n\t}\n\tprivate static int[] array_copy(int[] base) {\n\t\tint[] copy = new int[base.length];\n\t\tfor(int i=0;i<base.length;i++) {\n\t\t\tcopy[i] = base[i];\n\t\t}\n\t\treturn copy;\n\t}\n\tprivate static int[] asArray(ArrayList<Integer> ints) {\n\t\tint[] intlist = new int[ints.size()];\n\t\tfor(int i=0;i<intlist.length;i++) {\n\t\t\tintlist[i] = ints.get(i);\n\t\t}\n\t\treturn intlist;\n\t}\n\tprivate static int readInt() {\n\t\tif(read_line_int==null||read_line_int_ptr==read_line_int.length) {\n\t\t\tread_line_int = readLineInt();\n\t\t\tread_line_int_ptr=0;\n\t\t}\n\t\treturn read_line_int[read_line_int_ptr++];\n\t}\n\tprivate static long readLong() {\n\t\tif(read_line_long==null||read_line_long_ptr==read_line_long.length) {\n\t\t\tread_line_long = readLineLong();\n\t\t\tread_line_long_ptr=0;\n\t\t}\n\t\treturn read_line_long[read_line_long_ptr++];\n\t}\n\tprivate static String readString() {\n\t\tif(read_line==null||read_line_int_ptr==read_line.length) {\n\t\t\tread_line = readLine();\n\t\t\tread_line_ptr=0;\n\t\t}\n\t\treturn read_line[read_line_ptr++];\n\t}\n\tprivate static String[] readLine(){\n\t\ttry{\n\t\t\treturn reader.readLine().split(\" \");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn new String[]{e.getMessage()};\n\t\t}\n\t}\n\tprivate static int[] readLineInt(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tint[] ints = new int[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static long[] readLineLong(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tlong[] ints = new long[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Long.parseLong(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static byte[] readLineByte(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tbyte[] bytes = new byte[s.length];\n\t\t\tfor(int i=0;i<bytes.length;i++) {\n\t\t\t\tbytes[i] = Byte.parseByte(s[i]);\n\t\t\t}\n\t\t\treturn bytes;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static char[] readLineChar(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tchar[] chars = new char[s.length];\n\t\t\tfor(int i=0;i<chars.length;i++) {\n\t\t\t\tchars[i] = (char)Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn chars;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static void print(Object o){\n\t\tSystem.out.println(o);\n\t}\n\tprivate static void print(){\n\t\tSystem.out.println();\n\t}\n\tprivate static void printd(Object o){\n\t\tif(MODE_DEBUG)System.err.println(o);\n\t}\n\tprivate static void printd(){\n\t\tif(MODE_DEBUG)System.err.println();\n\t}\n}",
"Main",
"static BufferedReader reader;",
"reader",
"final static boolean MODE_DEBUG = false;",
"MODE_DEBUG",
"false",
"static int[] read_line_int;",
"read_line_int",
"static int read_line_int_ptr;",
"read_line_int_ptr",
"static long[] read_line_long;",
"read_line_long",
"static int read_line_long_ptr;",
"read_line_long_ptr",
"static String[] read_line;",
"read_line",
"static int read_line_ptr;",
"read_line_ptr",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t//code here\n\t\tint N = readInt();\n\t\tint K = readInt();\n\t\tint[] a = readLineInt();\n\t\tArrays.sort(a);\n\t\tint ans = 0;\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tans+=a[i];\n\t\t}\n\t\t\n\t\tprint(ans);\n\t}",
"main",
"{\n\t\t// TODO Auto-generated method stub\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t//code here\n\t\tint N = readInt();\n\t\tint K = readInt();\n\t\tint[] a = readLineInt();\n\t\tArrays.sort(a);\n\t\tint ans = 0;\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tans+=a[i];\n\t\t}\n\t\t\n\t\tprint(ans);\n\t}",
"reader = new BufferedReader(new InputStreamReader(System.in))",
"reader",
"new BufferedReader(new InputStreamReader(System.in))",
"int N = readInt();",
"N",
"readInt()",
"readInt",
"int K = readInt();",
"K",
"readInt()",
"readInt",
"int[] a = readLineInt();",
"a",
"readLineInt()",
"readLineInt",
"Arrays.sort(a)",
"Arrays.sort",
"Arrays",
"a",
"int ans = 0;",
"ans",
"0",
"for(int i=0;i<K;i++) {\n\t\t\tans+=a[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<K",
"i",
"K",
"i++",
"i++",
"i",
"{\n\t\t\tans+=a[i];\n\t\t}",
"{\n\t\t\tans+=a[i];\n\t\t}",
"ans+=a[i]",
"ans",
"a[i]",
"a",
"i",
"print(ans)",
"print",
"ans",
"String[] args",
"args",
"private static <T> int arraySearch(T needle, T[] heystack) {\n\t\tfor(int i=0;i<heystack.length;i++) {\n\t\t\tif(needle.equals(heystack[i])) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}",
"arraySearch",
"{\n\t\tfor(int i=0;i<heystack.length;i++) {\n\t\t\tif(needle.equals(heystack[i])) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}",
"for(int i=0;i<heystack.length;i++) {\n\t\t\tif(needle.equals(heystack[i])) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<heystack.length",
"i",
"heystack.length",
"heystack",
"heystack.length",
"i++",
"i++",
"i",
"{\n\t\t\tif(needle.equals(heystack[i])) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}",
"{\n\t\t\tif(needle.equals(heystack[i])) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}",
"if(needle.equals(heystack[i])) {\n\t\t\t\treturn i;\n\t\t\t}",
"needle.equals(heystack[i])",
"needle.equals",
"needle",
"heystack[i]",
"heystack",
"i",
"{\n\t\t\t\treturn i;\n\t\t\t}",
"return i;",
"i",
"return -1;",
"-1",
"1",
"T needle",
"needle",
"T[] heystack",
"heystack",
"private static int[] sort(int[] base) {\n\t\tint[] copy = array_copy(base);\n\t\tArrays.sort(copy);\n\t\treturn copy;\n\t}",
"sort",
"{\n\t\tint[] copy = array_copy(base);\n\t\tArrays.sort(copy);\n\t\treturn copy;\n\t}",
"int[] copy = array_copy(base);",
"copy",
"array_copy(base)",
"array_copy",
"base",
"Arrays.sort(copy)",
"Arrays.sort",
"Arrays",
"copy",
"return copy;",
"copy",
"int[] base",
"base",
"private static int[] array_copy(int[] base) {\n\t\tint[] copy = new int[base.length];\n\t\tfor(int i=0;i<base.length;i++) {\n\t\t\tcopy[i] = base[i];\n\t\t}\n\t\treturn copy;\n\t}",
"array_copy",
"{\n\t\tint[] copy = new int[base.length];\n\t\tfor(int i=0;i<base.length;i++) {\n\t\t\tcopy[i] = base[i];\n\t\t}\n\t\treturn copy;\n\t}",
"int[] copy = new int[base.length];",
"copy",
"new int[base.length]",
"base.length",
"base",
"base.length",
"for(int i=0;i<base.length;i++) {\n\t\t\tcopy[i] = base[i];\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<base.length",
"i",
"base.length",
"base",
"base.length",
"i++",
"i++",
"i",
"{\n\t\t\tcopy[i] = base[i];\n\t\t}",
"{\n\t\t\tcopy[i] = base[i];\n\t\t}",
"copy[i] = base[i]",
"copy[i]",
"copy",
"i",
"base[i]",
"base",
"i",
"return copy;",
"copy",
"int[] base",
"base",
"private static int[] asArray(ArrayList<Integer> ints) {\n\t\tint[] intlist = new int[ints.size()];\n\t\tfor(int i=0;i<intlist.length;i++) {\n\t\t\tintlist[i] = ints.get(i);\n\t\t}\n\t\treturn intlist;\n\t}",
"asArray",
"{\n\t\tint[] intlist = new int[ints.size()];\n\t\tfor(int i=0;i<intlist.length;i++) {\n\t\t\tintlist[i] = ints.get(i);\n\t\t}\n\t\treturn intlist;\n\t}",
"int[] intlist = new int[ints.size()];",
"intlist",
"new int[ints.size()]",
"ints.size()",
"ints.size",
"ints",
"for(int i=0;i<intlist.length;i++) {\n\t\t\tintlist[i] = ints.get(i);\n\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<intlist.length",
"i",
"intlist.length",
"intlist",
"intlist.length",
"i++",
"i++",
"i",
"{\n\t\t\tintlist[i] = ints.get(i);\n\t\t}",
"{\n\t\t\tintlist[i] = ints.get(i);\n\t\t}",
"intlist[i] = ints.get(i)",
"intlist[i]",
"intlist",
"i",
"ints.get(i)",
"ints.get",
"ints",
"i",
"return intlist;",
"intlist",
"ArrayList<Integer> ints",
"ints",
"private static int readInt() {\n\t\tif(read_line_int==null||read_line_int_ptr==read_line_int.length) {\n\t\t\tread_line_int = readLineInt();\n\t\t\tread_line_int_ptr=0;\n\t\t}\n\t\treturn read_line_int[read_line_int_ptr++];\n\t}",
"readInt",
"{\n\t\tif(read_line_int==null||read_line_int_ptr==read_line_int.length) {\n\t\t\tread_line_int = readLineInt();\n\t\t\tread_line_int_ptr=0;\n\t\t}\n\t\treturn read_line_int[read_line_int_ptr++];\n\t}",
"if(read_line_int==null||read_line_int_ptr==read_line_int.length) {\n\t\t\tread_line_int = readLineInt();\n\t\t\tread_line_int_ptr=0;\n\t\t}",
"read_line_int==null||read_line_int_ptr==read_line_int.length",
"read_line_int==null",
"read_line_int",
"null",
"read_line_int_ptr==read_line_int.length",
"read_line_int_ptr",
"read_line_int.length",
"read_line_int",
"read_line_int.length",
"{\n\t\t\tread_line_int = readLineInt();\n\t\t\tread_line_int_ptr=0;\n\t\t}",
"read_line_int = readLineInt()",
"read_line_int",
"readLineInt()",
"readLineInt",
"read_line_int_ptr=0",
"read_line_int_ptr",
"0",
"return read_line_int[read_line_int_ptr++];",
"read_line_int[read_line_int_ptr++]",
"read_line_int",
"read_line_int_ptr++",
"read_line_int_ptr",
"private static long readLong() {\n\t\tif(read_line_long==null||read_line_long_ptr==read_line_long.length) {\n\t\t\tread_line_long = readLineLong();\n\t\t\tread_line_long_ptr=0;\n\t\t}\n\t\treturn read_line_long[read_line_long_ptr++];\n\t}",
"readLong",
"{\n\t\tif(read_line_long==null||read_line_long_ptr==read_line_long.length) {\n\t\t\tread_line_long = readLineLong();\n\t\t\tread_line_long_ptr=0;\n\t\t}\n\t\treturn read_line_long[read_line_long_ptr++];\n\t}",
"if(read_line_long==null||read_line_long_ptr==read_line_long.length) {\n\t\t\tread_line_long = readLineLong();\n\t\t\tread_line_long_ptr=0;\n\t\t}",
"read_line_long==null||read_line_long_ptr==read_line_long.length",
"read_line_long==null",
"read_line_long",
"null",
"read_line_long_ptr==read_line_long.length",
"read_line_long_ptr",
"read_line_long.length",
"read_line_long",
"read_line_long.length",
"{\n\t\t\tread_line_long = readLineLong();\n\t\t\tread_line_long_ptr=0;\n\t\t}",
"read_line_long = readLineLong()",
"read_line_long",
"readLineLong()",
"readLineLong",
"read_line_long_ptr=0",
"read_line_long_ptr",
"0",
"return read_line_long[read_line_long_ptr++];",
"read_line_long[read_line_long_ptr++]",
"read_line_long",
"read_line_long_ptr++",
"read_line_long_ptr",
"private static String readString() {\n\t\tif(read_line==null||read_line_int_ptr==read_line.length) {\n\t\t\tread_line = readLine();\n\t\t\tread_line_ptr=0;\n\t\t}\n\t\treturn read_line[read_line_ptr++];\n\t}",
"readString",
"{\n\t\tif(read_line==null||read_line_int_ptr==read_line.length) {\n\t\t\tread_line = readLine();\n\t\t\tread_line_ptr=0;\n\t\t}\n\t\treturn read_line[read_line_ptr++];\n\t}",
"if(read_line==null||read_line_int_ptr==read_line.length) {\n\t\t\tread_line = readLine();\n\t\t\tread_line_ptr=0;\n\t\t}",
"read_line==null||read_line_int_ptr==read_line.length",
"read_line==null",
"read_line",
"null",
"read_line_int_ptr==read_line.length",
"read_line_int_ptr",
"read_line.length",
"read_line",
"read_line.length",
"{\n\t\t\tread_line = readLine();\n\t\t\tread_line_ptr=0;\n\t\t}",
"read_line = readLine()",
"read_line",
"readLine()",
"readLine",
"read_line_ptr=0",
"read_line_ptr",
"0",
"return read_line[read_line_ptr++];",
"read_line[read_line_ptr++]",
"read_line",
"read_line_ptr++",
"read_line_ptr",
"private static String[] readLine(){\n\t\ttry{\n\t\t\treturn reader.readLine().split(\" \");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn new String[]{e.getMessage()};\n\t\t}\n\t}",
"readLine",
"{\n\t\ttry{\n\t\t\treturn reader.readLine().split(\" \");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn new String[]{e.getMessage()};\n\t\t}\n\t}",
"try{\n\t\t\treturn reader.readLine().split(\" \");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn new String[]{e.getMessage()};\n\t\t}",
"catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn new String[]{e.getMessage()};\n\t\t}",
"Exception e",
"{\n\t\t\te.printStackTrace();\n\t\t\treturn new String[]{e.getMessage()};\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"return new String[]{e.getMessage()};",
"new String[]{e.getMessage()}",
"{\n\t\t\treturn reader.readLine().split(\" \");\n\t\t}",
"return reader.readLine().split(\" \");",
"reader.readLine().split(\" \")",
"reader.readLine().split",
"reader.readLine()",
"reader.readLine",
"reader",
"\" \"",
"private static int[] readLineInt(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tint[] ints = new int[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"readLineInt",
"{\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tint[] ints = new int[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"try{\n\t\t\tString[] s = readLine();\n\t\t\tint[] ints = new int[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}",
"catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}",
"Exception e",
"{\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"return null;",
"null",
"{\n\t\t\tString[] s = readLine();\n\t\t\tint[] ints = new int[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}",
"String[] s = readLine();",
"s",
"readLine()",
"readLine",
"int[] ints = new int[s.length];",
"ints",
"new int[s.length]",
"s.length",
"s",
"s.length",
"for(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Integer.parseInt(s[i]);\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<ints.length",
"i",
"ints.length",
"ints",
"ints.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tints[i] = Integer.parseInt(s[i]);\n\t\t\t}",
"{\n\t\t\t\tints[i] = Integer.parseInt(s[i]);\n\t\t\t}",
"ints[i] = Integer.parseInt(s[i])",
"ints[i]",
"ints",
"i",
"Integer.parseInt(s[i])",
"Integer.parseInt",
"Integer",
"s[i]",
"s",
"i",
"return ints;",
"ints",
"private static long[] readLineLong(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tlong[] ints = new long[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Long.parseLong(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"readLineLong",
"{\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tlong[] ints = new long[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Long.parseLong(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"try{\n\t\t\tString[] s = readLine();\n\t\t\tlong[] ints = new long[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Long.parseLong(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}",
"catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}",
"Exception e",
"{\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"return null;",
"null",
"{\n\t\t\tString[] s = readLine();\n\t\t\tlong[] ints = new long[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Long.parseLong(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}",
"String[] s = readLine();",
"s",
"readLine()",
"readLine",
"long[] ints = new long[s.length];",
"ints",
"new long[s.length]",
"s.length",
"s",
"s.length",
"for(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Long.parseLong(s[i]);\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<ints.length",
"i",
"ints.length",
"ints",
"ints.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tints[i] = Long.parseLong(s[i]);\n\t\t\t}",
"{\n\t\t\t\tints[i] = Long.parseLong(s[i]);\n\t\t\t}",
"ints[i] = Long.parseLong(s[i])",
"ints[i]",
"ints",
"i",
"Long.parseLong(s[i])",
"Long.parseLong",
"Long",
"s[i]",
"s",
"i",
"return ints;",
"ints",
"private static byte[] readLineByte(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tbyte[] bytes = new byte[s.length];\n\t\t\tfor(int i=0;i<bytes.length;i++) {\n\t\t\t\tbytes[i] = Byte.parseByte(s[i]);\n\t\t\t}\n\t\t\treturn bytes;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"readLineByte",
"{\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tbyte[] bytes = new byte[s.length];\n\t\t\tfor(int i=0;i<bytes.length;i++) {\n\t\t\t\tbytes[i] = Byte.parseByte(s[i]);\n\t\t\t}\n\t\t\treturn bytes;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"try{\n\t\t\tString[] s = readLine();\n\t\t\tbyte[] bytes = new byte[s.length];\n\t\t\tfor(int i=0;i<bytes.length;i++) {\n\t\t\t\tbytes[i] = Byte.parseByte(s[i]);\n\t\t\t}\n\t\t\treturn bytes;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}",
"catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}",
"Exception e",
"{\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"return null;",
"null",
"{\n\t\t\tString[] s = readLine();\n\t\t\tbyte[] bytes = new byte[s.length];\n\t\t\tfor(int i=0;i<bytes.length;i++) {\n\t\t\t\tbytes[i] = Byte.parseByte(s[i]);\n\t\t\t}\n\t\t\treturn bytes;\n\t\t}",
"String[] s = readLine();",
"s",
"readLine()",
"readLine",
"byte[] bytes = new byte[s.length];",
"bytes",
"new byte[s.length]",
"s.length",
"s",
"s.length",
"for(int i=0;i<bytes.length;i++) {\n\t\t\t\tbytes[i] = Byte.parseByte(s[i]);\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<bytes.length",
"i",
"bytes.length",
"bytes",
"bytes.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tbytes[i] = Byte.parseByte(s[i]);\n\t\t\t}",
"{\n\t\t\t\tbytes[i] = Byte.parseByte(s[i]);\n\t\t\t}",
"bytes[i] = Byte.parseByte(s[i])",
"bytes[i]",
"bytes",
"i",
"Byte.parseByte(s[i])",
"Byte.parseByte",
"Byte",
"s[i]",
"s",
"i",
"return bytes;",
"bytes",
"private static char[] readLineChar(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tchar[] chars = new char[s.length];\n\t\t\tfor(int i=0;i<chars.length;i++) {\n\t\t\t\tchars[i] = (char)Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn chars;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"readLineChar",
"{\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tchar[] chars = new char[s.length];\n\t\t\tfor(int i=0;i<chars.length;i++) {\n\t\t\t\tchars[i] = (char)Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn chars;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"try{\n\t\t\tString[] s = readLine();\n\t\t\tchar[] chars = new char[s.length];\n\t\t\tfor(int i=0;i<chars.length;i++) {\n\t\t\t\tchars[i] = (char)Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn chars;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}",
"catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}",
"Exception e",
"{\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}",
"e.printStackTrace()",
"e.printStackTrace",
"e",
"return null;",
"null",
"{\n\t\t\tString[] s = readLine();\n\t\t\tchar[] chars = new char[s.length];\n\t\t\tfor(int i=0;i<chars.length;i++) {\n\t\t\t\tchars[i] = (char)Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn chars;\n\t\t}",
"String[] s = readLine();",
"s",
"readLine()",
"readLine",
"char[] chars = new char[s.length];",
"chars",
"new char[s.length]",
"s.length",
"s",
"s.length",
"for(int i=0;i<chars.length;i++) {\n\t\t\t\tchars[i] = (char)Integer.parseInt(s[i]);\n\t\t\t}",
"int i=0;",
"int i=0;",
"i",
"0",
"i<chars.length",
"i",
"chars.length",
"chars",
"chars.length",
"i++",
"i++",
"i",
"{\n\t\t\t\tchars[i] = (char)Integer.parseInt(s[i]);\n\t\t\t}",
"{\n\t\t\t\tchars[i] = (char)Integer.parseInt(s[i]);\n\t\t\t}",
"chars[i] = (char)Integer.parseInt(s[i])",
"chars[i]",
"chars",
"i",
"(char)Integer.parseInt(s[i])",
"Integer.parseInt",
"Integer",
"s[i]",
"s",
"i",
"return chars;",
"chars",
"private static void print(Object o){\n\t\tSystem.out.println(o);\n\t}",
"print",
"{\n\t\tSystem.out.println(o);\n\t}",
"System.out.println(o)",
"System.out.println",
"System.out",
"System",
"System.out",
"o",
"Object o",
"o",
"private static void print(){\n\t\tSystem.out.println();\n\t}",
"print",
"{\n\t\tSystem.out.println();\n\t}",
"System.out.println()",
"System.out.println",
"System.out",
"System",
"System.out",
"private static void printd(Object o){\n\t\tif(MODE_DEBUG)System.err.println(o);\n\t}",
"printd",
"{\n\t\tif(MODE_DEBUG)System.err.println(o);\n\t}",
"if(MODE_DEBUG)System.err.println(o);",
"MODE_DEBUG",
"System.err.println(o)",
"System.err.println",
"System.err",
"System",
"System.err",
"o",
"Object o",
"o",
"private static void printd(){\n\t\tif(MODE_DEBUG)System.err.println();\n\t}",
"printd",
"{\n\t\tif(MODE_DEBUG)System.err.println();\n\t}",
"if(MODE_DEBUG)System.err.println();",
"MODE_DEBUG",
"System.err.println()",
"System.err.println",
"System.err",
"System",
"System.err",
"public class Main {\n\n\tstatic BufferedReader reader;\n\tfinal static boolean MODE_DEBUG = false;\n\tstatic int[] read_line_int;\n\tstatic int read_line_int_ptr;\n\tstatic long[] read_line_long;\n\tstatic int read_line_long_ptr;\n\tstatic String[] read_line;\n\tstatic int read_line_ptr;\n\t//static field here\n\t\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t//code here\n\t\tint N = readInt();\n\t\tint K = readInt();\n\t\tint[] a = readLineInt();\n\t\tArrays.sort(a);\n\t\tint ans = 0;\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tans+=a[i];\n\t\t}\n\t\t\n\t\tprint(ans);\n\t}\n\t\n\t//functions here\n\t//note that all methods should be STATIC\n\n\n\tprivate static <T> int arraySearch(T needle, T[] heystack) {\n\t\tfor(int i=0;i<heystack.length;i++) {\n\t\t\tif(needle.equals(heystack[i])) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tprivate static int[] sort(int[] base) {\n\t\tint[] copy = array_copy(base);\n\t\tArrays.sort(copy);\n\t\treturn copy;\n\t}\n\tprivate static int[] array_copy(int[] base) {\n\t\tint[] copy = new int[base.length];\n\t\tfor(int i=0;i<base.length;i++) {\n\t\t\tcopy[i] = base[i];\n\t\t}\n\t\treturn copy;\n\t}\n\tprivate static int[] asArray(ArrayList<Integer> ints) {\n\t\tint[] intlist = new int[ints.size()];\n\t\tfor(int i=0;i<intlist.length;i++) {\n\t\t\tintlist[i] = ints.get(i);\n\t\t}\n\t\treturn intlist;\n\t}\n\tprivate static int readInt() {\n\t\tif(read_line_int==null||read_line_int_ptr==read_line_int.length) {\n\t\t\tread_line_int = readLineInt();\n\t\t\tread_line_int_ptr=0;\n\t\t}\n\t\treturn read_line_int[read_line_int_ptr++];\n\t}\n\tprivate static long readLong() {\n\t\tif(read_line_long==null||read_line_long_ptr==read_line_long.length) {\n\t\t\tread_line_long = readLineLong();\n\t\t\tread_line_long_ptr=0;\n\t\t}\n\t\treturn read_line_long[read_line_long_ptr++];\n\t}\n\tprivate static String readString() {\n\t\tif(read_line==null||read_line_int_ptr==read_line.length) {\n\t\t\tread_line = readLine();\n\t\t\tread_line_ptr=0;\n\t\t}\n\t\treturn read_line[read_line_ptr++];\n\t}\n\tprivate static String[] readLine(){\n\t\ttry{\n\t\t\treturn reader.readLine().split(\" \");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn new String[]{e.getMessage()};\n\t\t}\n\t}\n\tprivate static int[] readLineInt(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tint[] ints = new int[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static long[] readLineLong(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tlong[] ints = new long[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Long.parseLong(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static byte[] readLineByte(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tbyte[] bytes = new byte[s.length];\n\t\t\tfor(int i=0;i<bytes.length;i++) {\n\t\t\t\tbytes[i] = Byte.parseByte(s[i]);\n\t\t\t}\n\t\t\treturn bytes;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static char[] readLineChar(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tchar[] chars = new char[s.length];\n\t\t\tfor(int i=0;i<chars.length;i++) {\n\t\t\t\tchars[i] = (char)Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn chars;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static void print(Object o){\n\t\tSystem.out.println(o);\n\t}\n\tprivate static void print(){\n\t\tSystem.out.println();\n\t}\n\tprivate static void printd(Object o){\n\t\tif(MODE_DEBUG)System.err.println(o);\n\t}\n\tprivate static void printd(){\n\t\tif(MODE_DEBUG)System.err.println();\n\t}\n}",
"public class Main {\n\n\tstatic BufferedReader reader;\n\tfinal static boolean MODE_DEBUG = false;\n\tstatic int[] read_line_int;\n\tstatic int read_line_int_ptr;\n\tstatic long[] read_line_long;\n\tstatic int read_line_long_ptr;\n\tstatic String[] read_line;\n\tstatic int read_line_ptr;\n\t//static field here\n\t\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\t//code here\n\t\tint N = readInt();\n\t\tint K = readInt();\n\t\tint[] a = readLineInt();\n\t\tArrays.sort(a);\n\t\tint ans = 0;\n\t\tfor(int i=0;i<K;i++) {\n\t\t\tans+=a[i];\n\t\t}\n\t\t\n\t\tprint(ans);\n\t}\n\t\n\t//functions here\n\t//note that all methods should be STATIC\n\n\n\tprivate static <T> int arraySearch(T needle, T[] heystack) {\n\t\tfor(int i=0;i<heystack.length;i++) {\n\t\t\tif(needle.equals(heystack[i])) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tprivate static int[] sort(int[] base) {\n\t\tint[] copy = array_copy(base);\n\t\tArrays.sort(copy);\n\t\treturn copy;\n\t}\n\tprivate static int[] array_copy(int[] base) {\n\t\tint[] copy = new int[base.length];\n\t\tfor(int i=0;i<base.length;i++) {\n\t\t\tcopy[i] = base[i];\n\t\t}\n\t\treturn copy;\n\t}\n\tprivate static int[] asArray(ArrayList<Integer> ints) {\n\t\tint[] intlist = new int[ints.size()];\n\t\tfor(int i=0;i<intlist.length;i++) {\n\t\t\tintlist[i] = ints.get(i);\n\t\t}\n\t\treturn intlist;\n\t}\n\tprivate static int readInt() {\n\t\tif(read_line_int==null||read_line_int_ptr==read_line_int.length) {\n\t\t\tread_line_int = readLineInt();\n\t\t\tread_line_int_ptr=0;\n\t\t}\n\t\treturn read_line_int[read_line_int_ptr++];\n\t}\n\tprivate static long readLong() {\n\t\tif(read_line_long==null||read_line_long_ptr==read_line_long.length) {\n\t\t\tread_line_long = readLineLong();\n\t\t\tread_line_long_ptr=0;\n\t\t}\n\t\treturn read_line_long[read_line_long_ptr++];\n\t}\n\tprivate static String readString() {\n\t\tif(read_line==null||read_line_int_ptr==read_line.length) {\n\t\t\tread_line = readLine();\n\t\t\tread_line_ptr=0;\n\t\t}\n\t\treturn read_line[read_line_ptr++];\n\t}\n\tprivate static String[] readLine(){\n\t\ttry{\n\t\t\treturn reader.readLine().split(\" \");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn new String[]{e.getMessage()};\n\t\t}\n\t}\n\tprivate static int[] readLineInt(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tint[] ints = new int[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static long[] readLineLong(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tlong[] ints = new long[s.length];\n\t\t\tfor(int i=0;i<ints.length;i++) {\n\t\t\t\tints[i] = Long.parseLong(s[i]);\n\t\t\t}\n\t\t\treturn ints;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static byte[] readLineByte(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tbyte[] bytes = new byte[s.length];\n\t\t\tfor(int i=0;i<bytes.length;i++) {\n\t\t\t\tbytes[i] = Byte.parseByte(s[i]);\n\t\t\t}\n\t\t\treturn bytes;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static char[] readLineChar(){\n\t\ttry{\n\t\t\tString[] s = readLine();\n\t\t\tchar[] chars = new char[s.length];\n\t\t\tfor(int i=0;i<chars.length;i++) {\n\t\t\t\tchars[i] = (char)Integer.parseInt(s[i]);\n\t\t\t}\n\t\t\treturn chars;\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}\n\tprivate static void print(Object o){\n\t\tSystem.out.println(o);\n\t}\n\tprivate static void print(){\n\t\tSystem.out.println();\n\t}\n\tprivate static void printd(Object o){\n\t\tif(MODE_DEBUG)System.err.println(o);\n\t}\n\tprivate static void printd(){\n\t\tif(MODE_DEBUG)System.err.println();\n\t}\n}",
"Main"
]
| import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class Main {
static BufferedReader reader;
final static boolean MODE_DEBUG = false;
static int[] read_line_int;
static int read_line_int_ptr;
static long[] read_line_long;
static int read_line_long_ptr;
static String[] read_line;
static int read_line_ptr;
//static field here
public static void main(String[] args) {
// TODO Auto-generated method stub
reader = new BufferedReader(new InputStreamReader(System.in));
//code here
int N = readInt();
int K = readInt();
int[] a = readLineInt();
Arrays.sort(a);
int ans = 0;
for(int i=0;i<K;i++) {
ans+=a[i];
}
print(ans);
}
//functions here
//note that all methods should be STATIC
private static <T> int arraySearch(T needle, T[] heystack) {
for(int i=0;i<heystack.length;i++) {
if(needle.equals(heystack[i])) {
return i;
}
}
return -1;
}
private static int[] sort(int[] base) {
int[] copy = array_copy(base);
Arrays.sort(copy);
return copy;
}
private static int[] array_copy(int[] base) {
int[] copy = new int[base.length];
for(int i=0;i<base.length;i++) {
copy[i] = base[i];
}
return copy;
}
private static int[] asArray(ArrayList<Integer> ints) {
int[] intlist = new int[ints.size()];
for(int i=0;i<intlist.length;i++) {
intlist[i] = ints.get(i);
}
return intlist;
}
private static int readInt() {
if(read_line_int==null||read_line_int_ptr==read_line_int.length) {
read_line_int = readLineInt();
read_line_int_ptr=0;
}
return read_line_int[read_line_int_ptr++];
}
private static long readLong() {
if(read_line_long==null||read_line_long_ptr==read_line_long.length) {
read_line_long = readLineLong();
read_line_long_ptr=0;
}
return read_line_long[read_line_long_ptr++];
}
private static String readString() {
if(read_line==null||read_line_int_ptr==read_line.length) {
read_line = readLine();
read_line_ptr=0;
}
return read_line[read_line_ptr++];
}
private static String[] readLine(){
try{
return reader.readLine().split(" ");
}catch(Exception e){
e.printStackTrace();
return new String[]{e.getMessage()};
}
}
private static int[] readLineInt(){
try{
String[] s = readLine();
int[] ints = new int[s.length];
for(int i=0;i<ints.length;i++) {
ints[i] = Integer.parseInt(s[i]);
}
return ints;
}catch(Exception e){
e.printStackTrace();
return null;
}
}
private static long[] readLineLong(){
try{
String[] s = readLine();
long[] ints = new long[s.length];
for(int i=0;i<ints.length;i++) {
ints[i] = Long.parseLong(s[i]);
}
return ints;
}catch(Exception e){
e.printStackTrace();
return null;
}
}
private static byte[] readLineByte(){
try{
String[] s = readLine();
byte[] bytes = new byte[s.length];
for(int i=0;i<bytes.length;i++) {
bytes[i] = Byte.parseByte(s[i]);
}
return bytes;
}catch(Exception e){
e.printStackTrace();
return null;
}
}
private static char[] readLineChar(){
try{
String[] s = readLine();
char[] chars = new char[s.length];
for(int i=0;i<chars.length;i++) {
chars[i] = (char)Integer.parseInt(s[i]);
}
return chars;
}catch(Exception e){
e.printStackTrace();
return null;
}
}
private static void print(Object o){
System.out.println(o);
}
private static void print(){
System.out.println();
}
private static void printd(Object o){
if(MODE_DEBUG)System.err.println(o);
}
private static void printd(){
if(MODE_DEBUG)System.err.println();
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.