acmsguru |
---|
Закончено |
1 a b' means that you have to answer the question: is there any discreditable information that party or block a knows about party or block b?
2 a b' means that you need to join party or block a with party or block b. The new block will have all the information a has, and all the information b has. All the information that was known by some parties or blocks about a and b now concerns the newly created block.
1 a b'. A query of the second kind looks like '
2 a b'. You should process queries in the order they are given. Each pair a, b references only existing parties or blocks. It is guaranteed that numbers a and b are different in any '
2 a b' query, but they can be equal in a '
1 a b' query.
YESor
NOfor each query of the first kind.
sample input | sample output |
4 6 1 2 1 3 3 2 4 4 2 4 1 2 4 1 3 4 2 2 3 1 5 4 1 4 5 | NO YES NO |
Название |
---|