← All problemsSign in

Queries on tree again!

CodeChefRating 2664Open on judge ↗

You are given a simple connected graph G with N vertices and N edges (a simple graph is an un-directed graph that has no loops and no more than one edge between any two different vertices). It is obvious that the graph G contains exactly one cycle and you can assume that the length of this cycle is odd (there are odd number of vertices in this cycle). The vertices are numbered from 1 to N. Each ed

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