Problems > Cover the Demands > Editorial

Cover the Demands — Solution & Editorial

Back to the Problem

Sort both; matching the k-th smallest capacity with the k-th smallest demand is optimal (any valid assignment can be un-crossed). Check pairwise ≥.

Complexity: O(N log N)