일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- django
- 알고리즘
- 장고
- 파이썬
- MyPlaylist
- 프로그래머스
- 마라마라빔
- 모각코
- 그리디알고리즘
- SQL
- 최소스패닝트리
- Bellman-Ford
- 백트래킹
- DFS
- 코드트리
- 동적계획법
- BFS
- 데이터베이스
- B대면노래방
- 백준
- 함밥
- 소프트웨어공학
- Planned
- Kruskal
- 실습
- 종합설계
- codetree
- programmers
- DP
- minimum spanning tree
Archives
- Today
- Total
Leta Learns
[Python] 백준 11399번 - ATM 본문
문제 https://www.acmicpc.net/problem/11399
11399번: ATM
첫째 줄에 사람의 수 N(1 ≤ N ≤ 1,000)이 주어진다. 둘째 줄에는 각 사람이 돈을 인출하는데 걸리는 시간 Pi가 주어진다. (1 ≤ Pi ≤ 1,000)
www.acmicpc.net
이중 for문 안 쓰려고 슬라이싱 했다. ㅋㅋ
import sys
input = sys.stdin.readline
n = int(input())
time = list(map(int, input().split()))
time.sort()
w = 0 #대기시간
for i in range(n):
wait = time[:i+1]
w += sum(wait)
print(w)
'Coding > 백준' 카테고리의 다른 글
[Python] 백준 15649번 - N과 M (1) (0) | 2022.02.24 |
---|---|
[Python] 백준 1026번 - 보물 (0) | 2022.02.24 |
[Python] 백준 1931번 - 회의실 배정 (0) | 2022.02.22 |
[Python] 백준 1764번 - 듣보잡 (0) | 2022.02.21 |
[Python] 백준 5052번 - 전화번호 목록 (0) | 2022.02.21 |
Comments