AT_abc278_c [ABC278C] FF

题目描述

【题目翻译】 洛谷是一个大平台,从前,这里有 $n$ 个用户。刚开始,他们没有任何关系。 有 $q$ 次操作,每组操作包含 $op_i$,$a_i$,$b_i$: + $op_i = 1$,表示 $a_i$ 关注了 $b_i$。 + $op_i = 2$,表示 $a_i$ 取关了 $b_i$。 + $op_i = 3$,表示查询 $a_i$ 与 $b_i$ 是否互关。 对于每个 $op_i = 3$,输出结果。 translated by @[liangbowen](https://www.luogu.com.cn/user/367488).

输入格式

第一行两个数 $n$,$q$。 接下来 $q$ 行,每行三个数 $op_i$,$a_i$,$b_i$。

输出格式

对于每个 $op_i = 3$,输出结果。

说明/提示

$1 \le n \le 10^9$ $1 \le q \le 2 \times 10^5$ 保证 $1 \le a_i, b_i \le n$,且 $a_i \ne b_i$。 保证 $op_i \in \{1, 2, 3\}$。