[๋ฐฑ์ค-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)
ํด์ค
๊ฐ๋จํ ์ ๋ ฌ ๋ฌธ์ ์๋ค!
'๐ Problem Solving > Baekjoon' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค-2776] ์๊ธฐ์ / Python (0) | 2021.05.18 |
---|---|
[๋ฐฑ์ค-2343] ๊ธฐํ ๋ ์จ / Python (0) | 2021.05.18 |
[๋ฐฑ์ค-11728] ๋ฐฐ์ด ํฉ์น๊ธฐ / Python (0) | 2021.05.18 |
[๋ฐฑ์ค-11656] ์ ๋ฏธ์ฌ ๋ฐฐ์ด / Python (0) | 2021.05.18 |
[๋ฐฑ์ค-10825] ๊ตญ์์ / Python (0) | 2021.05.17 |