반응형
11004번: K번째 수
수 N개 A1, A2, ..., AN이 주어진다. A를 오름차순 정렬했을 때, 앞에서부터 K번째 있는 수를 구하는 프로그램을 작성하시오.
www.acmicpc.net
# @Author YoungMinKim
# baekjoon
import sys
N,K = sys.stdin.readline().split()
ls = list(sys.stdin.readline().split())
result = list(map(int,ls))
result = sorted(result)
print(result[int(K)-1])
반응형
'백준 문제풀이' 카테고리의 다른 글
| baekjoon - python - 11022 (0) | 2020.09.13 |
|---|---|
| baekjoon - python - 11021 (0) | 2020.09.13 |
| baekjoon - python - 10998 (0) | 2020.09.06 |
| baekjoon - python - 10989 (0) | 2020.09.06 |
| baekjoon - python - 10987 (0) | 2020.09.06 |
댓글