Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02646 (python)

Fixed submission:
AV = [int(x) for x in input().split()]
BW = [int(x) for x in input().split()]
A = AV[0]
V = AV[1]
B = BW[0]
W = BW[1]
T = int(input())
T = float(T)
D = abs(A-B)
S = V-W
if S>0:
    T1 = float(D/S)
    if T1<=T:
        print('YES')
    else:
        print('NO')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
A,V = [int(x) for x in input().split()]
B,W = [int(x) for x in input().split()]
T = int(input())
D = abs(A-B)
S = V-W
T1 = float(D/S)
if S>0 and T1 <= T:
    print('Yes')
else:
    print('No')
Problem p02660 (python)

Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

a = int(input())
b = factorization(a)
countation = 0
for i in range(len(b)):
    t = b[i][1]
    k = 1
    n = 1
    while t >= n:
        countation += 1
        k = k + 1
        n = k*(k+1)/2
if a != 1:
    print(countation)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

a = int(input())
b = factorization(a)
countation = 0
for i in range(len(b)):
    t = b[i][1]
    k = 1
    n = 1
    while t >= n:
        countation += 1
        k = k + 1
        n = k*(k+1)/2
if a != 1
    print(countation)
else:
    print(0)
Problem p02681 (python)

Fixed submission:
S = list(input())
T = list(input())
a = 0
s = len(S)
for i in range(0,s):
    if S[i] != T[i]:
        a = 1
if a == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = list(input())
T = list(input())
a = 0
for i in range(0,s):
    if S[i] != T[i]:
        a = 1
if a == 0:
    print('Yes')
else:
    print('No')
Problem p02700 (python)

Fixed submission:
K = input().split(" ")
k = [int(n) for n in K]
t =k[0]//k[3]
a = k[2]//k[1]
t1 = k[0]%k[3]
a1 = k[2]%k[1]
if t1 != 0:
    t = t+1
if a1 != 0:
    a = a+1
if t>=a:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
K = input().split(" ")
k = [int(n) for n in K]
t =k[0]//k[3]
a = k[2]//k[1]
t1 = k[0]%k[3]
a1 = k[2]%k[1]
if t > a:
    print('Yes')
elif t == a and a1 /= 0:
    print('Yes')
elif t == a and t1 /= 0:
    print('No')
else:
    print('No')
Problem p02783 (python)

Fixed submission:
H,A =input().split()
h = int(H)
a = int(A)
if h % a == 0:
    n = h // a
else:
    n = h // a +1
print(n)

Buggy submission (verdict: Runtime Error):
H =input()
A =input()
h = int(H)
a = int(A)
if h % a == 0:
    n = h // a
else:
    n = h // a +1
print(n)

Buggy submission (verdict: Runtime Error):
H=input()
A=input()
h = int(H)
a = int(A)
if mod(h,a) == 0:
    n = h // A
else:
    n = h // a +1
print(n)

Buggy submission (verdict: Runtime Error):
H=input()
A=input()
h = int(H)
a = int(A)
if mod(H,A) == 0:
    n = H // A
else:
    n = H // A +1
print(n)

Buggy submission (verdict: Runtime Error):
h=input()
a=input()
H = int(h)
A= int(a)
n = H // A + 1
print(n)

Buggy submission (verdict: Runtime Error):
H=input()
A=input()
h = int(H)
a= int(A)
n :int= h // a + 1
print(n)

Buggy submission (verdict: Runtime Error):
h=input()
a=input()
H = int(h)
A= int(a)
n :int= H // A + 1
print(n)

Buggy submission (verdict: Runtime Error):
H=input()
A=input()
n=H//A+1
print(n)
Problem p02865 (python)

Fixed submission:
N = int(input())
if N%2 == 0:
    print(int(N/2-1))
else:
    print(int((N-1)/2))

Buggy submission (verdict: Runtime Error):
N = input()
if N % 2 == 0:
    print(N/2-1)
else:
    print((N-1)/2)

Buggy submission (verdict: Runtime Error):
N = 1
N = input()
if N % 2 == 0:
    print(N/2-1)
else:
    print((N-1)/2)

Buggy submission (verdict: Runtime Error):
N = input()
if N%2 = 0:
    print(N/2-1)
else:
    print((N-1)/2)

Buggy submission (verdict: Runtime Error):
int N
if N%2 = 0:
    print(N/2-1)
else:
    print((N-1)/2)
Problem p03455 (python)

Fixed submission:
a,b = input().split()
A = int(a)
B = int(b)
c=A*B
if c%2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a,b = input()
A = int(a)
B = int(b)
c=A*B
if c%2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a,b = input()
A = int(a)
B = int(b)
c=a*b
if c%2 == 0:
  print("Even")
else:
  print("Odd")
Problem p02606 (python)

Fixed submission:
L,R,d = map(int,input().split())
count=int(0)
for i in range(L,R+1):
    if i%d==0:
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
L=int(input())
R=int(input())
d=int(input())
count=int(0)
for i in range(L,R):
    if i%d==0:
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
L=int(input())
R=int(input())
d=int(input())
count=int(0)
for i in range(L,R):
    if i%d==0:
        count+=1
print count
Problem p02576 (python)

Fixed submission:
N,X,T=map(int,input().split())
if N//X<N/X<N//X+1:
  print((N//X+1)*T) 
else:
  print(N//X*T)

Buggy submission (verdict: Runtime Error):
N,X,T=map(int,input().split)
if N//X<N/X<N//x+1:
  print((N//X+1)*T) 
else:
  print(N/X*T)
Problem p02658 (python)

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
A=1
if 0 in L:
  print(0)
  exit()
for i in range(N):
  A=A*L[i]
  if 10**18<A:
    print(-1)
    exit()
print(A)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
A=1
for i in range(N):
  A=A*L[i]
  if 10**18&lt;A:
    print(-1)
    exit()
print(A)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
A=1
for i in range(N):
  A=A*L[i]
  if 10**18<A:
  print(-1)
  exit()
print(A)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
A=1
for i in range(N):
  A=A*L[i]
  if 10**18<A:
print(-1)
  exit()
print(A)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
A=1
for i in range(N):
  A=A*L[i]
  if 10**18<A:
print(-1)
  exit()
  print(A)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
A=1
for i in range(N):
  A=A*L[i]
  if 10**18<A:
  print(-1)
  exit()
  else:
  print(A)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
A=1
for i in range(N):
  A=A*L[i]
  if 10**18<A:
print(-1)
  else:
print(A)
  exit()

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
A=1
for i in range(N):
  A=A*L[i]
  if 10**18<A:
print(-1)
  exit()
else:
  print(A)
Problem p02971 (python)

Fixed submission:
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))

sort_A = sorted(A)
max = sort_A[N - 1]
sec = sort_A[N - 2]

count = A.count(max)

if count == 1:
  p = A.index(max)
  
  for i in range(p):
    print(max)
  
  print(sec)
  
  for j in range(p,N - 1):
    print(max)

else:
  for k in range(N):
    print(max)

Buggy submission (verdict: Runtime Error):
for _ in range(N):
    A.append(int(input()))

sort_A = sorted(A)
max = sort_A[N - 1]
sec = sort_A[N - 2]

count = A.count(max)

if count == 1:
  p = A.index(max)
  
  for i in range(p):
    print(max)
  
  print(sec)
  
  for j in range(p,N - 1):
    print(max)

else:
  for k in range(N):
    print(max)
Problem p02975 (python)

Fixed submission:
import sys

N = int(input())
a = list(map(int, input().split()))
 
x = 0
y = 0
z = 0

if a.count(0) == N:
  print('Yes')
  sys.exit()
  

if N % 3 != 0:
  print('No')
 
elif a.count(0) != 0:
  if a.count(0) != N / 3:
    print('No')
    sys.exit()
    
  else:
    for i in range(N):
      if a[i] != 0 and a[i] != x:
        if x == 0:
          x = a[i]
          continue
        else:
          print('No')
          sys.exit()
        
    print('Yes')
    

else:
  for i in range(N):
    if a[i] != x and a[i] != y and a[i] != z:
      if x == 0:
        x = a[i]
        continue
      elif y == 0:
        y = a[i]
        continue
      elif z == 0:
        z = a[i]
        continue
      else:
        print('No')
        sys.exit()
  
  if x ^ y == z and a.count(x) == a.count(y) and a.count(y) == a.count(z):
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
 
x = 0
y = 0
z = 0
 
if N % 3 != 0:
  print('No')
 
else:
 
  for i in range(N):
    if a[i] != x and a[i] != y and a[i] != z:
      if x == 0:
        x = a[i]
        continue
      elif y == 0:
        y = a[i]
        continue
      elif z == 0:
        z = a[i]
        continue
      else:
        print('No')
        sys.exit()
 
  if x ^ y == z:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys
 
N = int(input())
a = list(map(int, input().split()))
 
x = 0
y = 0
z = 0
 
if N % 3 != 0:
  print('No')
 
else:
 
  for i in range(N):
    if a[i] != x and a[i] != y and a[i] != z:
      if x == 0:
        x = a[i]
        continue
      elif y == 0:
        y = a[i]
        continue
      elif z == 0:
        z = a[i]
        continue
      else:
        print('No')
        sys.exit()
 
  if x != 0 and y != 0 and z != 0:
    print('Yes')
  else:
    print('No')
import sys

N = int(input())
a = list(map(int, input().split()))

x = 0
y = 0
z = 0

if N % 3 != 0:
  print('No')

else:

  for i in range(N):
    if a[i] != x and a[i] != y and a[i] != z:
      if x == 0:
        x = a[i]
        continue
      elif y == 0:
        y = a[i]
        continue
      elif z == 0:
        z = a[i]
        continue
      else:
        print('No')
        sys.exit()

  if x ^ y == z:
    print('Yes')
  else:
    print('No')
提出情報
Problem p02982 (python)

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

if D == 1:
  print(N * (N-1) // 2)
else:
  A = [0] * N
  count = 0
  sei = 0

  for i in range(0,N):
	  A[i] = list(map(int, input().split()))
    
  for p in range(0,N):
      for q in range(0,N):
          sum = 0
    
          for r in range(0,D):
              sum = sum + (A[p][r]-A[q][r]) ** 2
           
          sum = sum ** 0.5 
          sei = int(sum)
        
          if sum != 0 and sum == sei:
              count = count + 1
      
  print(count // 2)

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

if D == 1:
  print(N * (N-1) // 2)
else:
  A = [0] * D
  count = 0
  sei = 0

  for i in range(0,N):
	  A[i] = list(map(int, input().split()))
    
  for p in range(0,N):
      for q in range(0,N):
          sum = 0
    
          for r in range(0,D):
              sum = sum + (A[p][r]-A[q][r]) ** 2
           
          sum = sum ** 0.5 
          sei = int(sum)
        
          if sum != 0 and sum == sei:
              count = count + 1
      
  print(count // 2)

Buggy submission (verdict: Runtime Error):
N,D = map(int, input().split())
A = [0] * D
count = 0
sei = 0

for i in range(0,N):
	A[i] = list(map(int, input().split()))
    
for p in range(0,N):
    for q in range(0,N):
        sum = 0
    
        for r in range(0,D):
            sum = sum + (A[p][r]-A[q][r]) ** 2
           
        sum = sum ** 0.5 
        sei = int(sum)
        
        if sum != 0 and sum == sei:
            count = count + 1
      
print(count // 2)
Problem p02999 (python)

Fixed submission:
a = input().split()
if a[0] < a[1]:
  print('0')
else:
  print('10')

Buggy submission (verdict: Runtime Error):
a = raw_input().split()
if a[0] < a[1]:
  print('0')
  else:
    print('10')

Buggy submission (verdict: Runtime Error):
import numpy as np

b, c = map(int, input().split())
if b < c:
  print('0')
  else:
    print('10')

Buggy submission (verdict: Runtime Error):
b, c = map(int, input().split())
if b < c:
  print('0')
  else:
    print('10')
Problem p02865 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a = int(input())

if a % 2 == 0:
    r = a/2 -1
else:
    r = (a-1)/2

print("{}".format(int(r)))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a = int(input())
b = input().split()
c = input().split()

for i in range(a):
    b[i] = int(b[i])
    c[i] = int(c[i])

out = "Yes"

def check_max(l, num):
    max_num = 0
    max_i = -1

    l_sorted = sorted(l)
    num_list = [-1] * num
    num_list2 = [-1] * num

    for i in reversed(range(num)):
        for j in range(num):
            if l_sorted[i] == l[j]:
                if num_list[j] == -1:
                    num_list[j] = i+1
                    num_list2[i] = j
                    break

    return (num_list, list(reversed(num_list2)))

def checklist(l1, l2, num):
    result = True
    for i in range(num):
        if l1[i] > l2[i]:
            result = False
            break
    return result 


if out == "Yes":
    swap_num = 0

    num_list_b, num_list_b_index = check_max(b,a)
    num_list_c, num_list_c_index = check_max(c,a)



    for i in range(a-2):
        index1 = num_list_b_index[i]
        index2 = num_list_c_index[i]


        

        if b[index1] <= c[index2]:
            b[index1], b[index2] = b[index2], b[index1]

if not checklist(b, c, a):
    out = "No"
else:
    out = "Yes"

print(out)
Problem p02553 (python)

Fixed submission:
a,b,c,d=[int(_) for _ in input().split()]
ans=max(a*c,a*d,b*c,b*d)
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d=[int(_) for _ in input().split()]
if a<0 or b<0 or c<0 or d<0:
    print(min(a,b)*max(c,d))
else:
    print(max(a,b)*max(c,d))
5 -4 8 -1
Problem p02576 (python)

Fixed submission:
import math
n,x,t = map(int,input().split())
print(math.ceil(n/x)*t)

Buggy submission (verdict: Runtime Error):
n,n,x=input().strip()
Problem p02817 (python)

Fixed submission:
s,t = input().split()
print(t+s)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
print(t+s)
Problem p02582 (python)

Fixed submission:
sd = input()
ok = 0
if sd[0] == 'R':
    if sd[1] == 'R':
        if sd[2] == 'R':
            ok = 1
            print(3)
        else:
            ok = 1
            print(2)
    else:
        ok = 1
        print(1)
else:
    if sd[1] == 'R':
        if sd[2] == 'R':
            ok =1 
            print(2)
        else:
            ok = 1
            print(1)
    else:
        if sd[2] == 'R':
            print(1)
            ok = 1
if ok == 0:
    print(0)

Buggy submission (verdict: Runtime Error):
xkd = input()

xstr,kstr,dstr = xkd.split()

x = int(xstr)
k = int(kstr)
d = int(dstr)

if x >= k*d:
    print(x-(k*d))
else:
    if x <= -(k*d):
        print(x+(k*d))
    else:
        if x <= 0:
            lxl = -x
        else:
            lxl = x
        if x <= 0:
            now_x = x + (d * (int(lxl / d) + 1))
            left_x = -now_x
            right_x = now_x + d
        else:
            now_x = x - (d * (int(lxl / d) + 1))
            left_x = -(now_x - d)
            right_x = now_x
        now_k = k - int(lxl / d) - 1
        if now_x <= 0:
            if now_k % 2 == 0:
                print(left_x)
            else:
                print(right_x)
        else:
            if now_k % 2 == 0:
                print(right_x)
            else:
                print(left_x)

Buggy submission (verdict: Runtime Error):
xkd = input()

x,k,d = int(xkd.split())

if x >= k*d:
    print(x-(k*d))
else:
    if x <= -(k*d):
        print(x+(k*d))
    else:
        if x <= 0:
            lxl = -x
        else:
            lxl = x
        if x <= 0:
            now_x = x + (d * (int(lxl / d) + 1))
            left_x = -now_x
            right_x = now_x + d
        else:
            now_x = x - (d * (int(lxl / d) + 1))
            left_x = -(now_x - d)
            right_x = now_x
        now_k = k - int(lxl / d) - 1
        if now_x <= 0:
            if now_k % 2 == 0:
                print(left_x)
            else:
                print(right_x)
        else:
            if now_k % 2 == 0:
                print(right_x)
            else:
                print(left_x)
Problem p02583 (python)

Fixed submission:
n = int(input())
l_before = input()

l = l_before.split(' ')



i = 0
j = 0
k = 0

count = 0

for ic in range(n):
    for jc in range(n-ic-1):
        for kc in range(n-ic-jc-2):
            i = ic
            j = i + jc + 1
            k = j + kc + 1
            if int(l[i]) != int(l[j]):
                if int(l[j]) != int(l[k]):
                    if int(l[i]) != int(l[k]):
                        if int(l[i]) >= int(l[j]):
                            if int(l[k]) >= int(l[i]):
                                if int(l[k]) < int(l[i]) + int(l[j]):
                                    count = count + 1
                            else:
                                if int(l[i]) < int(l[k]) + int(l[j]):
                                    count = count + 1
                        else:
                            if int(l[k]) > int(l[j]):
                                if int(l[k]) < int(l[i]) + int(l[j]):
                                    count = count + 1
                            else:
                                if int(l[j]) < int(l[k]) + int(l[i]):
                                    count = count + 1

print(count)

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

l = l_before.split(' ')
lnum = len(l)


i = 0
j = 0
k = 0

count = 0

for ic in range(lnum):
    for jc in range(lnum-ic-1):
        for kc in range(lnum-ic-jc-1):
            i = ic
            j = ij + ic
            k = ij + ic +ik
            if i + j >= k:
                count = count + 1
            else:
                if i + k >= j:
                    count = count + 1
                else:
                    if k + j >= i:
                        count = count + 1

print(count)
Problem p02584 (python)

Fixed submission:
x,k,d=map(int,input().split())
x=abs(x) 

if x%d==0:
    minNear  = x%d + d
    minFar = x%d
    minTransitionToNear = (x-minNear)/d
    #print(minNear)
    #print(minFar)
    #print(minTransitionToNear)
    
else:
    minNear  = x%d
    minFar = x%d - d
    minTransitionToNear = (x-minNear)/d
    #print(minNear)
    #print(minFar)
    #print(minTransitionToNear)
    
if k<minTransitionToNear:
    print(x-k*d)
else:
    if (k-minTransitionToNear)%2==0:
        print(abs(minNear))
    else:
        print(abs(minFar))

Buggy submission (verdict: Runtime Error):
x,k,d=map(int,input().split())
x=abs(x) 

if x%d==0:
    minNear  = x%d + d
    minFar = x%d
    minTransitionToNear = (x-minNear)/d
else:
    minNear  = x%d
    minFar = x%d - d
    minTransitionToNear = (x-minPlus)/d
    
if k<minTransitionToNear:
    print(x-k*d)
else:
    if (k-minTransitionToNear)%2==0:
        print(minNear)
    else:
        print(minFar)
Problem p02641 (python)

Fixed submission:
X,N=map(int,input().split())
 
if N==0:
    _=input()
    print(X)
    
else:
    Ps=list(map(int,input().split()))
    d=0
    while 1:
        if X-d not in  Ps:
            print(X-d)
            break
        elif X+d not in Ps:
            print(X+d)
            break
        d+=1

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

if N==0:
    _=input()
    print(X)

Ps=list(map(int,input().split()))

d=0
while 1:
    d+=1
    if X-d not in  Ps:
        print(X-d)
        break
    elif X+d not in Ps:
        print(X+d)
        break
Problem p02658 (python)

Fixed submission:
#169B
N=int(input())
As=list(map(int,input().split()))

if min(As)==0:
    num=0
else:
    num=1
    for i in range(N):
        num *= As[i]
        if num>10**18:
            num=-1
            break

print(num)

Buggy submission (verdict: Runtime Error):
n=input()
A=eval('*'.join(input().split()))
print(-1 if A>10**18 else A)

Buggy submission (verdict: Runtime Error):
_=input()
A=eval('*'.join(input().split()))
print(-1 if A>10**18 else A)

Buggy submission (verdict: Runtime Error):
if min(As)==0:
    num=0
else:
    num=1
    for i in range(N):
        num *= As[i]
        if num>10**18:
            print("breakに突入")
            num=-1
            break

print(num)
Problem p03813 (python)

Fixed submission:
print("A"+"RB"[int(input())<1200]+"C")

Buggy submission (verdict: Runtime Error):
print("A"+"RB"[int(input())<1200)]+"C")
Problem p03844 (python)

Fixed submission:
a,op,b=input().split()
a=int(a)
b=int(b)

if op=="+":
  print(a+b)
else:
  print(a-b)

Buggy submission (verdict: Runtime Error):
a,op,b=input()
a=int(a)
b=int(b)

if op=="+":
  print(a+b)
else:
  print(a-b)
Problem p03852 (python)

Fixed submission:
c=input()
listVowels=["a","e","i","o","u"]
isVowel=c in listVowels
if isVowel:
    print("vowel")
else:
    print("consonant")

Buggy submission (verdict: Runtime Error):
c=input()
listVowels=["a","e","i","o","u"]
isVowel=c in vowelslist
if isVowel:
    print("vowel")
else:
    print("consonant")

Buggy submission (verdict: Runtime Error):
c=input()
listVowels=["a","e","i","o","u"]
isVowel=c in vowelslist
if isVowel:
    print("vowel")
else:
    print("consonant")

Buggy submission (verdict: Runtime Error):
listVowels=["a","e","i","o","u"]
isVowel=input() in vowelslist
if isVowel:
    print("vowel")
else:
    print("consonant")
Problem p03861 (python)

Fixed submission:
a,b,x=map(int,input().split())
print(b//x-a//x+(a%x==0))

Buggy submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
print(len(list(range(a,b+1,x)))-(a==b))

Buggy submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
print(len(list(range(a,b+1,x)))-(a==b))

Buggy submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
print(len(list(range(a,b+1,x)))-(a==b
Problem p02573 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10000000)

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

d = {i: [] for i in range(1, N + 1)}
for _ in range(M):
    a, b = list(map(int, input().split()))
    d[a].append(b)
    d[b].append(a)

visited = [False for _ in range(N + 1)]


def visit(x):
    if visited[x]:
        return 0
    visited[x] = True

    z = 1
    for y in d[x]:
        z += visit(y)
    return z


m = 1
for i in range(1, N + 1):
    r = visit(i)
    if m < r:
        m = r

print(m)

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

d = {i: [] for i in range(1, N + 1)}
for _ in range(M):
    a, b = list(map(int, input().split()))
    d[a].append(b)
    d[b].append(a)

visited = [False for _ in range(N + 1)]


def visit(x):
    if visited[x]:
        return 0
    visited[x] = True

    z = 1
    for y in d[x]:
        z += visit(y)
    return z


m = 1
for i in range(1, N + 1):
    r = visit(i)
    if m < r:
        m = r

print(m)
Problem p02690 (python)

Fixed submission:
x = int(input())

rs = [i ** 5 for i in range(300)]

for r in rs:
    if r <= x:
        if x - r in rs:
            print(rs.index(r), - rs.index(x - r))
            break
    if r > x:
        if r - x in rs:
            print(rs.index(r), rs.index(r - x))
            break

Buggy submission (verdict: Runtime Error):
x = int(input())

rs = [i ** 5 for i in range(300)]

for r in rs:
    if (x - r) in rs:
        print(rs.index(r), - rs.index(x - r))
    elif (x + r) in rs:
        print(rs.index(r), rs.index(x - r))
    else:
        continue
    break
Problem p02606 (python)

Fixed submission:
min, max, b = map(int, input().split())
result = 0
for i in range(min, max + 1):
  if i % b == 0:
    result += 1

print(result)

Buggy submission (verdict: Runtime Error):
for i in range(1, 1 + int(input())):

  match_pattern = []

  for x in range(1, 32):
    for y in range(1, 32):
      for z in range(1, 32):

        if i == (x**2 + y ** 2 + z ** 2 + x * y + y * z + z * x):
          match_pattern.append([x, y, z])
  
  print(len(match_pattern))