728x90
반응형
m,c = map(int,input().split())
list1=list(map(int,input().split()))
sort1=sorted(list1,reverse=True)
n=sort1[0]
cnt=0
score1=0
for i in sort1:
if i<=n:
cnt+=1
score1=i # 점수기억
if cnt ==c:
break # 순위가 파악되면 for문 탈출
print (score1)
728x90
반응형
'코딩테스트' 카테고리의 다른 글
백준 1978번 파이썬 풀이 (소수찾기) (0) | 2023.04.03 |
---|---|
백준 15650번 파이썬 풀이 (0) | 2023.03.27 |
백준 3009 번 파이썬 풀이 (0) | 2023.03.26 |
댓글