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

Function main

test/expander/include_unusual_format.cpp:8–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

mergeMethod · 0.80
sameMethod · 0.80

Tested by

no test coverage detected