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

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

k = int(input())

list = [a, b, c, d, e]

Flag = "Yay!"
for i in range(5):
    for j in range(5):
        if abs(list[i] - list[j]) > k:
            Flag = ":("
            break
print(Flag)

Buggy submission (verdict: Runtime Error):
a = input(>>)
b = input(>>)
c = input(>>)
d = input(>>)
e = input(>>)

k = input(>>)

if (a+b+c+d+e) > 4k:
    print(":(")
else:
    print(Yay!)
Problem p02879 (python)

Fixed submission:
a = list(map(int, input().split()))
if 1<=a[0] and a[0]<=9:
    if 1<=a[1] and a[1]<=9:
        print(a[0]*a[1])
    else:
        print(-1)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
f = 0
for i in range(1, 9):
    for j in range(1, 9):
        if i*j == n:
            f = 1
if f == 0:
    print("No")
else:
    print("Yes")
Problem p02880 (python)

Fixed submission:
n = int(input())
i = 1
j = 1
ans = 0
for i in range(10):
#  ans 
  for j in range(10):
    if i * j == n:
      ans = 1
if ans == 1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
i = 1
j = 1
ans = 0
for i in range(9):
#  ans 
  for j in range(9):
    if i * j == n:
      ans = 1
if ans == 1:
  print("Yes")1
else:
  print("No")
Problem p02881 (python)

Fixed submission:
import math
yu = int(input())
result = []
if yu == 2:
	print(1)
	quit()
for i in range(1,round(math.sqrt(yu)+1)):
	if yu % i == 0:
		result.append(i)


print(round(max(result)-1+(yu/max(result))-1))

Buggy submission (verdict: Runtime Error):
import math
yu = int(input())
result = []
for i in range(1,round(math.sqrt(yu))):
	if yu % i == 0:
		result.append(i)

print(round(max(result)-1+(yu/max(result))-1))
Problem p02879 (python)

Fixed submission:
a,b =map(int,input().split())
ai = int(a)
bi = int(b)
 
if ai < 10 and bi < 10:
  print(ai * bi)
else:
  print(-1)

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

if ai < 10 and bi < 10:
  print(ai * bi)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
import sys
 
a = sys.argv
i1 = int(a[1])
i2 = int(a[2])
if i1 < 10 and i2 < 10:
  print(i1 * i2)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
import sys
 
def main():
  a = sys.argv
  i1 = int(a[1])
  i2 = int(a[2])

  if i1 < 10 and i2 < 10:
    return i1 * i2
  else:
    return -1

main()

Buggy submission (verdict: Runtime Error):
import sys

a = sys.argv
i1 = int(a[1])
i2 = int(a[2])

if i1 < 10 and i2 < 10:
  return i1 * i2
else:
  return -1
Problem p02880 (python)

Fixed submission:
am=input()
a = int(am)
flg=0
for i in range(9):
  if a % (9-i) == 0 and a / (9-i) < 10:
    print("Yes")
    flg=1
    break
 
if flg==0:
  print("No")

Buggy submission (verdict: Runtime Error):
a=map(int,input().split())
flg=0
for i in range(9):
  if a % (9-i) == 0 and a / (9-i) < 10:
    print("YES")
    flg=1
    break

if flg==0:
  print("NO")
Problem p02881 (python)

Fixed submission:
import math
b = input()
a = int(b)

sqA = int(math.sqrt(a))

for i in range(10000000):
    d = a / (sqA - i)
    if d.is_integer() == True:
        break


e = d + sqA - i - 2

print(int(e))

Buggy submission (verdict: Runtime Error):
import math
b = input()
a = int(b)

c = int(math.sqrt(a))

for i in range(10000000):
    d = a / (c + i)
    if (d.is_integer() == True) & (i <= 10000):
        break
    if i > 10000:
        for j in range(1000000):
            f = a / (2 + j)
            if f.is_integer() == True:
                break
        break

if i > 1000:
    g = f + j
    print(int(g))
else:
    e = d + c + i - 2
    print(int(e))
Problem p03315 (python)

Fixed submission:
S = input()
R = 0
for i in range (4):
    if(S[i] == '+'):
        R = R + 1
    if(S[i] == '-'):
        R = R -1
print(R)

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


def Sn(N1):
    Sn = 0
    N = str(N1)
    for i in range(len(N)):
        Sn = Sn + int(N[i])

    return Sn

R = []
for i in range(1,3000):
    X = 0
    for j in range(i,1000):
        if(i/Sn(i) <= j/Sn(j)):
            X = X + 1

        if (X ==  1000 - i ):
            R.append(i)


for i in range(0,int(K)):
    print(R[i])
Problem p02879 (python)

Fixed submission:
A, B = map(int, input().split())

if A > 9 or B > 9:
    print('-1')
else:
    print(A*B)

Buggy submission (verdict: Runtime Error):
N = int(input())
flag = 0

for i in range(1, 10):
    if (N % i) == 0 and (N // i) < 10:
        print('Yes')
        break

else:
    print('No')
Problem p02951 (python)

Fixed submission:

A,B,C=list(map(int,input().split()))


C=C-(A-B)
if(C<0):
    print(0)
else:
    print(C)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
h[0] -= 1
flag = True
for i in range(n - 1):
    # print(i)
    if h[i] > h[i + 1]:
        flag = False
        break
    elif h[i] <= h[i + 1] - 1:
        h[i + 1] -= 1

if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
h[0] -= 1
flag = True
for i in range(n - 1):
    # print(i)
    if h[i] > h[i + 1]:
        flag = False
        break
    elif h[i] <= h[i + 1] - 1:
        h[i + 1] -= 1

if flag:
    print("Yes")
else:
    print("No")
Problem p02879 (python)

Fixed submission:
A, B = map(int, input().split())

if A <= 9 and B <= 9:
    ans = A * B
else:
    ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = "No"

for i in range(1, 10):
    if N % i == 0:
        t =  N / i
        if 1 <= t <= 9:
            ans = "Yes"
            break

print(ans)
Problem p02880 (python)

Fixed submission:
N = int(input())
ans = "No"

for i in range(1, 10):
    if N % i == 0:
        t =  N / i
        if 1 <= t <= 9:
            ans = "Yes"
            break

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = "No"

for i in range(1, 10):
    if N % i == 0:
        t =  N // A
        if 1 <= A <= 9:
            ans = "Yes"

print(ans)
Problem p03137 (python)

Fixed submission:
n, m = map(int, input().split())
l = list(map(int, input().split()))

l.sort()
d = l[len(l)-1] - l[0]
distance = []
sum = 0

for j in range(len(l)-1):
    distance.append( l[j+1] - l[j] )

distance.sort(reverse=True)

if n >= m:
    print("0")
else:
    for i in range(n-1):
        sum += distance[i]
    print(d-sum)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
l = list(map(int, input().split()))

l.sort()
distance = []
sum = 0

if m == 1:
    print("0")
    exit()

if m == 2:
    print(l[len(l)-1] - l[0])
    exit()

for i in range(len(l) - 1):
    distance.append(l[i+1] - l[i])

distance.sort(reverse=True)

for i in range(n-1):
    sum += distance[i]

print(l[len(l)-1] - l[0] - sum)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
l = list(map(int, input().split()))

l.sort()
distance = []
sum = 0

if m == 1:
    print("0")
    exit()

for i in range(len(l) - 1):
    distance.append(l[i+1] - l[i])

distance.sort(reverse=True)

for i in range(n-1):
    sum += distance[i]

print(l[len(l)-1] - l[0] - sum)
Problem p02879 (python)

Fixed submission:
A,B = (int(i) for i in input().split())  
if (A>9) or (B>9):
    print("-1")
else:
    print(A*B)

Buggy submission (verdict: Runtime Error):
A,B = (int(i) for i in input().split())  
if (len(A)>1) or (len(B)>1):
  print("-1")
else:
  print(A*B)

Buggy submission (verdict: Runtime Error):
A,B = (int(i) for i in input().split())  
if len(A)>1 | len(B)>1:
  print("-1")
else:
  print(A*B)

Buggy submission (verdict: Runtime Error):
A,B = (int(i) for i in input().split())  
if len(A)>1 or len(B)>1:
  print("-1")
else:
  print(A*B)

Buggy submission (verdict: Runtime Error):
A,B = input().split()
if (len(A)>1 or len(B)>1):
  print(-1) 
else:
  print(A*B)
Problem p02880 (python)

Fixed submission:
N=int(input())
for i in range(1,10):
    if N%i==0:
        tmp = N/i
        if tmp<10:
                print("Yes")
                break
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
for i in range(9):
  if N%i==0:
    tmp = N/i
    if tmp<10:
      print("Yes")
print("No")
Problem p03011 (python)

Fixed submission:
A=[int(i) for i in input().split()]
print(sum(A)-max(A))

Buggy submission (verdict: Runtime Error):
import numpy as np
L,A,B,M=(int(i) for i in input().split())
array=np.arange(A,A+B*L-1,B)
result=""
for i in range(L):
    result+=str(array[i])
print(int(result)%M)
Problem p03041 (python)

Fixed submission:
N,K=(int(i) for i in input().split())
S=input()
print(S[:K-1]+S[K-1].lower()+S[K:])

Buggy submission (verdict: Runtime Error):
N,K=(int(i) for i in input().split())
S=input()
print(S[:K]+S[K+1].lower()+S[K+1:])

Buggy submission (verdict: Runtime Error):
N.K=(int(i) for i in input().split())
S=input()
print(S[:K]+lower(S[K+1])+S[K+1:])
Problem p03073 (python)

Fixed submission:
S=input()
result1=0
result2=0
if S[0]=='1':
    for i in range(len(S)):
        if i%2==0:
            if S[i]=='0':
                result1+=1
            if S[i]=='1':
                result2+=1
        else:
            if S[i]=='1':
                result1+=1
            if S[i]=='0':
                result2+=1
    print(min(result1,result2))
else:
    for i in range(len(S)):
        if i%2==0:
            if S[i]=='0':
                result1+=1
            if S[i]=='1':
                result2+=1
        else:
            if S[i]=='1':
                result1+=1
            if S[i]=='0':
                result2+=1
    print(min(result1,result2))

Buggy submission (verdict: Runtime Error):
S=input()
result1=0
result2=0
if S[0]=='1':
    for i in range(len(S)):
        if i%2==0:
            if S[i]=='0':
                result1+=1
            if S[i]=='1':
                result2+=1
        else:
            if S[i]=='1':
                result1+=1
            if S[i]=='0':
                result2+=1
    print(min(result1,result2))
else:
     for i in range(len(S)):
        if i%2==0:
            if S[i]=='0':
                result1+=1
            if S[i]=='1':
                result2+=1
        else:
            if S[i]=='1':
                result1+=1
            if S[i]=='0':
                result2+=1
    print(min(result1,result2))
Problem p03075 (python)

Fixed submission:
A=[int(input()) for i in range(6)]
def Five(A):
    if A[-2]-A[0] > A[-1]:
        return print(":(")
    return print("Yay!")
Five(A)

Buggy submission (verdict: Runtime Error):
A=[int(input()) for i in range(6)]
def Five(A):
	for i in range(len(A)-2):
  		if A[i+1]-A[i] > A[-1]:
    		return print(":(")
	return print("Yay!")
Five(A)

Buggy submission (verdict: Runtime Error):
A=[int(i) for i in input()]
def Five(A):
	for i in range(len(A)-2):
  		if A[i+1]-A[i] > A[-1]:
    		return print(":(")
	return print("Yay!")
Five(A)
Problem p03186 (python)

Fixed submission:
A,B,C=map(int,input().split())
if A+B>=C:
  print(B+C)
else:
  print(2*B+A+1)

Buggy submission (verdict: Runtime Error):
A=input()
B=input()
C=input()
if A+B>C or B>C:
  print(B+C)
else:
  print(2*B+C-A-B)
Problem p03073 (python)

Fixed submission:
S = list(input())
stlen = len(S) 
if len(S)%2 == 0:
    a = '10'*(int(stlen/2))
    b = '01'*(int(stlen/2))
    counta = countb = 0
    for i in range(stlen):
        if a[i] != S[i]:
            counta += 1
        if b[i] != S[i]:
            countb += 1
    print(min(counta,countb))
else:
    a = '10'*(int(stlen/2))+'1'
    b = '01'*(int(stlen/2))+'0'
    counta = countb = 0
    for i in range(stlen):
        if a[i] != S[i]:
            counta += 1
        if b[i] != S[i]:
            countb += 1
    print(min(counta,countb))

Buggy submission (verdict: Runtime Error):
S = list(input())
stlen = len(S) 
if len(S)%2 == 0:
    a = '10'*(stlen/2)
    b = '01'*(stlen/2)
    counta = countb = 0
    for i in range(stlen):
        if a[i] != S[i]:
            counta += 1
        if b[i] != S[i]:
            countb += 1
    print(min(counta,countb))
else:
    a = '10'*(int(stlen/2))+'1'
    b = '01'*(int(stlen/2))+'0'
    counta = countb = 0
    for i in range(stlen):
        if a[i] != S[i]:
            counta += 1
        if b[i] != S[i]:
            countb += 1
    print(min(counta,countb))

Buggy submission (verdict: Runtime Error):
S = list(input())
stlen = len(S) 
if len(S)%2 == 0:
    a = '10'*(stlen/2)
    b = '01'*(stlen/2)
    counta = countb = 0
    for i in range(stlen):
        if a[i] != S[i]:
            counta += 1
        if b[i] != S[i]:
            countb += 1
    print(min(counta,countb))
else:
    a = '10'*(int(stlen/2))+'1'
    b = '01'*int((stlen/2))+'0'
    counta = countb = 0
    for i in range(stlen):
        if a[i] != S[i]:
            counta += 1
        if b[i] != S[i]:
            countb += 1
    print(min(counta,countb))
Problem p03127 (python)

Fixed submission:
def gcd(m,n):
    while n:
        m,n = n, m%n
    return m
n = int(input())
m = list(map(int,input().split()))
ans = m[0]
for i in range(1,n):
    ans = gcd(m[i],ans)
print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(m,n):
    while n:
        m,n = n, m%n
    return m
n = int(input())
m = map(int,input().split())
ans = m[0]
for i in range(1,n):
    ans = gcd(m[i],ans)
print(ans)
Problem p03137 (python)

Fixed submission:
N,M = map(int,input().split())
l = list(map(int,input().split()))
if M <= N:
    print('0')
else:
    l.sort()
    li = []
    for i in range(M-1):
        difference  = abs(l[i]-l[i+1])
        li.append(difference)
    li.sort()
    li.reverse()
    dif = 0
    for i in range(N-1):
        dif += li[i]
    print(l[M-1]-l[0]-dif)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
l = list(map(int,input().split()))
if M <= N:
    print('0')
else:
    l.sort()
    li = []
    for i in range(M-1):
        difference  = abs(l[i]-l[i+1])
        li.append(difference)
    li.sort().reverse()
    dif = 0
    for i in range(N-1):
        dif += li[i]
    print(l[M-1]-l[0]-dif)
Problem p02879 (python)

Fixed submission:
A,B=map(int,input().split())
if A/10 <1 and B/10 < 1:
  print(A*B)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
if A/10 >1 and B/10 > 1:
  print(A*B)
else:
  print(-1)
Problem p02879 (python)

Fixed submission:
A, B = map(int, input().split())
if A >= 10 or B >=10:
  print(-1)
else:
  print(A*B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A=(1,2,3,4,5,6,7,8,9)
B=(1,2,3,4,5,6,7,8,9)
count=0
for c in A:
  for d in B:
    e=c*d
    if N/e == 1 and N%e==0:
      count=count+1
if count >= 1 :
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
A=(1,2,3,4,5,6,7,8,9)
B=(1,2,3,4,5,6,7,8,9)
count=0
for a in A:
  for b in B:
    c=a*b
    if N/c == 1 and N%c==0:
      count=count+1
if count >= 1 :
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
A=(1,2,3,4,5,6,7,8,9)
B=(1,2,3,4,5,6,7,8,9)
count=0
for a in A:
  for b in B:
    if N/(a*b) == 1 and N%(a*b)==0:
      count=count+1
if count >= 1 :
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
A=(1,2,3,4,5,6,7,8,9)
B=(1,2,3,4,5,6,7,8,9)
count=0
for a in A:
  for b in B:
    if N/(a*b) == 1 and N%(a*b)==0:
      count=count+1
if count>=1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
A=(1,2,3,4,5,6,7,8,9)
B=(1,2,3,4,5,6,7,8,9)
count=0
for a in A:
  for b in B:
    if N/(a*b) == 1 and N%(a*b)==0:
      count=count+1
print(count)
if count>=1:
  print('Yes')
else:
  print('No')
Problem p02951 (python)

Fixed submission:
A,B,C = map(int, input().split())
D=C-(A-B)
if D > 0:
    print(D)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
A = map(int, input().split())
E=A[0]
B=A[1]
C=A[2]
D=C-(E-B)
print(D)

Buggy submission (verdict: Runtime Error):
A = map(int, input().split())
A=A[0]
B=A[1]
C=A[2]
D=C-(A-B)
print(D)

Buggy submission (verdict: Runtime Error):
A = map(int, input().split())
print(A[2]-(A[1]-A[0]))
Problem p02970 (python)

Fixed submission:
N, D = map(int, input().split())
B=2*D+1
if N % B == 0:
  A=N//B
else:
  A=N//B+1
print(A)

Buggy submission (verdict: Runtime Error):
N, D = map(int, input().split())
B=2*D
A=N//2B+1
print(A)

Buggy submission (verdict: Runtime Error):
N, D = map(int, input().split())
A=N//2D+1
print(A)
Problem p02987 (python)

Fixed submission:
S=input()
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('Yes')
elif S[0] == S[2] and S[1] == S[3] and S[0] != S[1]:
    print('Yes')
elif S[0] == S[3] and S[1] == S[2] and S[0] != S[1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S=input()
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print(Yes)
elif S[0] == S[2] and S[1] == S[3] and S[0] != S[1]:
    print(Yes)
elif S[0] == S[3] and S[1] == S[2] and S[0] != S[1]:
    print(Yes)
else:
    print(No)

Buggy submission (verdict: Runtime Error):
S=input()
if S[0]==S[1] and S[2]==S[3] and S[0]!=S[2]:
  print(Yes)
elif S[0]==S[2] and S[1]==S[3] and S[0]!=S[1]:
  print(Yes)
elif S[0]==S[3] and S[1]==S[2] and S[0]!=S[1]:
  print(Yes)
else:
  print(No)
Problem p03315 (python)

Fixed submission:
S= input()
A=S.count('+')
B=S.count('-')
print(A-B)

Buggy submission (verdict: Runtime Error):
S= int(input())
A=S.count('+')
B=S.count('-')
print(A-B)

Buggy submission (verdict: Runtime Error):
S= int(input())
A=S.count('+')
B=S.count('-')*(-1)
print(A+B)
Problem p02880 (python)

Fixed submission:
input_num = input()
input_num = int(input_num)
for i in range(1,10,1):
  flag = False
  for j in range(1,10,1):
    if input_num == i * j:
      print("Yes")
      flag = True
      break
  if flag:
    break
if not flag:
	print("No")

Buggy submission (verdict: Runtime Error):
input_num = input()
input_num = int(input_num)
for i in range(1,10,1):
  flag = False
  for j in range(1,10,1):
    if input_num == i * J:
      print("Yes")
      flag = True
      break
  if flag:
    break
if not flag:
	print("No")

Buggy submission (verdict: Runtime Error):
input_num = input()
input_num = int(input_num)
for i in range(1,100,1):
  flag = False
  for j in range(1,100,1):
    if input_num == i * J:
      print("Yes")
      flag = True
      break
  if flag:
    break
if not flag:
	print("No")

Buggy submission (verdict: Runtime Error):
input_num = input()
input_num = int(input_num)
ans_flag = False;
for i in range(1,100,1):
  for j in range(1,100,1):
    if input_num == i * J:
      print("Yes")
      ans_flag = True
      break;
if not ans_flag:
	print("No")
Problem p02881 (python)

Fixed submission:
a = int(input())
b = 0
l = int(a**0.5)+1
count = 0
for i in range(l):
    i = i+1
    if a%i == 0:
        j = a//i
    if i*j == a:
        if count == 0:
            count += 1
            c = i
            d = j
        if count>0:
            if (c+d)>(i+j):
                c = i
                d = j
ans = c+d-2
print(ans)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = 0
count = 0
for i in range(9):
  for j in range(9):
    if (i+1)*(j+1) == a:
      count += 1
      if count>0:
        if (c+d)>(i+1)+(j+1):
		  c = i+1
          d = j+1
      else :
        c = i+1
        d = j+1
ans = c+d-2
print(ans)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = 0
count = 0
for i in range(9):
  for j in range(9):
    if (i+1)*(j+1) == a:
      count += 1
      if count>0:
        if (c+d)>(i+1)+(j+1):
		  c = i+1
          d = j+1
      else :
        c = i+1
        d = j+1
ans = c+d-2
print
Problem p02880 (python)

Fixed submission:
n=int(input())
flag=False

for i in range(1,10):
    for j in range(1,10):
        if i*j==n:
            flag=True

if flag==True:
    print('Yes')
else:
    print('No')

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


if a//10!=0:
    print(-1)

elif b//10!=0:
    print(-1)

else:
    print(a*b)
Problem p02879 (python)

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

if (a <= 9 and b <= 9):
  print(a*b)
else:
  print(-1)

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

if (a >= 1 and a <= 9 and b >= 1 and b <= 9):
  print(a*b)
else:
  print(-1)
Problem p02881 (python)

Fixed submission:
tall = int(input())
bit = int(tall**(1/2))
while ((tall/bit)%1 != 0):
  bit -= 1
print(int(bit+tall/bit-2))

Buggy submission (verdict: Runtime Error):
tall = int(input())
bit = round(tall**(1/2))
while (bit/tall%1 != 0):
  bit -= 1
print(bit+tall/b-2)
Problem p02879 (python)

Fixed submission:
A, B = map(int, input().split())
if A > 9 or B > 9:
  print (-1)
else:
  print(A*B)

Buggy submission (verdict: Runtime Error):
def prime_factors(n):
    i = 2
    factors = 1
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors = i
    if n > 1:
        factors = i
    return factors
N = int(input())
large_factor = prime_factors(N)
print(int(large_factor+(N/large_factor)-2))

Buggy submission (verdict: Runtime Error):
A, B = map(int, raw_input().split())
if A > 9 or B > 9:
  print (-1)
else:
  print(A*B)
Problem p02880 (python)

Fixed submission:
N = int(input())
isDiv = 'No'
for i in range(1, 10):
  if N % i == 0:
    if N / i <= 9:
    	isDiv = 'Yes'
    	break
print(isDiv)

Buggy submission (verdict: Runtime Error):
N = int(input)
isDiv = 'No'
for i in range(1, 10):
  if N % i == 0:
    if N / i <= 9:
    	isDiv = 'Yes'
    	break
print(isDiv)

Buggy submission (verdict: Runtime Error):
N = int(input)
isDiv = 'No'
for i in range(1, 10):
  if N % i == 0:
    isDiv = 'Yes'
    break
print(isDiv)
Problem p02881 (python)

Fixed submission:
N = int(input())
def findSteps(n):
  for x in range(int(n**(1/2)), 1, -1):
    if (n % x == 0):
      return (int(x + n/x - 2))
  return (N-1)
 
print(findSteps(N))

Buggy submission (verdict: Runtime Error):
def prime_factors(n):
    i = 2
    factors = 1
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors = i
    if n > 1:
        factors = i
    return factors
N = int(input())
large_factor = prime_factor(N)
print(large_factor+(N/large_factor)-2)

Buggy submission (verdict: Runtime Error):
N = int(input)
Problem p02880 (python)

Fixed submission:
l = [0]*101
for i in range(1, 10):
    for j in range(1, 10):
        l[i*j] = 1
n = int(input())
if l[n] == 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
l = [0]*100
for i in range(1, 10):
    for j in range(1, 10):
        l[i*j] = 1
n = int(input())
if l[n] == 1:
    print("Yes")
else:
    print("No")
Problem p02925 (python)

Fixed submission:
from collections import deque
 
n = int(input())
lst = [deque(map(int, input().split())) for _ in range(n)]
 
current = []
for i in range(n):
    current.append(lst[i].popleft())

count = 0
players = set(range(1, n+1))
while True:
    index_lst = []
    for i in players:
        candidate = current[i-1]
        if candidate in index_lst:
            continue
        if current[candidate-1] == i:
            index_lst += [i, candidate]   
    if len(index_lst) == 0:
        if sum(current) == 0:
            print(count)
            break
        else:
            print(-1)
            break
    for i in index_lst:
        if len(lst[i-1]) == 0:
            current[i-1] = 0
        else:
            current[i-1] = lst[i-1].popleft()
    players = set(index_lst)
    count += 1

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = [deque(map(int, input().split())) for _ in range(n)]
 
current = []
for i in range(n):
    current.append(lst[i].popleft())

count = 0
while True:
    index_lst = []
    for i in range(len(current)):
        candidate = current[i]
        if candidate == 0:
            continue
        if current[candidate-1] == i+1:
            index_lst += [i+1, candidate]   
    if len(index_lst) == 0:
        if sum(current) == 0:
            print(count)
            break
        else:
            print(-1)
            break
    for i in set(index_lst):
        if len(lst[i-1]) == 0:
            current[i-1] = 0
        else:
            current[i-1] = lst[i-1].popleft()
    count += 1