[Baekjoon] 13305 주유소 python

sorzzzzy·2021년 8월 4일
0

Baekjoon Algorithm

목록 보기
29/46
post-thumbnail

🏷 문제


💡 코드

from sys import stdin

n = int(stdin.readline())
road = list(map(int, stdin.readline().split()))
price = list(map(int, stdin.readline().split()))
res = 0
tmp = price[0]
for i in range(len(road)):
    if price[i] < tmp:
        tmp = price[i]    
    res += tmp*road[i]
print(res)

🔑

profile
Backend Developer

0개의 댓글