https://www.acmicpc.net/problem/11399
11399번: ATM
첫째 줄에 사람의 수 N(1 ≤ N ≤ 1,000)이 주어진다. 둘째 줄에는 각 사람이 돈을 인출하는데 걸리는 시간 Pi가 주어진다. (1 ≤ Pi ≤ 1,000)
www.acmicpc.net
"""
ATM
N : 총 사람의 수
i번 사람이 걸리는 시간 = Pi
"""
N = int(input())
P_list = list(map(int, input().split(' ')))
P_list.sort()
for index_of_Pi in range(1, len(P_list)):
P_list[index_of_Pi] += P_list[index_of_Pi - 1]
print(sum(P_list))
'Problem-solving > 백준' 카테고리의 다른 글
백준 - 플로이드(11404번) (Python3) (0) | 2020.05.21 |
---|---|
백준 - 그룹 단어 체커(1316번) (Python3) (0) | 2020.05.21 |
백준 - 동전0(11047번) (Python3) (0) | 2020.05.21 |
백준 - RGB거리(1149번) (Python3) (0) | 2020.05.21 |
백준 - 섬의 개수(4963번) (Python3) (0) | 2020.05.15 |
댓글