python-algorithm

백준 2822 점수 계산

무적김두칠 2021. 12. 6. 14:47

1
2
3
4
5
6
7
8
9
10
11
tmp=[]
for i in range(8):
    tmp.append( [i+1int(input())])
tmp=sorted(tmp,key=lambda  x: x[1])
ans=0
idx=[]
for i in range(5):
    ans+=tmp[i+3][1]
    idx.append(tmp[i+3][0])
print(ans)
print (*sorted(idx))
cs

 

반응형