티스토리 뷰
https://www.acmicpc.net/problem/11399
11399번: ATM
첫째 줄에 사람의 수 N(1 ≤ N ≤ 1,000)이 주어진다. 둘째 줄에는 각 사람이 돈을 인출하는데 걸리는 시간 Pi가 주어진다. (1 ≤ Pi ≤ 1,000)
www.acmicpc.net
N = int(input())
people = sorted(list(map(int, input().split())))
result = time = 0
for i in range(0, N):
time += people[i]
result += time
print(result)
'Algorithm > Baekjoon' 카테고리의 다른 글
[백준] 1110 : 더하기 사이클 - Python (0) | 2020.03.12 |
---|---|
[백준] 9461 : 파도반 수열 - Python (0) | 2020.03.12 |
[백준] 1904 : 01타일 - Python (0) | 2020.03.11 |
[백준] 1541 : 잃어버린 괄호 - Python (0) | 2020.03.11 |
[백준] 11047 : 동전 0 - Python (0) | 2020.03.11 |