Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Final 1-B: Cargo Split

โญ beginnerโณ 40 min read๐Ÿ“ Lesson 204 of 281

Final simulation, problem B: binary search on the answer with a greedy check. Target: solved within 40 minutes.

Final 1-B โ€” Cargo Split. Minimize the largest contiguous block with at most k blocks: binary-search the answer, greedy-count parts, predicate parts(mid) <= k. Graded near-miss: strict < predicate.

Final 1-B. The wrong predicate returns a feasible-but-suboptimal limit โ€” visible on the very first test.