Skip to content

Commit ef8b49a

Browse files
rename dsu instance to cities
1 parent 609c5e4 commit ef8b49a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

solutions/cses-1676.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,17 @@ class DisjointSetUnion:
9999

100100
n, m = map(int, input().split())
101101

102-
dsu = DisjointSetUnion(n)
102+
cities = DisjointSetUnion(n)
103103
largest_size = 1
104104
components = n
105105

106106
for _ in range(m):
107107
a, b = map(lambda i: int(i) - 1, input().split())
108-
if dsu.union(a, b):
108+
if cities.union(a, b):
109109
components -= 1
110110

111111
# a is the parent node when uniting in our dsu implementation
112-
size_a = dsu.size[dsu.find_parent(a)]
112+
size_a = cities.size[cities.find_parent(a)]
113113
if size_a > largest_size:
114114
largest_size = size_a
115115

0 commit comments

Comments
 (0)