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

Fixed submission:
input_line=input().rstrip().split()
num1 = int(input_line[0])
num2 = int(input_line[1])
 
if (num1 > num2):
  print(str(num2)*num1)
elif (num1 < num2):
  print(str(num1)*num2)
elif (num1 == num2):
  print(str(num1)*num2)

Buggy submission (verdict: Runtime Error):
input_line=input().rstrip().slpit()
num1 = int(input_line[0])
num2 = int(input_line[1])

if (num1 > num2):
  print(str(num2)*num1)
elif (num1 < num2):
  print(str(num1)*num2)
elif (num1 == num2):
  print(str(num1)*num2)

Buggy submission (verdict: Runtime Error):
input_line=input().rstrip().slpit()
num1 = int(input_line[0])
num2 = int(input_line[1])
list1 = []
list2 = []
if (num1 > num2):
  for i in range(num1):
    list1.append(num2)
  list_num1 = join(map(str, list1))
  list_int_num1 = int(list_num1)
  print(list_num_num1)
elif (num1 < num2):
  for j in range(num2):
    list1.append(num1)
  list_num2 = join(map(str, list2))
  list_int_num2 = int(list_num2)
  print(list_num_num2)
elif (num1 == num2):
  for k in range(num2):
    list1.append(num1)
  list_num2 = join(map(str, list2))
  list_int_num2 = int(list_num2)
  print(list_num_num2)

Buggy submission (verdict: Runtime Error):
input_line=input().rstrip().slpit()
num1 = int(input_line[0])
num2 = int(input_line[1])
list1 = []
list2 = []
for i in range (num2):
  list1.append(num1)
list_num1 = join(map(str, list1))
list_int_num1 = int(list_num1)

for i in range (num1):
  list2.append(num2)
list_num2 = join(map(str, list2))
list_int_num2 = int(list_num2)

if (list_int_num1 > list_int_num2):
  print(list_int_num2)
elif(list_int_num1 < list_int_num2):
  print(list_int_num1)
elif(list_int_num1 == list_int_num2):
  print(list_int_num1)

Buggy submission (verdict: Runtime Error):
input_line=input().rstrip().slpit()
num1 = int(input_line[0])
num2 = int(input_line[1])
if (num1>num2):
  num = num2
elif(num1<num2):
  num = num1
elif(num1=num2):
  num = num1
count = num
for i in range(count):
  print(num)

Buggy submission (verdict: Runtime Error):
input_line=input().rstrip().slpit()
num1 = int(input_line[0])
num2 = int(input_line[1])
if (num1>num2):
  num = num2
elif(num<num2):
  num = num1
elif(num1=num2):
  num = num1
count = num
for i in range(count):
  print(num)
Problem p02897 (python)

Fixed submission:
K = int(input())

if K%2==0:
  a=K/2
else:
  a=(K//2)+1

     
print(a/K)

Buggy submission (verdict: Runtime Error):
K = int(input())
     
a = math.ceil(K/2)

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

a=math.ceil(n/2)

print(a/n)

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

a=math.ceil(n/2)

print(int(a))

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

a=math.ceil(n/2)

print(int(a))
Problem p03242 (python)

Fixed submission:
n=str(input())

print(n.translate(str.maketrans({'1': '9', '9': '1'})))

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

print(s.translate(str.maketrans({'9': '1', '1': '9'})))
Problem p03250 (python)

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

m=max(a,b,c)

print(int(9*m+a+b+c))

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

k=max(a,b,c)

print(int(9k+a+b+c))

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

k=max(a,b,c)

print(int(10k+a+b+c-k))
Problem p03631 (python)

Fixed submission:
n=int(input())

h=n // 100

t=(n-h*100) // 10

o=(n-h*100-t*10)

if h==o:
  print("Yes")
else:
  print("No")

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

h=n//100

t=(n-h*100)//10

o=(n-h*100-t*10)

if h=o:
  print("Yes")
else:
  print("No")
Problem p03803 (python)

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

if a==1:
  k=14
else:
  k=a
if b==1:
  m=14
else:
  m=b
  
if k>m:
  print("Alice")
elif k==m:
  print("Draw")
else:
  print("Bob")

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

if a==1:
  k=14
else:
  k=a
if b==1:
  m=14
else:
  m=b
  
if k>m:
  print("Alice")
elif k==m:
  print("Draw")
else k<m:
  print("Bob")

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

if a==1:
  a=14
else:
  a=a+0
if b==1:
  b=14
else:
  b=b+0
  
if a>b:
  print("Alice")
elif a==b:
  print("Draw")
else a<b:
  print("Bob")

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

if a==1:
  a=14
else:
  a=a
if b==1:
  b=14
else:
  b=b
  
if a>b:
  print("Alice")
elif a=b:
  print("Draw")
else a<b:
  print("Bob")
Problem p02790 (python)

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

print ( a*int(b) if int(a) <= int(b) else b*int(a))

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

print ( str(a)*b if a >= b else str(b)*a)
Problem p03036 (python)

Fixed submission:
A = list(map(int, input().split())) 
r = A[0]
D = A[1]
f = A[2]
 
 
count = 0
ans = 0
 
for i in range(10):
    f = (r*f) - D 
    count = count + 1
    print(f)
    if(count == 10):
        break

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

for i in range(10):
    ans = (r*f) - D 
    count = count + 1
    print(ans)
    if(count == 10):
        break

Buggy submission (verdict: Runtime Error):
r, D, f = map(int, input().split())
count = 0
ans = 0

for i in range(10):
    ans = (r*f) - D 
    count = count + 1
    print(ans)
    if(count = 10):
        break
Problem p03041 (python)

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

C = A[1]
D = A[0]
ans = ""

B = S[C-1]

#print(B)

if(B == "A"):
    B = "a"
elif(B == "B"):
    B = "b"
else:
    B = "c"

#print(B)

for i in range(D):
    if (i == C-1 ):
        ans = ans + B
        continue
    ans = (ans + S[i]) 

print(ans)

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

B = S[A[1]]

if(B == "A"):
    B = "a"
else if(B == "B"):
    B = "b"
else:
    B = "c"

S[A[1]] = B
print(S)
Problem p03075 (python)

Fixed submission:
import sys
import subprocess
import re
import datetime
import os

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

A = [a,b,c,d,e]
S = sorted(A)



V = (S[4] - S[0])
if V <= k:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
import sys
import subprocess
import re
import datetime
import os

A = []
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
k = int(input())

S = A.sorted()

V = (S[4] - S[0])
if V <= k:
    print("Yay!")
else:
    print(":(")
Problem p02832 (python)

Fixed submission:
### -*- coding: utf-8 -*-

N = int(input())
nums = list(map(int, input().split()))
 
hitting = 1
isHitOnce = False
for num in nums:
    if num == hitting:
        hitting += 1
        isHitOnce = True
 
if hitting == 1:
    print(-1)
else:
    print(N - (hitting - 1))

Buggy submission (verdict: Runtime Error):
### -*- coding: utf-8 -*-

splited = input().split("\n")
N = int(splited[0])
nums = list(map(int, splited[1].split()))

hitting = 1
isHitOnce = False
for num in nums:
    if num == hitting:
        hitting += 1
        isHitOnce = True

if hitting == 1:
    print(-1)
else:
    print(N - (hitting - 1))
Problem p02819 (python)

Fixed submission:
n = int(input())

def isprime(x):
    for i in range(2, int(x**0.5), 1):
        if x % i == 0:
            return False
    return True

i = n
while True:
    if isprime(i):
        break
    else:
        i += 1
print(i)

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

s = [2]
#for i in range(3, n, 2):
i = 3
while z < n:
    x = 1
    for j in s:
        if i % j == 0:
            x = 0
            break
    if x:
        z = i
        s.append(i)
    i += 2
print(z)
Problem p02881 (python)

Fixed submission:
import math
n = int(input())
s = int(math.sqrt(n))
a = 0
for i in range(s, 0, -1):
    if n % i == 0:
        a = i
        break
if a == 0:
    print(n - 1)
else:
    print(int((a - 1) + (n / a - 1)))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = int(math.sqrt(n))
a = 0
for i in range(s, 0, -1):
    if n % i == 0:
        a = i
        break
if a == 0:
    print(n - 1)
else:
    print(int((a - 1) + (n / a - 1)))
Problem p02912 (python)

Fixed submission:
# ABC141-D
import heapq
n, m = [int(x) for x in input().split()]
h = [-int(x) for x in input().split()]
heapq.heapify(h)
for i in range(m):
    x = heapq.heappop(h)
    heapq.heappush(h, -(-x//2))
z = 0
print(-sum(h))

Buggy submission (verdict: Runtime Error):
n, m = [int(x) for x in input().split()]
a = sorted([int(x) for x in input().split()], reverse=True)
i = 0
j = 1
l = len(a)
for _ in range(m):
    if n == 1:
        a[0] //=2
    else:
        if a[0] >= a[i] and a[0] >= a[j]:
            a[0] //= 2
        elif a[i] >= a[j]:
            a[i] //= 2
        else:
            a[j] //= 2
        if a[j] < a[j+1]:
            i = j
            j = j+1
print(sum(a))
Problem p02935 (python)

Fixed submission:
n=int(input())
v=sorted(list(map(float,input().split())))
z = v[0]
for i in range(1,n):
    z=(z+v[i])/2
print(z)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)
n=int(input())
v=sorted(list(map(float,input().split())))
x=-1
y=-1
z=10000.0
while True:
    for i in range(n-1):
        if v[i+1]-v[i] < z:
            x=i+1
            y=i
            z=v[i+1]-v[i]
    v[y]=(v[x]+v[y])/2
    del(v[x])
    v=sorted(v)
    n=len(v)
    if n==1:
        print(v[0])
        break

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1000)
n=int(input())
v=sorted(list(map(float,input().split())))
x=-1
y=-1
z=10000.0
while True:
    for i in range(n-1):
        if v[i+1]-v[i] < z:
            x=i+1
            y=i
            z=v[i+1]-v[i]
    v[y]=(v[x]+v[y])/2
    del(v[x])
    v=sorted(v)
    n=len(v)
    if n==1:
        print(v[0])
        break

Buggy submission (verdict: Runtime Error):
n=int(input())
v=sorted(list(map(float,input().split())))
x=-1
y=-1
z=10000.0
while True:
    for i in range(n-1):
        if v[i+1]-v[i] < z:
            x=i+1
            y=i
            z=v[i+1]-v[i]
    v[y]=(v[x]+v[y])/2
    del(v[x])
    v=sorted(v)
    n=len(v)
    if n==1:
        print(v[0])
        break

Buggy submission (verdict: Runtime Error):
n=int(input())
v=sorted(list(map(float,input().split())))
x=-1
y=-1
z=10000
for k in range(n-1):
    for i in range(n-1):
        if v[i+1]-v[i] < z:
            x=i+1
            y=i
            z=v[i+1]-v[i]
    v[y]=(v[x]+v[y])/2
    del(v[x])
    v=sorted(v)
    n=len(v)
print(v[0])

Buggy submission (verdict: Runtime Error):
n=int(input())
v=sorted(list(map(float,input().split())))
x=-1
y=-1
z=10000
for k in range(n-1):
    for i in range(n-1):
        if v[i+1]-v[i] < z:
            x=i+1
            y=i
            z=v[i+1]-v[i]
    v[y]=(v[x]+v[y])/2
    del(v[x])
    n=len(v)
print(v[0])
Problem p03038 (python)

Fixed submission:
N, M = (int(x) for x in input().split())
A = [int(x) for x in input().split()]
cb = [0] * M
for i in range(M):
    b, c = [int(x) for x in input().split()]
    cb[i] = [c, b]
list.sort(cb, reverse=True)

D = [0] * N
k = 0
for i in range(M):
    for j in range(cb[i][1]):
        if k < N:
            D[k] = cb[i][0]
            k += 1
        else:
            i = M
            break

S = 0
list.sort(A)
for i in range(N):
    if D[i] > A[i]:
        S += D[i]
    else:
        S += A[i]
print(S)

Buggy submission (verdict: Runtime Error):
N, M = (int(x) for x in input().split())
A = [int(x) for x in input().split()]
B = [0] * M
C = [0] * M
Bsum = 0
for i in range(M):
    B[i], C[i] = (int(x) for x in input().split())
    Bsum += B[i]
C_ = [0] * Bsum
k = 0
for i in sorted(range(len(C)), key=lambda k: C[k], reverse=True):
        for j in range(B[i]):
            C_[k] = C[i]
            k += 1
Ia = sorted(range(len(A)-1,-1,-1), key=lambda k: A[k])
S = 0
j = 0 # index for A
for i in range(min(Bsum, N)):
    if C_[i] > A[Ia[j]]:
        S += C_[i]
        j += 1
    else:
        S += A[Ia[j]]
        j += 1
    if j == N:
        break
for k in range(j, N):
    S += A[Ia[k]]

print(S)
Problem p03073 (python)

Fixed submission:
S = input()
p01 = 0
p10 = 0
p00 = 0
p11 = 0
for i in range(0, (len(S)//2 * 2), 2):
    if S[i:i+2] == '01':
        p01 += 1
    elif S[i:i+2] == '10':
        p10 += 1
    elif S[i:i+2] == '00':
        p00 += 1
    else:
        p11 += 1
#print(p01,p10,p00,p11)
c = 0
if (p01 == 0) and (p10 == 0):
    c = len(S) // 2
elif p01 >= p10:
    c = p10 * 2 + p00 + p11
    if len(S) & 1:
        if S[-1] == S[-2]:
            c += 1
else:
    c = p01 * 2 + p00 + p11
    if len(S) & 1:
        if S[-1] == S[-2]:
            c += 1
print(c)

Buggy submission (verdict: Runtime Error):
#ABC124-C 別解
S = input()
c = 0
zo = 0
oz = 0
for i in range(0, len(S), 2):
    if S[i] == '0':
        oz += 1
    else:
        zo += 1
    if S[i+1] == '0':
        zo += 1
    else:
        oz += 1
if len(S) & 1:
    if S[-1] == '0':
        oz += 1
print(min(oz, zo))
Problem p03077 (python)

Fixed submission:
import math
N = int(input())
A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
print(math.ceil(N / min(A)) + 4)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
print(math.ceil(N / min(A)) * (mi + 1) + 4)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
mi = 0
mA = 1e18
for i in range(0,5):
    if (A[i] < mA):
        mA = A[i]
        mi = i
print(math.ceil(N / mA) * (mi + 1) + 4)

Buggy submission (verdict: Runtime Error):
from math import ceil
N = int(input())
A = [0] * 5
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
mi = 0
mA = 1e18
for i in range(0,5):
    if (A[i] < mA):
        mA = A[i]
        mi = i
print(math.ceil(N / mA) * (mi + 1) + 4)

Buggy submission (verdict: Runtime Error):
N = int(input())
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
mi = 0
mA = 1e16
for i in range(5):
    if (A[i] < mA):
        mA = A[i]
        mi = i
print((N // A[mi]) + (5 - mi) + mi)
Problem p03135 (python)

Fixed submission:
T, X = (int(x) for x in input().split())
print(T/X)

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

N, K = (int(x) for x in input().split())
A = np.array(list(int(x) for x in input().split()), dtype='uint64')

fmax = 0
for x in range(K+1):
    i = np.arange(N, dtype='uint64')
    fx = np.sum(np.bitwise_xor(A, i, dtype='uint64'), dtype='uint64')
    if fmax < fx:
        fmax = fx
print(fmax)
Problem p03272 (python)

Fixed submission:
N, i = map(int, input().split())
print(N - i + 1)

Buggy submission (verdict: Runtime Error):
N, i = map(int(x), input().split())
print(i - N + 1)
Problem p03013 (python)

Fixed submission:
n,m=map(int,input().split()) 
lista=[]
for i in range(m): 
	a=int(input())
	lista.append(a)

ans=1


def fb(num):
    """num番目のフィボナッチ数を返す
    """
    a, b = 1, 1
    for i in range(num):
        a, b = a + b, a
    return b
    
#print(fb(3))

if m==0:
	ans=ans*fb(n)
	
else:
	for i in range(m-1):
		if (lista[i]+1==lista[i+1])&(m>=2):
			ans=0
  	
  	
	else:
		lista.append(n)
		if lista[0]!=1:
				ans=ans*(fb(lista[0]-1))
				for i in range(1,m):
						ans=ans*(fb(lista[i]-lista[i-1]-2))
					
		 
					
		if lista[0]==1:
				for i in range(1,m):
						ans=ans*(fb(lista[i]-lista[i-1]-2))
					
		
		ans= ans*(fb(lista[m]-lista[m-1]-1))
		
print(ans%1000000007)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split()) 
lista=[]
for i in range(m): 
	a=int(input())
	lista.append(a)

ans=1


def fb(num):
    """num番目のフィボナッチ数を返す
    """
    a, b = 1, 1
    for i in range(num):
        a, b = a + b, a
    return b
    
#print(fb(3))

if m==0:
	ans=ans*fb(n)
	
else:
	for i in range(m-1):
		if (lista[i]+1==lista[i+1])&(m>=2):
			ans=0
  	
  	
		else:
			lista.append(n)
			if lista[0]!=1:
					ans=ans*(fb(lista[0]-1))
					for i in range(1,m):
							ans=ans*(fb(lista[i]-lista[i-1]-2))
					
		 
					
			if lista[0]==1:
					for i in range(1,m):
							ans=ans*(fb(lista[i]-lista[i-1]-2))
					
		
	ans= ans*(fb(lista[m]-lista[m-1]-1))
		
print(ans%1000000007)
Problem p02879 (python)

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

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

Fixed submission:
lst = []
for i in range(1,10):
  for j in range(1,10):
    lst.append(i*j)

N = int(input())
if N in lst:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
lst = []
for i in range(10):
  for j in range(10):
    lst.append(i*j)

N = int(input())
if N in lst:
  print(Yes)
else:
  print(No)
Problem p02987 (python)

Fixed submission:
w=input()
s=list(set(list(w)))

if len(s) == 2 and w.count(s[0]) == 2:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
w=input()
s=list(set(list(w)))

if len(s) = 2 and w.count(s[0]) = 2:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
w=input()
s=set(list(w))

if len(s) = 2 and w.count(s[0]) = 2:
  print("Yes")
else:
  print("No")
Problem p03011 (python)

Fixed submission:
p,q,r = map(int,input().split())    
lst = [p,q,r]

A = lst[0] + lst[1]
B = lst[1] + lst[2]
C = lst[0] + lst[2]

print(min([A,B,C]))

Buggy submission (verdict: Runtime Error):
import numpy as np
lst = list(input().split())

num = len(lst)

A = lst[0] + lst[1]
B = lst[1] + lst[2]
C = lst[0] + lst[2]

print(np.min([A,B,C]))

Buggy submission (verdict: Runtime Error):
import numpy as np
lst = list(input().split())

num = len(lst)

A = lst[0] + lst[1]
B = lst[1] + lst[2]
C = lst[0] + lst[2]

print(np.min(np.array(A,B,C)))

Buggy submission (verdict: Runtime Error):
import numpy as np
lst = list(input().split())

num = len(lst)

A = lst[0] + lst[1]
B = lst[1] + lst[2]
C = lst[0] + lst[2]

print(min(np.array(A,B,C)))
Problem p02832 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 0
tmp = 1

for i in range(n):
  if a[i] == tmp:
    tmp += 1
  else:
    ans += 1

if ans != 0 and tmp ==1:
  print(-1)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 0
tmp = 1

for i in range(n):
  if a[i] == tmp:
    tmp += 1
  else:
    ans += 1

if ans = 0:
  print(-1)
else:
  print(ans)
Problem p02790 (python)

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

a_array = []
for i in range(int(b)):
    a_array.append(a)
a_str = "".join(a_array)

b_array = []
for i in range(int(a)):
    b_array.append(b)
b_str = "".join(b_array)


if a_str < b_str:
    print(a_str)
elif b_str < a_str:
    print(b_str)
else:
    print(a_str)

Buggy submission (verdict: Runtime Error):
a, b = [input() for i in range(2)]
a_array = []
for i in range(int(b)):
    a_array.append(a)
a_str = "".join(a_array)

b_array = []
for i in range(int(a)):
    b_array.append(b)
b_str = "".join(b_array)


if a_str < b_str:
    print(a_str)
elif b_str < a_str:
    print(b_str)
else:
    print(a_str)
Problem p02831 (python)

Fixed submission:
import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

A,B = map(int, input().split())
print(lcm(A,B))

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

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

print(lcm(A, B))
Problem p02793 (python)

Fixed submission:
from fractions import gcd
import sys

if True:
    N, *A = map(int, sys.stdin.read().split())
else:
    N = int(input())
    A = list(map(int, input().split()))

a = 1
for v in A:
    a = a * v // gcd(a, v)

MOD = int(1e9) + 7
sum_ = 0
for v in A:
    sum_ += a // v

print(sum_ % MOD)

Buggy submission (verdict: Runtime Error):
import math

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

def lcm_(a, b):
    return (a * b) // math.gcd(a, b)

lcm = A[0]
for a in A[1:]:
    lcm = lcm_(lcm, a)

MOD = int(1e9) + 7
sum_ = 0
for a in A:
    sum_ += lcm // a
    sum_ %= MOD

print(sum_)

Buggy submission (verdict: Runtime Error):
import math

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

def lcm_(a, b):
    return (a * b) // math.gcd(a, b)

lcm = A[0]
for a in A[1:]:
    lcm = lcm_(lcm, a)

MOD = int(1e9) + 7
sum_ = 0
for a in A:
    sum_ += lcm // a
    sum_ %= MOD

print(sum_)

Buggy submission (verdict: Runtime Error):
import math

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

def lcm_(a, b): return (a * b) // math.gcd(a, b)

lcm = A[0]
for a in A[1:]:
    lcm = lcm_(lcm, a)

MOD = int(1e9) + 7
sum_ = 0
for a in A:
    sum_ += lcm // a
    sum_ %= MOD

print(sum_)
Problem p02833 (python)

Fixed submission:
def f(n):
    d, z = 10, 0
    while d <= n:
        z += n // d
        d *= 5
    return z

n = int(input())

ans = 0
if n % 2 == 0: # even                                                                                                                                   
    ans = f(n)
print(ans)

Buggy submission (verdict: Runtime Error):
def f(n):
    d = 10
    z = 0
    while d <= n:
        z += (n // d)
	    d = 5 * d
    return z

n = int(input())

if n % 1 == 1: # odd                                                                                                                                    
    print(0)
else: # even                                                                                                                                            
    ans = f(n)
    print(ans)
Problem p02832 (python)

Fixed submission:
N = int(input())
an = list(map(int, input().split()))
enable = 0

if not 1 in an:
  enable = 1
  
count = 0
block = 1
for i in range(N):
  if an[i] != block:
    count += 1
  else:
    block += 1
    
if enable == 1:    
  print(-1)
else:
  print(count)

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

if not 1 in an:
  print(-1)

count = 1
for i in an:
  if i == an[i]:
    count += 0
  elif i != an[i]:
    count += 1
print(count)
Problem p02790 (python)

Fixed submission:
def execute(key: int, base: str) -> str:
  s = ""
  for i in range(key):
    s += str(base)
  return s

a, b = input().split()
c = [execute(int(a), b), execute(int(b), a)]
print(sorted(c)[0])

Buggy submission (verdict: Runtime Error):
def execute(key: int, base: str) -> str:
  s = ""
  for i in range(key):
    s += str(base)
  return s

a, b = input().split()
c = [execute(a, b), execute(b, a)]
print(sorted(c)[0])
Problem p02790 (python)

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

print(str(sorted(i)[0]) * sorted(i)[1])

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

print(str(np.sort(i)[0]) * np.sort(i)[1])
Problem p02859 (python)

Fixed submission:
r = int(input())

print(r**2)

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

print(r**2)

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

return r^2
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 <= b and b <= 9:
  print(a*b)
else:
  print(-1
Problem p02831 (python)

Fixed submission:
if __name__ == "__main__":
    x,y = [int(x) for x in input().split()]
    if x < y:
        tmp = x
        x = y
        y = tmp
    a = x * y
    
    r = x % y;
    while(r!=0):
        x = y
        y = r
        r = x % y;
    
    print(int(a/y))

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

if __name__ == "__main__":
    x,y = [int(x) for x in input().split()]
    print(np.lcm(x,y))

Buggy submission (verdict: Runtime Error):
import math

if __name__ == "__main__":
    x,y = [int(x) for x in input().split()]
    print(x*y // math.gcd(x, y))