[๋ฐฑ์ค€-2822] ์ ์ˆ˜ ๊ณ„์‚ฐ / Python

๐Ÿ“š Problem Solving/Baekjoon

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

 

2822๋ฒˆ: ์ ์ˆ˜ ๊ณ„์‚ฐ

8๊ฐœ ์ค„์— ๊ฑธ์ณ์„œ ๊ฐ ๋ฌธ์ œ์— ๋Œ€ํ•œ ์ฐธ๊ฐ€์ž์˜ ์ ์ˆ˜๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ์ ์ˆ˜๋Š” 0๋ณด๋‹ค ํฌ๊ฑฐ๋‚˜ ๊ฐ™๊ณ , 150๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™๋‹ค. ๋ชจ๋“  ๋ฌธ์ œ์— ๋Œ€ํ•œ ์ ์ˆ˜๋Š” ์„œ๋กœ ๋‹ค๋ฅด๋‹ค. ์ž…๋ ฅ์œผ๋กœ ์ฃผ์–ด์ง€๋Š” ์ˆœ์„œ๋Œ€๋กœ 1๋ฒˆ ๋ฌธ์ œ, 2๋ฒˆ ๋ฌธ

www.acmicpc.net

score = []
for i in range(8):
    score.append(int(input()))
temp = []
answer = 0
for i in range(5):
    answer += max(score)
    temp.append(score.index(max(score)) + 1)
    score[score.index(max(score))] = -1
temp.sort()
print(answer)
print(*temp)

 

ํ•ด์„ค

๊ฐ„๋‹จํ•œ ์ •๋ ฌ ๋ฌธ์ œ์˜€๋‹ค!