All the contest those are hosted on Codechef without the monthly challenges are having Long Queue issue…
I have submitted a solution on running contest CodeJunk and it’s still in inqueue. Even before this contest all are having the same issue. Why is this happening again again even having a small number of participants??
XOR of all odd distance node values from the node 1 will be the state… a non zero value is winning and 0 is losing.
We can observe that it’s always possible to move from winning to losing for our opponent similar to how u prove a nim game… u just move from the odd distance to even distance by choosing an appropriate node… it’s similar to removing stones in the nim game because the even distance values aren’t considered in our XOR which means an operation on the odd distance node is like removing a stone.
When in the losing state we can prove that we only move to a winning state. If we choose any node we will only obtain a non zero XOR since the current XOR is 0.