Buggy python submission (verdict: Runtime Error):
#D - Friends
N,M = map(int,input().split())
par = [i for i in range(N+1)]
rank = [1] * (N + 1)

def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]

def size(x):
    return par.count(find(x))

def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return 0
    if x > y:
        x,y = y,x
    par[y] = x
    if par[x] == par[y]:
        rank[x] += 1
#    par[x] = y

print(par)
print(rank)
for i in range(M):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    unite(a,b)
    print(par)
    print(rank)
group_count = 0

group_count = max(rank)

# 出力
print(group_count)


Fixed submission:
#D - Friends
N,M = map(int,input().split())
par = [i for i in range(N)]
rank = [1] * (N)

def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]

def size(x):
    return par.count(find(x))

def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y : return 0
    if par[x] > par[y]:
        x,y = y,x
    par[y] = x
#    par[x] = x
    if par[x] == par[y]:
        rank[x] += rank[y]
#        rank[y] += rank[x]
#print(par)
#print(rank)
for i in range(M):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    unite(a,b)
#    print(par)
#    print(rank)
group_count = 0

group_count = max(rank)

# 出力
print(group_count)

Buggy python submission (verdict: Time Limit Exceeded):
#D - Friends
N,M = map(int,input().split())
par = [i for i in range(N+1)]
 
def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]
 
def size(x):
    return par.count(find(x))
 
def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return 0
    if par[x] > par[y]:
        x,y = y,x
    #par[x] += par[y]
    par[y] = x
#    par[x] = y
 
#print(par)
for i in range(M):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    unite(a,b)
#    print(par)
 
group_count = 0
 
for i in range(N):
    group_count = max(group_count,size(i))
 
# 出力
print(group_count)


Fixed submission:
#D - Friends
N,M = map(int,input().split())
par = [i for i in range(N)]
rank = [1] * (N)

def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]

def size(x):
    return par.count(find(x))

def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y : return 0
    if par[x] > par[y]:
        x,y = y,x
    par[y] = x
#    par[x] = x
    if par[x] == par[y]:
        rank[x] += rank[y]
#        rank[y] += rank[x]
#print(par)
#print(rank)
for i in range(M):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    unite(a,b)
#    print(par)
#    print(rank)
group_count = 0

group_count = max(rank)

# 出力
print(group_count)

Buggy python submission (verdict: Time Limit Exceeded):
#D - Friends
N,M = map(int,input().split())
par = [i for i in range(N+1)]

def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]

def size(x):
    return par.count(find(x))

def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return 0
    if par[x] > par[y]:
        x,y = y,x
    #par[x] += par[y]
    par[y] = x
#    par[x] = y

#print(par)
for i in range(M):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    unite(a,b)
#    print(par)

group_count = 0

for i in range(N):
    group_count = max(group_count,size(i))

# 出力
print(group_count)


Fixed submission:
#D - Friends
N,M = map(int,input().split())
par = [i for i in range(N)]
rank = [1] * (N)

def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]

def size(x):
    return par.count(find(x))

def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y : return 0
    if par[x] > par[y]:
        x,y = y,x
    par[y] = x
#    par[x] = x
    if par[x] == par[y]:
        rank[x] += rank[y]
#        rank[y] += rank[x]
#print(par)
#print(rank)
for i in range(M):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    unite(a,b)
#    print(par)
#    print(rank)
group_count = 0

group_count = max(rank)

# 出力
print(group_count)

Buggy python submission (verdict: Runtime Error):
#D - Friends
N,M = map(int,input().split())
par = [i for i in range(N+1)]

def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]

def size(x):
    return par.count(find(x))

def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return 0
    if par[x] > par[y]:
        x,y = y,x
    #par[x] += par[y]
    par[y] = x
#    par[x] = y

print(par)
for i in range(M):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    unite(a,b)
    print(par)

group_count = 0

for i in range(N):
    group_count = max(group_count,size(i))

# 出力
print(group_count)


Fixed submission:
#D - Friends
N,M = map(int,input().split())
par = [i for i in range(N)]
rank = [1] * (N)

def find(x):
    if par[x] == x:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]

def size(x):
    return par.count(find(x))

def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y : return 0
    if par[x] > par[y]:
        x,y = y,x
    par[y] = x
#    par[x] = x
    if par[x] == par[y]:
        rank[x] += rank[y]
#        rank[y] += rank[x]
#print(par)
#print(rank)
for i in range(M):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    unite(a,b)
#    print(par)
#    print(rank)
group_count = 0

group_count = max(rank)

# 出力
print(group_count)