Số nhỏ thứ k

View as PDF



Time limit:
Python 3 20.0s

Author:
Problem types
Allowed languages
C#, C++, Clang, Clang++, Cobol, D, Groovy, Haskell, JS, Java, Kotlin, Lua, Node JS, OCaml, ObjectiveC, Output, PHP, Prolog, Pypy, Pypy 3, Ruby, Rust, Scala, Scratch, Swift
Points: 800 (p) Time limit: 10.0s Memory limit: 256M Input: stdin Output: stdout

Cho một dãy gồm \(N\) số nguyên dương \(A_1, A_2,…, A_N\).(\(N \le 10^4, A_i \le 10^9\)) và số \(K\) (\(K \le N\)). Hãy in ra số nhỏ thứ \(K\) trong dãy.

Input

  • Dòng đầu chứa số \(N, K\),
  • Dòng thứ hai chứa \(N\) số nguyên dương \(A_1, A_2,…, A_N\).

Output

  • Một dòng chứa dãy số nhỏ thứ \(K\) trong dãy.

Example

Test 1

Input
6 4    
91 451 43 3 452 54
Output
91

Comments (5)

Most recent
Loading comments...