Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  while a[x] != x:
    a[x] = a[a[x]]
  return a[x]

for _ in range(m):
  x,y=map(int,input().split())
  x,y=find(x-1),find(y-1)
  if x == y: continue
  a[y]=x

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))


Fixed submission:
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  g = x
  while g != a[g]: g = a[g]
  a[x] = g
  return g

for _ in range(m):
  x,y=map(int,input().split())
  x,y=find(x-1),find(y-1)
  if x == y: continue
  a[y]=x

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  if a[x]==x:
    return x
  a[x] = find(a[x])
  return a[x]

for _ in range(m):
  x,y=map(int,input().split())
  x,y=find(x-1),find(y-1)
  if x == y: continue
  a[y]=x

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))


Fixed submission:
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  g = x
  while g != a[g]: g = a[g]
  a[x] = g
  return g

for _ in range(m):
  x,y=map(int,input().split())
  x,y=find(x-1),find(y-1)
  if x == y: continue
  a[y]=x

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  if a[x]==x:
    return x
  a[x] = find(a[x])
  return a[x]

for _ in range(m):
  x,y=map(int,input().split())
  a[find(y-1)]=find(x-1)

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))


Fixed submission:
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  g = x
  while g != a[g]: g = a[g]
  a[x] = g
  return g

for _ in range(m):
  x,y=map(int,input().split())
  x,y=find(x-1),find(y-1)
  if x == y: continue
  a[y]=x

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  if a[x]==x:
    return x
  a[x] = find(a[x])
  return a[x]

def union(x,y):
  x, y = find(x), find(y)
  if x == y: return
  a[min(x,y)] = max(x,y)

for _ in range(m):
  x,y=map(lambda x:int(x)-1,input().split())
  union(x, y)

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))


Fixed submission:
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  g = x
  while g != a[g]: g = a[g]
  a[x] = g
  return g

for _ in range(m):
  x,y=map(int,input().split())
  x,y=find(x-1),find(y-1)
  if x == y: continue
  a[y]=x

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  if a[x]==x:
    return x
  a[x] = find(a[x])
  return a[x]

def union(x,y):
  x, y = find(x), find(y)
  if x == y: return
  a[x] = y

for _ in range(m):
  x,y=map(lambda x:int(x)-1,input().split())
  union(x, y)

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))


Fixed submission:
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  g = x
  while g != a[g]: g = a[g]
  a[x] = g
  return g

for _ in range(m):
  x,y=map(int,input().split())
  x,y=find(x-1),find(y-1)
  if x == y: continue
  a[y]=x

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  if a[x]==x:
    return x
  a[x] = find(a[x])
  return a[x]

for _ in range(m):
  x,y=map(lambda x:find(int(x)-1),input().split())
  if x != y: a[x] = y

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))


Fixed submission:
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  g = x
  while g != a[g]: g = a[g]
  a[x] = g
  return g

for _ in range(m):
  x,y=map(int,input().split())
  x,y=find(x-1),find(y-1)
  if x == y: continue
  a[y]=x

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  if a[x]==x:
    return x
  a[x] = find(a[x])
  return a[x]

for _ in range(m):
  x,y=map(lambda x:int(x)-1,input().split())
  a[find(y)]=find(x)

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))


Fixed submission:
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  g = x
  while g != a[g]: g = a[g]
  a[x] = g
  return g

for _ in range(m):
  x,y=map(int,input().split())
  x,y=find(x-1),find(y-1)
  if x == y: continue
  a[y]=x

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))