← All problemsSign in

Make and Break on Tree

CodeChefRating 3349Open on judge ↗

Alice and Bob play a game on a simple undirected tree with $N$ nodes. The game consists of two steps: 1) Alice selects two nodes such that there is **no direct edge** between them, and connects them with an edge. Note that after this step, the graph is no longer a tree. 2) After Alice's step, Bob selects an edge of this graph and deletes it, such that after deletion the graph becomes a tree agai

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