본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 20044번 Project Teams

by 현장 2021. 12. 20.

-코드

n = int(input())
students = list(map(int, input().split()))
teams = []
for i in range(n):
    r = max(students) + min(students)
    teams.append(r)
    students.remove(max(students))
    students.remove(min(students))
print(min(teams))