Contest: ICO 2018 Practice Contest 1 Problem Statement
Given a graph with $N$ vertices and $N1$ edges and $Q$ queries, you have to find the parity of path length from a node $A$ to node $B$ for each query. Explanation
Theorem: Any connected graph with $N$ vertices and $N−1$ edges is a tree. Proof Let $G$ be a connected graph with $N$ vertices and $N − 1$ edges. We show that $G$ contains no cycles. Assume to the contrary that $G$ contains cycles. Remove an edge from a cycle so that the resulting graph is again connected. Continue this process of removing one edge from one cycle at a time till the resulting graph $H$ is a tree. As $H$ has $N$ vertices, so number of edges in $H$ is $N−1$. Now, the number of edges in $G$ is greater than the number of edges in $H$. So $N−1 > N−1$, which is not possible. Hence, $G$ has no cycles and therefore is a tree. asked 13 Oct '17, 23:20

I did it in easier way.dfs of node.colored by 0 and 1.if xor value of two node is 1 then odd otherwise even (By observation).My code got AC.tell me if i'm wrong!! @ista @mathecodician answered 14 Oct '17, 00:35
You did the same thing. We are storing the distances and finding the parity of their sum, you are storing parity and xoring; both are equivalent. Also, Both solutions are one pass dfs preprocessing.
(14 Oct '17, 08:31)

where is practice section link????????// answered 14 Oct '17, 15:36
https://www.codechef.com/problems/RAJAPR0
(14 Oct '17, 15:45)
He meant "if contest link is given, then why not practice link which is more relevant"
(14 Oct '17, 15:47)
Because when I posted the editorial, that time the practice link was not live :3
(14 Oct '17, 16:05)

Can't we find the depth of each node by one bfs precomputation instead of dfs ? answered 26 Oct '17, 11:53

@ista2000 , please wikify it yourself. Server glitches are a pain _
@vijju123 Sorry I forgot :P I wikified all others.
I wikified it twice ;_; Doesn't work
Even @admin faced the problem I guess. If she couldn't do it, who are we :3