当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
You are given a tree (an acyclic undirected connected graph) with n nodes. The tree nodes are numbered from 1 to n.
Each node has a color, white or black. All the nodes are black initially.
We will ask you to perfrom some instructions of the following form:
The first line contains a number n denoted how many nodes in the tree(1 ≤ n ≤ 105). The next n - 1 lines, each line has two numbers (u, v) describe a edge of the tree(1 ≤ u, v ≤ n). The next line contains a number m denoted how many operations we are going to process(1 ≤ m ≤ 105). The next m lines, each line describe a operation (t, u) as we mentioned above(0 ≤ t ≤ 1, 1 ≤ u ≤ n).
For each query operation, output the corresponding result.
5 1 2 1 3 1 4 1 5 3 0 1 1 1 0 1
5 1
| bzoj_id | 3637 |
| import_source_sha256 | ac8af14a709c2db657f94d79b5d03582916f987585fdbbbd9577a83374ac6d2a |
| bzoj_checker_pending | False |
| 时间上限 | 内存上限 |
| 8000 MS | 512 MB |