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

Fixed submission:
n, m = map(int, input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]
res = True
for i in range(len(b)):
    if b[i] not in a[i]:
        res = False
        break

print('Yes' if res else 'No')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]
i,j = 0,0
start = []
while i<=n-m:
    if b[0] in a[i]:
        start.append(a[i].index(b[0]))
        j += 1
        for k in range(1,m):
            if b[k] in a[i+j]:
                start.append(a[i+j].index(b[k]))
                j += 1
                if not start[0] == start[j-1]:
                    start.clear()
                    j = 0
                break
            else:
                start.clear()
                j = 0
                break
    if len(start)==m:
        break
    i += 1
print('Yes' if len(start)>0 else 'No')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]
i,j = 0,0
start = []
while i<=n-m:
    if b[0] in a[i]:
        start.append(a[i].index(b[0]))
        j += 1
        for k in range(1,m):
            if b[k] in a[i+j]:
                start.append(a[i+j].index(b[k]))
                j += 1
            else:
                start.clear()
                j = 0
                break
            if not start[0] == start[j-1]:
                start.clear()
                j = 0
                break
    if len(start)==m:
        break
    i += 1
print('Yes' if len(start)>0 else 'No')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]
i,j = 0,0
start = []
while i<n-m:
    if b[0] in a[i]:
        start.append(a[i].index(b[0]))
        j += 1
        for k in range(1,m):
            if b[k] in a[i+j]:
                start.append(a[i+j].index(b[k]))
                j += 1
            else:
                start.clear()
                j = 0
                break
            if (not start[0] == start[j-1]):
                start.clear()
                j = 0
                break
    i += 1
print('Yes' if len(start)>0 else 'No')
Problem p03075 (python)

Fixed submission:
from functools import reduce

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    a = int(input().rstrip())
    b = int(input().rstrip())
    c = int(input().rstrip())
    d = int(input().rstrip())
    e = int(input().rstrip())
    k = int(input().rstrip())
    if abs(a - b) >k or abs(a - c) >k  or abs(a - d) >k or abs(a - e) >k or abs(b - c) >k or abs(b - d) >k  or abs(b - e) >k or abs(c - d) >k or abs(c - e) >k or abs(d - e) >k:
        print(':(')
    else:
        print('Yay!')
        
if __name__ == '__main__':
    main()

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

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]
    ans = []
    X, Y, Z, K = (int(_) for _ in input().split())
    A = list(int(_) for _ in input().split())
    A.sort()
    B = list(int(_) for _ in input().split())
    B.sort()
    C = list(int(_) for _ in input().split())
    C.sort()
    for a in A:
        for b in B:
            for i in range(min(len(C),3001)):
                ans.append(a + b + C[i])
    ans.sort()
    ans = ans[::-1]
    ans = ans[:K]
    print('\n'.join(map(str,ans)))

if __name__ == '__main__':
    main()
Problem p03077 (python)

Fixed submission:
from functools import reduce
import math

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N = int(input().rstrip())
    S = []
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    S.append(int(input().rstrip()))
    min_s = min(S)
    if(N % min_s == 0):
        print(N//min_s -1 + 5)
    else:
        print(N//min_s + 5)
    
if __name__ == '__main__':
    main()

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

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]
    ans = []
    X, Y, Z, K = (int(_) for _ in input().split())
    A = list(int(_) for _ in input().split())
    A.sort()
    B = list(int(_) for _ in input().split())
    B.sort()
    C = list(int(_) for _ in input().split())
    C.sort()
    for a in A:
        for b in B:
            for i in range(min(len(C),3001)):
                ans.append(a + b + C[i])
    ans.sort()
    ans = ans[::-1]
    ans = ans[:K]
    print('\n'.join(map(str,ans)))

if __name__ == '__main__':
    main()
Problem p03805 (python)

Fixed submission:
from functools import reduce
import math
import itertools

def main():
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N,M = (int(_) for _ in input().split())
    a = []
    b = []
    for i in range(M):
        c, d = (int(_) for _ in input().split())
        a.append(c)
        b.append(d)
    l = list(_ for _ in range(2,N+1))
    d = []
    for elem in itertools.permutations(l,len(l)):
        elem = list(elem)
        elem.insert(0,1)
        d.append(elem)
    ans = 0
    for l1 in d:
        flag = True
        for i in range(len(l1)-1):
            for j in range(M):
                if(a[j]==l1[i] and b[j] ==l1[i+1]) or (b[j]==l1[i] and a[j] ==l1[i+1]):
                    flag = True
                    break
                flag = False
            if flag == False:
                break
        if flag:
            ans += 1

    print(ans)
if __name__ == '__main__':
    main()

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

def main():
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N,M = (int(_) for _ in input().split())
    a = []
    b = []
    for i in range(N):
        c, d = (int(_) for _ in input().split())
        a.append(c)
        b.append(d)
    l = list(_ for _ in range(2,N+1))
    d = []
    for elem in itertools.permutations(l,len(l)):
        elem = list(elem)
        elem.insert(0,1)
        d.append(elem)
    ans = 0
    for l1 in d:
        flag = True
        for i in range(len(l1)-1):
            for j in range(M):
                if(a[j]==l1[i] and b[j] ==l1[i+1]) or (b[j]==l1[i] and a[j] ==l1[i+1]):
                    flag = True
                    break
                flag = False
            if flag == False:
                break
        if flag:
            ans += 1

    print(ans)
if __name__ == '__main__':
    main()
Problem p03073 (python)

Fixed submission:
S = list(input())

dist1 = 0  # 1010...01 との編集距離
dist2 = 0  # 0101...10 との編集距離
for i, s in enumerate(S):
    if i % 2 == 1:
        if s == '1':
            dist2 += 1
        else:
            dist1 += 1
    if i % 2 == 0:
        if s == '1':
            dist1 += 1
        else:
            dist2 += 1

print(min(dist1, dist2))

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

S = np.array(list(map(int, list(input()))))
q, r = len(S) // 2, len(S) % 2
a1 = np.array([1, 0] * q + [1] * r)  # 1010...01 (偶数長なら 1010...10)
a2 = np.array([0, 1] * q + [0] * r)  # 1010...01 (偶数長なら 1010...10)

print(min(sum(abs(a1 - S)), sum(abs(a2 - S))))
Problem p03075 (python)

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

antenna = [a, b, c, d, e]
is_ok = True
for i in range(len(antenna)):
    for j in range(i+1, len(antenna)):
        if antenna[j] - antenna[i] > k:
            is_ok = False

if is_ok:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
from itertools import product

X, Y, Z, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

AB = [a + b for a, b in product(A, B)]
AB.sort(reverse=True)

ABC = [ab + c for ab, c in product(AB[:K], C)]
ABC.sort(reverse=True)

for abc in ABC[:K]:
    print(abc)
Problem p03072 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split(" ")))
m = float('-inf')
count = 1
for i in range(1,N):
    m = max(m,A[i-1])
    if A[i]>=m: count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = map(int,input().split(" "))
m = int('-inf')
count = 0
for i in range(N-2,-1,-1):
  m = max(m,A[i+1])
  if A[i]>=m: count += 1
print(count)
Problem p03135 (python)

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

Buggy submission (verdict: Runtime Error):
T, X = list(map(int, input().split())
print(T / X)
Problem p03317 (python)

Fixed submission:
import sys

def solve(n, k, as1):
    if (n-1)%(k-1)==0:
        return (n-1)//(k-1)
    else:
        return (n-1)//(k-1)+1

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_n, str_k] = line.split(' ')
    line = sys.stdin.readline().rstrip()
    as1 = line.split(' ')
    return (int(str_n), int(str_k), [int(a) for a in as1])

def main():
    n, k, as1 = readQuestion()
    answer = solve(n, k, as1)
    print(answer)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def solve(n, k, as):
        return n/(k-1)

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_n, str_k] = line.split(' ')
    line = sys.stdin.readline().rstrip()
    as = line.split(' ')
    return (int(str_n), int(str_k), [int(a) for a in as])

def main():
    n, k, as = readQuestion()
    answer = solve(n, k, as)
    print(answer)
    
if __name__ == '__main__':
    main()
Problem p03127 (python)

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

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

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

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

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

# 最大公約数
ans = functools.reduce(math.gcd, a)
print(ans)
Problem p03221 (python)

Fixed submission:
n,m = map(int,input().split())
city = [[] for _ in range(n+1)]
ret = ["" for _ in range(m)]
def createSix(s):
    while len(s) != 6:
        s = "0" + s
    return s
for i in range(m):
    a,b = map(int, input().split())
    city[a].append((b, i))
for i in range(n+1):
    city[i].sort()
for i in range(n+1):
    for j in range(len(city[i])):
        ret[city[i][j][1]] = createSix(str(i)) + createSix(str(j+1))
for i in ret:
    print(i)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
city = [[] for _ in range(n+1)]
ret = ["" for _ in range(m)]
def createSix(s):
    while len(s) != 6:
        s = "0" + s
    return s
for i in range(m):
    a,b = map(int, input().split())
    city[a].append((b, i))
for i in range(m):
    city[i].sort()
print(city)
for i in range(n+1):
    for j in range(len(city[i])):
        ret[city[i][j][1]] = createSix(str(i)) + createSix(str(j+1))
for i in ret:
    print(i)
Problem p03127 (python)

Fixed submission:
from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
tmp = gcd(A[0], A[1])
for a in A:
    tmp = gcd(tmp, a)
print(tmp)

Buggy submission (verdict: Runtime Error):
from math import gcd
N = int(input())
A = list(map(int, input().split()))
tmp = gcd(A[0], A[1])
for a in A:
    tmp = gcd(tmp, a)
print(tmp)
Problem p03775 (python)

Fixed submission:
from sys import setrecursionlimit; setrecursionlimit(10**9)
N = int(input())

def factorize(n):
    # NOTE: if n == 1, return []
    if n < 1:
        raise Exception('Invalid input: n = {}'.format(n))
    i = 2
    ret = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            ret.append(i)
        i += 1
    if n > 1:
        ret.append(n)
    return ret

A = factorize(N)
l = len(A)

def res(i, B, C):
    if i >= l:
        val = 1
        for b in B:
            val *= b
        C.append(max(len(str(val)), len(str(N//val))))
        return None
    B.append(A[i])
    res(i+1, B, C)
    B.pop()
    res(i+1, B, C)
    return C

if N == 1:
    print(1)
else:
    C = res(0, [], [])
    print(min(C))

Buggy submission (verdict: Runtime Error):
from sys import setrecursionlimit; setrecursionlimit(10**9)
N = int(input())

def factorize(n):
    # NOTE: if n == 1, return []
    if n < 1:
        raise Exception('Invalid input: n = {}'.format(n))
    i = 2
    ret = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            ret.append(i)
        i += 1
    if n > 1:
        ret.append(n)
    return ret

A = factorize(N)
l = len(A)

def res(i, B, C):
    if i >= l:
        val = 1
        for b in B:
            val *= b
        C.append(max(len(str(val)), len(str(N//val))))
        return None
    B.append(A[i])
    res(i+1, B, C)
    B.pop()
    res(i+1, B, C)
    return C

C = res(0, [], [])
print(min(C))

Buggy submission (verdict: Runtime Error):
from sys import setrecursionlimit; setrecursionlimit(10**9)
N = int(input())

def factorize(n):
    # NOTE: if n == 1, return []
    if n < 1:
        raise Exception('Invalid input: n = {}'.format(n))
    i = 2
    ret = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            ret.append(i)
        i += 1
    if n > 1:
        ret.append(n)
    return ret

A = factorize(N)
l = len(A)

def res(i, B, C):
    if i >= l:
        val = 1
        for b in B:
            val *= b
        C.append(max(len(str(val)), len(str(N//val))))
        return None
    B.append(A[i])
    res(i+1, B, C)
    B.pop()
    res(i+1, B, C)
    return C

C = res(0, [], [])
print(min(C))

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

def factorize(n):
    # NOTE: if n == 1, return []
    if n < 1:
        raise Exception('Invalid input: n = {}'.format(n))
    i = 2
    ret = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            ret.append(i)
        i += 1
    if n > 1:
        ret.append(n)
    return ret

A = factorize(N)
l = len(A)

def res(i, B, C):
    if i >= l:
        val = 1
        for b in B:
            val *= b
        C.append(max(len(str(val)), len(str(N//val))))
        return None
    B.append(A[i])
    res(i+1, B, C)
    B.pop()
    res(i+1, B, C)
    return C

C = res(0, [], [])
print(min(C))
Problem p03631 (python)

Fixed submission:

a=input()
if a[0]==a[2]:
    print("Yes")
else:print("No")

Buggy submission (verdict: Runtime Error):
import math as m
from functools import reduce
 
n=int(input())
l=[]
def f(a,b):
    return int(a*b/m.gcd(a,b))
for i in range(n):
    l.add(int(input()))
print(reduce(f,l))
Problem p03834 (python)

Fixed submission:
s = input().replace(","," ")
print(s)

Buggy submission (verdict: Runtime Error):
s = input()
print(s.replace(","," ")

Buggy submission (verdict: Runtime Error):
s = input()
prin(s.replace(","," ")

Buggy submission (verdict: Runtime Error):
s = str(input())
print(s.replace(',',' ')

Buggy submission (verdict: Runtime Error):
a = input()
print(a.replace(',',' ')
Problem p03075 (python)

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

if e-a <= k:
	print("Yay!")
else:
	print(":(")

Buggy submission (verdict: Runtime Error):
a = int(input().split())
b = int(input().split())
c = int(input().split())
d = int(input().split())
e = int(input().split())
k = int(input().split())

if e-a <= k:
	print("Yay!")
else :
	print(":(")
Problem p03135 (python)

Fixed submission:
t, x = map(int, input().split()) 
print(t/x)

Buggy submission (verdict: Runtime Error):
t, x = map(int, raw_input.split()) 
print(t/x)

Buggy submission (verdict: Runtime Error):
t, x = map(int, input.split()) 
print(t/x)
Problem p03072 (python)

Fixed submission:
x=int(input())
li = list(map(int,input().split()))
i=0
c=0
a=1
for n in li:
  while c<i:
    if li[c]>n:
      break
    c+=1
    if c==i:
      a+=1
  c=0  
  i+=1
print(a)

Buggy submission (verdict: Runtime Error):
x=int(input())
li = list(map(int,input().split()))
i=0
c=0
a=0
for n in li:
  while c<i:
    if li[c]>n:
      break
    c+=1
    if c=i:
      a+=1
  c=0  
  i+=1
print(a)
Problem p03073 (python)

Fixed submission:
string=list(input())
if int(string[0])==1:
    c=0
else:
    c=1
a=0
for s in string:
    if int(s)==0 and c==1:
        c-=1
    elif int(s)==0 and c==0:
        c+=1
        a+=1
    elif int(s)==1 and c==0:
        c+=1
    elif int(s)==1 and c==1:
        c-=1
        a+=1
print(a)

Buggy submission (verdict: Runtime Error):
string=list(input())
if int(string[1])==0:
  c=1
else:
  c=0
a=0
for s in string:
  if int(s)==0 and c==1:
    c-=1
  elif int(s)==0 and c==0:
    c+=1
    a+=1
  elif int(s)==1 and c==0:
	c+=1
  elif int(s)==1 and c==1:
	c-=1
    a+=1
print(a)

Buggy submission (verdict: Runtime Error):
string=list(input())
if int(string[1]==0):
  c=1
else:
  c=0
a=0
for s in string:
  if int(s)==0 and c==1:
    c-=1
  elif int(s)==0 and c==0:
    c+=1
    a+=1
  elif int(s)==1 and c==0:
	c+=1
  elif int(s)==1 and c==1:
	c-=1
    a+=1
print(a)

Buggy submission (verdict: Runtime Error):
string=list(input())
c=0
a=0
for s in string:
  if int(s)==0 and c=1:
    c-=1
  elif int(s)==0 and c=0:
    c+=1
    a+=1
  elif int(s)==1 and c=0:
	c+=1
  elif int(s)==1 and c=1:
	c-=1
    a+=1
print(a)
Problem p03272 (python)

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

Buggy submission (verdict: Runtime Error):
N =input(int())
i =input(int())
print(int(N+1-i))

Buggy submission (verdict: Runtime Error):
N =input(int())
a =input(int())
print(N-a+1)
Problem p03075 (python)

Fixed submission:
s = [int(input()) for i in range(5)]
k = int(input())
count = 0

for i in s:
    for j in s:
        if (i-j)**2 > k**2:
            print(":(")
            count+=1
            break
    if count == 1:
        break

if count == 0:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
s = [int(input()) for i in range(5)]
k = int(input())
count =	0

for i in s:
    for j in s:
        if (i-j)**2 > k**2:
            print(":(")
            count+=1
	    break

if count == 0:
    print("Yay!")
Problem p03077 (python)

Fixed submission:
import numpy as np
import math

n = float(input())
list = [int(input()) for i in range(5)]

l = np.array(list)

d = np.amin(l)
dm = np.argmin(l)

print(int(math.ceil(n/d)+4))

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

n = float(input())
list = [int(input()) for i in range(5)]

l = np.array(list)

d = np.amin(l)
dm = np.argmin(l)
'''                                                                                 
if dm == 4:                                                                         
    print(int(n//d))                                                                
'''
else:
    print(int(n//d+5))
Problem p03127 (python)

Fixed submission:
def gcd(m, n):
    return m if n == 0 else gcd(n, m % n)


n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = gcd(ans, a[i])
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = math.gcd(ans, a[i])
print(ans)
Problem p03075 (python)

Fixed submission:
n = 5
list=[int(input()) for i in range(n)]
p = int(input())
max = 0
a = 0
for i in range(n):
  for j in range(n):
    a = abs(list[i] - list[j])
    if a > max:
      max = a
      
if max <= p:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
n = int(input())
list=[int(input()) for i in range(n)]
max = 0
a = 0
for i in range(n):
  for j in range(n):
    a = abs(list[i] - list[j])
    if a > max:
      max = a
      
if max <= 15:
  print('Yey!')
else:
  print(':(')
Problem p03075 (python)

Fixed submission:
a=[]
for i in range(5):
    a.append(int(input()))

if (max(a)-min(a)) > input():
    print(":(")
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
a=[]
for i in range(5):
    a.append(int(input()))

if (max(a)-min(a)) > input():
    print(":(")
else:
    print("Yay!")
Problem p03327 (python)

Fixed submission:
n=input()
n=int(n)
if n>999:
    print("ABD")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):

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


sum=0
for x in range(b-a+1):
    sum+=x
    
high=sum-b

print(high)
Problem p03207 (python)

Fixed submission:
N = int(input())
p = []
for i in range(N):
        p.append(int(input()))
sum  = 0
max_value = max(p)
p.remove(max_value)

sum += max_value/2

for i in p:
        sum += i

print(int(sum))

Buggy submission (verdict: Runtime Error):
N = int(input())
p = []
for i in range(N):
        p.append(int(input())
sum  = 0
max_value = max(p)
p.remove(max_value)

sum += max_value/2

for i in p:
        sum += i

print(sum)