Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = sorted(list(str(input())))
T = sorted(list(str(input())),reverse=True)

print('YNeos'[S>=::2])

Fixed submission:
S = sorted(list(str(input())))
T = sorted(list(str(input())),reverse=True)

for i in range(min(len(S),len(T))):
    if S[i] < T[i]:
        print('Yes')
        break
    elif S[i] == T[i]:
        if i+1 == len(S) < len(T):
            print('Yes')
            break
        elif i+1 == len(T):
            print('No')
            break
        else:
            continue
    else:
        print('No')
        break
Buggy python submission (verdict: Runtime Error):
N = int(input()
A = map(int,input().split())

flg = True
cnt = 0

while flg = True:
    for i in range(N):
        if A[i]%2 = 1 then:
            flg = False
            break
    cnt += 1
    A = [a/2 for a in A]

print(cnt)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

cnt = 0
flg = True

while flg == True:
    for i in range(N):
        if A[i]%2 == 1:
            flg = False
            break
    if flg == True:
        cnt += 1
        A = [a/2 for a in A]

print(cnt)
Buggy python submission (verdict: Runtime Error):
r, g, b = map(int,input().split())

if (100*r + 10*g + b) % 4 == 0:
    print(f'YES')
else:
    print(f'NO')

Fixed submission:
r, g, b = map(int,input().split())

if (100*r + 10*g + b) % 4 == 0:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
r, g, b = map(int,input().split())

if (100*r + 10*g + b) % 4 == 0:
    print(f'YES')
else:
    print(f'NO')

Fixed submission:
r, g, b = map(int,input().split())

if (100*r + 10*g + b) % 4 == 0:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
r, g, b = map(int,input())

if (100*r + 10*g + b) % 4 == 0:
    print(f'YES')
else:
    print(f'NO')

Fixed submission:
r, g, b = map(int,input().split())

if (100*r + 10*g + b) % 4 == 0:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))

k_mul = 1
for i in range(k):
    k_mul *= a[i]

first = k_mul
for i in range(k, n):
    new = (first // a[i-k]) * a[i]
    if first < new:
        print("Yes")
    else:
        print("No")
    first = new

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))


for i in range(k, n):
    if a[i-k] < a[i]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

tmp = []
s = 0
for i in a:
    if s + i <= k:
        tmp.append(i)
        s += i
a = tmp
tmp = []
s = 0
for i in b:
    if s + i <= k:
        tmp.append(i)
        s += i
b = tmp
line = b[::-1] + a

ans = 0
left = 0
for left in range(len(line)):
    sum_ = 0
    right = left
    while right < len(line) and sum_ + line[right] <= k:
        sum_ += line[right]
        right += 1
    l = right -left
    if l > ans:
        ans = l
print(ans) 

Fixed submission:
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

tmp = []
s = 0
for i in a:
    if s + i <= k:
        tmp.append(i)
        s += i
    else:
        break
a = tmp
tmp = []
s = 0
for i in b:
    if s + i <= k:
        tmp.append(i)
        s += i
    else:
        break
b = tmp
line = b[::-1] + a

ans = 0
right = 0
sum_ = 0
for left in range(len(line)):
    while right < len(line) and sum_ + line[right] <= k:
        sum_ += line[right]
        right += 1
    l = right -left 
    if l > ans:
        ans = l

    if right == left: right += 1
    else: sum_ -= line[left]

print(ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
d = []
for i in range(n):
    a,b = map(int,input().split())
    d.append([a,b])
 
d.sort(key=lambda x:x[0])

sum_ = 0
cnt = 0
for ab in d:
    if cnt + ab[1] > M:
        sum_ += ab[0] * (M-cnt)
        break
    else:
        cnt += ab[1]
        sum_ += ab[0]*ab[1]
print(sum_)


Fixed submission:
n,M = map(int,input().split())
d = []
for i in range(n):
    a,b = map(int,input().split())
    d.append([a,b])
 
d.sort(key=lambda x:x[0])

sum_ = 0
cnt = 0
for ab in d:
    if cnt + ab[1] > M:
        sum_ += ab[0] * (M-cnt)
        break
    else:
        cnt += ab[1]
        sum_ += ab[0]*ab[1]
print(sum_)
Buggy python submission (verdict: Runtime Error):
N = int(input())
h = [int(i) for i in input().split()]
dp = [inf for _ in range(N)]
dp[0] = 0
for i in range(N-1):
    dp[i+1] = min(dp[i+1], dp[i] + abs(h[i+1]-h[i]))
    if i+2 < N:
        dp[i+2] = min(dp[i+2], dp[i] + abs(h[i+2]-h[i]))
print(dp[-1])

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
inf = 10 ** 10
dp = [inf] * n
dp[0] = 0
for i in range(n - 1):
    temp = abs(h[i + 1] - h[i])
    dp[i + 1] = min(dp[i + 1], temp + dp[i])
    if i + 2 < n:
        temp = abs(h[i + 2] - h[i])
        dp[i + 2] = min(dp[i + 2], temp + dp[i])
print(dp[-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
h = [int(i) for i in input().split()]

def jump(now,h,cost):
    if now == len(h)-2: #ゴール一歩手前
        return cost + abs(h[-1] - h[now])
    elif now == len(h)-1: #ゴールについた時
        return cost

    cost1 = jump(now+1,h,cost)
    cost2 = jump(now+2,h,cost)
    if cost1 <= cost2:
        return cost1 + abs(h[now] - h[now+1])
    else: return cost2 + abs(h[now] - h[now+2])

cost = 0
print(jump(0,h,0))

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
inf = 10 ** 10
dp = [inf] * n
dp[0] = 0
for i in range(n - 1):
    temp = abs(h[i + 1] - h[i])
    dp[i + 1] = min(dp[i + 1], temp + dp[i])
    if i + 2 < n:
        temp = abs(h[i + 2] - h[i])
        dp[i + 2] = min(dp[i + 2], temp + dp[i])
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,K = map(int,input().split())
h = np.array([int(i) for i in input().split()])
dp = [10**10 for _ in range(N)]
dp[0] = 0
for i in range(1,N):
    dp[i:i+K] = np.fmin(dp[i:i+K], dp[i-1] + np.abs(h[i:i+K] - h[i-1]))
        
print(dp[-1])

Fixed submission:
import numpy as np
N,K = map(int,input().split())
h = np.array([int(i) for i in input().split()])
dp = np.full(N,10**10,dtype=int)
dp[0] = 0
for i in range(1,N):
    dp[i:i+K] = np.fmin(dp[i:i+K], dp[i-1] + np.abs(h[i:i+K] - h[i-1]))
        
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
h = [int(i) for i in input().split()]
dp = [10**10 for _ in range(N)]
dp[0] = 0
for i in range(1,N):
    dp[i] = min([dp[i-k]+abs(h[i-k]-h[i]) for k in range(min(K,i)+1)])
        
print(dp[-1])

Fixed submission:
import numpy as np
N,K = map(int,input().split())
h = np.array([int(i) for i in input().split()])
dp = np.full(N,10**10,dtype=int)
dp[0] = 0
for i in range(1,N):
    dp[i:i+K] = np.fmin(dp[i:i+K], dp[i-1] + np.abs(h[i:i+K] - h[i-1]))
        
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
h = [int(i) for i in input().split()]
dp = [10**10 for _ in range(N)]
dp[0] = 0
for i in range(1,N):
    for k in range(min(K,i)+1):
        dp[i] = min(dp[i], dp[i-k] + abs(h[i-k]-h[i]))
        
print(dp[-1])

Fixed submission:
import numpy as np
N,K = map(int,input().split())
h = np.array([int(i) for i in input().split()])
dp = np.full(N,10**10,dtype=int)
dp[0] = 0
for i in range(1,N):
    dp[i:i+K] = np.fmin(dp[i:i+K], dp[i-1] + np.abs(h[i:i+K] - h[i-1]))
        
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
h = [int(i) for i in input().split()]
dp = [10**10 for _ in range(N)]
dp[0] = 0
for i in range(N-1):
    for k in range(1,K+1):
        if i+k < N:
            dp[i+k] = min(dp[i+k], dp[i] + abs(h[i+k]-h[i]))
print(dp[-1])

Fixed submission:
import numpy as np
N,K = map(int,input().split())
h = np.array([int(i) for i in input().split()])
dp = np.full(N,10**10,dtype=int)
dp[0] = 0
for i in range(1,N):
    dp[i:i+K] = np.fmin(dp[i:i+K], dp[i-1] + np.abs(h[i:i+K] - h[i-1]))
        
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np



N,W = map(int,input().split())
items = [[int(a) for a in input().split()]]
for i in range(N-1):
    items.append([int(a) for a in input().split()])
items = np.array(items)
dp = np.full((N+1,W+1),0,dtype=np.int64)
dp[0][W] = 0
for i in range(N):
    for w in range(W+1):
        if w-items[i][0] >= 0:
            dp[i+1][w] =max(dp[i][w],dp[i][w-items[i][0]]+items[i][1])
        else:
            dp[i+1][w] = dp[i][w]
print(dp[N][W])

Fixed submission:
import numpy as np
 
N,Max_W = map(int,input().split())
 
dp = [0 for _ in range(Max_W + 1)]
dp = np.array(dp)
 
for i in range(N):
    w,v = map(int,input().split())
    a = dp[:-w] + v
    b = dp[w:]
    m = np.maximum(a,b)
    dp[w:] = m
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
 
N,Max_W = map(int,input().split())
 
dp = [0 for _ in range(Max_W + 1)]
dp = np.array(dp)
 
for i in range(N):
    w,v = map(int,input().split())
    a = dp[:-w] + v
    b = dp[w:]
    m = np.maximum(a,b)
    dp[w:] = m
print(dp[-1])

Fixed submission:
import numpy as np
 
N,Max_W = map(int,input().split())
INF = np.inf

dp = np.full(N*10**3+1,Max_W+1,dtype=np.int64)
dp[0] = 0
for i in range(N):
    w,v = map(int,input().split())
    a = dp[:-v] + w
    b = dp[v:]
    m = np.minimum(a,b)
    dp[v:] = m
max_w = 0
max_v = 0
ans = np.where( dp <= Max_W )
print(np.max(ans))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
s=input()
t=input()
a=len(s)
b=len(t)
dp=np.full((a+1,b+1),0,dtype=int)
for i in range(a):
  for j in range(b):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j])
res=''
while a!=0 and b!=0:
  if dp[a][b]==dp[a-1][b]:
    a-=1
  elif dp[a][b]==dp[a][b-1]:
    b-=1
  else:
    a-=1
    b-=1
    res=s[a]+res
print(res)

Fixed submission:
import numpy as np
S = np.array([ord(i)-97 for i in input()], dtype=int)
T = np.array([ord(i)-97 for i in input()], dtype=int)
Ns = len(S)
Nt = len(T)
equal = np.equal.outer(S, T).astype(int)
 
dp = [np.zeros(Nt + 1, dtype=int)]
for i in range(Ns):
    x = dp[-1].copy()
    newDP = x.copy()
    newDP[1:] = np.maximum(x[:-1] + equal[i], newDP[1:])
    np.maximum.accumulate(newDP, out=newDP)
    dp.append(newDP)
 
 
ans = ""
i, j = Ns, Nt
while i > 0 and j > 0:
    if S[i-1] == T[j-1]:
        ans += chr(S[i-1]+97)
        i -= 1
        j -= 1
        continue
    if dp[i][j] == dp[i - 1][j]:
        i -= 1
    else:
        j -= 1
 
print(ans[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
t=input()
a=len(s)
b=len(t)
dp=[[0]*(b+1) for i in range(a+1)]
for i in range(a):
  for j in range(b):
    if s[i]==t[j]:
      dp[i+1][j+1]=dp[i][j]+1
    else:
      dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j])
res=''
while a!=0 and b!=0:
  if dp[a][b]==dp[a-1][b]:
    a-=1
  elif dp[a][b]==dp[a][b-1]:
    b-=1
  else:
    a-=1
    b-=1
    res=s[a]+res
print(res)

Fixed submission:
import numpy as np
S = np.array([ord(i)-97 for i in input()], dtype=int)
T = np.array([ord(i)-97 for i in input()], dtype=int)
Ns = len(S)
Nt = len(T)
equal = np.equal.outer(S, T).astype(int)
 
dp = [np.zeros(Nt + 1, dtype=int)]
for i in range(Ns):
    x = dp[-1].copy()
    newDP = x.copy()
    newDP[1:] = np.maximum(x[:-1] + equal[i], newDP[1:])
    np.maximum.accumulate(newDP, out=newDP)
    dp.append(newDP)
 
 
ans = ""
i, j = Ns, Nt
while i > 0 and j > 0:
    if S[i-1] == T[j-1]:
        ans += chr(S[i-1]+97)
        i -= 1
        j -= 1
        continue
    if dp[i][j] == dp[i - 1][j]:
        i -= 1
    else:
        j -= 1
 
print(ans[::-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())

xyh = [list(map(int, input().split())) for i in range(n)]
if xyh[0][2]:
    x,y,h = xyh[0]
if xyh[1][2]:
    x,y,h = xyh[1]
for i in range(101):
    for j in range(101):
        k = h + abs(i - x) + abs(j - y)
        if all(h == max(k - abs(i - x) - abs(j - y), 0) for x, y, h in xyh):
            print(i, j, k)

Fixed submission:
n = int(input())

xyh = [list(map(int, input().split())) for i in range(n)]
if xyh[0][2]:
    x,y,h = xyh[0]
if xyh[1][2]:
    x,y,h = xyh[1]
if xyh[-1][2]:
    x,y,h = xyh[-1]
for i in range(101):
    for j in range(101):
        k = h + abs(i - x) + abs(j - y)
        if all(h == max(k - abs(i - x) - abs(j - y), 0) for x, y, h in xyh):
            print(i, j, k)

Buggy python submission (verdict: Runtime Error):
n = int(input())

xyh = [list(map(int, input().split())) for i in range(n)]
if xyh[0][2]:
    x,y,h = xyh[0]
for i in range(101):
    for j in range(101):
        k = h + abs(i - x) + abs(j - y)
        if all(h == max(k - abs(i - x) - abs(j - y), 0) for x, y, h in xyh):
            print(i, j, k)

Fixed submission:
n = int(input())

xyh = [list(map(int, input().split())) for i in range(n)]
if xyh[0][2]:
    x,y,h = xyh[0]
if xyh[1][2]:
    x,y,h = xyh[1]
if xyh[-1][2]:
    x,y,h = xyh[-1]
for i in range(101):
    for j in range(101):
        k = h + abs(i - x) + abs(j - y)
        if all(h == max(k - abs(i - x) - abs(j - y), 0) for x, y, h in xyh):
            print(i, j, k)
Buggy python submission (verdict: Runtime Error):
import sympy
n = int(input())
cnt = 0

for i in range(1,n+1):
    if len(sympy.divisors(i)) == 8 and i % 2 == 1:
        cnt += 1
print(cnt)

Fixed submission:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
cnt = 0

for i in range(1,n+1):
    if len(make_divisors(i)) == 8 and i % 2 == 1:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):

ans = ""
if N == 1:
    print("1")
elif N == -1:
    print("10")
else:
    while True:
        r = N % 2
        N = (N-r) /-2
        ans = str(int(r)) + ans
        if N == 0 or N == 1:
            ans = str(int(N)) + ans
            break

    print(ans)

Fixed submission:
import math
N = int(input())

ans = ""
if N == 1:
    print("1") 
elif N == 0:
    print("0")  
elif N == -1:
    print("10")
else:
    while True:
        r = N % 2
        N = (N-r) /-2
        ans = str(int(r)) + ans
        if N == 0 or N == 1:
            ans = str(int(N)) + ans
            break

    print(ans)
Buggy python submission (verdict: Runtime Error):
word = input()
if word[-1] == 's':
  return ''.join(word, 'es')
else:
  return ''.join(word, 's')

Fixed submission:
word = input()
if word[-1] == 's':
  print(word+'es')
else:
  print(word+'s')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
point = []
for _ in range(n):
    point.append((tuple(map(int, input().split()))))
point = set(point)
max_d = 0
for p in point:
    for q in point:
        d = abs(p[0] - q[0]) + abs(p[1] - q[1])
        if d > max_d:
            max_d = d
print(max_d)

Fixed submission:
n = int(input())
point = []
for _ in range(n):
    point.append((tuple(map(int, input().split()))))
point = list(set(point))
point = sorted(point)
if len(point) == 1: print(0)
else:  
    d1 = max([(x+y) for x,y in point])- min([(x+y) for x,y in point])
    d2 = max([(x-y) for x,y in point]) - min([(x-y) for x,y in point])
    print(max(d1,d2))
Buggy python submission (verdict: Runtime Error):
if len(set(input())) ==2: print("Yes)
else: print("No")                                

Fixed submission:
a = input()
if len(set(a)) == 2:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = [map(int, input().split())]
print(sum([1 for i in range(len(arr)) if (((arr[i] < arr[i+1]) and (arr[i] > arr[i-1])) or ((arr[i] > arr[i+1]) and (arr[i] < arr[i-1])))]))


Fixed submission:
n = int(input())
arr = list(map(int, input().split()))
count = 0
for i in range(1, len(arr)-1):
  if (arr[i+1] - arr[i])* (arr[i] - arr[i-1]) > 0:
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N,X,M = map(int, input().split())


A = [-1]*(M+100)
A[0] = X
i = 0
tmpans = 0
flag = False
check = [-1]*(M+1)
slice = -1
while i< N-1:
    newa = A[i]**2%M
    i+= 1
    if check[newa] != -1:
        flag = True
        slice = check[newa]
        break
    A[i] = newa
    check[newa] = i

if not flag:
    print(sum(A[:i+1]))

else:
    print(sum(A[:slice])+ sum(A[slice:i])*((N-slice)//(i-slice))+sum(A[slice:slice + (N-slice)%(i-slice)]))


Fixed submission:
s = input()
if s[-1] == "s":
    print(s + "es")
else:
    print(s + "s")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

ans = 0
i = 1
while i < N:
    j = 1
    while i*j < N:
        ans += 1
        j += 1
    i+= 1

print(ans)


Fixed submission:
N = int(input())

ans = 0
i = 1
while i**2 < N:
    j = i
    while i*j < N:
        if i == j:
            ans += 1
        else:
            ans += 2
        j += 1
    i+= 1

print(ans)
Buggy python submission (verdict: Runtime Error):
N,X,M = map(int, input().split())


A = [-1]*M
A[0] = X
i = 0
tmpans = 0
flag = False
check = [-1]*(M+1)
slice = -1
while i< N-1:
    newa = A[i]**2%M
    i+= 1
    if check[newa] != -1:
        flag = True
        slice = check[newa]
        break
    A[i] = newa
    check[newa] = i

if not flag:
    print(sum(A[:i+1]))

else:
    print(sum(A[:slice])+ sum(A[slice:i])*((N-slice)//(i-slice))+sum(A[slice:slice + (N-slice)%(i-slice)]))


Fixed submission:
N,X,M = map(int, input().split())


A = [-1]*(M+100)
A[0] = X
i = 0
tmpans = 0
flag = False
check = [-1]*(M+1)
slice = -1
while i< N-1:
    newa = A[i]**2%M
    i+= 1
    if check[newa] != -1:
        flag = True
        slice = check[newa]
        break
    A[i] = newa
    check[newa] = i

if not flag:
    print(sum(A[:i+1]))

else:
    print(sum(A[:slice])+ sum(A[slice:i])*((N-slice)//(i-slice))+sum(A[slice:slice + (N-slice)%(i-slice)]))

Buggy python submission (verdict: Runtime Error):
N,X,M = map(int, input().split())


A = [-1]*M
A[0] = X
i = 0
tmpans = 0
flag = False
check = [-1]*(M+1)
slice = -1
while i< N-1:
    newa = A[i]**2%M
    i+= 1
    if check[newa] != -1:
        flag = True
        slice = check[newa]
        break
    A[i] = newa
    check[newa] = i

if not flag:
    print(sum(A[:i+1]))

else:
    print(sum(A[:slice])+ sum(A[slice:i])*((N-slice)//(i-slice))+sum(A[slice:(N-slice)%(i-slice)]))


Fixed submission:
N,X,M = map(int, input().split())


A = [-1]*(M+100)
A[0] = X
i = 0
tmpans = 0
flag = False
check = [-1]*(M+1)
slice = -1
while i< N-1:
    newa = A[i]**2%M
    i+= 1
    if check[newa] != -1:
        flag = True
        slice = check[newa]
        break
    A[i] = newa
    check[newa] = i

if not flag:
    print(sum(A[:i+1]))

else:
    print(sum(A[:slice])+ sum(A[slice:i])*((N-slice)//(i-slice))+sum(A[slice:slice + (N-slice)%(i-slice)]))
Buggy python submission (verdict: Runtime Error):
s = int(input())

a = [-1]*(s+1)
mod = 10**9 + 7

a[0] = 1
a[1] = 0
a[2] = 0
a[3] = 1
for i in range (4,s+1):
    a[i] = (a[i-1]+a[i-3])%mod

print(a[s])


Fixed submission:
s = int(input())

a = [-1]*(s+10)
mod = 10**9 + 7

a[0] = 1
a[1] = 0
a[2] = 0
a[3] = 1
if s > 3:
    for i in range (4,s+1):
        a[i] = (a[i-1]+a[i-3])%mod

print(a[s])

Buggy python submission (verdict: Runtime Error):
s = int(input())

a = [-1]*(s+1)

a[0] = 1
a[1] = 0
a[2] = 0
a[3] = 1
for i in range (4,s+1):
    a[i] = a[i-1]+a[i-3]

print(a[s])


Fixed submission:
s = int(input())

a = [-1]*(s+10)
mod = 10**9 + 7

a[0] = 1
a[1] = 0
a[2] = 0
a[3] = 1
if s > 3:
    for i in range (4,s+1):
        a[i] = (a[i-1]+a[i-3])%mod

print(a[s])
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
import copy

N, M = map(int,input().split())

edge_list = [set() for i in range (N)]


for i in range (M):
    A,B = map(int,input().split())
    edge_list[A-1].add(B-1)
    edge_list[B-1].add(A-1)

for i in range (N):
    d =deque(edge_list[i])
    while d:
        a = d.popleft()
        el = copy.copy(edge_list[a])
        for j in range (len(edge_list[a])):
            aj = el.pop()
            if (aj not in edge_list[i]) and i != aj:
                edge_list[i].add(aj)
                d.append(aj)


edge_list = list(map(len,edge_list))

print(max(edge_list)+1)


Fixed submission:
class UnionFind:
    def __init__ (self,n):
        self.parent = [i for i in range (n)]
        self.height = [0 for _ in range (n)]

    def get_root(self,i):
        if self.parent[i] == i:
            return i
        else:
            self.parent[i] = self.get_root(self.parent[i])
            return self.parent[i]

    def unite(self,i,j):
        root_i = self.get_root(i)
        root_j = self.get_root(j)
        if root_i != root_j:
            if self.height[root_i] < self.height[root_j]:
                self.parent[root_i] = root_j
            else:
                self.parent[root_j] = root_i
                if self.height[root_i] == self.height[root_j]:
                    self.height[root_i] += 1

    def is_in_group(self,i,j):
        if self.get_root(i) == self.get_root(j):
            return True
        else:
            return False

def main():
    N,M = map(int, input().split())
    uf = UnionFind(N)
    for _ in range (M):
        A,B = map(lambda x: int(x)-1,input().split())
        uf.unite(A,B)

    check = [0]*N
    for i in range(N):
        check[uf.get_root(i)] += 1
    print(max(check))


main()
Buggy python submission (verdict: Runtime Error):
H,W,M = map(int,input().split())
m =[[0]*W for _ in range (H)]
hlist = [0]*H
wlist = [0]*W
for i in range (M):
    h,w = map(lambda x: int(x)-1,input().split())
    m[h][w] = 1
    hlist[h]+=1
    wlist[w]+=1

hmax = 0
hind = []
for i in range(H):
    if hmax < hlist[i]:
        hmax = hlist[i]
        hind = [i]
    elif hmax == hlist[i]:
        hind.append(i)


wmax = 0
wind = []
for i in range(W):
    if wmax < wlist[i]:
        wmax = wlist[i]
        wind = [i]
    elif wmax == wlist[i]:
        wind.append(i)


flag = False
for h in hind:
    for w in wind:
        if m[h][w] == 0:
            print(hmax + wmax)
            flag = True
            break
    if flag:
        break

if not flag:
    print(hmax + wmax - 1)


Fixed submission:
H,W,M = map(int,input().split())

hlist = [0]*H
wlist = [0]*W
sets = set()
for i in range (M):
    h,w = map(lambda x: int(x)-1,input().split())
    hlist[h]+=1
    wlist[w]+=1
    sets.add((h,w))

hmax = 0
hind = []
for i in range(H):
    if hmax < hlist[i]:
        hmax = hlist[i]
        hind = [i]
    elif hmax == hlist[i]:
        hind.append(i)


wmax = 0
wind = []
for i in range(W):
    if wmax < wlist[i]:
        wmax = wlist[i]
        wind = [i]
    elif wmax == wlist[i]:
        wind.append(i)


flag = False
for h in hind:
    for w in wind:
        if (h,w) not in sets:
            flag = True
            break
    if flag:
        break

if flag:
    print(hmax + wmax)
else:
    print(hmax + wmax - 1)
Buggy python submission (verdict: Runtime Error):
    X = int(input())
    if X > 30:
      print("Yes")
    else:
      print("No")

Fixed submission:
X = int(input())
if X >= 30:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
X = int(input())
if X > 30:
  print("Yes")
 else:
   print("No")

Fixed submission:
X = int(input())
if X >= 30:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
X = int(input())
X = range(-40 < 40)
if X > 30:
  print("Yes")
else:
  print("No")

Fixed submission:
X = int(input())
if X >= 30:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
X = input()
if X > 30:
  print("Yes")
else:
  print("No")

Fixed submission:
X = int(input())
if X >= 30:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
X = input()
X = range(-40,40)
if X > 30:
  print("Yes")
else:
  print("No")

Fixed submission:
X = int(input())
if X >= 30:
    print("Yes")
else:
    print("No")