Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort()
red = p[-x:]
green = q[-y:]
ri, gi = 0, 0
for blank in r:
  if (red[ri]>green[gi] and gi<y) or (ri>=x and gi<y):
    if blank>green[gi]:
      green[gi] = blank
      gi += 1
  elif ri<x:
    if blank>red[ri]:
      red[ri] = blank
      ri += 1
print(sum(red)+sum(green))

Fixed submission:
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort()
top_red = p[-x:]
top_green = q[-y:]
final = top_red+top_green+r
final.sort()
print(sum(final[-(x+y):]))

Buggy python submission (verdict: Runtime Error):
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort()
red = p[-x:]
green = q[-y:]
ri, gi = 0, 0
for blank in r:
  if (red[ri]>green[gi] and gi<y) or (ri>=x and gi<y):
    if blank>green[gi]:
      green[gi] = blank
      gi += 1
  elif ri<x:
    if blank>red[ri]:
      red[ri] = r[bi]
      ri += 1
print(sum(red)+sum(green))

Fixed submission:
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort()
top_red = p[-x:]
top_green = q[-y:]
final = top_red+top_green+r
final.sort()
print(sum(final[-(x+y):]))

Buggy python submission (verdict: Runtime Error):
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort()
red = p[-x:]
green = q[-y:]
ri, gi = 0, 0
for blank in r:
  if (red[ri]>green[gi] and gi<y) or ri>=x:
    if blank>green[gi]:
      green[gi] = blank
      gi += 1
  elif ri<x:
    if blank>red[ri]:
      red[ri] = r[bi]
      ri += 1
print(sum(red)+sum(green))

Fixed submission:
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort()
top_red = p[-x:]
top_green = q[-y:]
final = top_red+top_green+r
final.sort()
print(sum(final[-(x+y):]))
Buggy python submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
friendships = [[] for _ in range(n)]
for _ in range(m):
  a, b = map(int, input().split())
  friendships[a-1].append(b-1)
  friendships[b-1].append(a-1)
blockships = [[] for _ in range(n)]
for _ in range(k):
  c, d = map(int, input().split())
  blockships[c-1].append(d-1)
  blockships[d-1].append(c-1)
# assign users (id) for connected component, according to friendships
# also increment a counter for size of each component
component_id = [-1]*n
component_size = dict()
def search(node, parent_id):
  if component_id[node] != -1:
    return
  component_id[node] = parent_id
  component_size[parent_id] = component_size.get(parent_id, 0) + 1
  for other in friendships[node]:
    search(other, parent_id)
for initial_node in range(n):
  search(initial_node, initial_node)
# calculate number of suggestions for each node
for node in range(n):
  suggestions = 0
  current_id = component_id[node]
  suggestions += component_size[current_id] - 1
  suggestions -= len(friendships[node])
  suggestions -= sum(int(component_id[other] == current_id) for other in blockships[node])
  print(suggestions, end=" ")

Fixed submission:
n, m, k = map(int, input().split())
friendships = [[] for _ in range(n)]
for _ in range(m):
  a, b = map(int, input().split())
  friendships[a-1].append(b-1)
  friendships[b-1].append(a-1)
blockships = [[] for _ in range(n)]
for _ in range(k):
  c, d = map(int, input().split())
  blockships[c-1].append(d-1)
  blockships[d-1].append(c-1)
# assign users (id) for connected component, according to friendships
# also increment a counter for size of each component
component_id = [-1]*n
component_size = dict()
stack_to_visit = [(node, node) for node in range(n)]
while stack_to_visit:
  node, parent_id = stack_to_visit.pop()
  if component_id[node] != -1:
    continue
  component_id[node] = parent_id
  component_size[parent_id] = component_size.get(parent_id, 0) + 1
  for other in friendships[node]:
    stack_to_visit.append((other, parent_id))
# calculate number of suggestions for each node
for node in range(n):
  suggestions = 0
  current_id = component_id[node]
  suggestions += component_size[current_id] - 1
  suggestions -= len(friendships[node])
  suggestions -= sum(int(component_id[other] == current_id) for other in blockships[node])
  print(suggestions, end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
def check_all_distinct(A):
  already_seen_chars = list()
  for character in A:
    if character not in already_seen_chars:
      already_seen_chars.append(character)
    else: return "NO"
  return "YES"


if __name__ == "__main__":
  N = int(input())
  A = input().split()
  print(check_all_distinct(A))

Fixed submission:
N = int(input())
A = input().split()
if len(A) != len(set(A)):
  print("NO")
else:
  print("YES")

Buggy python submission (verdict: Runtime Error):
def check_all_distinct(A):
  already_seen_chars = list()
  for character in A:
    if character not in already_seen_chars:
      already_seen_chars.append(character)
      print(already_seen_chars)
    else: return "NO"
  return "YES"


if __name__ == "__main__":
  N = int(input())
  A = input().split()
  print(check_all_distinct(A))

Fixed submission:
N = int(input())
A = input().split()
if len(A) != len(set(A)):
  print("NO")
else:
  print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
def check_all_distinct(A):
  for idx, character in enumerate(A):
    if character in A[idx+1:]: return "NO"
  return "YES"


if __name__ == "__main__":
  N = int(input())
  A = input().split()
  dict_chars = dict()
  print(check_all_distinct(A))

Fixed submission:
N = int(input())
A = input().split()
if len(A) != len(set(A)):
  print("NO")
else:
  print("YES")
Buggy python submission (verdict: Runtime Error):
"""
if a monster is not attacked, it doesn't do anything, so we can
deal with each living monster as a separate problem that takes
a certain number of moves to kill it and all of its offspring.
when x is not 1,
num(x) = 2*num(floor(x/2))+1
(because it took one move to kill it, and there will be two offspring)
and when x is 2 or 3,
num(x) = 3
so we can do some recursion, or memoization, or tabulation
"""

from math import floor


def get_num_attacks(H):
  if H>3:
    return 2*get_num_attacks(floor(H/2))+1
  if H==2 or H==3:
    return 3
  if H==1
    return 1


if __name__ == "__main__":
  H = int(input())
  print(get_num_attacks(H))

Fixed submission:
"""
if a monster is not attacked, it doesn't do anything, so we can
deal with each living monster as a separate problem that takes
a certain number of moves to kill it and all of its offspring.
when x is not 1,
num(x) = 2*num(floor(x/2))+1
(because it took one move to kill it, and there will be two offspring)
and when x is 2 or 3,
num(x) = 3
so we can do some recursion, or memoization, or tabulation
"""

from math import floor


def get_num_attacks(H):
  if H>3:
    return 2*get_num_attacks(floor(H/2))+1
  if H==2 or H==3:
    return 3
  if H==1:
    return 1


if __name__ == "__main__":
  H = int(input())
  print(get_num_attacks(H))
Buggy python submission (verdict: Runtime Error):
def repeat_string(x, y):
    """Return the digit x repeated y times."""
    single_string = str(x)
    repeat_string = single_string*y
    return repeat_string


def compare_strings(a, b):
    if a>b: return(repeat_string(b, a))
    return(repeat_string(a, b))


if __name__ == "__main__":
    test1 = "4 3"
    test2 = "7 7"
    test = test2
    test_input = map(int, intput().split())
    print(compare_strings(*test_input))


Fixed submission:
def repeat_string(x, y):
    """Return the digit x repeated y times."""
    single_string = str(x)
    repeat_string = single_string*y
    return repeat_string


def compare_strings(a, b):
    if a>b: return(repeat_string(b, a))
    return(repeat_string(a, b))


if __name__ == "__main__":
    test1 = "4 3"
    test2 = "7 7"
    test = test2
    test_input = map(int, input().split())
    print(compare_strings(*test_input))
Buggy python submission (verdict: Runtime Error):
"""
can do it by subproblems. for a given i, the only information you need from the previous values
is the min value of previous values.
the first i=0 is guaranteed to satisfy the constraint. (counting from zero).
"""
import sys


def count_low_elements(N, P):
    count = 0
    min_so_far = sys.maxsize
    for val in P:
        if val <= min_so_far:
            count += 1
            min_so_far = val
    return count


if __name__ == "__main__":
    test1 = \
"""5
4 2 5 1 3"""
    test2 = \
"""4
4 3 2 1"""
    test3 = \
"""6
1 2 3 4 5 6"""
    test4 = \
"""8
5 7 4 2 6 8 1 3"""
    test5 = \
"""1
1"""
    test = test5
    # N, P_string = test.split("\n")
    # P = list(map(int, P_string.split()))
    N = int(input())
    P = list(map(int, input().split()))
    print(count_low_elements(N, P))
`

Fixed submission:
"""
can do it by subproblems. for a given i, the only information you need from the previous values
is the min value of previous values.
the first i=0 is guaranteed to satisfy the constraint. (counting from zero).
"""
import sys


def count_low_elements(N, P):
    count = 0
    min_so_far = sys.maxsize
    for val in P:
        if val <= min_so_far:
            count += 1
            min_so_far = val
    return count


if __name__ == "__main__":
    test1 = \
"""5
4 2 5 1 3"""
    test2 = \
"""4
4 3 2 1"""
    test3 = \
"""6
1 2 3 4 5 6"""
    test4 = \
"""8
5 7 4 2 6 8 1 3"""
    test5 = \
"""1
1"""
    test = test5
    # N, P_string = test.split("\n")
    # P = list(map(int, P_string.split()))
    N = int(input())
    P = list(map(int, input().split()))
    print(count_low_elements(N, P))
Buggy python submission (verdict: Runtime Error):
import queue
from itertools import product

H, W = map(int, input().split())
road_grid = [row for row in input()]

# for each start point, find the furthest travellable point
# then return largest path length of all these
# ps y is down, x is right
furthest_so_far = -1
for y_init, x_init in product(range(H), range(W)):
    if road_grid[y_init][x_init] == "#": continue
    boundary = queue.Queue()
    boundary.put((y_init, x_init))
    steps_taken = [[-1]*W for _ in range(H)]
    steps_taken[y_init][x_init] = 0
    while not boundary.empty():
        y, x = boundary.get()
        neighbours = [(y+1, x), (y, x+1), (y-1, x), (y, x-1)]
        for (new_y, new_x) in neighbours:
            if (0 <= new_y < H and 0 <= new_x < W
                and steps_taken[new_y][new_x] == -1 and road_grid[new_y][new_x] == "."):
                steps_taken[new_y][new_x] = steps_taken[y][x] + 1
                boundary.put((new_y, new_x))
    furthest_so_far = max(furthest_so_far, max(max(steps_taken)))
print(furthest_so_far)


Fixed submission:
x = input()
print(chr(ord(x)+1))
Buggy python submission (verdict: Runtime Error):
import queue
from itertools import product

test_lines = test_input.split("\n")
H, W = map(int, test_lines.pop(0).split())
road_grid = [row for row in test_lines]

# for each start point, find the furthest travellable point
# then return largest path length of all these
# ps y is down, x is right
furthest_so_far = -1
for y_init, x_init in product(range(H), range(W)):
    if road_grid[y_init][x_init] == "#": continue
    boundary = queue.Queue()
    boundary.put((y_init, x_init))
    steps_taken = [[-1]*W for _ in range(H)]
    steps_taken[y_init][x_init] = 0
    while not boundary.empty():
        y, x = boundary.get()
        neighbours = [(y+1, x), (y, x+1), (y-1, x), (y, x-1)]
        for (new_y, new_x) in neighbours:
            if (0 <= new_y < H and 0 <= new_x < W
                and steps_taken[new_y][new_x] == -1 and road_grid[new_y][new_x] == "."):
                steps_taken[new_y][new_x] = steps_taken[y][x] + 1
                boundary.put((new_y, new_x))
    furthest_so_far = max(furthest_so_far, max(max(steps_taken)))
print(furthest_so_far)


Fixed submission:
from itertools import product
import queue
 
H, W = map(int, input().split())
road_grid = list()
for _ in range(H):
  road_grid.append(input())

# for each start point, find the furthest travellable point
# then return largest path length of all these
# ps y is down, x is right
furthest_so_far = -1
for y_init, x_init in product(range(H), range(W)):
    if road_grid[y_init][x_init] == "#": continue
    boundary = queue.Queue()
    boundary.put((y_init, x_init))
    steps_taken = [[-1]*W for _ in range(H)]
    steps_taken[y_init][x_init] = 0
    while not boundary.empty():
        y, x = boundary.get()
        neighbours = [(y+1, x), (y, x+1), (y-1, x), (y, x-1)]
        for (new_y, new_x) in neighbours:
            if (0 <= new_y < H and 0 <= new_x < W
                and steps_taken[new_y][new_x] == -1 and road_grid[new_y][new_x] == "."):
                steps_taken[new_y][new_x] = steps_taken[y][x] + 1
                boundary.put((new_y, new_x))
    furthest_here = max(max(row) for row in steps_taken)
    furthest_so_far = max(furthest_so_far, furthest_here)
print(furthest_so_far)
Buggy python submission (verdict: Runtime Error):
# the uppercase letters are encoded as 65 to 90
# I want to put A as 0, so Z is 25

def letter_to_int(letter):
    return ord(letter)-65


def int_to_letter(encoded_value):
    return chr(encoded_value+65)


def shift_string(N, string):
    shifted_string = ""
    for char in string:
        encoding = letter_to_int(char)
        # mod ensures it wraps around, eg N=3 sends Z to C
        shifted = (encoding+N)%26
        decoded_to_letter = int_to_letter(shifted)
        shifted_string = shifted_string + decoded_to_letter
    return shifted_string


if __name__ == "__main__":
    test1 = \
"""2
ABCXYZ"""
    test2 = \
"""0
ABCXYZ"""
    test3 = \
"""13
ABCDEFGHIJKLMNOPQRSTUVWXYZ"""
    various_tests = [test1, test2, test3]
"""    for test in various_tests:
        lines = test.split("\n")
        N = int(lines[0])
        string = lines[1]
        print(shift_string(N, string))"""
    N = int(input())
    string = input()
    print(shift_string(N, string))

Fixed submission:
# the uppercase letters are encoded as 65 to 90
# I want to put A as 0, so Z is 25

def letter_to_int(letter):
    return ord(letter)-65


def int_to_letter(encoded_value):
    return chr(encoded_value+65)


def shift_string(N, string):
    shifted_string = ""
    for char in string:
        encoding = letter_to_int(char)
        # mod ensures it wraps around, eg N=3 sends Z to C
        shifted = (encoding+N)%26
        decoded_to_letter = int_to_letter(shifted)
        shifted_string = shifted_string + decoded_to_letter
    return shifted_string


if __name__ == "__main__":
    test1 = \
"""2
ABCXYZ"""
    test2 = \
"""0
ABCXYZ"""
    test3 = \
"""13
ABCDEFGHIJKLMNOPQRSTUVWXYZ"""
    various_tests = [test1, test2, test3]
    """for test in various_tests:
        lines = test.split("\n")
        N = int(lines[0])
        string = lines[1]
        print(shift_string(N, string))"""
    N = int(input())
    string = input()
    print(shift_string(N, string))
Buggy python submission (verdict: Runtime Error):
a,b,c=(int(x) for x in input().split())

count7=0

if a==7:
    count7=count7+1
if b==7:
    count7=count7+1
if c==7:
    count7=count7+1

if count7==1:
    print("YES")
else:
    print("NO")


Fixed submission:
a,b,c=(int(x) for x in input().split())

count7=0

if a==7:
    count7=count7+1
if b==7:
    count7=count7+1
if c==7:
    count7=count7+1

if count7==1:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
a,b,c=(int(x) for x in input().split())

count7=0

if a==7:
    count7=count7+1
if b==7:
    count7=count7+1
if c==7:
    count7=count7+1

if count7==1:
    print("YES")
else:
    print("NO")


Fixed submission:
a,b,c=(int(x) for x in input().split())

count7=0

if a==7:
    count7=count7+1
if b==7:
    count7=count7+1
if c==7:
    count7=count7+1

if count7==1:
    print("YES")
else:
    print("NO")

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

count7=0

if a==7:
    count7=count7+1
if b==7:
    count7=count7+1
if c==7:
    count7=count7+1

if count7==1:
    print("YES")
else:
    print("NO")


Fixed submission:
a,b,c=(int(x) for x in input().split())

count7=0

if a==7:
    count7=count7+1
if b==7:
    count7=count7+1
if c==7:
    count7=count7+1

if count7==1:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = sorted(list(map(int, input().split())))
result = [A.count(i+1) for i in range(N)]

for r in result:
    print(r)


Fixed submission:
N = int(input())
A = sorted(list(map(int, input().split())))
least = 1
result = [0] * N
for a in A:
    result[a-1] += 1
    if a != least:
        least = a

for r in result:
    print(r)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = sorted(list(map(int, input().split())))
result = []

for i in range(N):
    n = i + 1
    result.append(A.count(n))

for r in result:
    print(r)


Fixed submission:
N = int(input())
A = sorted(list(map(int, input().split())))
least = 1
result = [0] * N
for a in A:
    result[a-1] += 1
    if a != least:
        least = a

for r in result:
    print(r)
Buggy python submission (verdict: Time Limit Exceeded):
import math


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


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


K = int(input())
data = [k+1 for k in range(K)]
result = []
for i, d_i in enumerate(data):
    for j, d_j in enumerate(data[i:]):
        for d_k in data[i+j:]:
            result.append([d_i, d_j, d_k])

s = 0
for r in result:
    r0, r1, r2 = r
    g = gcd(r2, gcd(r0, r1))
    if r0 == r1 == r2:
        s += g
    elif r0 != r1 and r1 != r2:
        s += g * 6
    else:
        s += g * 3

print(s)


Fixed submission:
import itertools
import math


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


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


K = int(input())
data = [k+1 for k in range(K)]
result = list(itertools.combinations_with_replacement(data, 3))

s = 0

for r in result:
    r0, r1, r2 = r
    g0 = gcd(r0, r1)
    g = gcd(g0, r2)
    if r0 == r1 == r2:
        s += g
    elif r0 != r1 and r1 != r2:
        s += g * 6
    else:
        s += g * 3

print(s)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())))
sum_a = sum(a)
if a[n-m] >= sum_a/(4*m):
    print('Yes')
else:
    print('No')

Fixed submission:
a, b, c = map(int, input().split())
tmp = b
b = a
a = tmp
tmp = c
c = a
a = tmp
print(a, b, c)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
# B - Sum of Three Integers

K, S = map(int, input().split())

count = 0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z == S:
                count += 1
print(count)


Fixed submission:
#!/usr/bin/env python3
# B - Sum of Three Integers

K, S = map(int, input().split())

count = 0
for x in range(K+1):
    for y in range(K+1):
        z = S-x-y
        if 0 <= z <= K:
            count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
k = int(input())
s = str(input())
e = len(s)

if k < int(len(s)):
  print(n[0:int(e-k)-1]+'.'*3)
else:
  print(s)

Fixed submission:
k = int(input())
s = str(input())
e = int(len(s))

if k < e:
  print(s[0:k]+'.'*3)
else:
  print(s)
Buggy python submission (verdict: Runtime Error):
A,B,C,K =  map(int,input().split())

count = 0

if K <= A:
    count += A
    print(count)

elif K <= A + B:
    count += A
    print (count)

else:
    count += 2*A + B - K
    print(count)


Fixed submission:
S =  list(input())
T =  list(input())
del T[-1]

if S == T:
    print('Yes')

else:
    print('No')
Buggy python submission (verdict: Runtime Error):
nt(input())
A , B = map(int,input().split())

if A == B:
    if A % K == 0:
        print('OK')
    else:
        print('NG')

else:
    for i in range(B-A):
        i += A
        if i % K == 0:
            print('OK')
            break

    else:
        print('NG')


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

if A == B:
    if A % K == 0:
        print('OK')

    elif B % K == 0:
        print('OK')

    else:
        print('NG')

else:
    for i in range(B-A+1):
        i += A
        if i % K == 0:
            print('OK')
            break

    else:
        print('NG')
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

if "ABC" in s:
  print(s.count("ABC")
else:
  print(0)

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

if "ABC" in s:
    print(s.count("ABC"))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
R = 3
C = 3
matrix = [] 
print("Enter the entries rowwise:") 
 
for i in range(R):         
    a =[] 
    for j in range(C):  
         a.append(int(input())) 
    matrix.append(a) 
  
# For printing the matrix 
for i in range(R): 
    for j in range(C): 
        print(matrix[i][j], end = " ") 
    print() 

i= int(input("Enter: "))
if i in matrix:
    print("Yes")
else:
    print("No")

Fixed submission:
row1 = list(map(int,input().split()))
row2 = list(map(int,input().split()))
row3 = list(map(int,input().split()))
n = int(input())
arr = []
for i in range(n):
    temp = int(input())
    arr.append(temp)
#
if row1[0] in arr and row1[1] in arr and row1[2] in arr or row2[0] in arr and row2[1] in arr and row2[2] in arr or row3[0] in arr and row3[1] in arr and row3[2] in arr:
    print("Yes")
    exit()
elif row1[0] in arr and row2[0] in arr and row3[0] in arr or row1[1] in arr and row2[1] in arr and row3[1] in arr or row1[2] in arr and row2[2] in arr and row3[2] in arr:
    print("Yes")
    exit()
elif row1[0] in arr and row2[1] in arr and row3[2] in arr or row1[2] in arr and row2[1] in arr and row3[0] in arr:
    print("Yes")
    exit()
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N, M = input().split()
print("Yes" if N == M else "No")

Fixed submission:
N, M = input().split()
print("Yes" if N == M else "No")

Buggy python submission (verdict: Runtime Error):
"Yes" if (N == M) else "No"

Fixed submission:
N, M = input().split()
print("Yes" if N == M else "No")
Buggy python submission (verdict: Runtime Error):
new_str, num, string = "", int(input()), input().split(" ")
for i in range(0, num):
    new_str += string[0][i] + string[1][i]
print(new_str)

Fixed submission:
new_str, num, string = "", int(input()), input().split(" ")
for x in range(0, num):
    new_str += string[0][x] + string[1][x]
print(new_str)
Buggy python submission (verdict: Runtime Error):
num, bricks, count, smash = int(input()), [int(x) for x in input().split(" ")], 1, 0
for x in bricks:
    if count == x: count += 1
    else: smash += 1
print(smash if smash != len(bricks) else 0 if len(bricks) == 1 else -1)

Fixed submission:
def gcd(a, b):
    return b if a == 0 else gcd(b%a, a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))

Buggy python submission (verdict: Runtime Error):
num, bricks, count, smash = int(input()), [int(x) for x in input().split(" ")], 1, 0
for x in bricks:
    if count == x: count += 1
    else: smash += 1
print(smash if smash != len(bricks) else 0 if len(bricks) == 1 else -1)

Fixed submission:
def gcd(a, b):
    return b if a == 0 else gcd(b%a, a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))

Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    return b if a == 0 else gcd(b%a, a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))

Fixed submission:
def gcd(a, b):
    return b if a == 0 else gcd(b%a, a)
num = [int(x) for x in input().split(" ")]
print(int(num[0]*num[1]/gcd(num[0], num[1])))