题目链接:
http://codeforces.com/problemset/problem/429/A
A. Xor-tree
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Iahub is very proud of his recent discovery, propagating trees. Right now, he invented a new tree, called xor-tree. After this new revolutionary discovery, he invented a game for kids which uses xor-trees.
The game is played on a tree having n nodes, numbered from 1 to n. Each node i has an initial value initi, which is either 0 or 1. The root of the tree is node 1.
One can perform several (possibly, zero) operations on the tree during the game. The only available type of operation is to pick a nodex