solulubeta
Sign in
Story Problems / Priority queue
04.02 · Problem

Cheapest Way to Join the Ropes

Medium Min-heap: always merge the two smallest Pro

This problem is part of solulu Pro

A climber has ropes of given lengths. Joining two ropes costs the sum of their lengths and produces one longer rope. He must join all ropes into a single rope. What is the minimum total cost?

Lifetime ₹2,000 ₹1,000 · Beta offer
Mark this problem as solved when you are finished.

Item 47 of 94 · updated 2026-10-12