run2ai / algorithm-taek

0 stars 0 forks source link

ATM 인출 시간 계산하기 #19

Closed Blzae97 closed 3 months ago

Blzae97 commented 3 months ago

시간 제한: 1초 난이도: 실버Ⅲ 백준 온라인 저지: 11399번 https://www.acmicpc.net/problem/11399

teang1995 commented 3 months ago
# https://www.acmicpc.net/problem/11399

import sys

from collections import defaultdict

N = int(sys.stdin.readline())
num_dict = defaultdict(int)

times = [int(x) for x in sys.stdin.readline().split(' ')]

tot_time = 0
wait_time = 0
for time in sorted(times):
    tot_time += time
    tot_time += wait_time
    wait_time += time

print(tot_time)