Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Given a sequence of ~N~ positive integers ~A_1, A_2, \ldots, A_N~ and a number ~K~.
Print the ~K~-th smallest number in the sequence.
Input
- The first line contains the integers ~N~ and ~K~.
- The second line contains ~N~ positive integers ~A_1, A_2, \ldots, A_N~.
Output
- A single line containing the ~K~-th smallest number in the sequence.
Constraints
- ~K \leq N ≤ 10^5~.
- ~A_i ≤ 10^9~.
Sample Input
6 4
1 3 5 10 9 7
Sample Output
7
Bình luận