Problem 3638 · Medium

Maximum Balanced Shipments

Parcels stand in a line. A shipment is a contiguous run whose final parcel weighs strictly less than the heaviest parcel in that run; find the most non-overlapping shipments you can form, leaving parcels unshipped if needed.

Open the interactive visualisation