MCPcopy Create free account
hub / github.com/atcoder/ac-library / main

Function main

test/expander/include_all.cpp:7–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5using namespace atcoder;
6
7int main() {
8 int n, q;
9 scanf("%d %d", &n, &q);
10
11 dsu uf(n);
12 for (int i = 0; i < q; i++) {
13 int t, u, v;
14 scanf("%d %d %d", &t, &u, &v);
15 if (t == 0) {
16 // merge
17 uf.merge(u, v);
18 } else {
19 // find
20 if (uf.same(u, v)) {
21 printf("1\n");
22 } else {
23 printf("0\n");
24 }
25 }
26 }
27}

Callers

nothing calls this directly

Calls 2

mergeMethod · 0.80
sameMethod · 0.80

Tested by

no test coverage detected