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

Fixed submission:
import numpy as np
import scipy.sparse.csgraph as graph

N = int(input())
G = np.array([list(map(int, input().split())) for i in range(N)])

G2 = graph.floyd_warshall(G, directed=False)

if np.any(G != G2):
    print(-1)
    exit()
else:
    c = [2*10**9]*N
    d = np.diag(c)
    G += d
    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            two = np.min(G[i]+G[j])
            if two != G[i,j]:
                ans += G[i,j]

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import scipy.sparse.csgraph as graph

N = int(input())
G = np.array([list(map(int, input().split())) for i in range(N)])

G2 = graph.floyd_warshall(G, directed=False)

if np.any(G != G2):
    print(-1)
else:
    c = [2*10**9]*N
    d = np.diag(c)
    G += d
    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            two = np.min(G[i]+G[j])
            if two != G[i,j]:
                ans += G[i,j]

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import scipy.sparse.csgraph as graph

N = int(input())
G = np.array([list(map(int, input().split())) for i in range(N)], dtype = 'int32')

G2 = graph.floyd_warshall(G, directed=False)

if np.any(G != G2):
    print(-1)
else:
    c = [2*10**9]*N
    d = np.diag(c)
    G += d
    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            two = np.min(G[i]+G[j])
            if two != G[i,j]:
                ans += G[i,j]

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import scipy.sparse.csgraph as graph

N = int(input())
G = np.array([list(map(int, input().split())) for i in range(N)], dtype = 'int64')

G2 = graph.floyd_warshall(G, directed=False)

if np.any(G != G2):
    print(-1)
else:
    c = [2*10**9]*N
    d = np.diag(c)
    G += d
    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            two = np.min(G[i]+G[j])
            if two != G[i,j]:
                ans += G[i,j]

print(ans)

Buggy submission (verdict: Runtime Error):
import copy
INF = float('inf')
N = int(input())
a = []
for i in range(N):
    a.append(list(map(int, input().split())))
flag = 0
length = 0


for i in range(N):
    for j in range(N):
        muda = 0
        for k in range(N):
            if k == i or k == j:
                continue
            mix = b[i][k] + b[k][j]
            if a[i][j] > mix:
                flag = 1
            elif a[i][j] == mix:
                muda = 1
        if muda == 1:
            continue
        length += a[i][j]

if (flag == 0):
    length = int(length/2)
else:
    length = -1
print(length)
Problem p03633 (python)

Fixed submission:
import functools
import math

def gcd(x,y):
    a,b = max(x,y), min(x,y)
    while b != 0:
        a,b = b,a%b

    return a

def lcm2(x,y):
    return x*y // gcd(x,y)
    
N = int(input())
T = []
for i in range(N):
    ti = int(input())
    T.append(ti)

result = 1
for t in T:
    result = lcm2(result, t)

print(result)

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

def gcd(x,y):
    a,b = max(x,y), min(x,y)
    while a % b != 0:
        a,b = b,a%b

    return b

def lcm2(x,y):
    return int(x*y / gcd(x,y))
    
N = int(input())
T = []
for i in range(N):
    ti = int(input())
    T.append(ti)

result = 1
for t in T:
    result = lcm2(result, t)

print(result)

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

def gcd(x,y):
    a,b = max(x,y), min(x,y)
    while a % b != 0:
        a,b = b,a%b

    return b
    

def lcm2(x,y):
    return int(x*y / gcd(x,y))

def lcm_lot(nums):
    return functools.reduce(lcm2, nums, 1)

N = int(input())
T = []
for i in range(N):
    ti = int(input())
    T.append(ti)

print(lcm_lot(T))

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

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

def lcm_lot(nums):
    return functools.reduce(lcm2, nums, 1)

N = int(input())
T = []
for i in range(N):
    ti = int(input())
    T.append(ti)

print(lcm_lot(T))
Problem p03383 (python)

Fixed submission:
input = raw_input
range = xrange

n, m = map(int,input().split())
grid = [input() for i in range(n)]

use = [False]*n
cur = []
def backtrack_even(i, rem, addwhat):
    if rem == 0:
        if addwhat != None: cur.append(addwhat)
        check(cur)
        if addwhat != None: cur.pop()
        return
    if use[i]: return backtrack_even(i+1, rem, addwhat)
    use[i] = True; cur.append(i)
    for j in range(i+1, n):
        if use[j]: continue
        use[j] = True; cur.append(j)
        backtrack_even(i+1, rem-2, addwhat)
        use[j] = False; cur.pop()
    use[i] = False; cur.pop()

def backtrack():
    if n%2 == 0: return backtrack_even(0, n, None)
    for i in range(n):
        use[i] = True
        backtrack_even((0 if i else 1), n-1, i)
        use[i] = False

middle_initial = (m%2 == 0)
from collections import Counter
def check(cur):
    P = cur[::2] + cur[1::2][::-1]
    cols = Counter((''.join(grid[P[i]][j] for i in range(n))) for j in range(m))
    #print(cur, P, cols)
    middle_filled = middle_initial
    rem = m
    while rem:
        w = next(iter(cols))
        cols[w]-= 1; rem-= 1
        if cols[w] == 0: del cols[w]
        w2 = w[::-1]
        if w2 in cols:
            assert cols[w2]
            cols[w2]-= 1; rem-= 1
            if cols[w2] == 0: del cols[w2]
        elif w == w[::-1] and not middle_filled:
            middle_filled = True
        else: return False
    print("YES"); exit()

backtrack()
print("NO")

Buggy submission (verdict: Runtime Error):
input = raw_input
range = xrange

n, m = map(int,input().split())
grid = [input() for i in range(n)]

use = [False]*n
cur = []
def backtrack(i, rem):
    if rem == 0: return check(cur)
    if use[i]: return backtrack(i+1, rem)
    if rem == 1:
        use[i] = True; cur.append(i)
        backtrack(i+1, 0)
        use[i] = False; cur.pop()
    use[i] = True; cur.append(i)
    for j in range(i+1, n):
        if use[j]: continue
        use[j] = True; cur.append(j)
        backtrack(i+1, rem-2)
        use[j] = False; cur.pop()
    use[i] = False; cur.pop()

middle_initial = (n%2 == 0)
from collections import Counter
def check(cur):
    P = cur[::2] + cur[1::2][::-1]
    cols = Counter((''.join(grid[P[i]][j] for i in range(n))) for j in range(m))
    middle_filled = middle_initial
    rem = n
    while rem:
        w = next(iter(cols))
        cols[w]-= 1; rem-= 1
        if cols[w] == 0: del cols[w]
        w2 = w[::-1]
        if w2 in cols:
            assert cols[w2]
            cols[w2]-= 1; rem-= 1
            if cols[w2] == 0: del cols[w2]
        elif w == w[::-1] and not middle_filled:
            middle_filled = True
        else: return False
    print("YES"); exit()

backtrack(0, n)
print("NO")
Problem p03616 (python)

Fixed submission:
input = __import__('sys').stdin.readline
MIS = lambda: map(int,input().split())
 
# f(a) = z                 a <= x1
#        a+z-x1      x1 <= a <= x2
#        x2+z-x1     x2 <= a
class Sandgraph:
    def __init__(_, X):
        _.z = _.x1 = 0
        _.x2 = X
    
    def add(_, dt):
        # Go towards the ceiling
        d1 = min(dt, X-(_.x2+_.z-_.x1))
        _.z+= d1
        dt-= d1
        # Reduce the diagonal
        d1 = min(dt, _.x2-_.x1)
        _.z+= d1
        _.x2-= d1
    
    def sub(_, dt):
        # Go towards the floor
        d1 = min(dt, _.z)
        _.z-= d1
        dt-= d1
        # Reduce the diagonal
        d1 = min(dt, _.x2-_.x1)
        _.x1+= d1
    
    def __call__(_, a):
        if a <= _.x1: return _.z
        elif a <= _.x2: return a + _.z - _.x1
        else: return _.x2 + _.z - _.x1
 
X = int(input())
k = int(input())
rev = list(MIS())
Q = int(input())
sand = Sandgraph(X)
 
last_t = 0
i = 0 # even -, odd +
for QUERY in range(Q):
    t, a = MIS()
    while i<k and rev[i] <= t:
        dt = rev[i] - last_t
        if i%2 == 0: sand.sub(dt)
        else: sand.add(dt)
        last_t = rev[i]
        i+= 1
    dt = t - last_t
    if i%2 == 0: sand.sub(dt)
    else: sand.add(dt)
    print(sand(a))
    last_t = t

Buggy submission (verdict: Runtime Error):
input = __import__('sys').stdin.readline
MIS = lambda: map(int,input().split())

# f(a) = z                 a <= x1
#        a+z-x1      x1 <= a <= x2
#        x2+z-x1     x2 <= a
class Sandgraph:
    def __init__(_, X):
        _.z = _.x1 = 0
        _.x2 = X
    
    def __repr__(_):
        return f"<{_.z} {_.x1} {_.x2}>"
    
    def add(_, dt):
        # Go towards the ceiling
        d1 = min(dt, X-(_.x2+_.z-_.x1))
        _.z+= d1
        dt-= d1
        # Reduce the diagonal
        d1 = min(dt, _.x2-_.x1)
        _.z+= d1
        _.x2-= d1
    
    def sub(_, dt):
        # Go towards the floor
        d1 = min(dt, _.z)
        _.z-= d1
        dt-= d1
        # Reduce the diagonal
        d1 = min(dt, _.x2-_.x1)
        _.x1+= d1
    
    def __call__(_, a):
        if a <= _.x1: return _.z
        elif a <= _.x2: return a + _.z - _.x1
        else: return _.x2 + _.z - _.x1

X = int(input())
k = int(input())
rev = list(MIS())
Q = int(input())
sand = Sandgraph(X)

last_t = 0
i = 0 # even -, odd +
for QUERY in range(Q):
    t, a = MIS()
    while i<k and rev[i] <= t:
        dt = rev[i] - last_t
        if i%2 == 0: sand.sub(dt)
        else: sand.add(dt)
        last_t = rev[i]
        i+= 1
    dt = t - last_t
    if i%2 == 0: sand.sub(dt)
    else: sand.add(dt)
    print(sand(a))
    last_t = t
Problem p03627 (python)

Fixed submission:
from collections import Counter
n = int(input())
C = Counter(map(int,input().split()))
quad = [i for i in C if C[i] >= 4]
if quad: maxa = max(quad)**2
else: maxa = 0

twice = [i for i in C if C[i] >= 2]
twice.sort()
if len(twice) >= 2: maxa = max(maxa, twice[-1]*twice[-2])
print(maxa)

Buggy submission (verdict: Runtime Error):
from __future__ import print_function
from collections import deque
from bisect import bisect_left as bl
input = raw_input
range = xrange

def goto(fr, to):
    i = bl(occ[to], fr+1)
    if i == len(occ[to]): return n+1
    return occ[to][i]

s = [-1]+[ord(c)-97 for c in input()]
n = len(s)-1
occ = [[] for i in range(26)]
for i in range(1, n+1):
    occ[s[i]].append(i)
visit = [None]*(n+2)
visit[0] = (-1, -1) # letter, lastindex
Q = deque()
Q.append(0)

while len(Q):
    p = Q.popleft()
    if p == n+1: break
    for q in range(26):
        qi = goto(p, q)
        if visit[qi]: continue
        visit[qi] = (q, p)
        Q.append(qi)
stack = []
i = n+1
while visit[i][0] != -1:
    stack.append(visit[i][0])
    i = visit[i][1]

for i in reversed(stack):
    print(chr(97+i), end='')
Problem p03639 (python)

Fixed submission:
# one -> four
# two -> two, four
# four -> one, two, four

n = int(input())
one = 0
two = 0
four = 0

for a in map(int,input().split()):
    if a%2 != 0: one+= 1
    elif a%4 != 0: two+= 1
    else: four+= 1

def no():
    print("No")
    exit()

if two == 0:
    #1414141
    print("Yes" if four >= one-1 else "No")
else:
    #222222241414141
    print("Yes" if four >= one else "No")

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

Buggy submission (verdict: Runtime Error):
h, w = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))
grid = [[' ']*w for i in range(h)]

ci = 0
for i in range(h):
    for j in range(w):
        if not a[ci]: ci+= 1
        if i%2==0: grid[i][j] = ci+1
        else: grid[i][~j] = ci+1
        a[ci]-= 1
for row in grid: print(*row)
Problem p03648 (python)

Fixed submission:
x = int(input())
if x == 0:
    print(4)
    print(3, 3, 3, 3)
    exit()

x-= 1
phase = x//50
subphase = x%50
pstart = phase*50

left = 99+phase-(x-pstart)
right = 48+phase-(x-pstart)
ans = [left]*(1+subphase)+[right]*(49-subphase)
print(50)
print(*ans)

Buggy submission (verdict: Runtime Error):
x = int(input())
if x == 0:
    print(4)
    print(3, 3, 3, 3)
    1/0

x-= 1
phase = x//50
subphase = x%50
pstart = phase*50

left = 99+phase-(x-pstart)
right = 48+phase-(x-pstart)
ans = [left]*(1+subphase)+[right]*(49-subphase)
print(50)
print(*ans)
Problem p03251 (python)

Fixed submission:
def is_collided(x: int, y: int, xn: list, ym: list) -> bool:
    xn_max = max(xn)
    ym_min = min(ym)

    if xn_max >= ym_min:
        return True
    # xn_max ~ ym_minとx ~ yが重なっていなければ衝突する
    return xn_max >= y or ym_min <= x

def main():
    line1 = list( map(lambda x:int(x), input().split(' ')) )
    line2 = list( map(lambda x:int(x), input().split(' ')) )
    line3 = list( map(lambda x:int(x), input().split(' ')) )
    print("War") if is_collided(line1[2], line1[3], line2, line3) else  print("No War")

if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
def is_collided(x: int, y: int, xn: list, ym: list) -> bool:
    xn_max = max(xn)
    ym_min = min(ym)

    if xn_max > ym_min:
        return True
    # xn_max ~ ym_minとx ~ yが重なっていれば衝突しない
    if xn_max < x < ym_min or xn_max < y <= ym_min or \
    x < xn_max < y or x < x < ym_min <= y:
        return False
    return True


def main():
    line1: list = list( map(lambda x:int(x), input().split(' ')) )
    line2: list = list( map(lambda x:int(x), input().split(' ')) )
    line3: list = list( map(lambda x:int(x), input().split(' ')) )
    if is_collided(line1[2], line1[3], line2, line3):
        print("War")
    else:
        print("No War")

if __name__=='__main__':
    main()
    # print(is_collided(10, 20, [8, 5, 13], [16, 22]))
    # print(is_collided(-48, -1, [-20, -35, -91, -23], [-22, 66]))
    # print(is_collided(6, 8, [-10, 3, 1, 5, -100], [100, 6, 14]))

Buggy submission (verdict: Runtime Error):
def is_collided(x: int, y: int, xn: list, ym: list) -> bool:
    xn_max = max(xn)
    ym_min = min(ym)

    if xn_max > ym_min:
        return True
    # xn_max ~ ym_minとx ~ yが重なっていれば衝突しない
    if xn_max < x < ym_min or xn_max < y <= ym_min or \
    x < xn_max < y or x < x < ym_min <= y:
        return False
    return True


def main():
    line1: list = list( map(lambda x:int(x), input().split(' ')) )
    line2: list = list( map(lambda x:int(x), input().split(' ')) )
    line3: list = list( map(lambda x:int(x), input().split(' ')) )
    if is_collided(line1[2], line1[3], line2, line3):
        print("War")
    else:
        print("No War")

if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
def is_collided(x: int, y: int, xn: list, ym: list) -> bool:
    xn_max = max(xn)
    ym_min = min(ym)

    if xn_max > ym_min:
        return True
    # xn_max ~ ym_minとx ~ yが重なっていれば衝突しない
    if xn_max < x < ym_min or xn_max < y <= ym_min or \
    x < xn_max < y or x < x < ym_min <= y:
        return False
    return True


def main():
    line1: list = list( map(lambda x:int(x), input().split(' ')) )
    line2: list = list( map(lambda x:int(x), input().split(' ')) )
    line3: list = list( map(lambda x:int(x), input().split(' ')) )
    if is_collided(line1[2], line2[3], line2, line3):
        print("War")
    else:
        print("No War")

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

Fixed submission:
R = int(input())
G = int(input())

print(2*G-R)

Buggy submission (verdict: Runtime Error):
V
Problem p03597 (python)

Fixed submission:
N = int(input())
A = int(input())

print(N**2-A)

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

print(N**2-A)
Problem p03697 (python)

Fixed submission:
a,b = map(int,input().split())
print("error" if a+b>=10 else a+b)

Buggy submission (verdict: Runtime Error):
a,b = input().split(" ")
print("error" if a+b>=10 else a+b)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
print("error" if a+b>=10 else a+b)
Problem p03385 (python)

Fixed submission:
S = input()
if S.count('a') and S.count('b') and S.count('c'):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A, B, K = [int(i) for i in input().split()]

S = set()
for i in range(A, A+K):
    if i > B:
        break
    S.add(i)
for i in range(B-K+1, B+1):
    if i < A:
        break
    S.add(i)
for i in sorted(S):
    print(i)

Buggy submission (verdict: Runtime Error):
A, B, K = [int(i) for i in input().split()]

S = set()
for i in range(A, A+K):
    if i > B:
        break
    S.add(i)
for i in range(B-K+1, B+1):
    if i < A:
        break
    S.add(i)
for i in sorted(S):
    print(i)
Problem p03720 (python)

Fixed submission:
N,  M = [int(i) for i in input().split()]
cities = {}
for i in range(N):
    cities[i+1] = 0
for i in range(M):
    for c in [int(i) for i in input().split()]:
        cities[c] += 1
for key, val in sorted(cities.items()):
    print(val)

Buggy submission (verdict: Runtime Error):
N,  M = [int(i) for i in input().split()]
cities = {}
for i in range(M):
    cities[i+1] = 0
for i in range(M):
    for c in [int(i) for i in input().split()]:
        cities[c] += 1
for key, val in sorted(cities.items()):
    print(val)
Problem p03737 (python)

Fixed submission:
A, B, C = input().split()
print(A[0].upper()+B[0].upper()+C[0].upper())

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
AA = "%-101s", A
BB = "%-101s", B
if AA == BB:
    print("EQUAL")
elif AA>BB:
    print("GREATER")
else:
    print("LESS")

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
AA = "%101s", A
BB = "%101s", B
if AA == BB:
    print("EQUAL")
elif AA>BB:
    print("GREATER")
else:
    print("LESS")
Problem p03738 (python)

Fixed submission:
A = input()
B = input()
AA = "%101s" % A
BB = "%101s" % B
if AA == BB:
    print("EQUAL")
elif AA>BB:
    print("GREATER")
else:
    print("LESS")

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
AA = f"{A:>101}"
BB = f"{B:>101}"
if AA == BB:
    print("EQUAL")
elif AA>BB:
    print("GREATER")
else:
    print("LESS")
Problem p03814 (python)

Fixed submission:
A=str(input())
a=A.index("A")
Z=[]
for i in enumerate(A):
    if i[1]=="Z":
        Z.append(i[0])
if len(Z)>=2:
    b=max(Z)
else:
    b=A.index("Z")

print(len(A[a:b+1]))

Buggy submission (verdict: Runtime Error):
A=str(input())
a=A.index("A")
Z=[]
for i in enumerate(A):
    if i[1]=="Z":
        Z.append(i[0])
if len(Z)>=2:
    b=max(Z)
else:
    b=A.index("B")
print(len(A[a:b+1]))
Problem p03577 (python)

Fixed submission:
s = input()
print(s[:-8])

Buggy submission (verdict: Runtime Error):
s = input()
return s[:-8]

Buggy submission (verdict: Runtime Error):
s = input()
return s[:-4]
Problem p03351 (python)

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

if abs(c - a) <= d:
    print("Yes")
elif abs(b - a) <= d and abs(c - b) <= d:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x = int(input())
a = int(x**(1/2))
max_ = 0

while a > 1:
    i = 2
    while a**i <= x:
        if max_ < a**i:
            max_ = a**i
        i += 1
    a -=1
print(max_)
Problem p03325 (python)

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

from operator import mul
from functools import reduce

even_list = list(filter(lambda x:x%2==0, a))

if len(even_list) == 0:
    print(0)
else:

    count = 0

    for m in even_list:
    
        while True:
            m = m / 2
            count += 1
    
            if m % 2 == 1:
                break

    print(count)

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

from operator import mul
from functools import reduce

even_list = list(filter(lambda x:x%2==0, a))

if len(even_list) == 0:
    print(0)
else:
    m = reduce(mul, even_list)
    count = 0
    while True:
        m = m / 2
        count += 1
    
        if m % 2 == 1:
            break

    print(count)
Problem p03296 (python)

Fixed submission:
N = int(input())
a = [s for s in map(int, input().split())]
a.append(-1)
c = 0
result = 0
for i in range(1, N + 1):
	if a[i] == a[i - 1]:
		c += 1
	else:
		if c == 0:
			continue
		else:
			c += 1
			if c % 2 == 1:
				result += (c - 1) / 2
				c = 0
			else:
				result += c / 2
				c = 0
print(int(result))

Buggy submission (verdict: Runtime Error):
N = int(input())
s = map(int, input().split())
c = 0

for i in range(1, N):
	if s[i] == s[i - 1]:
		c += 1
	else:
print(c)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = map(int, input().split())
c = 0

for i in range(1, N):
	if s[i] == s[i - 1]:
		c += 1
	else:
		pass
print(c)
Problem p03324 (python)

Fixed submission:
D, N = map(int, input().split())
output = 1
for i in range(D):
	output *= 100
if N == 100:
	N = 101
output *= N
print(output)

Buggy submission (verdict: Runtime Error):
D, N = map(int, input().split())
output = 1
for i in range(D):
	output *= 100
if N = 100:
	N = 101
output *= N
print(output)
Problem p03260 (python)

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

if a%2 ==0 or b%2 ==0: 
    print("No") 
else: 
    print("Yes")

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

c, d = (int(i) for i in input().split())  
a = [int(i) for i in input().split()]
b = a.copy()

k = 0
for i in a:
    b[k] = abs(i - d)
    k += 1

m = min(b) 

lo = []

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


                
print(gcd_list(b))
Problem p03262 (python)

Fixed submission:
c, d = (int(i) for i in input().split())  
a = [int(i) for i in input().split()]
b = a.copy()
 
k = 0
for i in a:
    b[k] = abs(i - d)
    k += 1
 
m = min(b) 
 
def dec():
 
    i = m
    while i > 0:
        if m% i == 0: 
            k = 0
            for j in b:
                if j%i ==0:
                    k +=1
                if k==len(b):
                    return i
                
            if i == m:
                i -= i//2
                
        i -=1
 
 
 
 
                
print(dec())

Buggy submission (verdict: Runtime Error):
import math
N, X = map(int, input().split())
x = list(map(int,input().split()))
D = abs(x[0]-X)
for i in x:
    D = math.gcd(D,abs(i-X))
print(D)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
x = list(map(int,input().split()))
D = abs(x[0]-X)
for i in x:
    D = math.gcd(D,abs(i-X))
print(D)

Buggy submission (verdict: Runtime Error):
import sys
 
N, X = map(int, input().split())
x = list(map(int,input().split()))
D = abs(x[0]-X)
for i in x:
    D = math.gcd(D,abs(i-X))
print(D)

Buggy submission (verdict: Runtime Error):
import math
 
N, X = map(int, input().split())
x = list(map(int,input().split()))
D = abs(x[0]-X)
for i in x:
    D = math.gcd(D,abs(i-X))
print(D)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
c, d = (int(i) for i in input().split())  
a = [int(i) for i in input().split()]
b = a.copy()
k = 0
for i in a:
    b[k] = abs(i - d)
    k += 1
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(b))

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

c, d = (int(i) for i in input().split())  
a = [int(i) for i in input().split()]
b = a.copy()

k = 0
for i in a:
    b[k] = abs(i - d)
    k += 1

m = min(b) 

lo = []

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


                
print(gcd_list(b))
Problem p03337 (python)

Fixed submission:
x=input().split()
(a,b)=(int(x[0]),int(x[1]))
print(max(a*b,a-b,a+b))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
m=0
for i in range(n-1):
    x=s[:i]
    y=s[i:]
    x=set(x)
    y=set(y)
    z=x.intersection(y)
    m=max(len(z),m)
print(m)
Problem p03323 (python)

Fixed submission:
l=input().split()
a=int(l[0])
b=int(l[1])
if a<9 and b<9:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
l=input.split()
a=int(l[0])
b=int(l[1])
if a<9 and b<9:
    print('Yay!')
else:
    print(':(')
Problem p03359 (python)

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

Buggy submission (verdict: Runtime Error):
K = int(input())
max_index = numbers.index(max(numbers))
result = [numbers[i] * 2 ** K if i == max_index else numbers[i] for i in range(len(numbers))]
print(sum(result))
Problem p03415 (python)

Fixed submission:
a = list(input())
b = list(input())
c = list(input())
print(a[0]+b[1]+c[2])

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

print(abs(N-2)*abs(M-2))