백준 알고리즘
백준 25305 파이썬
KokoaJelly
2023. 2. 2. 14:35
https://www.acmicpc.net/problem/25305
25305번: 커트라인
시험 응시자들 가운데 1등은 100점, 2등은 98점, 3등은 93점이다. 2등까지 상을 받으므로 커트라인은 98점이다.
www.acmicpc.net
n, k = map(int,input().split())
points_list = list(map(int,input().split()))
points_list.sort(reverse=True)
print(points_list[k-1])
전혀 어려울게 없는 문제다.
그냥 sort(reverse = True)를 사용한다면, 내림차순으로 정렬이 된다.
그리고 그 커트라인에 해당하는 사람을 print해주면 된다.