what's this mean
int find(int u) { return P[u] = P[u] == u ? u : find(P[u]); }
full code(c++) -it tell which number are connected.
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
int n, m, k;
int P[N];
int find(int u) { return P[u] = P[u] == u ? u : find(P[u]); }
int main() {
scanf("%d %d %d", &n, &m, &k);
iota(P, P+N, 0);
for(int i = 0, a, b; i < m; ++i) {
scanf("%d %d", &a, &b);
a = find(a), b = find(b);
P[a] = b;
}
for(int i = 0, a, b; i < k; ++i) {
scanf("%d %d", &a, &b);
puts(find(a) == find(b) ? "yes" : "no");
}
}
input- 3 2 3 1 2 2 1 2 3 3 1 1 2
out put- no no yes