← All problemsSign in

PAINT CHEF CITY

PAINTRD In Chef City, there are n cities connected by m one-way roads. Master Chef can paint any of these roads. It costs d unit of money where d is the length of that road. His task is to paint some of the roads so that the painted roads can be partitioned into some disjoint cycles such that every vertex appears in exactly k of these disjoint cycles. But he has to minimize the costs of paintin

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start