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

Fixed submission:
from functools import reduce

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

n = int(input())
lst = list(map(int, input().split()))
 
def gcd_list(numbers):
    return reduce(gcd, numbers)
 
print(gcd_list(lst))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

n = int(input())
lst = list(map(int, input().split()))

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

print(gcd_list(lst))
Problem p03209 (python)

Fixed submission:
nk_list = list(map(int, input().split()))
n,k = nk_list[0], nk_list[1]

keta_lst = list()
for i in range(50):
    if i == 0:
        keta = 1
        keta_lst.append(keta)
    else:
        keta = 2*keta + 3
        keta_lst.append(keta)

paty_lst = list()
for i in range(50):
    if i == 0:
        paty = 1
        paty_lst.append(paty)
    else:
        paty = 2*paty+1
        paty_lst.append(paty)

def eat_paty(n,k):
    
    if n == 0 and k == 1:
        return 1
    
    keta_before = keta_lst[n-1]
    
    if k == 1:
        return 0
    elif k <= keta_before + 1:
        return eat_paty(n-1, k-1)
    elif k == keta_before + 2:
        return paty_lst[n-1]+1
    elif k <= 2*keta_before + 1:
        return paty_lst[n-1] + 1 + eat_paty(n-1, k-keta_before-2)
    elif k > 2*keta_before + 1:
        return 2 * paty_lst[n-1] + 1

print(eat_paty(n,k))

Buggy submission (verdict: Runtime Error):
nk_list = list(map(int, input().split()))
n,k = nk_list[0], nk_list[1]

keta_lst = list()
for i in range(50):
    if i == 0:
        keta = 1
        keta_lst.append(keta)
    else:
        keta = 2*keta + 3
        keta_lst.append(keta)

paty_lst = list()
for i in range(50):
    if i == 0:
        paty = 1
        paty_lst.append(paty)
    else:
        paty = 2*paty+1
        paty_lst.append(paty)

def eat_paty(n,k):
    
    if n == 0 and k == 1:
        return 1
    
    keta_before = keta_lst[n-1]
    
    if k == 1:
        return 0
    elif k <= keta_before + 1:
        return eat_paty(n-1, k-1)
    elif k == keta_before + 2:
        return paty_lst[n-1]+1
    elif k <= 2*keta_before + 1:
        return paty_lst[n-1] + 1 + eat_paty(n-1, k-keta_before-2)
    elif k == 2*keta_before + 2:
        return 2 * paty_lst[n-1] + 1

print(eat_paty(n,k))

Buggy submission (verdict: Runtime Error):
nk_list = list(map(int, input().split()))
n,k = nk_list[0], nk_list[1]

keta_lst = list()
for i in range(50):
    if i == 0:
        keta = 1
        keta_lst.append(keta)
    else:
        keta = 2*keta + 3
        keta_lst.append(keta)

paty_lst = list()
for i in range(50):
    if i == 0:
        paty = 1
        paty_lst.append(paty)
    else:
        paty = 2*paty+1
        paty_lst.append(paty)

def eat_paty(n,k):
    
    if n == 0 and k == 1:
        return 1
    
    keta_before = keta_lst[n-1]
    
    if k == 1:
        return 0
    elif k <= keta_before + 1:
        return eat_paty(n-1, k-1)
    elif k == keta_before + 2:
        return paty_lst[n-1]
    elif k <= 2*keta_before + 1:
        return paty_lst[n-1] + eat_paty(n-1, k-keta_before-2)
    elif k == 2*keta_before + 2:
        return 2 * paty_lst[n-1]

print(eat_paty(n,k))
Problem p03221 (python)

Fixed submission:
nm_lst = list(map(int, input().split()))
city_lst = [list(map(int, (str(i)+' '+input()).split())) for i in range(nm_lst[1])]

city_lst = sorted(city_lst, key = lambda x: x[1]*(10**12) + x[2])

ans_lst = []
num_num = 0
for n, city in enumerate(city_lst):
    prefec_num = city[1]
    prefec_str = '0' * (6-len(str(prefec_num))) + str(prefec_num)
    if n == 0 or (prefec_num != city_lst[n-1][1]):
        num_num = 1
    else:
        num_num += 1
    num_str = '0' * (6-len(str(num_num))) + str(num_num)
    ans_lst.append([city[0], prefec_str, num_str])
    
ans_lst = sorted(ans_lst, key = lambda x:x[0])

for city in ans_lst:
    print(city[1]+city[2])

Buggy submission (verdict: Runtime Error):
nm_lst = list(map(int, input().split()))
city_lst = [list(map(int, (str(i)+' '+input()).split())) for i in range(nm_lst[1])]

city_lst = sorted(city_lst, key = lambda x: x[1]*10**7 + x[2])

ans_lst = []
num_num = 0
for n, city in enumerate(city_lst):
    prefec_num = city[1]
    prefec_str = '0' * (6-len(str(prefec_num))) + str(prefec_num)
    if n = 0 or (prefec_num != city_lst[n-1][1]):
        num_str = '000001'
        num_num = 1
    else:
        num_num += 1
        num_str = '0' * (6-len(str(num_num))) + str(num_num)
    ans_lst.append([city[0], prefec_str, num_str])
    
ans_lst = sorted(ans_lst, key = lambda x:x[0])

for city in ans_lst:
    print(city[1]+city[2])

Buggy submission (verdict: Runtime Error):
nm_lst = list(map(int, input().split()))
city_lst = [list(map(int, (str(i)+' '+input()).split())) for i in range(nm_lst[1])]

city_lst = sorted(city_lst, key = lambda x: x[1]*10**7 + x[2])

ans_lst = []
num_num = 0
for n, city in enumerate(city_lst):
    prefec_num = city[1]
    if len(str(prefec_num)) < 6:
        prefec_str = '0' * (6-len(str(prefec_num))) + str(prefec_num)
    if prefec_num != city_lst[n-1][1]:
        num_str = '000001'
        num_num = 1
    else:
        num_num += 1
        num_str = '0' * (6-len(str(num_num))) + str(num_num)
    ans_lst.append([city[0], prefec_str, num_str])
    
ans_lst = sorted(ans_lst, key = lambda x:x[0])

for city in ans_lst:
    print(city[1]+city[2])
Problem p03253 (python)

Fixed submission:
import scipy.misc
import math

n,m = map(int, input().split())

M = m
lst, count = [],[]
if M == 1:
    print(1)
else:
    for i in range(2,int(math.sqrt(m))+1):
        while M % i == 0:
            M = M // i
            if i not in lst:
                count.append(1)
                lst.append(i)
            else:
                count[-1] += 1
    if M > 1:
        lst.append(M)
        count.append(1)       

    ans = 1
    for i in count:
        ans = ans * scipy.misc.comb(i+n-1,i, exact=1)
        ans = ans % (10**9+7) 

    print(int(ans))

Buggy submission (verdict: Runtime Error):
import scipy
import math

n,m = map(int, input().split())

M = m
lst, count = [],[]
for i in range(2,int(math.sqrt(m))+1):
    while M % i == 0:
        M = M // i
        if i not in lst:
            count.append(1)
            lst.append(i)
        else:
            count[-1] += 1
if M > 1:
    lst.append(M)
    count.append(1)       

ans = 1
for i in count:
    ans = ans * scipy.special.comb(i+n-1,i)
    ans = ans % (10**9+7) 

print(int(ans))

Buggy submission (verdict: Runtime Error):
import scipy.special
import math

n,m = map(int, input().split())

M = m
lst, count = [],[]
for i in range(2,int(math.sqrt(m))+1):
    while M % i == 0:
        M = M // i
        if i not in lst:
            count.append(1)
            lst.append(i)
        else:
            count[-1] += 1
if M > 1:
    lst.append(M)
    count.append(1)       

ans = 1
for i in count:
    ans = ans * scipy.special.comb(i+n-1,i)
    ans = ans % (10**9+7) 

print(int(ans))

Buggy submission (verdict: Runtime Error):
import scipy.special
import math

n,m = map(int, input().split())

M = m
lst, count = [],[]
for i in range(2,int(math.sqrt(m))+1):
    while M % i == 0:
        M = M // i
        if i not in lst:
            count.append(1)
            lst.append(i)
        else:
            count[-1] += 1
if M > 1:
    lst.append(M)
    count.append(1)       

ans = 1
for i in count:
    ans *= scipy.special.comb(i+n-1,i)
    ans = ans % (10**9+7) 

print(int(ans))

Buggy submission (verdict: Runtime Error):
import scipy.special

n,m = map(int, input().split())

M = m
lst, count = [],[]
for i in range(2,int(math.sqrt(m))+1):
    while M % i == 0:
        M = M // i
        if i not in lst:
            count.append(1)
            lst.append(i)
        else:
            count[-1] += 1
if M > 1:
    lst.append(M)
    count.append(1)       

ans = 1
for i in count:
    ans *= scipy.special.comb(i+n-1,i)
    ans = ans % (10**9+7) 

print(int(ans))

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

M = m
lst, count = [],[]
for i in range(2,int(math.sqrt(m))+1):
    while M % i == 0:
        M = M // i
        if i not in lst:
            count.append(1)
            lst.append(i)
        else:
            count[-1] += 1
if M > 1:
    lst.append(M)
    count.append(1)       

ans = 1
for i in count:
    ans *= scipy.special.comb(i+n-1,i)
    ans = ans % (10**9+7) 

print(int(ans))
Problem p03291 (python)

Fixed submission:
e,a,b,c=1,0,0,0
p=1000000007
for i in input():
  if i == "A":
    a+=e
  elif i == "B":
    b+=a
  elif i == "C":
    c+=b
  else:
    e,a,b,c = (3*e)%p,(e+3*a)%p,(a+3*b)%p,(b+3*c)%p
print(c%1000000007)

Buggy submission (verdict: Runtime Error):
str_num = 1
a,b,c = 0, 0, 0
for i in s:
    if i == 'A':
        a += 1
    elif i == 'B':
        b += a
    elif i == 'C':
        c += b
    else:
        a,b,c = 3*a+str_num, a+3*b, b+3*c
        str_num *= 3
print(c)
Problem p03317 (python)

Fixed submission:
import math
n, k = map(int, input().split())
lst = list(map(int, input().split()))
a = lst.index(1)
print(math.ceil((n - 1) / (k-1)))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
lst = list(map(int, input().split()))
a = lst.index(1)
print(math.ceil(a/2) + math.ceil((n-a-1)/2))
Problem p03329 (python)

Fixed submission:
n = int(input())

lst = []
for i in range(7):
    lst.append(6**i)
for i in range(1, 6):
    lst.append(9**i)

dp = [0]*100001
for i in range(1, n+1):
    candi = []
    for j in lst:
        if i >= j:
            candi.append(dp[i-j]+1)
    dp[i] = min(candi)
print(dp[i])

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

dp = [0]*100001
for i in range(1, n+1):
    candi = []
    for j in lst:
        if i >= j:
            candi.append(dp[i-j]+1)
    dp[i] = min(candi)
print(dp[i])
Problem p02879 (python)

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

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
A=sorted(list(map(int,input().split())))
F=sorted(list(map(int,input().split())),reverse=True)
ok=A[-1]*F[0]
ng=-1
while(ng+1<ok):
  c=ng+(ok-ng)//2
  sum=0
  for i in range(N):
    if(A[i] - c//F[i]>=0):
      sum += A[i] - c//F[i]
  if(sum<=K):
    ok=c
  else:
    ng=c
 
print(ok)

Buggy submission (verdict: Runtime Error):
a = int(input())
for i in range(9):
  if(a%(i+1) ==0 and a/(i+1)<=9):
    print("Yes") 
    exit()
print("No")
Problem p02879 (python)

Fixed submission:
x,y = map(int,input().split())
if(x<1 or x>9 or y<1 or y>9):
  print("-1")
else:
  print(x*y)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input.split())
if(x<1 or x>9 or y<1 or y>9):
  print("-1")
else:
  print(x*y)

Buggy submission (verdict: Runtime Error):
a,b = map(int,raw_input.split())
if(a<1 or a>9 or b<1 or b >9):
  print("-1")
else:
  print(a*b)

Buggy submission (verdict: Runtime Error):
a,b = map(int,raw_input.split())
if(a>9 or b >9):
  print("-1")
else:
  print(a*b)

Buggy submission (verdict: Runtime Error):
x, y = map(int, raw_input().split())
if(x>=1and x<=9) or (y>=1 and y<=9):
	print(x*y)
else:
	print("-1")
Problem p02880 (python)

Fixed submission:
x = int(input())
for i in range(1,10):
  for  j in range(1,10):
    f = 0
    if(i*j==x):
      	f = 1
      	print("Yes")
      	break
  if(f==1):
    break
  
if(f==0):
  print("No")

Buggy submission (verdict: Runtime Error):
x = int(input())
for i in range(1,10):
  for  j in range(1,10):
    f = 0
    if(i*j==x):
      	f = 1
      	print("Yes")
      	break
  if(f==1):
 	break
if(f==0):
  print("No")

Buggy submission (verdict: Runtime Error):
x = int(input())
for i in range(1,10):
  for  j in range(1,10):
    f = 0
    if(i*j==x):
      	f = 1
      	print("Yes")
      	break
  if(f==1):
 	break
 

 if(f==0):
  print("No")

Buggy submission (verdict: Runtime Error):
x = int(input())
for i in range(1,10):
  for  j in range(1,10):
    f = 0
    if(i*j==x):
      	f = 1
      	print("Yes")
      	break
  if(f==1):
 	break
 

if(f==0):
  print("No")

Buggy submission (verdict: Runtime Error):
x = int(input())
for i in range(1,10):
	for  j in range(1,10):
    	f = 0
    	if(i*j==x):
      		f = 1
      		print("Yes")
      		break
	if(f==1)
    break
 

if(f==0):
  print("No")
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):
a, b = map(int, input().split())
if a > 10 | b > 10:
 	print (-1)
	else:
  	print(a * b)
Problem p02879 (python)

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

Buggy submission (verdict: Runtime Error):
N =int(input())
num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in reversed(range(2, 10)):
    if N % i == 0 and int(N / i) in num:
        count = 1
        break
    else:
        count = 0
if count == 1:
    print("Yes")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N =int(input())
num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in reversed(range(1, 10)):
    if N % i == 0 and int(N / i) in num:
        count = 1
        break
    else:
        count = 0
if count == 1:
    print("Yes")
else:
    print("NO")
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()
if a < 3200:
    print("red")
elif a >= 3200:
    print(s)

Buggy submission (verdict: Runtime Error):
a = int(input())
s = input()
if a < 3200:
    print(red)
elif a >= 3200:
    print(s)
Problem p02879 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())

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

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

Fixed submission:
a = int(input())

if a % 2 == 1:
  b = a // 2 + 1
else:
  b = a / 2
  
print(b / a)

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

print((N + 1) // 2 / N)

Buggy submission (verdict: Runtime Error):
N = int(input())
for i in range(1, N+1)
if i % 2 == 1
	a += 1
 
output(N / a)
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print("red")

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

a = 0

for i in range(N):
         a += 1 / A[i]

print(1 / a)
Problem p02879 (python)

Fixed submission:
data = input().split()
A = int(data[0])
B = int(data[1])

if A < 10 and B < 10:
  print(str(A * B))
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
data = input(split())
A = int(data[0])
B = int(data[1])

if A < 10 and B < 10:
  print(str(A * B))
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
data = input(split())
A = int(data[0])
B = int(data[1])

if A < 10 and B < 10:
  print(A * B)
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
data = input(split())
A = data[0]
B = data[1]

if A < 10 and B < 10:
  print(A * B)
else:
  print('-1')
Problem p02987 (python)

Fixed submission:
S=input()
L=[]
for i in range(3):
    L.append(S.count(S[i]))
if sum(L)==6:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S=input()
L=[]
for i in range(3):
    L.apend(S.count(S[i]))
if sum(L)==6:
    print('Yes')
else:
    print('No')
Problem p03135 (python)

Fixed submission:
T,X=map(int,input().split())
print(T/X)

Buggy submission (verdict: Runtime Error):
print(int(input())/int(input()))

Buggy submission (verdict: Runtime Error):
print(int(input())/int(input())
Problem p03077 (python)

Fixed submission:
l = [int(input()) for _ in range(6)]
N = l[0]
l = l[1:]

print(-(-N//min(l))+4)

Buggy submission (verdict: Runtime Error):
l = [int(input()) for _ in range(6)]
N = l[0]
l = l[1:]

c = [0] * 5
for i in range(len(l)):
    if N > l[i]:
        c[i] = N - l[i]
        N = l[i]

res = 0
for i in range(5):
    if c[i] > 0:
        if i == 0:
            res += int(c[i]/l[i]) + 1
            m = c[i] - int(c[i]/l[i]) * l[i]
        else:
            c[i] = max(0,c[i] - l[i] * res)
            c[i] += m
            res += int((c[i])/l[i])
            m = c[i] - int((c[i])/l[i]) * l[i]
    

print(5+res)
Problem p03242 (python)

Fixed submission:
N = list(input())

r = []

for i in N:
    if i == '1':
        r.append('9')
    else:
        r.append('1')

print(''.join(r))

Buggy submission (verdict: Runtime Error):
import collections
 
n = int(input())
v = [int(i) for i in input().split()]
 
v1 = [v[i] for i in range(0,n,2)]
v2 = [v[i] for i in range(1,n,2)]
 
count1 = collections.Counter(v1).most_common(2)
count2 = collections.Counter(v2).most_common(2)

if max(count1.values()) != max(count2.values()):
    res = len(v1) - max(count1.values()) + len(v2) - max(count2.values())
    print(res)
else:
    if len(count1) == 1:
        print(len(v1))
    else:
        res1 = len(v1) - count1[0][1] + len(v2) - count2[1][1]
        res2 = len(v1) - count1[1][1] + len(v2) - count2[0][1]
        print(min(res1,res2))
Problem p02879 (python)

Fixed submission:
input = [int(i) for i in input().split()]
for i in input:
  if i > 9 or i < 1:
    print(-1)
    quit()
print(input[0] * input[1])

Buggy submission (verdict: Runtime Error):
input = int(input())
chars = [i for i in range(1,10)]
for n in chars:
  if input / n in chars:
    print("Yes")
    quit()
print("No")
Problem p02879 (python)

Fixed submission:
def kakezan():
    if (1 <= a <= 9) and (1 <= b <= 9):
        return a * b
    else:
        return -1

a, b = map(int, input().split())

print(kakezan())

Buggy submission (verdict: Runtime Error):
def kakezan():
    if (1 <= a <= 9) and (1 <= b <= 9):
        return a * b
    else:
        return -1

a = int(input())
b = int(input())

print(kakezan())
Problem p02879 (python)

Fixed submission:
a, b = map(int, input().split())
if 1 > a or a > 20:
    raise ValueError("invalid number")
    
if 1 > b or b > 20:
    raise ValueError("invalid number")

if a <= 0 or a >= 10:
    print("-1")
elif b <= 0 or b >= 10:
    print("-1")
else:
    print("{}".format(a*b))

Buggy submission (verdict: Runtime Error):
a, b = map(input().slice())
if a <= 0 or a >= 10:
  return -1
if b <= 0 or b >= 10:
  return -1
return a*b
Problem p02880 (python)

Fixed submission:
n = int(input())
if not isinstance(n, int):
    print("No")
else:
    ran = list(range(1,10))
    product = [x*y for x in ran for y in ran]
    print("Yes") if n in product else print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
if not isinstance(n, int):
    print("No")
else:
    ran = list(range(1,10))
	product = [x*y for x in ran for y in ran]
    print("Yes") if n in product else print("No")
Problem p02880 (python)

Fixed submission:
from sys import exit
 
n = int(input())
 
for i in range(1, 10):
	for j in range(1, 10):
		if (i*j == n):
			print('Yes')
			exit(0)

print('No')

Buggy submission (verdict: Runtime Error):
from sys import exit

n = int(input())

for i in range(1, 10):
	for j in range(1, 10):
      if (i*j == n):
        print('Yes')
        exit(0)

print('No')
Problem p02933 (python)

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

if n < 3200:
    print('red')
else:
    print(s)

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

if n < 3200:
	print("red")
else
	print("s")
Problem p02879 (python)

Fixed submission:
string = input()
 
v = string.split(" ")
 
if not len(v) == 2:
  print(-1)
 
a = int(v[0])
b = int(v[1])
 
if 0 < a < 10 and 0 < b < 10:
   print(a * b)
else: 
    print(-1)

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

v = string.split(" ")

if not len(v) == 2:
  return -1

a = int(v[0])
b = int(v[1])

if 0 < a < 10 and 0 < b < 10:
  return a * b

return -1
Problem p02879 (python)

Fixed submission:
import sys
 
input = sys.stdin.readline().split()
result = 1
for n in input:
  n=int(n)
  if result==-1:
    break
  if n<10:
    result = result * n
  else:
    result=-1
print(result)

Buggy submission (verdict: Runtime Error):
import sys
 
args = sys.argv
x = int(sys.argv[0])
y = int(sys.argv[1])
if x<10 and y<10:
	print(x*y)
else:
	print('-1')

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv
x = int(sys.argv[1])
y = int(sys.argv[2])
if x<10 and y<10:
	print(x*y)
else:
	print('-1')

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv

if(sys.argv[0]<10 && sys.argv[1]<10) {
	print(argv[0]*argv[1])
} else {
	print('-1')
}
Problem p02879 (python)

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

if 1 <= A and A <= 9 and 1 <= B and B <= 9:
  print(A * B)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
A , B = map(int, input().split())

if 1 <= A and A <= 9 and 1 <= B and B <= 9:
  print(A * B)
else:
  print(-1)
Problem p02879 (python)

Fixed submission:
num_0,num_1 = map(int,input().split())

if num_0<10 and num_1<10:
    print(num_0*num_1)
else:
    print(-1)

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

answer = ['No']*101

for i in range(1,10):
    for j in range(1,10):
        answer[i*j]='Yes'

print(answer[num])
Problem p02880 (python)

Fixed submission:
num = int(input())

answer = ['No']*101

for i in range(1,10):
    for j in range(1,10):
        answer[i*j]='Yes'

print(answer[num])

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

answer = ['No']*100

for i in range(1,10):
    for j in range(1,10):
        answer[i*j]='Yes'

print(answer[num])
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):
import numpy as np
N, train_max = map(int, input().split())
members = np.sort(list(map(int, input().split())))
members_sum = members.sum()
foods = np.sort(list(map(int, input().split())))[::-1]

inferenced_time_max = int(1e+6 * 1e+6)
inferenced_time_min = -1

while inferenced_time_max > inferenced_time_min + 1:
  inferenced_time = (inferenced_time_max + inferenced_time_min) // 2
  inferenced_members = np.minimum(members, inferenced_time // foods)
  if members_sum - inferenced_members.sum() <= train_max:
    inferenced_time_max = inferenced_time
  else:
    inferenced_time_min = inferenced_time

print(inferenced_time_max)
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 = int(input())
for i in range (1,10):
    if a % i == 0 and a/i < 10:
        print('Yes')
        exit()

print('No')

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a <= 9 and b < = 9:
    print(a*b)
else:
    print(-1)
Problem p02916 (python)

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

sum = 0

for i, ai in enumerate(a):
    sum += b[ai-1]
    try:
        if a[i] == a[i+1] -1:
            sum += c[ai-1]
    except:
        break
print(sum)

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

ans = 0
store = -5
for e, i in enumerate(a):
    bi = b[(e+2)%3]
    if i == store + 1:
        print(e)
        ans += c[i-2]
    ans += bi
    store = i
print(ans)
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):
i = input().split(" ")
m,n = i[0]*i[1]
if m <= 9 and m>=9 and n<=9 and n>=1:
  print(m*n)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
i = input().split(" ")
m,n = i[0]*i[1]
if m < 9 and n<9:
  print(m*n)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
i = input().split(" ")
mul = i[0]*i[1]
if mul < 81:
  print(mul)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
n,m = input().split(" ")
mul = n*m
if mul < 81:
  print(mul)
else:
  print(-1)