[백준] 25305번(커트라인)

·2023년 2월 6일

백준 문제풀이

목록 보기
37/159

백준 25305번


최종 제출 코드

num, cut = map(int, input().split())
score = list(map(int,input().split()))

score.sort(reverse=True)

print(score[cut-1])
  • list.sort(reverse=True): 배열을 내림차순으로 정렬
  • 커트라인은 곧 등수
  • score 배열을 내림차순으로 정렬한 후 등수에 해당하는 원소 출력
profile
백엔드 개발자가 되고 싶어요(22.8.15~)

0개의 댓글