NeetCode #588LC-2477MediumGraphs
← Back to All Problems

#588 · #2477 · Minimum Fuel Cost to Report to the Capital(到达首都的最少油耗)

📌 Problem Statement & Constraints

There is a tree of n cities with city 0 as the capital. roads[i] = [a, b] is an undirected road. Each city has one representative, and each car has seats seats. Representatives travel toward the capital, and cars can share seats only when travelling together. Return the minimum total fuel cost, where each unit of distance costs 1 litre. Constraints: 1 <= n <= 10^5, 1 <= seats <= 10^5.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!