b_주유소_13305
| source | www.acmicpc.net/problem/13305 |
| type | 📌 개발노트 |
| topics | 600-알고리즘 & 코딩테스트 602 그리디 |
| types | 문제풀이 |
| 정답여부 | 성공 |
문제
N개 도시
도시마다 리터당 가격이다름
왼 to 오
답
쉬움
import sys
import math
sys.stdin.readline()
v =list(map(int,sys.stdin.readline().strip().split()))
n =list(map(int,sys.stdin.readline().strip().split()))
small = math.inf
total = 0
for i in range(len(n)):
small = min(small,n[i])
if i >= len(v):
continue
total += (small * v[i])
print(total)