CF1491H Yuezheng Ling and Dynamic Tree
Description
Yuezheng Ling gives Luo Tianyi a tree which has $ n $ nodes, rooted at $ 1 $ .
Luo Tianyi will tell you that the parent of the $ i $ -th node is $ a_i $ ( $ 1 \leq a_i
Input Format
N/A
Output Format
N/A
Explanation/Hint
The tree in example is shown below.
After the query of the first type, the tree changes and is looking as shown below.
