https://www.acmicpc.net/problem/11399
11399번: ATM
첫째 줄에 사람의 수 N(1 ≤ N ≤ 1,000)이 주어진다. 둘째 줄에는 각 사람이 돈을 인출하는데 걸리는 시간 Pi가 주어진다. (1 ≤ Pi ≤ 1,000)
www.acmicpc.net
1. 내가 작성한 코드
n = int(input())
time = list(map(int,input().split()))
time.sort()
cnt = 0
total = 0
for i in time:
cnt += i
total += cnt
print(total)
댓글