← All problemsSign in

Kingdom of Chef

Chef lives in a country represented by cities numbered from **1** to **N** and connected to each other via bidirectional weighted paths in such a way that there is a unique path between any pair of cities. Chef aims to conquer a subset of these cities and form his Kingdom. He can choose a subset of nodes **$v_1, v_2, \dots, v_k$** and his followers will occupy those cities to make an initial king

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