a codeforces contest.

C. Oriented Journey

we direct the edges such that 𝑒→𝑣, where 𝑒<𝑣, denotes that 𝑠𝑒 and 𝑠𝑣 are different, and otherwise same. since there’s only π‘›βˆ’1 provided bits, we can fix 𝑠𝑛=0. thus we can root our tree at 𝑛 and deduce all the bits from there.