Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# import collections

print('input >>')
N, K, Q = map(int, (input().split()))
points = [K] * N
A = []
for _ in range(Q):
    A.append(int(input()))

Acount = collections.Counter(A)

for answerer, times in Acount.items():
    points = [p - times for p in points]
    points[answerer - 1] += times

# print('----------output----------')

for answerer in range(N):
    print('Yes') if points[answerer] > 0 else print('No')

Fixed submission:
import collections

# print('input >>')
N, K, Q = map(int, (input().split()))
points = [K] * N
A = []
for _ in range(Q):
    A.append(int(input()))

Acount = collections.Counter(A)

for answerer, times in Acount.items():
    points[answerer - 1] += times

# print('----------output----------')

for answerer in range(N):
    print('Yes') if points[answerer] > Q else print('No')

Buggy python submission (verdict: Time Limit Exceeded):
# import collections

# print('input >>')
N, K, Q = map(int, (input().split()))
points = [K] * N
A = []
for _ in range(Q):
    A.append(int(input()))

# Acount = collections.Counter(A)

for answer in A:
    points = [p - 1 for p in points]
    points[answer - 1] += 1

# print('----------output----------')

for answerer in range(N):
    print('Yes') if points[answerer] > 0 else print('No')

Fixed submission:
import collections

# print('input >>')
N, K, Q = map(int, (input().split()))
points = [K] * N
A = []
for _ in range(Q):
    A.append(int(input()))

Acount = collections.Counter(A)

for answerer, times in Acount.items():
    points[answerer - 1] += times

# print('----------output----------')

for answerer in range(N):
    print('Yes') if points[answerer] > Q else print('No')
Buggy python submission (verdict: Runtime Error):
import collections
from scipy.special import comb

N = int(input())
s = []
for _ in range(N):
    s.append(list(input()))

for i in range(len(s)):
    s[i] = tuple(sorted(s[i]))
    
c = collections.Counter(s)

cnt = 0
for c_ in c.values():
    cnt += comb(c_, 2)
    
print(int(cnt))

Fixed submission:
import collections
from scipy.misc import comb

N = int(input())
s = []
for _ in range(N):
    s.append(list(input()))

for i in range(len(s)):
    s[i] = tuple(sorted(s[i]))
    
c = collections.Counter(s)

cnt = 0
for c_ in c.values():
    cnt += comb(c_, 2, exact=True)
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
import math

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

ball_arr = [0] * N

for i in range(math.ceil(N/2), N):
    ball_arr[i] = a[i]
    
# print(ball_arr)

for i in reversed(range(math.ceil(N/2))):
    # print(i+1)
    # print(sum(ball_arr[i-1::i+1]))
    # print(sum(ball_arr[i-1::i+1]) != a[i])
    mul_arr = ball_arr[i-1::i+1]
    if sum(mul_arr) != a[i]:
        # print((mull_arr.index(0)+1)*i)
        ball_arr[(mul_arr.index(0)+1)*i] = 1
    # print(ball_arr)
    # print('---')
# print(ball_arr)

M = sum(ball_arr)
print(M)
for i, v in enumerate(ball_arr):
    if v == 1:
        print(i+1, end=' ')

Fixed submission:
import sys

import math

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

ball_arr = [0] * N

for i in range(math.floor(N/2), N):
    ball_arr[i] = a[i]
    
# print(ball_arr)

for i in reversed(range(math.floor(N/2))):
    # print(i)
    # print(i+1)
    # print(sum(ball_arr[i-1::i+1]))
    # print(sum(ball_arr[i-1::i+1]) != a[i])
    mul_arr = ball_arr[i::i+1]
    # print(mul_arr)
    if sum(mul_arr) % 2 != a[i]:
        # print((mull_arr.index(0)+1)*i)
        if 0 in mul_arr: 
            ball_arr[(mul_arr.index(0)+1)*i] = 1
        else:
            print(-1)
            sys.exit()
    # print(ball_arr)
    # print('---')
# print(ball_arr)

M = sum(ball_arr)
print(M)
for i, v in enumerate(ball_arr):
    if v == 1:
        print(i+1, end=' ')
Buggy python submission (verdict: Runtime Error):
import math

def lcm(a, b):
    y = a*b / math.gcd(a, b)
    return int(y)

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

A -= 1

lcm_cd = lcm(C, D)
a_by_c = A // C
a_by_d = A // D
b_by_c = B // C
b_by_d = B // D
a_by_cd = A // lcm_cd
b_by_cd = B // lcm_cd

toB = B - (b_by_c + b_by_d - b_by_cd)
toA = A - (a_by_c + a_by_d - a_by_cd)

print(toB - toA)

Fixed submission:
import fractions

def lcm(a, b):
    y = a*b / fractions.gcd(a, b)
    return int(y)

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

A -= 1

lcm_cd = lcm(C, D)
a_by_c = A // C
a_by_d = A // D
b_by_c = B // C
b_by_d = B // D
a_by_cd = A // lcm_cd
b_by_cd = B // lcm_cd

toB = B - (b_by_c + b_by_d - b_by_cd)
toA = A - (a_by_c + a_by_d - a_by_cd)

print(toB - toA)
Buggy python submission (verdict: Runtime Error):
import sys
 
def fibo(n):
    a, b = 0, 1
    if n == 1:
        return 1
    else:
        for i in range(n):
            a0 = a
            a = b
            b = a0 + b
        return b
        
N, M = map(int, input().split())
a = []
 
if M == 0:
    print(fibo(N) % 1000000007)
    sys.exit()
 
for i in range(M):
    a.append(int(input()))
    
for j in range(len(a)-1):
    if a[j+1] - a[j] == 1:
        print(0)
        sys.exit()
    
hole = 0
pattern = 1
 
for i, k in enumerate(a):
    if i == 0:
        pattern *= fibo(k-1)
    else:
        if i > 0:
            pattern *= fibo(a[i]-a[i-1]-2)
        
pattern *= fibo(N-a[-1]-1)
print(pattern % 1000000007)

Fixed submission:
L = list(map(int,input().split()))
L.sort()
print(L[0]+L[1])
Buggy python submission (verdict: Runtime Error):
def intersect(a, b, c, d):
    if b <= c or d <= a:
        return None
    else:
        li = sorted([a, b, c, d])
        return li[1], li[2]
        
N, M = map(int, input().split())
LR = []
for _ in range(M):
    LR.append(tuple(map(int, input().split())))
    
a, b = LR[0]
for lr in LR:
    a, b = intersect(a, b, *lr)
    
print(b-a + 1)

Fixed submission:
def intersect(a, b, c, d):
    if b < c or d < a:
        return -2, -1
    else:
        li = sorted([a, b, c, d])
        return li[1], li[2]
        
N, M = map(int, input().split())
LR = []
for _ in range(M):
    LR.append(tuple(map(int, input().split())))
    
a, b = LR[0]
for lr in LR:
    a, b = intersect(a, b, *lr)
    
ans = b-a+1
print(ans) if a > 0 else print('0')
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
from functools import reduce

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

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

gcd_max = 0

for i, _ in enumerate(A):
    gcd_max = max(gcd_max, gcd(A[:i] + A[i+1:]))
    
print(gcd_max)

# 考え中。。。

Fixed submission:
from fractions import gcd
 
N = int(input())
A = list(map(int, input().split()))
 
L = [0] * (N+1)
R = [0] * (N+1)
 
L[0] = 0
R[-1] = 0
 
for i in range(len(A)):
    L[i] = gcd(L[i-1], A[i])
    
for i in reversed(range(len(A))):
    R[i] = gcd(R[i+1], A[i])
    
ans = 0    
 
for i in range(N):
    ans = max(ans, gcd(L[i-1], R[i+1]))
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
from functools import reduce

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

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

gcd_max = 0

for i, _ in enumerate(A):
    gcd_max = max(gcd_max, gcd(A[:i] + A[i+1:]))
    
print(gcd_max)

Fixed submission:
from fractions import gcd
 
N = int(input())
A = list(map(int, input().split()))
 
L = [0] * (N+1)
R = [0] * (N+1)
 
L[0] = 0
R[-1] = 0
 
for i in range(len(A)):
    L[i] = gcd(L[i-1], A[i])
    
for i in reversed(range(len(A))):
    R[i] = gcd(R[i+1], A[i])
    
ans = 0    
 
for i in range(N):
    ans = max(ans, gcd(L[i-1], R[i+1]))
    
print(ans)
Buggy python submission (verdict: Runtime Error):
N = input()
S = input()
K = int(input())

char = S[K]

for s in S:
    print('*',end='') if s != char else print(s,end='')

Fixed submission:
N = input()
S = input()
K = int(input())
 
char = S[K-1]
 
for s in S:
    print('*',end='') if s != char else print(s,end='')
Buggy python submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
AC = [0] * N

for i in range(1, len(S)):
    if S[i-1] == 'A' and S[i] == 'C':
        AC[i] = AC[i-1] + 1
    else:
        AC[i] = AC[i-1]


for i in range(Q):
    start, end = map(lambda x:int(x)-1, input().split())
    print(AC[end] - AC[start])

Fixed submission:
b = input()

if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'C':
  print('G')
else:
  print('C')
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
AC = [0] * N

for i in range(len(S)-1):
    if S[i] == 'A' and S[i+1] == 'C':
        AC[i] = 1

for i in range(Q):
    start, end = map(lambda x:int(x)-1, input().split())
    ans = sum(AC[start:end+1])
    if AC[end] == 1 and ans != 0:
        ans -= 1
    print(ans)

Fixed submission:
N, Q = map(int, input().split())
S = input()
AC = [0] * N

for i in range(1, len(S)):
    if S[i-1] == 'A' and S[i] == 'C':
        AC[i] = AC[i-1] + 1
    else:
        AC[i] = AC[i-1]


for i in range(Q):
    start, end = map(lambda x:int(x)-1, input().split())
    print(AC[end] - AC[start])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()

for i in range(Q):
    start, end = map(int, input().split())
    print(S[start-1:end].count('AC'))

Fixed submission:
N, Q = map(int, input().split())
S = input()
AC = [0] * N

for i in range(1, len(S)):
    if S[i-1] == 'A' and S[i] == 'C':
        AC[i] = AC[i-1] + 1
    else:
        AC[i] = AC[i-1]


for i in range(Q):
    start, end = map(lambda x:int(x)-1, input().split())
    print(AC[end] - AC[start])
Buggy python submission (verdict: Runtime Error):
S = list(input())
i = 0
cnt = 0

while True:
    if len(S) < 2:
        break
    if S[i] != S[i+1]:
        cnt += 2
        S.pop(i)
        S.pop(i)
        if i > 0:
            i -= 1
    else:
        i += 1
print(cnt)

Fixed submission:
import sys

S = list(input())
i = 0
cnt = 0

if len(S) == 1:
    print(0)
    sys.exit()

while True:
    if i == len(S) - 2:
        if S[i] != S[i+1]:
            cnt += 2
        break
    if S[i] != S[i+1]:
        cnt += 2
        S.pop(i)
        S.pop(i)
        if i > 0:
            i -= 1
    else:
        i += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
S = list(input())
i = 0
cnt = 0

while True:
    if i == len(S) - 2:
        break
    if S[i] != S[i+1]:
        cnt += 2
        S.pop(i)
        S.pop(i)
        if i > 0:
            i -= 1
    else:
        i += 1
print(cnt)
    

Fixed submission:
import sys

S = list(input())
i = 0
cnt = 0

if len(S) == 1:
    print(0)
    sys.exit()

while True:
    if i == len(S) - 2:
        if S[i] != S[i+1]:
            cnt += 2
        break
    if S[i] != S[i+1]:
        cnt += 2
        S.pop(i)
        S.pop(i)
        if i > 0:
            i -= 1
    else:
        i += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
3
100000000 JPY
100.00000000 BTC
0.00000001 BTC

Fixed submission:
N = int(input())

ot = 0
for i in range(N):
    x,u = input().split()
    if u == 'JPY':
        ot += int(x)
    if u == 'BTC':
        ot += float(x)*380000
        
print(ot)
Buggy python submission (verdict: Runtime Error):
# PROXY

import functools
import math
N = int(input())
Nlist = [int(i) for i in input().split()]
gcd = functools.reduce(math.gcd, Nlist)
print(gcd)

Fixed submission:
# PROXY

import functools
import fractions
N = int(input())
Nlist = [int(i) for i in input().split()]
gcd = functools.reduce(fractions.gcd, Nlist)
print(gcd)
Buggy python submission (verdict: Time Limit Exceeded):
K, A, B = map(int,input().split())

sunuke_has = [1,0]

for i in range(K):
    if A < B-1:
        if sunuke_has[1] == 0:
            if sunuke_has[0] < A:
                sunuke_has[0] += 1
            else:
                if i != K-1:
                    sunuke_has[0] -= A
                    sunuke_has[1] += 1
                else:
                    sunuke_has[0] += 1
        else:
            sunuke_has[1] = 0
            sunuke_has[0] += B
    else:
        sunuke_has[0] += 1
    #print(str(i) + '回目')
    #print(sunuke_has)
        
print(sunuke_has[0])

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

first_bis = min(K,A)-1
second_exchange = int((K-first_bis)/2)
final_bis = K-first_bis-second_exchange*2

if A<B-1:
    bis = 1+first_bis+second_exchange*(B-A)+final_bis
else:
    bis = K+1
    
print(bis)
Buggy python submission (verdict: Runtime Error):
10
1 8 10 5 8 12 34 100 11 3

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

L.sort()
L.reverse()

if L[0] < sum(L)-L[0]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()

X_dif = []

excep = 0

if M == 1:
    excep = 'M1'
    
if not excep == 'M1':
    for i in range(M-1):
        X_dif.append(X[i+1]-X[i])
    
    X_dif.sort()
    X_dif.reverse()

    if len(X_dif) == 1:
        excep = 'X_dif1'
    
    if not excep == 'X_dif1':
        for N in range(N-1):
            X_dif.pop(0)

if excep == 'M1':
    print(1)
elif excep == 'X_dif1':
    print(2)
else:
    print(sum(X_dif))

Fixed submission:
# print('input >>')
N, M = map(int,(input().split()))
X = list(map(int,(input().split())))
X.sort()
Xdiff = [X[i + 1] - X[i] for i in range(len(X) - 1)]
Xdiff.sort(reverse=True)
ans = (X[-1]-X[0]) - sum(Xdiff[:N-1])

# print('----------output----------')
print(ans)

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

X_dif = []

excep = 0

if M == 1:
    excep = M1
    
if not excep = M1:
    for i in range(M-1):
        X_dif.append(X[i+1]-X[i])
    
    X_dif.sort()
    X_dif.reverse()

    if len(X_dif) == 1:
        excep == X_dif1
    
    if not X_dif1:
        for N in range(N-1):
            X_dif.pop(0)

if excep == M1:
    print(1)
elif excep == X_dif1:
    print(2)
else:
    print(sum(X_dif))

Fixed submission:
# print('input >>')
N, M = map(int,(input().split()))
X = list(map(int,(input().split())))
X.sort()
Xdiff = [X[i + 1] - X[i] for i in range(len(X) - 1)]
Xdiff.sort(reverse=True)
ans = (X[-1]-X[0]) - sum(Xdiff[:N-1])

# print('----------output----------')
print(ans)

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

X_dif = []

for i in range(M-1):
    X_dif.append(X[i+1]-X[i])
    
X_dif.sort()
X_dif.reverse()

for N in range(N-1):
    X_dif.pop(0)
    
print(sum(X_dif))

Fixed submission:
# print('input >>')
N, M = map(int,(input().split()))
X = list(map(int,(input().split())))
X.sort()
Xdiff = [X[i + 1] - X[i] for i in range(len(X) - 1)]
Xdiff.sort(reverse=True)
ans = (X[-1]-X[0]) - sum(Xdiff[:N-1])

# print('----------output----------')
print(ans)

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

X_dif = []

for i in range(M-1):
    X_dif.append(X[i+1]-X[i])
    
X_dif.sort()
X_dif.reverse()

for N in range(N-1):
    X_dif.pop(0)
    
print(sum(X_dif))

Fixed submission:
# print('input >>')
N, M = map(int,(input().split()))
X = list(map(int,(input().split())))
X.sort()
Xdiff = [X[i + 1] - X[i] for i in range(len(X) - 1)]
Xdiff.sort(reverse=True)
ans = (X[-1]-X[0]) - sum(Xdiff[:N-1])

# print('----------output----------')
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

# print('input >>')
N, K = map(int, (input().split()))
h = []
for _ in range(N):
    h.append(int(input()))

h.sort()
hdiff = [h[i + 1] - h[i] for i in range(len(h) - 1)]
hdiff = np.array(hdiff)
ans = 10 ** 10
# print('hdiff: %s' % hdiff)
for i in range(N - K+1):
    # print('i %s' % i)
    # print('hdiff[i:i+K-1]: %s' % hdiff[i:i+K-1])
    ans = min(ans,np.sum(hdiff[i:i+K-1]))

# print('----------output----------')
print(ans)

Fixed submission:
import numpy as np

# print('input >>')
N, K = map(int, (input().split()))
h = []
for _ in range(N):
    h.append(int(input()))

h.sort()
hdiff = [h[i + 1] - h[i] for i in range(len(h) - 1)]
hdiff = np.array(hdiff)
ans = np.sum(hdiff[0:0+K-1])
# print('hdiff: %s' % hdiff)
sum_ = np.sum(hdiff[0:0+K-1])
for i in range(1, N-K+1):
    # print('i %s' % i)
    # print('hdiff[i:i+K-1]: %s' % hdiff[i:i+K-1])]
    sum_ = sum_-hdiff[i-1]+hdiff[i+K-2]
    ans = min(ans, sum_)

# print('----------output----------')
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# print('input >>')

N, K = map(int, (input().split()))
h = []
for _ in range(N):
    h.append(int(input()))

h.sort()
hdiff = [h[i + 1] - h[i] for i in range(len(h) - 1)]
ans = 10 ** 10
# print('hdiff: %s' % hdiff)
for i in range(N - K+1):
    # print('i %s' % i)
    # print('hdiff[i:i+K-1]: %s' % hdiff[i:i+K-1])
    ans = min(ans,sum(hdiff[i:i+K-1]))

# print('----------output----------')
print(ans)

Fixed submission:
import numpy as np

# print('input >>')
N, K = map(int, (input().split()))
h = []
for _ in range(N):
    h.append(int(input()))

h.sort()
hdiff = [h[i + 1] - h[i] for i in range(len(h) - 1)]
hdiff = np.array(hdiff)
ans = np.sum(hdiff[0:0+K-1])
# print('hdiff: %s' % hdiff)
sum_ = np.sum(hdiff[0:0+K-1])
for i in range(1, N-K+1):
    # print('i %s' % i)
    # print('hdiff[i:i+K-1]: %s' % hdiff[i:i+K-1])]
    sum_ = sum_-hdiff[i-1]+hdiff[i+K-2]
    ans = min(ans, sum_)

# print('----------output----------')
print(ans)
Buggy python submission (verdict: Runtime Error):
3 2 10 20
8 15 13
16 22

Fixed submission:
n,m,x,y = map(int,input().split())
xs = list(map(int,input().split()))
ys = list(map(int,input().split()))

war = True

for z in range(-100,101):
    new_xs = xs + [z]
    new_ys = ys + [z]
    new_xs.sort()
    new_ys.sort()
    if new_xs[-1] == z and new_xs[-2] != z and new_ys[0] == z and x<z<=y:
        war = False
        
if war:
    print('War')
else:
    print('No War')
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
T = input()

dicS = {}
dicT = {}

for i,_s_ in enumerate(S):
   if not _s_ in dicS:
       dicS[_s_] = []
   dicS[_s_] = dicS[_s_] + [i]
   
for i,_t_ in enumerate(T):
    if not _t_ in dicT:
        dicT[_t_] = []
    dicT[_t_] = dicT[_t_] + [i]
    
listS = []
listT = []

for _s_ in dicS.values():
    listS.append(_s_)
    
for _t_ in dicT.values():
    listT.append(_t_)

for i,_s_ in enumerate(listS):
    listS[i] = tuple(_s_)
    
for i,_t_ in enumerate(listT):
    listT[i] = tuple(_t_)


setS = set(listS)
setT = set(listT)

if setS == setT:
   print('Yes')
else:
    print('No')

Fixed submission:
S = input()
T = input()
 
dicS = {}
dicT = {}

alphabet = "abcdefghijklmnopqrstuvwxyz"

for _a in alphabet:
    dicS[_a] = []
    dicT[_a] = []

for i,_s_ in enumerate(S):
    dicS[_s_].append(i)
   
for i,_t_ in enumerate(T):
    dicT[_t_].append(i)

for _s in dicS:
    dicS[_s] = tuple(dicS[_s])

for _t in dicT:
    dicT[_t] = tuple(dicT[_t])

flg = True
for t in dicS.values():
    if not t in dicT.values():
        flg = False
        
if flg:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import functools
import fractions
N, X = [int(i) for i in input().split()]
X_N = [int(i) for i in input().split()]
list = []
for e in [int(i) for i in input().split()]:
    list.append(abs(e - X))
gcd = functools.reduce(fractions.gcd, list)
print(gcd)

Fixed submission:
import fractions as math

N, X = map(int,(input().split()))
x = list(map(int,input().split()))
x.append(X)
x_min = min(x)

x_0 = [x_- x_min for x_ in x]

gcd = x_0[0]
for x_0_ in x_0:
    gcd = math.gcd(gcd,x_0_)

print(gcd)

Buggy python submission (verdict: Runtime Error):
# PROXY

import functools
import fractions
N, X = [int(i) for i in input().split()]
X_N = [int(i) for i in input().split()]
list = []
for e in [int(i) for i in input().split()]:
    list.append(abs(e - X))
gcd = functools.reduce(fractions.gcd, list)
print(gcd)
    

Fixed submission:
import fractions as math

N, X = map(int,(input().split()))
x = list(map(int,input().split()))
x.append(X)
x_min = min(x)

x_0 = [x_- x_min for x_ in x]

gcd = x_0[0]
for x_0_ in x_0:
    gcd = math.gcd(gcd,x_0_)

print(gcd)

Buggy python submission (verdict: Runtime Error):
# PROXY

import functools
import math
N, X = [int(i) for i in input().split()]
X_N = [int(i) for i in input().split()]
list = []
for e in [int(i) for i in input().split()]:
    list.append(abs(e - X))
gcd = functools.reduce(math.gcd, list)
print(gcd)

Fixed submission:
import fractions as math

N, X = map(int,(input().split()))
x = list(map(int,input().split()))
x.append(X)
x_min = min(x)

x_0 = [x_- x_min for x_ in x]

gcd = x_0[0]
for x_0_ in x_0:
    gcd = math.gcd(gcd,x_0_)

print(gcd)

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

N, X = map(int,(input().split()))
x = list(map(int,input().split()))
x_min = min(x)

x_0 = [x_- x_min for x_ in x]

gcd = x_0[0]
for x_0_ in x_0:
    gcd = math.gcd(gcd,x_0_)

ans = gcd

if N==1:
    ans = abs(x[0] - X)

print(ans)

Fixed submission:
import fractions as math

N, X = map(int,(input().split()))
x = list(map(int,input().split()))
x.append(X)
x_min = min(x)

x_0 = [x_- x_min for x_ in x]

gcd = x_0[0]
for x_0_ in x_0:
    gcd = math.gcd(gcd,x_0_)

print(gcd)

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

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

N, X = map(int,(input().split()))
x = list(map(int,input().split()))
x_min = min(x)

x_0 = [x_- x_min for x_ in x]

ans = gcd_list(x_0)

if N==1:
    ans = abs(x[0] - X)

print(ans)

Fixed submission:
import fractions as math

N, X = map(int,(input().split()))
x = list(map(int,input().split()))
x.append(X)
x_min = min(x)

x_0 = [x_- x_min for x_ in x]

gcd = x_0[0]
for x_0_ in x_0:
    gcd = math.gcd(gcd,x_0_)

print(gcd)
Buggy python submission (verdict: Runtime Error):
import math

# print('input >>')
D, G = map(int, (input().split()))
pc = []
for _ in range(D):
    p, c = map(int, (input().split()))
    pc.append((p, c))

point = 0
ans = []

def dfs(i, count, point):
    # Gまで到達したかどうか確かめる
    if point >= G:
        ans.append(count)
        return
    # 途中まで解いてGまで届くかどうか試す
    if point + (i + 1) * 100 * (pc[i][0] - 1) >= G:
        count += math.ceil((G - point) / ((i + 1) * 100))
        point += math.ceil((G - point) / ((i + 1) * 100)) * (i + 1) * 100
        ans.append(count)
    if i == 0:
        return
    # 完全に解く
    dfs(i-1, count+pc[i][0], point + (i+1)*100 * pc[i][0] + pc[i][1])
    # 完全に解かない
    dfs(i-1, count, point)

dfs(D-1,0,0)

# print('----------output----------')
print(min(ans))

Fixed submission:
import math

# print('input >>')
D, G = map(int, (input().split()))
pc = []
for _ in range(D):
    p, c = map(int, (input().split()))
    pc.append((p, c))

point = 0
ans = []

def dfs(i, count, point):
    # Gまで到達したかどうか確かめる
    c_ = count
    if point >= G:
        ans.append(count)
        return
    # 途中まで解いてGまで届くかどうか試す
    if point + (i + 1) * 100 * (pc[i][0] - 1) >= G:
        count += math.ceil((G - point) / ((i + 1) * 100))
        ans.append(count)
    # 全部解いてGまで届くかどうか試す
    elif point + (i + 1) * 100 * pc[i][0] + pc[i][1] >= G:
        count += pc[i][0]
        ans.append(count)
    if i == 0:
        return
    # 完全に解く
    dfs(i-1, c_+pc[i][0], point + (i+1)*100 * pc[i][0] + pc[i][1])
    # 完全に解かない
    dfs(i-1, c_, point)

dfs(D-1,0,0)

# print('----------output----------')
print(min(ans))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a - a*b >= 0:
  print(a-2*b)
else
  print("0")

Fixed submission:
a, b = map(int, input().split())
if a - 2*b >= 0:
  print(a-2*b)
else:
  print("0")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = input().split(' ')
a = 0
sum = 0
for i in range(1, N):
    sum += int(A[i])
for i in range(N):
    a += int(A[i]) *  sum
    if i < N - 1:
        sum -= int(A[i + 1])
    
print(int(a % (1e9 + 7)))

Fixed submission:
line = input().split(' ')
D = float(line[0])
T = float(line[1])
S = float(line[2])

if D / S <= T:
    print("Yes")
else:
    print("No")