[Silver V] Title: K번째 수, Time: 3696 ms, Memory: 623040 KB -BaekjoonHub

This commit is contained in:
SSUM
2025-01-28 21:29:46 +09:00
parent fa6d5abe88
commit f19d102cd0
2 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
import sys
input = sys.stdin.readline
N, K = map(int,(input().split(' ')))
arr = list(map(int, input().split(' ')))
arr.sort()
print(arr[K-1])

View File

@@ -0,0 +1,30 @@
# [Silver V] K번째 수 - 11004
[문제 링크](https://www.acmicpc.net/problem/11004)
### 성능 요약
메모리: 623040 KB, 시간: 3696 ms
### 분류
정렬
### 제출 일자
2025년 1월 28일 21:28:27
### 문제 설명
<p>수 N개 A<sub>1</sub>, A<sub>2</sub>, ..., A<sub>N</sub>이 주어진다. A를 오름차순 정렬했을 때, 앞에서부터 K번째 있는 수를 구하는 프로그램을 작성하시오.</p>
### 입력
<p>첫째 줄에 N(1 ≤ N ≤ 5,000,000)과 K (1 ≤ K ≤ N)이 주어진다.</p>
<p>둘째에는 A<sub>1</sub>, A<sub>2</sub>, ..., A<sub>N</sub>이 주어진다. (-10<sup>9</sup> ≤ A<sub>i</sub> ≤ 10<sup>9</sup>)</p>
### 출력
<p>A를 정렬했을 때, 앞에서부터 K번째 있는 수를 출력한다.</p>