Buggy python submission (verdict: Time Limit Exceeded):
import collections

n, m = map(int, input().split())
if m == 0:
    print(1)
    exit()
if m == 1:
    print(2)
    exit()
boss = {i: 0 for i in range(1, n + 1)}

def look_boss(num):
    if boss[num] == 0:
        return num
    while num != boss[num]:
        num = boss[num]
    return num

for _ in range(m):
    a, b = map(int, input().split())
    boss_a = look_boss(a)
    boss[a] = boss_a
    boss_b = look_boss(b)
    boss[b] = boss_b
    if boss_a != boss_b:
        boss[boss_b] = boss_a

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


Fixed submission:
import collections

n, m = map(int, input().split())
if m == 0:
    print(1)
    exit()
if m == 1:
    print(2)
    exit()
boss = list(range(n))

def look_boss(target):
    num = target
    while num != boss[num]:
        num = boss[num]
    boss[target] = num
    return num

for _ in range(m):
    a, b = map(int, input().split())
    boss_a = look_boss(a-1)
    boss_b = look_boss(b-1)
    if boss_a != boss_b:
        boss[boss_b] = boss_a

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

Buggy python submission (verdict: Runtime Error):
import collections

n, m = map(int, input().split())
if m == 0:
    print(1)
    exit()
if m == 1:
    print(2)
    exit()
ids = {i: 0 for i in range(1, n+1)}
id = 1
for _ in range(m):
    a, b = map(int, input().split())
    if ids[a] == 0 and ids[b] != 0:
        ids[a] = ids[b]
    elif ids[a] != 0 and ids[b] == 0:
        ids[b] = ids[a]
    elif ids[a] == 0 and ids[b] == 0:
        ids[a] = id
        ids[b] = id
        id += 1
tmp = collections.Counter(ids.values())
tmp.pop(0)
print(max(tmp.values()))


Fixed submission:
import collections

n, m = map(int, input().split())
if m == 0:
    print(1)
    exit()
if m == 1:
    print(2)
    exit()
boss = list(range(n))

def look_boss(target):
    num = target
    while num != boss[num]:
        num = boss[num]
    boss[target] = num
    return num

for _ in range(m):
    a, b = map(int, input().split())
    boss_a = look_boss(a-1)
    boss_b = look_boss(b-1)
    if boss_a != boss_b:
        boss[boss_b] = boss_a

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

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ab = [list(map(int, input().split()))]
for _ in range(m-1):
    a, b = map(int, input().split())
    for i in ab:
        if a not in i and b in i:
            i.append(a)
            break
        elif b not in i and a in i:
            i.append(b)
            break
        elif a in i and b in i:
            break
    else:
        ab.append([a, b])
ab_m = []
for i in ab:
    ab_m.append(len(i))

print(max(ab_m))


Fixed submission:
import collections

n, m = map(int, input().split())
if m == 0:
    print(1)
    exit()
if m == 1:
    print(2)
    exit()
boss = list(range(n))

def look_boss(target):
    num = target
    while num != boss[num]:
        num = boss[num]
    boss[target] = num
    return num

for _ in range(m):
    a, b = map(int, input().split())
    boss_a = look_boss(a-1)
    boss_b = look_boss(b-1)
    if boss_a != boss_b:
        boss[boss_b] = boss_a

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