← All problemsSign in

3928. Minimum Cost to Buy Apples II

LeetCodeArrayGraph TheoryHeap (Priority Queue)Shortest PathOpen on judge ↗

You are given an integer n and an integer array prices of length n, where prices[i] is the price of apples at shop i. You are also given a 2D integer array roads, where roads[i] = [ui, vi, costi, taxi] represents a bidirectional road: - ui and vi are the shops connected by the road. - costi is the cost to travel the road without carrying apples. - taxi is the multiplier applied to costi when t

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start