Skip to content

Commit 18b2a11

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2c00c4c commit 18b2a11

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

solutions/gold/cf-468B.mdx

+5-4
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,17 @@ struct DSU {
3838

3939
// get representive component (uses path compression)
4040
int get(int x) { return e[x] < 0 ? x : e[x] = get(e[x]); }
41-
41+
4242
bool same_set(int a, int b) { return get(a) == get(b); }
43-
43+
4444
int size(int x) { return -e[get(x)]; }
45-
45+
4646
bool unite(int x, int y) { // union by size
4747
x = get(x), y = get(y);
4848
if (x == y) return false;
4949
if (e[x] > e[y]) swap(x, y);
50-
e[x] += e[y]; e[y] = x;
50+
e[x] += e[y];
51+
e[y] = x;
5152
return true;
5253
}
5354
};

0 commit comments

Comments
 (0)