-->
当前位置:首页 > 题库

PROGRAMMING:K-th element

Luz5年前 (2021-05-10)题库386
Given an unordered integer array with the size of $$n (1 / Leq n / Leq 1000000) $, the same element may exist in the array. Please find out the element with the smallest value of $$K (1 / Leq K / Leq n) $. The element with the smallest value of $$k $$refers to the element in the position of $$k $$sorted from small to large.
###Input format:
Each input file is a test case. The first line of each file gives two positive integers $$n $$and $$k $$, and the second line gives $$n $$integers separated by spaces.
###Output format:
Output the value of the small element $$k $.
###Input example:
```in
10 4
2 3 5 12 4 9 3 8 2 9
```
###Output example:
```out
three
```







answer:If there is no answer, please comment