Notice
Recent Posts
Recent Comments
Link
반응형
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 | 30 | 31 |
Tags
- 파이썬 알고리즘
- 프로그래머스
- 너비우선탐색
- 오버라이딩
- 이진탐색
- 캐싱
- 지도학습
- 딕셔너리
- 자바
- 파이썬 오류
- Merge sort
- BOJ
- 코딩
- HTTP
- 딥러닝
- 코딩테스트
- 스택과 힙
- 파이썬
- 해시
- 깊이우선탐색
- post
- bineary search
- 알고리즘
- 백준
- 멱등
- 강화학습
- 머신러닝
- 코테
- 비지도학습
- rest api
Archives
- Today
- Total
chae._.chae
[Algorithm] 백준 #13305 주유소 본문
728x90
반응형
import sys
input = sys.stdin.readline
N = int(input())
distances = list(map(int, input().split()))
costs = list(map(int, input().split()))
# 처음에는 시작지점에서 기름 넣고 시작
total = costs[0]*distances[0]
min_cost = costs[0]
for i in range(1, N-1):
if min_cost > costs[i]:
min_cost = costs[i]
total += min_cost*distances[i]
print(total)
풀엇는데 또또또 까먹음..
728x90
'파이썬 알고리즘 > BOJ' 카테고리의 다른 글
| [Algorithm] 백준 #20920 영단어 암기는 괴로워 (0) | 2024.07.08 |
|---|---|
| [Algorithm] 백준 #17266 어두운 굴다리 (0) | 2024.07.08 |
| [Algorithm] 백준 #9017 크로스 컨트리 (0) | 2024.07.07 |
| [Algorithm] 백준 #1244 스위치 켜고 끄기 (0) | 2024.07.07 |
| [Algorithm] 백준 #1205 등수 구하기 (0) | 2024.07.07 |