Notice
Recent Posts
Recent Comments
Link
목록백준13305 (1)
꾸준하게 거북이처럼
백준 13305 주유소
13305번: 주유소 표준 입력으로 다음 정보가 주어진다. 첫 번째 줄에는 도시의 개수를 나타내는 정수 N(2 ≤ N ≤ 100,000)이 주어진다. 다음 줄에는 인접한 두 도시를 연결하는 도로의 길이가 제일 왼쪽 도로부터 N-1 www.acmicpc.net from cmath import inf numOfCity = int(input()) cityDistance = list(map(int,input().split())) cost = list(map(int,input().split())) result = 0 lowerCost = inf for i in range(numOfCity - 1): if cost[i] < lowerCost: result += cost[i] * cityDistance[i] lowe..
Algorithm 문제 & 공부/그리디
2022. 6. 7. 16:25