본문 바로가기

Programming [Python]/백준 알고리즘 솔루션

#328 백준 파이썬 [2822] 점수 계산

https://www.acmicpc.net/problem/2822

 

PYTHON CODE

score = [[int(input()), i+1] for i in range(8)]
score = sorted(score, key = lambda x: -x[0])
problem = []
sum_score = 0

for i in range(5):
    sum_score += score[i][0]
    problem.append(score[i][1])
    
print(sum_score)
for i in sorted(problem):
    print(i, end = ' ')