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

Fixed submission:
i = input().split()
a = float(i[0])
b = float(i[1])
t = float(i[2])
f = True
n = 0
while(f):

    if t  + 0.5 < n * a:
       f = False
       break
    n = n + 1
n = n-1
print(int(n * b))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split()
mi = abs(int(a[0]))
ans =  0 
count = 0
for i in range(n):
    ans = ans + abs(int(a[i]))
    if mi > abs(int(a[i])):
        mi = abs(int(a[i]))
    if int(a[i])<0:
        count = count + 1
if count%2 ==0:
    print(ans)
else:
    print(ans-2*mi)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split()
mi = abs(int(a[0]))
ans =  0 
for i in range(n):
    ans = ans + abs(int(a[i]))
    if mi > abs(int(a[i])):
        mi = abs(int(a[i]))
print(ans-2*mi)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split()
mi = abs(int(a[0]))
ans =  0 
for i in range(n):
    ans = ans + abs(int(a[i]))
    if mi > abs(int(a[i])):
        mi = abs(int(a[i]))
print(ans-2*mi)
Problem p03059 (python)

Fixed submission:
A, B, T = list(map(int, input().strip().split()))
i = 1
X = 0
while A * i < T + 0.5:
  X = X + B
  i += 1
else:
  print(X)

Buggy submission (verdict: Runtime Error):
import numpy as np 
N = int(input())
A =list(map(int, input().strip().split()))
Ap = np.abs(A)
i = 0
m = 0
s = 0
M = 0
while i <= N - 1:
    if A[i] < 0:
        m += 1
    i += 1
if m % 2 == 0:
    M = np.sum(Ap)
if m % 2 == 1:
    while s <= N - 1:
        M1 = np.sum(Ap) - 2 * Ap[s]
        if M1 >= M:
            M = M1
        s += 1
print(M)

Buggy submission (verdict: Runtime Error):
import numpy as np 
N = int(input())
A =list(map(int, input().strip().split()))
Ap = np.abs(A)
i = 0
m = 0
s = 1
while i <= N - 1:
    if A[i] < 0:
        m += 1
    i += 1
if m % 2 == 0:
    M = np.sum(Ap)
if m % 2 == 1:
    M = np.sum(Ap) - 2 * Ap[0]
    while s <= N - 1:
        M1 = np.sum(Ap) - 2 * Ap[s]
        if M1 > M:
            M = M1
        s += 1
print(M)
Problem p03059 (python)

Fixed submission:
a, b, t = list(map(int, input().split()))
print(sum([b for _ in range(a, t+1, a)]))

Buggy submission (verdict: Runtime Error):
a, b, t = list(map(int, imput().split()))
print(sum([b for _ in range(a, t+1, a)]))

Buggy submission (verdict: Runtime Error):
a, b, t = map(int, imput().split())
print(sum([b for _ in range(a, t+1, a)]))

Buggy submission (verdict: Runtime Error):
a, b, t = map(int, imput().split())
if a > t:
    print(sum([b for _ in range(a, t+1, a)]))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
a, b, t = map(int, imput().split())
total = 0
for _ in range(a, t+1, a):
    total += b
print(total)
Problem p03059 (python)

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

ans = 0
s = 1
while True:
    if s % A == 0:
        ans += B
    s += 1
    if s > T + 0.5:
        break

print(ans)

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

d = {}


def gcd(a, b):
    if (a, b) in d:
        return d[(a, b)]
    else:
        while b != 0:
            a, b = b, a % b
        d[(a, b)] = a
    return a


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


N = int(input())
A = [int(a) for a in input().split()]

max_ = 0
for i in range(1, len(A) + 1):
    num = gcd_list(A[:i-1] + A[i:])
    if max_ < num:
        max_ = num

print(max_)
Problem p03067 (python)

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

road = list(range(A + 1, B)) if A < B else list(range(B + 1, A))
if C in road:
    print("Yes")
else:
    print("No")

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

pattern = re.compile(r"#.")
s, count = re.subn(pattern, "##", S)
print(count)
Problem p03059 (python)

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

def count(s):
    a = int(s[0])
    b = int(s[1])
    t = int(s[2])
    a_now = a
    sum_ = 0
    while a_now< t+0.5:
        sum_ += b
        a_now += a
    
    return sum_

print(count(li))

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

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

def list_primes(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

prime_list = list_primes(max(As))
max_prime = 0
max_prime_n = 0
for n,i in enumerate(prime_list):
    max_prime_now = max(list(map( lambda x: i if x % i == 0 else 0, As)))
    if max_prime_now > max_prime:
        max_prime = max_prime_now
        max_prime_n = n
As_np = np.array(As)
As_np[As_np%max_prime==0]=max(As_np)

sigma = 1
len_As = len(As_np)
for i in reversed(range(2,max(As_np)+1)):
    if (As_np % i).sum()==0:
        As_np = As_np/i
        sigma *= i

print(sigma)

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

def count(s):
    a = int(s[0])
    b = int(s[1])
    t = int(s[2])
    a_now = a
    sum_ = 0
    while a_now< t+0.5:
        sum_ += b
        a_now += a
    
    return t
  
 print(count(li))
Problem p03071 (python)

Fixed submission:
a,b=map(int, input().split()) 
max1 = max(a,b)
max2 = max(min(a,b), max(a,b)-1)
 
print(max1+max2)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
max1 = max(a,b)
max2 = max(min(a,b),max(a,b)-1)
print(max1 + max2)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
max1 = max(a,b)
max2 = max(min(a,b),max(a,b)-1)
print(max1 + max2)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
max1 = max(a,b)
max2 = max(min(a,b),max(a,b)-1)
 
print(max1 + max2)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
max1 = max(a,b)
max2 = max(min(a,b),max(a,b)-1)

return max1 + max2
Problem p03059 (python)

Fixed submission:
a,b,t = map(int,input().split())
print(int(((t+0.5)//a)*b))

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

Fixed submission:
#参考　https://atcoder.jp/contests/abc124/submissions/4948803
from itertools import accumulate

n, k = map(int,input().split())
p = list(input())
a = []
pre = '1'
cnt = 0
for i in range(n):
     if pre != p[i]:
          a.append(cnt)
          cnt = 1
          pre = p[i]
     else:
          cnt += 1
a.append(cnt)
if pre == '0':
     a.append(0)

w = 2*k+1

if w >= len(a):
     print(n)
else:
     acc = list(accumulate(a))
     ans = 0
     acc = [0] + acc
     for i in range(0,len(a)-w+1,2):
          ans = max(ans,acc[i+w]-acc[i])
     print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
p = list(input())
a = []
ape = 1
for i in range(1,n):
     if p[i-1] != p[i]:
          a.append(ape)
          ape = 1
     else:
          ape += 1
a.append(ape)

if (p[0] == '1') or (len(a) == 1):
     kaisi = 0
else:
     kaisi = 1

ans = 0
anslist = []

for i in range(kaisi,min(2*k+1+kaisi,len(a))):
     ans += a[i]
anslist.append(ans)

for i in range(kaisi+2,len(a),2):
     if i+2*k <= len(a)-1:
          ans = ans-a[i-2]-a[i-1]+a[i+2*k]+a[i+2*k-1]
          anslist.append(ans)
     else:
          break
ans = 0
if (kaisi != 0) and (k != 0):
     for i in range(0,2*k):
          ans += a[i]
     anslist.append(ans)

print(max(anslist))

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
p = list(input())
a = []
ape = 1
for i in range(1,n):
     if p[i-1] != p[i]:
          a.append(ape)
          ape = 1
     else:
          ape += 1
a.append(ape)

if (p[0] == '1') or (len(a) == 1):
     kaisi = 0
else:
     kaisi = 1

ans = 0
anslist = []

for i in range(kaisi,min(2*k+1+kaisi,len(a))):
     ans += a[i]
anslist.append(ans)

for i in range(kaisi+2,len(a),2):
     if i+2*k <= len(a)-1:
          ans = ans-a[i-2]-a[i-1]+a[i+2*k]+a[i+2*k-1]
          anslist.append(ans)
     else:
          break
ans = 0
if kaisi != 0 and k != 0:
     for i in range(0,2*k):
          ans += a[i]
     anslist.append(ans)

print(max(anslist))
Problem p03105 (python)

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

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
isl1 = [0]*m
isl2 = [0]*m
for i in range(m):
    (isl1[i], isl2[i]) = map(int,input().split())
    isl1[i] -= 1
    isl2[i] -= 1
boss = [-1]*n
mem = [1]*n
dpt = [0]*n
ans = [0]*m
s = (n*(n-1))//2
ans[m-1] = s
 
def sea(i, boss):
     m = 0
     while boss[i] >= 0:
          i = boss[i]
          m += 1
     return i,m
 
for j in range(m-1):
     i = m-j-1
     i1,i2 = isl1[i],isl2[i]
     p1,m1 = sea(i1, boss)
     p2,m2 = sea(i2, boss)
     if p1 != p2:
          if dpt[m1] < dpt[m2]:
               (p1,p2) = (p2,p1)
          boss[p2] = p1
          s -= mem[p1]*mem[p2]
          mem[p1] += mem[p2]
          mem[p2] = 0
          dpt[p1] = max(dpt[p1],dpt[p2]+1)
     ans[i-1] = s
         
for i in range(m):
     print(ans[i])
Problem p03128 (python)

Fixed submission:
#参照　https://atcoder.jp/contests/abc118/submissions/4292288
n,m = map(int, input().split())
b = [0,2,5,5,4,5,6,3,7,6]
a = [0]+list(map(int, input().split()))
f = [-1]*(n+1)
f[0]=0
for i in range(1,n+1):
    for j in range(1,m+1):
        x = a[j]
        if(i-b[x]<0):
            continue
        f[i] = max(f[i],f[i-b[x]]*10 + x)
        #print(i+1,"番目に,",str(f[i])+","+str(f[i-b[x]]*10 + x),"の最大値を入れると",f)
print(f[n])

Buggy submission (verdict: Runtime Error):
n, m = map(int,input().split())
num = list(map(int,input().split()))
num_dic = {1:2,2:5,3:5,4:4,5:5,6:6,7:3,8:7,9:6}

dp = [0]*(n+1)

def creat_num(original,num):#original=431,num=1 return 4311
    if original == 0:
        return num
    new = list(map(int,list(str(original)))) + [num]
    new.sort()
    new.reverse()
    return int("".join(list(map(str,new))))

def match_dp(dp,num,num_dic,n):
    for i in num:
        if n - num_dic[i] >= 0:
            new_num = creat_num(dp[n],i)
            dp[n-num_dic[i]] = max(new_num, dp[n-num_dic[i]])
            match_dp(dp,num,num_dic,n-num_dic[i])

match_dp(dp,num,num_dic,n)

print(dp[0])
Problem p03424 (python)

Fixed submission:
n = int(input())
t = 'Y'
x = input().split()
    
if(t in x):
  print('Four')
else:
  print('Three')

Buggy submission (verdict: Runtime Error):
n = int(input())
ok = False
for i in range(n):
  t = input()
  if(t == 'Y'):
    ok = True
    break
    
if(ok):
  print('Four')
else:
  print('Three')
Problem p03377 (python)

Fixed submission:
input_data = input().split(" ")
a, b, x = int(input_data[0]), int(input_data[1]), int(input_data[2])
def check(A, B, X):
    if (A > X) or (A+B < X):
        return print("NO")
    inb_cat = X - A
    if inb_cat > B:
        return print("NO")

    else:
        return print("YES")


check(a, b, x)

Buggy submission (verdict: Runtime Error):
n = int(input())
input_num = input().split(" ")
sort_list = sorted(input_num)
center = int(n/2) - 1
for num in input_num:
    new_list = sort_list[0:]
    new_list.remove(num)
    print(new_list[center])
Problem p03059 (python)

Fixed submission:
def main():
  test = input()
  A, B, T = map(int, test.split(" "))
  print(B*(T//A))
  return 

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
	A, B, T = map(int, input().split())
	print(B*(T//A)

Buggy submission (verdict: Runtime Error):
A, B, T = map(int, input().split())
print(B*(T//A)
Problem p03377 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a,b,x = map(int, raw_input().split())
if a<=x and x<=a+b:
 print("YES")
else:
 print("NO")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*
n = int(raw_input())
x =[]
x = map(int, raw_input().split())

for i in range(n):
 copyx = list(x)
 del copyx[i]
 copyx.sort()
 b = copyx[int((n-1)/2)]
 print(b)
Problem p03238 (python)

Fixed submission:
n=int(input())
if n==1:print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)

Buggy submission (verdict: Runtime Error):
    n=int(input())
    if n==1:print("Hello World")
    else:
        a=int(input())
        b=int(input())
        print(a+b)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n==1:print("Hello World)
else:
    a=int(input())
    b=int(input())
    print(a+b)
Problem p03239 (python)

Fixed submission:
n,t=[int(s)for s in input().split()]
cost=[]
for _ in range(n):
  c,ti=[int(s)for s in input().split()]
  if ti<=t:cost.append(c)
if len(cost)==0:print("TLE")
else:
  cs=sorted(cost)
  print(cs[0])

Buggy submission (verdict: Runtime Error):
n,t=[int(s)for s in input().split()]
cost=[]
for _ in range(n):
  c,ti=[int(s)for s in input().split()]
  if ti<t:cost.append(c)
if len(cost)==0:print("TLE")
else:
  cs=cost.sorted()
  print(cs[0])
Problem p03261 (python)

Fixed submission:
n=int(input())
ws=[input()]
for i in range(1,n):
  w=input()
  if w in ws or w[0]!=ws[i-1][-1]:
    print("No")
    break
  ws.append(w)
else:print("Yes")

Buggy submission (verdict: Runtime Error):
n=int(input())
ws=[input()]
for i in range(1,n):
  w=input()
  if w in ws or w[0]!=ws[i-1][-1]:
    print("No")
    break
else:print("Yes")

Buggy submission (verdict: Runtime Error):
n=int(input())
ws=[]
for i in range(n):
  w=input()
  if w in ws or w[0]!=ws[i-1][-1]:
    print("No")
    break
else:
  print("Yes")
Problem p03059 (python)

Fixed submission:
A, B, T = map(int, input().rstrip().split())
c = (T + 0.5) // A
t = int(c * B)
print(t)

Buggy submission (verdict: Runtime Error):
A, B, T = map(int, input().rstrip().split())
c = (T + 0.5) // A
t = c * B
return t
Problem p03323 (python)

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

if A > 8 or B > 8:
    print(':(')
else:
    print('Yay!')

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

if A > 8 or B > 8:
    print(':(')
else:
    print('Yay!')

Buggy submission (verdict: Runtime Error):
A = map(int, input())
B = map(int, input())
A, B = list(A)[0], list(B)[0]

if A > 8 or B > 8:
    print(':(')
else:
    print('Yay!')

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

if A > 8 or B > 8:
    print(':(')
else:
    print('Yay!')

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

if A > 8 or B > 8:
    print(':(')
else:
    print('Yay!')
Problem p03324 (python)

Fixed submission:
D, N = map(int, input().split())
if D == 0:
    out = N
    if N == 100:
        out = 101
else:
    out = 100 ** D * N
    if N == 100:
        out = 100 ** (D + 1) + 100 ** D
print(out)

Buggy submission (verdict: Runtime Error):
D, N = input().split()
if D == 0:
    out = N
else:
    out = 100 * D * N
print(out)
Problem p03550 (python)

Fixed submission:
def getNum():
    N,Z,W = map(int,input().split())
    cards = input()
    cards = cards.split()
    return N,Z,W,cards

def cal(N,Z,W,cards):
    if len(cards) > 1:
        cand1 = abs(W - int(cards[-1]))
        cand2 = abs(int(cards[-1]) - int(cards[-2]))
        if cand1 >= cand2:
            print(cand1)
        else:
            print(cand2)
    else:
        print(abs(W - int(cards[-1])))

def main():
    N,Z,W,cards = getNum()
    cal(N,Z,W,cards)

main()

Buggy submission (verdict: Runtime Error):
def getNum():
    N,Z,W = map(int,input().split())
    cards = input()
    cards = cards.split()
    return N,Z,W,cards

def cal(N,Z,W,cards):
    cand1 = abs(W - int(cards[-1]))
    cand2 = abs(int(cards[-1]) - int(cards[-2]))
    if cand1 >= cand2:
        print(cand1)
    else:
        print(cand2)

def main():
    N,Z,W,cards = getNum()
    cal(N,Z,W,cards)

main()
Problem p03557 (python)

Fixed submission:

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

A.sort()
C.sort()

def bin_search_withR(vlist, targ):
    lb = -1
    ub = len(vlist)
    while ub - lb > 1:
        mid = (lb + ub) // 2
        if vlist[mid] >= targ:
            ub = mid
        else:
            lb = mid
    return ub, lb

def bin_search_withL(vlist, targ):
    lb = -1
    ub = len(vlist)
    while ub - lb > 1:
        mid = (lb + ub) // 2
        if vlist[mid] > targ:
            ub = mid
        else:
            lb = mid
    return ub, lb

total = 0
for b in B:
    a_ub, a_lb = bin_search_withR(A, b)
    c_ub, c_lb = bin_search_withL(C, b)
    total += a_ub * (N - c_ub)

print(total)

Buggy submission (verdict: Runtime Error):

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

A.sort()
C.sort()

def bin_search_withR(vlist, targ):
    lb = -1
    ub = len(vlist)
    while ub - lb > 1:
        mid = (lb + ub) // 2
        if vlist[mid] >= targ:
            ub = mid
        else:
            lb = mid
    return ub, lb

def bin_search_withL(vlist, targ):
    lb = -1
    ub = len(vlist)
    while ub - lb > 1:
        mid = (lb + ub) // 2
        if vlist[mid] > targ:
            ub = mid
        else:
            lb = mid
    return ub, lb

total = 0
for b in B:
    a_ub, a_lb = bin_search_r(A, b)
    c_ub, c_lb = bin_search_l(C, b)
    total += a_ub * (N - c_ub)

print(total)
Problem p03106 (python)

Fixed submission:
a = list(map(int, input().split()))
num1 = a[0]
num2 = a[1]
list1 = []
list2 = []
max = a[2]
for i in range(1, num1 + 1):
  if num1 % i == 0:
    list1.append(i)
    
for i in range(1, num2 + 1):
  if num2 % i == 0:
    list2.append(i)

list3 = list(set(list1) & set(list2))
list3.sort()
list3.reverse()

print(list3[max -1])

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
num1 = a[0]
num2 = a[1]
list1 = []
list2 = []
max = a[2]
for i in range(1, num1):
  if num1 % i == 0:
    list1.append(i)
    
for i in range(1, num2):
  if num2 % i == 0:
    list2.append(i)

list3 = list1 + list2
list3 = list(set(list3))
print(list3[max -1])
Problem p03126 (python)

Fixed submission:
a = list(map(int, input().split()))
k = []
for i in range(0, a[0]):
  b = list(map(int, input().split()))
  del b[0]
  k += b

kk = 0
for i in range(1, a[1] + 1):
  if k.count(i) == a[0]:
    kk += 1
print(kk)

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
k = []
for i in range(0, a[0]):
  b = list(map(int, input().split()))
  del b[0]
  k.append(b)
 
kk = 0
for i in range(1, a[1] + 1):
  if k.count(i) == a[0]:
    kk += 1
print(q)

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
k = []
for i in range(0, a[0]):
  b = list(map(int, input().split()))
  del b[0]
  k.append(b)

q = 0
for i in range(1, a[1] + 1)
  if k.count(i) == a[0]:
    q += 1
print(q)
Problem p03155 (python)

Fixed submission:
N = int(input())
H = int(input())
W = int(input())
print((N-H+1)*(N-W+1))

Buggy submission (verdict: Runtime Error):
N = input()
H = input()
W = input()
print((N-H+1)*(N-W+1))
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 fractions
from functools import reduce


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


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


N, X = (int(i) for i in input().split())
A = [int(i) for i in input().split()]


def aho(x):
  return x - X


B = list(map(aho, A))

C = gcd_list(B)

print(C)
Problem p03261 (python)

Fixed submission:
N = int(input())
A = []
for i in range(N):
   A.append(input())
S = 0
for i in range(N-1):
    if A[i][-1] == A[i+1][0]:
        S += 1
B = 0
for i in range(N):
    for j in range(N):
        if A[i] == A[j]:
            B += 1
        else:
            B += 0

if S == N-1 and B == N:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(N):
   A.append(input())
S = 0
for i in range(N-1):
    if A[i][-1] == A[i+1][0]:
        S += 1
B = 0
for i in range(N):
    for j in range(N):
        if A[i] == A[j]:
            B += 1
            else:
                B += 0

if S == N-1 and B == N:
    print('Yes')
else:
    print('No')

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

for i in range(N-1):
     S = 0
     if A[i][-1] == A[i+1][0]:
        S += 1
for i in range(N):
  for j in range(N):
    if i != j:
      if A[i] == A[j]:
        A == 1
      else:
        A == 0

if S == 1 and A == 0:
  print('Yes')
else:
Problem p03262 (python)

Fixed submission:
import fractions
from functools import reduce


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


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


N, X = (int(i) for i in input().split())
A = [int(i) for i in input().split()]


def aho(x):
  return x - X


B = list(map(aho, A))

C = gcd_list(B)

print(abs(C))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(N):
   A.append(input())
S = 0
for i in range(N-1):
    if A[i][-1] == A[i+1][0]:
        S += 1
B = 0
for i in range(N):
    for j in range(N):
        if A[i] == A[j]:
            B += 1
            else:
                B += 0

if S == N-1 and B == N:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(N):
   A.append(input())
S = 0
for i in range(N-1):
    if A[i][-1] == A[i+1][0]:
        S += 1
B = 0
for i in range(N):
    for j in range(N):
      if A[i] == A[j]:
        B += 1
      else:
        B += 0

if S == N-1 and B == N:
    print('Yes')
else:
    print('No')
Problem p03264 (python)

Fixed submission:
K = int(input())
if K % 2 == 0:
    A = (K // 2) * (K // 2)
    print(A)
else:
    B = ((K // 2) + 1) * (K // 2)
    print(B)

Buggy submission (verdict: Runtime Error):
N, K = (int(i) for i in input().split())
D = 0
for i in range(1, N + 1):
    for j in range(1, N + 1):
        A = i + j
        if A % K == 0:
          for k in range(1, N + 1):
            B = j + k
            C = i + k
            if B % K == 0 and C % K == 0:
              D += 1
print(D)

Buggy submission (verdict: Runtime Error):
N, K = (int(i) for i in input().split())
D = 0
for i in range(1, [N + 1]):
    for j in range(1,[N + 1]):
        A = i + j
        if A % K == 0:
            for j in range(1, [N + 1]):
                for k in range(1, [N + 1]):
                    B = j + k
                    C = i + k
                    if B % K == 0 and C % K == 0:
                        D += 1
print(D)

Buggy submission (verdict: Runtime Error):
N, K  = (int(i) for i in input().split())
D = 0
for i in range(N + 1):
    for j in range(N + 1):
         A = i + j
         if A % K == 0:
              for j in range(N + 1):
                  for k in range(N + 1):
                      B = j + k
                      C = i + k
                      if B % K = 0 and C % K = 0:
                          D += 1
print(D)

Buggy submission (verdict: Runtime Error):
A, B, C, D = (int(i) for i in input().split())
if D > B and A > C:
    E = (C - (D - B))
    F = D - (A - C)
    G = (A - (D - B))
    H = B - (A - C)
    print(E, F, G, H)
elif A > C and B > D:
    E = C + (B - D)
    F = D - (A - C)
    G = A + (B - D)
    H = B - (A - C)
    print(E, F, G, H)
elif B > D and C > A:
    E = (C + (B - D))
    F = D + (C - A)
    G = (A + (B - D))
    H = B + (C - A)
    print(E, F, G, H)
else:
    E = C - (D - B)
    F = D + (C - A)
    G = A - (D - B)
    H = B + (C - A)
    print(E, F, G, H)

Buggy submission (verdict: Runtime Error):
K = (int(i) for i in input().split())
if K % 2 == 0:
    A = (K / 2) * (K / 2)
    print(A)
else:
    B = ((K / 2) + 1) * (K / 2)
    print(B)
Problem p03280 (python)

Fixed submission:
A, B = (int(i) for i in input().split())
C = (A - 1) * (B - 1)
print(C)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N < 105:
  print(0)
elif 105 <= N < 155:
  print(1)
elif 155 <= N < 195:
  print(2)
else:
  print(3)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N < 105:
  print(0)
elif 105 <= N < 155:
  print(1)
else:
  print(2)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N <= 105:
  print(1)
elif N > 105:
  print(2)