4 1 2 2 3 3 4
10 We can get the following configurations ($abcd$ means vertices $1,2,3,4$ have $a,b,c,d$ written on them): $1111$, $1110$, $1100$, $1000$, $0111$, $0110$, $0100$, $0011$, $0010$, $0001$.
5 1 2 1 3 1 4 1 5
24
6 1 3 2 3 3 4 4 5 4 6
40
9 1 2 2 3 1 4 4 5 1 6 6 7 7 8 8 9
255
{
"problem": {
"name": "Tree Vertices XOR",
"description": {
"content": "You are given a tree with $N$ vertices. The vertices are numbered from $1$ to $N$, and the $i$\\-th edge connects vertices $u_i$ and $v_i$. Initially, on each vertex of the tree is written number $1$. ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 4000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "agc052_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a tree with $N$ vertices. The vertices are numbered from $1$ to $N$, and the $i$\\-th edge connects vertices $u_i$ and $v_i$.\nInitially, on each vertex of the tree is written number $1$.\n...",
"is_translate": false,
"language": "English"
}
]
}