BOJ2587-대표값2, BOJ25305-커트라인 (python3)

Ok Haeeun·2023년 2월 7일
0

Python3로 algorithm문풀

목록 보기
10/53

오늘은 진짜 너무 쉬운 정렬 출력 문제들이라(파이썬이라 더 쉬운..)
양심상 두 문제를 풀어보았다.

2587-대표값2

num_list = list(int(input()) for _ in range(5))
num_list.sort()
total = 0
for i in range(5):
    total += num_list[i]
print(int(total/5))
print(num_list[2])

25305-커트라인

first_input = input().split()
n,k = int(first_input[0]),int(first_input[1])
second_input = list(map(int,input().split()))
second_input.sort(reverse=True)
print(second_input[k-1])
profile
tistory에 이어서 기록합니다 👉 https://i-m-okay.tistory.com/

0개의 댓글

관련 채용 정보