쏘ing

[Python] 백준 11399 ATM 본문

알고리즘/CLASS 3

[Python] 백준 11399 ATM

한민민 2022. 2. 21. 16:05

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

풀이

import sys

num = int(sys.stdin.readline().rstrip())

num_list = list(map(int, sys.stdin.readline().rstrip().split()))

num_list.sort()

temp = 0
sum_list = []

for i in num_list:
    temp += i
    sum_list.append(temp)
print(sum(sum_list))

 

'알고리즘 > CLASS 3' 카테고리의 다른 글

[Python] 백준 9095 1, 2, 3 더하기  (0) 2022.02.21
[Python] 백준 11047 동전 0  (0) 2022.02.21
[Python] 백준 11279 최대 힙  (0) 2022.02.21
[Python] 백준 1764 듣보잡  (0) 2022.02.21
[Python] 백준 17219 비밀번호 찾기  (0) 2022.02.21
Comments