THE MAP OF PUBG
CodeChefOpen on judge ↗
$Chef$ is in the $map$ of $PUBG$. The map has $N$ cities numbered $1,2,...,N$. The cities are connected by $N-1$ bidirectional roads. He has formed a strategy to travel in this map. Initially all cities are marked as $BLACK$. Chef is currently in the city $X$. $STEP$ $1:$ He marks the current city as $RED$. $STEP$ $2:$ He selects a $BLACK$ city at $random$ $directly$ c
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.
Sign in to chat with the tutor and save your progress.
Sign in to start