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

[백준/파이썬] 28464번 Potato

by 현장 2024. 9. 9.

-Code

from sys import stdin

n = int(stdin.readline())
french_fries = sorted(list(map(int, stdin.readline().split())))
sung, park = sum(french_fries[:n // 2]), sum(french_fries[n // 2:])

print(sung, park)