-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBOJ_11004.java
More file actions
27 lines (21 loc) · 760 Bytes
/
Copy pathBOJ_11004.java
File metadata and controls
27 lines (21 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// BOJ - 11004
// Problem Sheet - https://www.acmicpc.net/problem/11004
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(bf.readLine());
int n = Integer.parseInt(st.nextToken());
int k = Integer.parseInt(st.nextToken());
int[] numbers = new int[n];
st = new StringTokenizer(bf.readLine());
for (int i=0 ; i<n ; i++) {
numbers[i] = Integer.parseInt(st.nextToken());
}
Arrays.sort(numbers);
System.out.println(numbers[k-1]);
bf.close();
System.exit(0);
}
}