'SPOJ : Play with trees
I am struggling a little with the following problem in SPOJ
https://www.spoj.com/problems/PT07A/
Every online resource that I can find is listing this problem to be solved using "cut-edge " logic in a graph but I am not able to fit that logic into this problem.
My logic is to count the edges that have at least one vertex as ground, if the count is even then output 0 else, output 1. This logic is really simple and just reading the data. Still facing TLE(time limit exceeded).
Can you please suggest if at least the logic that I am thinking is correct or not and if a solution can be hinted then great?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
