are the same color, so he wants to make sure thi</div>
<div>s situation does not happen.It is guaranteed that the connections between the N barns do not form an</div>
<div>y 'cycles'. That is, between any two barns, there is at most one sequence of connections that will l</div>
<div>ead from one to the other.How many ways can Farmer John paint the remaining yet-uncolored barns?</div>
<div>给你一颗大小为n&lt;=1e5的树，三种颜色，每个点涂一种颜色，相邻点不能同色。下面告�