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

Fixed submission:
n, m = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(m)]

u = [-1] * (n + 1)

def find(v):
    if u[v] < 0:
        return v
    else:
        return find(u[v])

total = n * (n - 1) // 2
ans = [total]

for a, b in reversed(ab[1:]):
    af = find(a)
    bf = find(b)
    af, bf =sorted([af, bf])
    if af != bf:
        total -= u[af] * u[bf]
        u[af] += u[bf]
        u[bf] = af
    ans.append(total)

for a in reversed(ans):
    print(a)

Buggy submission (verdict: Runtime Error):
def find(x):
  if P[x] < 0:
    return x
  else:
    return find(P[x])

N, M, *X = map(int,open(0).read().split())
P = [-1] * (N + 1)
S = N * (N - 1) // 2
r = [S]

while X:
  b, a = find(X.pop()), find(X.pop())
  if a != b:
    S -= P[a] * P[b]
    P[a] += P[b]
    P[b] = a
  r.append(S)

r.pop()
print(*reversed(r), sep='\n')

Buggy submission (verdict: Runtime Error):
def find(x):
  if P[x] < 0:
    return x
  else:
    return P[x]

N, M, *X = map(int,open(0).read().split())
P = [-1] * (N + 1)
S = N * (N - 1) // 2
r = [S]

while X:
  b, a = find(X.pop()), find(X.pop())
  if a != b:
    S -= P[a] * P[b]
    if P[a] > P[b]:
      a, b = b, a
    P[a] += P[b]
    P[b] = a
  r.append(S)

r.pop()
print(*reversed(r), sep='\n')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(m)]

u = [-1] * (n + 1)

def find(v):
    if u[v] < 0:
        return v
    else:
        return find(u[v])

total = n * (n - 1) // 2
ans = [total]

for a, b in reversed(ab):
    af = find(a)
    bf = find(b)
    if af != bf:
        total -= u[af] * u[bf]
        u[af] += u[bf]
        u[bf] = af
    ans.append(total)

for a in reversed(ans[:-1]):
  print(a)
Problem p03634 (python)

Fixed submission:
from collections import deque

N = int(input())
ABC = [list(map(int, input().split())) for _ in range(N - 1)]
Q, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(Q)]

G = [[] * N for _ in range(N)]
for a, b, c in ABC:
  G[a - 1].append((b - 1, c))
  G[b - 1].append((a - 1, c))

D = [-1] * N
D[K - 1] = 0

q = deque()
q.append(K - 1)
while q:
  n = q.popleft()
  for i, c in G[n]:
    if D[i] < 0:
      q.append(i)
      D[i] = D[n] + c

for x, y in XY:
  print(D[x - 1] + D[y - 1])

Buggy submission (verdict: Runtime Error):
N = int(input())
ABC = [list(map(int, input().split())) for _ in range(N - 1)]
Q, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(Q)]

G = [[] * N for _ in range(N)]
for a, b, c in ABC:
  G[a - 1].append((b - 1, c))
  G[b - 1].append((a - 1, c))

D = [-1] * N

def dfs(v, d):
  D[v] = d
  for i, c in G[v]:
    if D[i] < 0:
      dfs(i, d + c)

dfs(K - 1, 0)

for x, y in XY:
  print(D[x - 1] + D[y - 1])

Buggy submission (verdict: Runtime Error):
N = int(input())
ABC = [list(map(int, input().split())) for _ in range(N - 1)]
Q, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(Q)]

G = [[] * N for _ in range(N)]
for a, b, c in ABC:
  G[a - 1].append((b - 1, c))
  G[b - 1].append((a - 1, c))

D = [-1] * N

def dfs(v, p, d):
  D[v] = d
  for i, c in G[v]:
    if D[i] < 0:
      if i == p:
        continue
      dfs(i, v, d + c)

dfs(K - 1, -1, 0)

for x, y in XY:
  print(D[x - 1] + D[y - 1])
Problem p03728 (python)

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

if N == 1:
    print(0)
    exit()

Pi = [0] * (N + 1)
for i, n in enumerate(P, 1):
    Pi[n] = i

T = [0] * N
f = [0] * N

if Pi[N] > Pi[N - 1]:
    T[N - 1] = 0
    f[N - 1] = N - 1
else:
    T[N - 1] = 1
    f[N - 1] = N

for i in range(N - 2, 0, -1):
    if T[i + 1] == 0:
        i_i = Pi[i]
        i_ii = Pi[i + 1]
        if i_ii > i_i:
            T[i] = T[i + 1]
            f[i] = f[i + 1]
        else:
            T[i] = T[i + 1] + 1
            f[i] = i + 1
    else:
        i_f = Pi[f[i + 1]]
        i_i = Pi[i]
        i_ii = Pi[i + 1]
        if i_f < i_i < i_ii or i_ii < i_f < i_i or i_i < i_ii < i_f:
            T[i] = T[i + 1]
            f[i] = f[i + 1]
        else:
            T[i] = T[i + 1] + 1
            f[i] = i + 1

print(T[1])

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

Pi = [0] * (N + 1)
for i, n in enumerate(P, 1):
    Pi[n] = i

T = [0] * N
f = [0] * N

if Pi[N] > Pi[N - 1]:
    T[N - 1] = 0
    f[N - 1] = N - 1
else:
    T[N - 1] = 1
    f[N - 1] = N

for i in range(N - 2, 0, -1):
    if T[i + 1] == 0:
        i_i = Pi[i]
        i_ii = Pi[i + 1]
        if i_ii > i_i:
            T[i] = T[i + 1]
            f[i] = f[i + 1]
        else:
            T[i] = T[i + 1] + 1
            f[i] = i + 1
    else:
        i_f = Pi[f[i + 1]]
        i_i = Pi[i]
        i_ii = Pi[i + 1]
        if i_f < i_i < i_ii or i_ii < i_f < i_i or i_i < i_ii < i_f:
            T[i] = T[i + 1]
            f[i] = f[i + 1]
        else:
            T[i] = T[i + 1] + 1
            f[i] = i + 1

print(T[1])
Problem p02880 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
for i range(10):
    num = n % i
    if num != 0:
        print('No')
else:
    print('Yes')
Problem p02879 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=list(map(int,raw_input().split(' ')))
if(a>=1 and a<=9 and b>=1 and b<=9):
  print(a*b)
else:
  print(-1)
Problem p02881 (python)

Fixed submission:
n=int(input())
ans=n-1
e=int(n**(1/2))+1
for i in range(2,e):
  if(n%i==0):
    ans=min(ans,i+int(n/i)-2)
print(ans)

Buggy submission (verdict: Runtime Error):
import math.sqrt as sqrt
n=int(input())
ans=1+n
if(n%2==0):
  ans=2+int(n/2)
  
for i in range(3,int(sqrt(n))+1,2):
  if(n%i==0):
    ans=min(ans,(i+int(n/i)))
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=1+n
if(n%2==0):
  ans=2+int(n/2)
  
for i in range(3,int(sqrt(n))+1,2):
  if(n%i==0):
    ans=min(ans,(i+int(n/i)))
print(ans)
Problem p02879 (python)

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

Buggy submission (verdict: Runtime Error):
A,B=map(int,input(),split())
if 1<=A<=9:
        if 1<=B<=9:
            print(A*B)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input(),split())
if 1<=A<=9:
        if 1<=B<=9:
        print(A*B)
else print(-1)

Buggy submission (verdict: Runtime Error):
a=A
b=B
if 1<=a<=9:
  if 1<=b<=9:
    print(a*b)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
if 1<=A<=9:
  if 1<=B<=9:
    print(A*B)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
if 1<=A<=9:
  if 1<=B<=9:
    print(A*B)
  elif 10<=B<=20:
    print(-1)
elif 10<=A<=20:
  print(-1)

Buggy submission (verdict: Runtime Error):
if 1<=A<=9:
  if 1<=B<=9:
    C=A*B
    print(C)
  else print(-1)
else print(-1)

Buggy submission (verdict: Runtime Error):
ygfgfuh
Problem p02915 (python)

Fixed submission:
N=int(input())
print(N*N*N)

Buggy submission (verdict: Runtime Error):
N=input()
print(N*N*N)
Problem p02933 (python)

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

Buggy submission (verdict: Runtime Error):
a=int(input())
s=input()
if a=>3200:
  print(s)
else:
  print('red')

Buggy submission (verdict: Runtime Error):
a=int(input())
s=input()
if a=>3200:
  print('s')
else:
  print('red')
Problem p02881 (python)

Fixed submission:
n = int(input())
r = int(n**0.5)
revList = [i for i in range(r+1)]
revList = revList[1:]
revList.reverse()

for i in revList:
  if n % i == 0:
    res = int(n/i) + i - 2
    break
print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
r = int(n**0.5)
revList = [i for i in range(r)]
revList = revList[1:]
revList.reverse()

for i in revList:
  if n % i == 0:
    res = int(n/i) + i - 2
    break
print(res)
Problem p02879 (python)

Fixed submission:
a, b = [int(i) for i in input().split(" ")]

if (a < 10 and a > 0) and (b < 10 and b > 0):
    print(a * b)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
def func():
    a = int(input())
    for i in range(1, 10):
        for n in range(1, 10):
            if a == i * n:
                print("Yes")
                return
    print("No")
 
 
func()
Problem p02879 (python)

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

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

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split())) # 消化コスト
F = list(map(int, input().split())) # 食べにくさ
 
import math
import numpy as np
 
A.sort(reverse = True)
F.sort()
 
arrA = np.array(A)
arrF = np.array(F)
 
range_max = max(arrA * arrF) + 1
range_min = max(min((A-K) * B), 0)
 
my_lambda = lambda x: sum([max(math.ceil(A[i] - x/F[i]), 0) for i in range(0, N)]) <= K
 
my_range = range(range_min, range_max)
 
def node(lst):
    len_lst = len(lst)
    if len_lst % 2 == 0:
        mid_idx = int(len_lst/2)
    else:
        mid_idx = int(math.floor(len_lst/2))
 
    if len_lst == 1:
        print(lst[mid_idx])
        return()
 
    if my_lambda(lst[mid_idx-1]) == True:
        left = lst[0:mid_idx]
        node(left)
    else:
        right = lst[mid_idx:]
        node(right)
node(my_range)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split())) # 消化コスト
F = list(map(int, input().split())) # 食べにくさ
 
import math
import numpy
 
A.sort(reverse = True)
F.sort()

arrA = np.array(A)
arrF = np.array(F)

range_max = max(arrA * arrF) + 1
range_min = max(min((A-K) * B), 0)
 
my_lambda = lambda x: sum([max(math.ceil(A[i] - x/F[i]), 0) for i in range(0, N)]) <= K
 
my_range = range(range_min, range_max)
 
def node(lst):
    len_lst = len(lst)
    if len_lst % 2 == 0:
        mid_idx = int(len_lst/2)
    else:
        mid_idx = int(math.floor(len_lst/2))
 
    if len_lst == 1:
        print(lst[mid_idx])
        return()
 
    if my_lambda(lst[mid_idx-1]) == True:
        left = lst[0:mid_idx]
        node(left)
    else:
        right = lst[mid_idx:]
        node(right)
node(my_range)
Problem p02881 (python)

Fixed submission:
import numpy as np

N = int(input())
N_sqrt = int(np.sqrt(N))+1
N_ = [i for i in range(2, N_sqrt) if N % i == 0]

if len(N_) == 0:
    print(N-1)
else:
    pair = [(i, int(N/i)) for i in N_]
    my_lambda = lambda x : sum(x)
    x = list(map(my_lambda, pair))
    print(min(x)-2)

Buggy submission (verdict: Runtime Error):
N = input()
N_sqrt = int(np.sqrt(N))+1
N_ = [i for i in range(2, N_sqrt) if N % i == 0]

if len(N_) == 0:
    print(N-1)
else:
    pair = [(i, int(N/i)) for i in N_]
    my_lambda = lambda x : sum(x)
    x = list(map(my_lambda, pair))
    print(min(x)-2)
Problem p02990 (python)

Fixed submission:
import math
n,k = map(int,input().split())

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) if n-r >= 0 else 0

for i in range(1,k+1):
    red = n - k
    blue = i
    print(combinations_count(red+1,blue)*combinations_count(k-1,i-1)%(10**9+7))

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

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1,k+1):
    red = n - k
    blue = i
    print(combinations_count(red+1,blue)*combinations_count(k-1,i-1)%(10**9+7))
Problem p03013 (python)

Fixed submission:
n,m = map(int,input().split())
a_list = [int(input()) for _ in range(m)]

dp = [1]*(n+1)

for a in a_list:
    dp[a] = 0

for i in range(2,n+1):
    if dp[i] != 0:
        dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%(10**9+7))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a_list = [int(input()) for _ in range(m)]
count = 0
def dfs(pos):
    global count
    if pos >= n-1:
        count += 1
        return True
    for i in [1,2]:
        if pos+i in a_list:
            pass
        else:
            dfs(pos+i)
    return True

dfs(0)
print(count%1000000007)
Problem p03107 (python)

Fixed submission:
import collections
s = list(input())
c = collections.Counter(s)
print(2*min(c['0'],c['1']))

Buggy submission (verdict: Runtime Error):
s = list(input())
s_len = len(s)
i = 0
while True:
    if len(s) <= 1:
        break
    if s[i] == s[i+1] and len(s)==2:
        break
    if s[i] != s[i+1]:
        del s[i:i+2]
        i = 0
    else:
        i += 1
print(s_len-len(s))
Problem p03127 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]

def func_gcd(a,b):
    if b == 0:
        return a
    else:
        return func_gcd(b,a%b)

if len(a) == 1:
    print(a[0])
else:
    res = func_gcd(a[0],a[1])
    for i in range(2,n):
        res = func_gcd(res,a[i])
    print(res)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
a = [int(i) for i in input().split()]

if len(a) == 1:
    print(a[0])
else:
    res = math.gcd(a[0],a[1])
    for i in range(2,n):
        res = math.gcd(res,a[i])
    print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = set([int(i) for i in input().split()])
if len(a) == 1:
    print(a[0])
else:
    list_a = set([max([mons%i for i in a]) for mons in a])
    list_b = set([min([m%i for i in list_a if i != m and i!=0]) for m in list_a])
    print(min([i for i in list_b if i != 0]))
Problem p02879 (python)

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

answer = 0
 
if a >= 10 or b >= 10:
  answer = -1
else:
  answer = a * b
  
print(answer)

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

if a >= 10 or b >= 10:
  answer = -1
else:
  answer = a * b
  
print(answer)
Problem p02935 (python)

Fixed submission:
n=int(input())
arr=list(map(int, input().split()))
while len(arr)>1:
  arr = sorted(arr)
  v1 = arr.pop(0)
  v2 = arr.pop(0)
  arr.append((v1 + v2) / 2)
print(arr[0])

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(map(int, input().split()))
while len(arr) > 1:
  arr = sorted(arr)
  v1 = arr.pop(0)
  v2 = arr.pop(0)
  arr.appned((v1 + v2) / 2)
print(arr[0])

Buggy submission (verdict: Runtime Error):
n = input()
arr = list(map(int, input().split()))
while len(arr) > 1:
  arr = sorted(arr)
  v1 = arr.pop(0)
  v2 = arr.pop(0)
  arr.appned((v1 + v2) / 2)
print(arr[0])
Problem p02951 (python)

Fixed submission:
a, b, c = map(int, input().split())
capacity = a - b
if c > capacity:
    answer = c - capacity
else:
    answer = 0
    
print(answer)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().solit())
capacity = a - b
answer = c - capacity
if answer < 0:
  answer = 0
print(answer)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().solit())
answer = c - (a- b)
print(answer)
Problem p02879 (python)

Fixed submission:
x,y = map(int, input().split())
if x>0 and x<10 and y>0 and y<10:
	print(x*y)
else:
	print(-1)

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

Fixed submission:
x = int(input())
for i in range(1,10,1):
    if x%i == 0 and x/i < 10 and x/i > 0:
        print("Yes")
        break
    if i == 9:
        print("No")

Buggy submission (verdict: Runtime Error):
x = input()
for i in range(1,10,1):
    if x%i == 0 and x/i < 10 and x/i > 0:
        print("Yes")
        break
    if i == 9:
        print("No")
Problem p02879 (python)

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

if a < 1 or a > 9:
    print(-1)
elif b < 1 or b > 9:
    print(-1)
else:
    print(a * b)

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

if a < 1 or a > 9:
    return -1

if b < 1 or b > 9:
    return -1

return a * b

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

if a < 1 or a > 9:
    return -1

if b < 1 or b > 9;
    return -1

return a * b
Problem p02935 (python)

Fixed submission:
N = int(input())
vs = sorted(map(int, input().split(" ")), reverse=True)
 
r = [v * (0.5 ** (i + 1)) for i, v in enumerate(vs)]
r [-1] = r[-1] * 2
print(sum(r))

Buggy submission (verdict: Runtime Error):
N = int(input())
vs = sorted(map(int, input().split(" ")), reverse=True)

r = [v * (0.5 ** i) for i, v in enumerate(vs)]

return sum(r)
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):
answer = {
    "1":[1,2,3,4,5,6,7,8,9],
    "2":[2,4,6,8,10,12,14,16,18],
    "3":[3,6,9,12,15,18,21,24,27],
    "4":[4,8,12,16,20,24,28,32,36],
    "5":[5,10,15,20,25,30,35,40,45],
    "6":[6,12,18,24,30,36,42,48,54],
    "7":[7,14,21,28,35,42,49,56,63],
    "8":[8,16,24,32,40,48,56,64,72],
    "9":[9,18,27,36,45,54,63,72,81]
}

N = int(input())
a = 0
for value in answer.values():
  if N in value:
    a = 1

if a == 1:
	print("Yes")
else:
	print("No")
Problem p02880 (python)

Fixed submission:
answer = {
    "1":[1,2,3,4,5,6,7,8,9],
    "2":[2,4,6,8,10,12,14,16,18],
    "3":[3,6,9,12,15,18,21,24,27],
    "4":[4,8,12,16,20,24,28,32,36],
    "5":[5,10,15,20,25,30,35,40,45],
    "6":[6,12,18,24,30,36,42,48,54],
    "7":[7,14,21,28,35,42,49,56,63],
    "8":[8,16,24,32,40,48,56,64,72],
    "9":[9,18,27,36,45,54,63,72,81]
}

N = int(input())
a = 0
for value in answer.values():
  if N in value:
    a = 1

if a == 1:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
answer = {
    "1":[1,2,3,4,5,6,7,8,9],
    "2":[2,4,6,8,10,12,14,16,18],
    "3":[3,6,9,12,15,18,21,24,27],
    "4":[4,8,12,16,20,24,28,32,36],
    "5":[5,10,15,20,25,30,35,40,45],
    "6":[6,12,18,24,30,36,42,48,54],
    "7":[7,14,21,28,35,42,49,56,63],
    "8":[8,16,24,32,40,48,56,64,72],
    "9":[9,18,27,36,45,54,63,72,81]
}

N = int(input())
a = 0
for value in answer.values():
	if N in value:
    	a = 1

if a == 1:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
answer = {
    "1":[1,2,3,4,5,6,7,8,9],
    "2":[2,4,6,8,10,12,14,16,18],
    "3":[3,6,9,12,15,18,21,24,27],
    "4":[4,8,12,16,20,24,28,32,36],
    "5":[5,10,15,20,25,30,35,40,45],
    "6":[6,12,18,24,30,36,42,48,54],
    "7":[7,14,21,28,35,42,49,56,63],
    "8":[8,16,24,32,40,48,56,64,72],
    "9":[9,18,27,36,45,54,63,72,81]
}

N = int(input())
a = 0
for value in answer.values():
	if N in value:
    	a = 1

if a == 1:
	print("Yes")
else:
	print("No")
Problem p02897 (python)

Fixed submission:
n=int(input())
if n%2 == 0:
  print(1/2)
elif n==1:
  print(1)
else:
  print((int(n/2)+1)/n)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n % 2 == 0:
      print(1/2)
elif n == 1:
      print(1)
else:
      print((int(n/2)+ １／n))
Problem p02879 (python)

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

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

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

if (A >= 1 and A <= 9) and (B >= 1 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(%d % A*B)
  
else:
  print(-1)
Problem p02879 (python)

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

if a > 9 or b > 9:
	print("-1")
else:
	out = a * b
	print('{0}'.format(out))

Buggy submission (verdict: Runtime Error):
    a,b = map(int,input().split())
     
    if a > 9 or b > 9:
      print(-1)
    else:
      out = a * b
      print('{0}'.format(out))

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

if a > 9 or b > 9:
  print(-1)
else:
  out = a * b
  print('{0}'.format(out))
Problem p02880 (python)

Fixed submission:
def main():
	num = int(input())
	for i in range(1,10):
		q, mod = divmod(num, i)
		if mod == 0 and q < 10:
			return "Yes"

	return "No"
if __name__ == "__main__":
    print(main())

Buggy submission (verdict: Runtime Error):
def main(num):
    num = int(input())
    for i in range(1,10):
        q, mod = divmod(num, i)
        if mod == 0 and q < 10:
            return "Yes"

    return "No"
if __name__ == "__main__":
    print(main())

Buggy submission (verdict: Runtime Error):
    def main(num):
        num = int(input())
        for i in range(1,10):
            q, mod = divmod(num, i)
            if mod == 0 and q < 10:
                return "Yes"
     
        return "No"
    if __name__ == "__main__":
        result = main()
        print(result)

Buggy submission (verdict: Runtime Error):
    def main():
        num = int(input())
        for i in range(1,10):
            q, mod = divmod(num, i)
            if mod == 0 and q < 10:
                return "Yes"
     
        return "No"
    if __name__ == "__main__":
        print(main())

Buggy submission (verdict: Runtime Error):
def main(num):
    num = int(input())
    for i in range(1,10):
        q, mod = divmod(num, i)
        if mod == 0 and q < 10:
            return "Yes"

    return "No"
if __name__ == "__main__":
    print(main())

Buggy submission (verdict: Runtime Error):
num = int(input())
    for i in range(1,9):
        q, mod = divmod(num, i)
        if mod == 0 and 1 < q < 10:
            print("Yes")
            return

    print("No")

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

for i in range(1,9):
    q, mod = divmod(num, i)
    if q == 0 and 1 < q < 10:
        print("Yes")
        return
print("No")
Problem p02881 (python)

Fixed submission:
num = int(input())
minimam = 10**12
for i in range(1,10**6+1):
    q, mod = divmod(num, i)
    distance = q + i -2
    if mod == 0 and minimam > distance:
        minimam = distance
print(minimam)

Buggy submission (verdict: Runtime Error):
input_num = int(input())
num_sqrt = int(math.sqrt(input_num))

minimam = input_num
for i in range(num_sqrt+1,0,-1):
    q, mod = divmod(input_num, i)
    if mod == 0:
        distance = q + i -2
        if minimam > distance:
            minimam = distance
print(minimam)

Buggy submission (verdict: Runtime Error):
import math
def main1():
    input_num = int(input())
    num_sqrt = int(math.sqrt(input_num))

    minimam = input_num
    for i in range(num_sqrt+1,0,-1):
        q, mod = divmod(input_num, i)
        if mod == 0:
            distance = q + i -2
            if minimam > distance:
            minimam = distance
    print(minimam)
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())

B = int(input())

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

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

B = int(input())

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

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

B = int(input())

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

Fixed submission:
ab = input()
a, b = ab.split(" ")
A = int(a)
B = int(b)

if "0" in a or "0" in b or A > 9 or B > 9:
    print(-1)
else:
    print(A * B)

Buggy submission (verdict: Runtime Error):
ab = input()
a, b = ab.split(" ")
A = int(a)
B = int(b)

if "0" in a or "0" in b or a > 9 or b > 9:
    print(-1)
else:
    print(A * B)

Buggy submission (verdict: Runtime Error):
ab = inpout()
a, b = ab.split("")
A = int(a)
B = int(b)

if "0" in a or "0" in b:
	print(-1)
else:
	print(A * B)

Buggy submission (verdict: Runtime Error):
ab = inpout()
a, b = ab.split("")
A = int(a)
B = int(b)

if "0" in a or "0" in b:
	print(-1)
else
	print(A * B)
Problem p02879 (python)

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

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

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