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
- 해시
- 비지도학습
- 코딩
- 파이썬
- 딥러닝
- 자바
- rest api
- 오버라이딩
- 깊이우선탐색
- 이진탐색
- 프로그래머스
- 파이썬 오류
- Merge sort
- 멱등
- 머신러닝
- 딕셔너리
- HTTP
- 코딩테스트
- 스택과 힙
- post
- 강화학습
- 알고리즘
- 코테
- 파이썬 알고리즘
- 캐싱
- 백준
- bineary search
- BOJ
- 너비우선탐색
- 지도학습
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 |