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

Fixed submission:
a,b=(int(x) for x in input().split())
if int(25*(a+1)/2)<int(10*b):
  print(-1)
elif int(25*(a+1)/2)==int(10*b):
  if a%2==1:
    print(-1)
  else:
    print(int(10*b))
elif int(10*(b+1))<=int(25*a/2):
  print(-1)
elif int(10*(b+1)-1)==int(25*a/2):
  if a%2==1:
    print(-1)
  else:
    print(int(25*a/2))  
else:
  if a%2==1:
    print(max([int(25*a/2+1),int(10*b)]))
  else:
    print(max([int(25*a/2),int(10*b)]))

Buggy submission (verdict: Runtime Error):
a,b=(int(x) for x in input().split())
if int(25*(a+1)/2)<int(10*b):
  print(-1)
if int(25*(a+1)/2)=int(10*b):
  if a%2==0:
    print(-1)
  else:
    print(int(25*a/2))
if int(10*(b+1))<=int(25*a/2):
  print(-1)
else:
  if a%2==1:
    print(max([int(25*a/2+1),int(10*b)]))
  else:
    print(max([int(25*a/2),int(10*b)]))
Problem p03109 (python)

Fixed submission:
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or mm==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if dd>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if dd>30:
        print('TBD')
      else:
        print('Heisei')

Buggy submission (verdict: Runtime Error):
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or mm==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if d>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if d>30:
        print('TBD')
      else:
        print('Heisei')

Buggy submission (verdict: Runtime Error):
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or mm==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if d>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if d>30:
        print('TBD')
      else:
        print('Heisei')



  if mm<=4:
    if dd<=30:
      print('Heisei')
else:
  print('TBD')

Buggy submission (verdict: Runtime Error):
yy,mm,dd =map(int,input().split('/'))

if yy>2019:
  print('TBD')
else:
  if mm>4:
    print('TBD')
  else:
    if mm==1 or m==3:
      if dd>31:
        print('TBD')
      else:
        print('Heisei')
    if mm==2:
      if d>29:
        print('TBD')
      else:
        print('Heisei')
    if mm==4:
      if d>30:
        print('TBD')
      else:
        print('Heisei')



  if mm<=4:
    if dd<=30:
      print('Heisei')
else:
  print('TBD')
Problem p03110 (python)

Fixed submission:
N = int(input())

answer=0
for _ in range(N):
    money_str, unit = input().split()
    money = float(money_str)
    if unit == "BTC":
        money *= 380000
    answer += money

print(answer)

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

answer=0
for _ in range(N):
    money_str, unit = input().split()
    money = float(money)
    if unit == "BTC":
        money *= 380000
    answer += money

print(answer)
Problem p03145 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(a*b/2)
Problem p02683 (python)

Fixed submission:
import itertools
import numpy as np

N, M, X = map(int, input().split())
lis_all = [list(map(int, input().split())) for _ in range(N)]

lis_C = np.array(list(map(lambda x: x[0], lis_all)))
lis_A = np.array(list(map(lambda x: x[1:], lis_all)))

row_idx = []
bools = [True,False]
for boollis in itertools.product(bools, repeat=N):
    row_idx.append(list(boollis))


c_min = lis_C.sum()+100
for i in range(len(row_idx)):
    if all(lis_A[row_idx[i]].sum(axis=0) >= X):
        c_min = min(lis_C[row_idx[i]].sum(), c_min)
if c_min > lis_C.sum():
    ans = -1
else :
    ans = c_min
print(ans)

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

N, M, X = map(int, input().split())
lis_all = [list(map(int, input().split())) for _ in range(N)]

lis_C = np.array(list(map(lambda x: x[0], lis_all)))
lis_A = np.array(list(map(lambda x: x[1:], lis_all)))

row_idx = []
bools = [True,False]
for boollis in itertools.product(bools, repeat=M):
    row_idx.append(list(boollis))

c_min = lis_C.sum()+100
for i in range(len(lis_idx)):
    if all(lis_A[row_idx[i]].sum(axis=0) >= X):
        c_min = min(lis_C[row_idx[1]].sum(), c_min)
if c_min > lis_C.sum():
    ans = -1
else :
    ans = c_min
print(ans)
Problem p02767 (python)

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

lis_X_sorted = sorted(lis_X)

def calc_dif_sq(a,b):
    return (a-b)**2

if N == 1:
    ans = 0
elif min(lis_X_sorted)==max(lis_X_sorted):
    ans = 0
else :
    res = []
    for p in range(lis_X_sorted[0],lis_X_sorted[-1]):
        tmp = sum(list(map(lambda x:calc_dif_sq(x, p), lis_X_sorted)))
        res.append(tmp)
    ans = min(res)
print(ans)

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

lis_X_sorted = sorted(lis_X)

def calc_dif_sq(a,b):
    return (a-b)**2

if N == 1:
    ans = 0
else :
    res = []
    for p in range(lis_X_sorted[0],lis_X_sorted[-1]):
        tmp = sum(list(map(lambda x:calc_dif_sq(x, p), lis_X_sorted)))
        res.append(tmp)
    ans = min(res)
print(ans)

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

lis_X_sorted = sorted(lis_X)

def calc_dif_sq(a,b):
    return (a-b)**2

res = []
for p in range(lis_X_sorted[0],lis_X_sorted[-1]):
    tmp = sum(list(map(lambda x:calc_dif_sq(x, p), lis_X_sorted)))
    res.append(tmp)
ans = min(res)
print(ans)

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

lis_X_sorted = sorted(lis_X)

def calc_dif_sq(x,p):
    return (x-p)**2

res = []
for p in range(lis_X_sorted[0],lis_X_sorted[-1]):
    tmp = sum(map(lambda x:calc_dif_sq(x, p), lis_X_sorted))
    res.append(tmp)
ans = min(res)
print(ans)
Problem p02786 (python)

Fixed submission:
H = int(input())
counter = 0
i = H
while i > 1:
    i = i//2
    counter += 1
    
ans = int(2**(counter+1)-1)
print(ans)

Buggy submission (verdict: Runtime Error):
%%time
H = int(input())
counter = 0
i = H
while i > 1:
    i = i//2
    counter += 1
    
ans = 2**(counter+1)-1
print(ans)
Problem p02791 (python)

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

counter=0
minimum = 10000000
for i in range(N):
    minimum = min([minimum,lis[i]])
    counter += int(lis[i] <= minimum)
print(counter)

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

counter = 0
for i in range(N):
    counter += int(lis[i] <= min(lis[:i+1]))
print(counter )
Problem p02691 (python)

Fixed submission:
from _collections import defaultdict
import sys

read = sys.stdin.buffer.read
N = int(input())
A = [int(i) for i in input().split()]
D = defaultdict(int)

for i, a in enumerate(A, 1):
    D[i - a] += 1

ans = 0
for i, a in enumerate(A, 1):
    ans += D[i + a]
print(ans)

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

N = int(input())
A = np.array(input().split(), np.int32)
B = np.arange(1, N + 1)
X = A[None, :] + A[:, None]
Y = B[None, :] - B[:, None]
print(np.count_nonzero(X == Y))

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

N = int(input())
A = np.array(input().split(), np.float32)
B = np.arange(1, N + 1)
X = A[None, :] + A[:, None]
Y = np.abs(B[None, :] - B[:, None])
print(np.count_nonzero(X == Y) // 2)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = np.array(input().split(), np.int64)
B = np.arange(1, N + 1)
X = A[None,:] + A[:,None]
Y = B[None,:] - B[:,None]
print(np.count_nonzero(X == Y))
Problem p02692 (python)

Fixed submission:
X = [0, 0, 0]
N, X[0], X[1], X[2] = map(int, input().split())
Q = []
for _ in range(N):
    s = input()
    if s == 'AB':
        Q.append([0, 1])
    elif s == 'AC':
        Q.append([0, 2])
    else:
        Q.append([1, 2])
ans = True
ret = ''
for i in range(N):
    a = Q[i][0]
    b = Q[i][1]
    if X[a] == X[b] == 0:
        ans = False
        break
    elif X[a] < X[b]:
        ret += chr(ord(str(a)) + 17)
        X[a] += 1
        X[b] -= 1
    elif X[a] > X[b] or i == N - 1:
        ret += chr(ord(str(b)) + 17)
        X[a] -= 1
        X[b] += 1
    else:
        s = Q[i + 1][0]
        t = Q[i + 1][1]
        if a == s or a == t:
            ret += chr(ord(str(a)) + 17)
            X[a] += 1
            X[b] -= 1
        else:
            ret += chr(ord(str(b)) + 17)
            X[a] -= 1
            X[b] += 1
    if X[a] < 0 or X[b] < 0:
        ans = False
        break
if ans:
    print('Yes')
    print('\n'.join(ret))
else:
    print('No')

Buggy submission (verdict: Runtime Error):
X = [0, 0, 0]
N, X[0], X[1], X[2] = map(int, input().split())
Q = []
for _ in range(N):
    s = input()
    if s == 'AB':
        Q.append([0, 1])
    elif s == 'AC':
        Q.append([0, 2])
    else:
        Q.append([1, 2])
ans = True
ret = ''
for i in range(N):
    a = Q[i][0]
    b = Q[i][1]
    if X[a] == X[b] == 0:
        ans = False
        break
    elif X[a] < X[b]:
        ret += chr(ord(str(a)) + 17)
        X[a] += 1
        X[b] -= 1
    elif X[a] > X[b] or i == N - 1:
        ret += chr(ord(str(b)) + 17)
        X[a] -= 1
        X[b] += 1
    else:
        s = Q[i + 1][0]
        t = Q[i + 1][1]
        if a == s or a == t:
            ret += chr(ord(str(a)) + 17)
            X[a] += 1
            X[b] -= 1
        else:
            ret += chr(ord(str(b)) + 17)
            X[a] -= 1
            X[b] += 1
    print(X, ret)
    if X[a] < 0 or X[b] < 0:
        ans = False
        break
if ans:
    print('Yes')
    print('\n'.join(ret))
else:
    print('No')

Buggy submission (verdict: Runtime Error):
X = [0, 0, 0]
N, X[0], X[1], X[2] = map(int, input().split())
Q = []
for _ in range(N):
    s = input()
    if s == 'AB':
        Q.append([0, 1])
    elif s == 'AC':
        Q.append([0, 2])
    else:
        Q.append([1, 2])
ans = True
ret = ''
for i in range(N):
    a = Q[i][0]
    b = Q[i][1]
    if X[a] == X[b] == 0:
        ans = False
        break
    elif i == N - 1 or X[a] < X[b]:
        ret += chr(ord(str(a)) + 17)
        X[a] += 1
        X[b] -= 1
    elif X[a] > X[b]:
        ret += chr(ord(str(b)) + 17)
        X[a] -= 1
        X[b] += 1
    else:
        s = Q[i + 1][0]
        t = Q[i + 1][1]
        if a == s or a == t:
            ret += chr(ord(str(a)) + 17)
            X[a] += 1
            X[b] -= 1
        else:
            ret += chr(ord(str(b)) + 17)
            X[a] -= 1
            X[b] += 1
    if X[i] < 0 or X[j] < 0:
        ans = False
        break
if ans:
    print('Yes')
    print('\n'.join(ret))
else:
    print('No')
Problem p02694 (python)

Fixed submission:
import math
N=int(input())

x=100.0
for i in range(N):
    x=math.floor(x*1.01)
    if(x>=N):
        print(i+1)
        break;
    i+=1

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

x=100.0
for i in range(N):
    x=math.floor(x*1.01)
    if(x>=N):
        print(i+1)
        break;
    i+=1
Problem p02760 (python)

Fixed submission:
A=[]
for i in range(3):
    A.append(list(map(int,input().split())))
N=int(input())
B=list(int(input()) for i in range(N))

for i in range(N):
    for j in range(3):
        for k in range(3):
            if B[i] == A[j][k]:
                A[j][k] = 0             
if( ((A[0][0]==0) and (A[1][1]==0) and (A[2][2]==0)) or
   ((A[2][0]==0) and (A[1][1]==0) and (A[0][2]==0)) ):
    print('Yes');exit(0)


for j in range(len(A[0])): 
    if( ((A[j][0]==0) and (A[j][1]==0) and (A[j][2]==0)) or
       ((A[0][j]==0) and (A[1][j]==0) and (A[2][j]==0))    ):    
        print('Yes');
        exit(0)

print('No')

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

for i in range (N):
    for j in range(len(A[0])):
        if (B[i] in A[j]):
            #print(type(B[i]),B[i],A[j])
            A[j][A[j].index(B[i])]=0
check=0
if((A[0][0]+A[1][1]+A[2][2]==0) or (A[2][0]+A[1][1]+A[0][2]==0) ):
    print('Yes');check=1
else:    
    for j in range(len(A[0])): 
        if( (A[j][0]+A[j][1]+A[j][2]==0) or (A[0][j]+A[1][j]+A[2][j]==0)    ):    
            print('Yes');check=1
            break;
    if(check==0):
        print('No')
Problem p02772 (python)

Fixed submission:
import numpy as np
Nnum=int(input())
An=np.array([int(i) for i in input().split()])
Ane=An[An%2==0]
Ane3=Ane%3
Ane5=Ane%5
Ane3or5=Ane3*Ane5

if(np.sum(Ane3or5)==0):
    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
Nnum=int(input())
An=np.array([int(i) for i in input().split()])
Ane=An[An%2==0]
Ane3=Ane%3
Ane5=Ane%5
Ane3or5=Ane3*Ane5

if(np.sum(Ane3or5)==0):
    print("APPROVED")
else:
    print("DENIED")
Problem p02639 (python)

Fixed submission:
lst=[]
str = input()
lst = str.split(' ')
i = lst.index('0')
print(i+1)

Buggy submission (verdict: Runtime Error):
lst=[]
str = input()
lst = str.split(' ')
i = lst.index(0)
print(i+1)
Problem p03095 (python)

Fixed submission:
#AGC031 A Colorful Subsequence
# Answer
N = int(input())
S = input()
alpha = [0]*26
mod = 10**9+7

for n in S:
    num = ord(n)-97
    alpha[num] += 1
    
ans = 1
for i in range(26):
    ans *= (alpha[i]+1)

ans %= mod
print(ans-1)

Buggy submission (verdict: Runtime Error):
#AGC031 A Colorful Subsequence
# Answer
N = int(input())
S = input()
alpha = [0]*26
mod = 10**9+7

for n in S:
    num = ord(n)-97
    alpha[num] += 1
    
ans = 1
for i in range(26):
    ans *= (alpha[i]+1)

(ans-1) %= mod
print(ans)
Problem p02658 (python)

Fixed submission:
# 169 B

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

def code(a):
    pro = 1
    if 0 in a:
        print(0)
    else:
        for i in a:
            pro *= i
            if pro > (10 ** 18):
                print(-1)
                return
        print(pro)

code(l)

Buggy submission (verdict: Runtime Error):
# 169 B

import math
n = int(input())
a = list(map(int, input().split()))
p = 1
x = True

p = math.product(a)
if p > (10 ** 18):
    x = False


if x == True:
    print(p)
else:
    print(-1)
Problem p02687 (python)

Fixed submission:
# 166 A

s = input()

if s == "ABC":
    print("ARC")
elif s == "ARC":
    print("ABC")

Buggy submission (verdict: Runtime Error):
# 166 A

s = input()

if s == "ABC":
    print("ARC")
elif s == "ARC"
    print("ABC")
Problem p02694 (python)

Fixed submission:
# 165 B

x = int(input())
d= 100
yr = 0

while d < x:
    d += (d // 100)
    yr += 1

print(yr)

Buggy submission (verdict: Runtime Error):
using namespace std;
int main(){
    long long x;
    cin >> x,
    long long p, yr = 0;
    while p < x{
        p += p / 100
        yr ++
    }
    cout << yr << endl;
    return 0
}
Problem p03427 (python)

Fixed submission:
n = input()
ans1=sum(int(i)for i in n)
ans2=int(n[0])-1+9*(len(n)-1)
print(max(ans1,ans2))

Buggy submission (verdict: Runtime Error):
n = input()
ans1=int(n[0])
for i in n:
  ans1 += int(i)
ans2=int(n[0])-1+9*(len(n)-1)
print(max(ans1,ans2)

Buggy submission (verdict: Runtime Error):
n = input()
ans1=sum(int(i)for i in n)
ans2=int(n[0])-1+9*(len(n)-1)
print(max(ans1,ans2)
Problem p03651 (python)

Fixed submission:
N,K = map(int, input().split())
A = list(map(int, input().split())) 
A.sort()
A.reverse() 
x = A[0]   
for i in range (1, N):
  while A[i] != 0:
    x , A[i] = A[i] , x % A[i]
if K > A[0]:
  print('IMPOSSIBLE')
else:
  print('POSSIBLE' if K%x == 0 else 'IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split())) 
a.sort()
a.reverse() 
x = a[0]   
for i in range (1, N):
  while a[i] != 0:
    x , a[i] = a[i] , x % a[i]
if K > a[0]:
  print('IMPOSSIBLE')
else:
  print('POSSIBLE' if K%x == 0 else 'IMPOSSIBLE')
Problem p03665 (python)

Fixed submission:
n, p = map(int,input().split())
a = list(map(int,input().split()))
 
o = 0
for i in a:
    if  i % 2:
        o += 1 
e = n-o
if o != 0:
    print((2**e)*int(2**(o-1)))
else:
    if p == 0:
        print(2**n)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
n, p = map(int,input().split())
a = list(map(int,input().split()))
 
o = 0
for i in a:
    if  i % 2:
        o += 1 
e = n-o
if o != 0:
    print((2**e)*int(2**(o-1)))
else:
    if P == 0:
        print(2**n)
    else:
        print(0)
Problem p03937 (python)

Fixed submission:
h, w = map(int,input().split())
a = [list(input()) for _ in range(h)]
c = 0
for p in a :
    for q in p:
        if q=="#":
            c +=1
 
if c == h + w - 1:
    print("Possible")
else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
h, w = map(int,input().split())
a = [list(input()) for _ in range(H)]
c = 0
for p in a :
    for q in p:
        if q=="#":
            c +=1
 
if c == h + w - 1:
    print("Possible")
else:
    print("Impossible")
Problem p02641 (python)

Fixed submission:
X, N = map(int, input().split())
if N == 0:
    print(X)
else:
    P = list(map(int, input().split()))
    for i in range(1000):
        if (X-i) not in P:
            print(X-i)
            break
        elif (X+i) not in P:
            print(X+i)
            break

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
if N == 0:
    print(X)
else:
    P = list(map(int, input().split()))
    for i in range(1,102):
        if (X-i) not in P:
            print(X-i)
            break
        elif (X+i) not in P:
            print(X+i)
            break
    else:
        print(X)
        break
Problem p02694 (python)

Fixed submission:
import math
X = int(input())
base = 100
rt = 0
while X > base:
    base = math.floor(base * 1.01)
    rt += 1
print(rt)

Buggy submission (verdict: Runtime Error):
X = int(input())
base = 100
rt = 0
while X > base:
    base = math.floor(base * 1.01)
    rt += 1
print(rt)
Problem p02854 (python)

Fixed submission:
## B - Iron Bar Cutting
N = int(input())
A = list(map(int, input().split()))
L = 0
R = sum(A)
ans = sum(A)
for n in range(N):
    L += A[n]
    R -= A[n]
    if ans > abs(L-R):
        ans = abs(L-R)
print(ans)

Buggy submission (verdict: Runtime Error):
## B - Iron Bar Cutting
N = int(input())
A = list(map(int, input().split()))
val = sum(A)//2
tmp = 0
for n in range(N):
    tmp += A[n]
    if tmp >= val:
        print( min( abs(sum(A[n+1:] - tmp ), abs(sum(A[n:] - tmp - A[n] ) )
        break
Problem p03241 (python)

Fixed submission:
import math
n, m = map(int, input().split())
kotae=1

for i in range(1,int(math.sqrt(m))+1):
	if m%i==0:
		if i*n<=m:
			kotae=max(kotae, i)
		if (m//i)*n<=m:
			kotae=max(kotae, m//i)
print(kotae)

Buggy submission (verdict: Runtime Error):
import math
n, m,X = map(int, input().split(),1)
for i in range(1,32000):
	if m%i==0:
		if i*n<=m:
			X=max(X, i)
		if (m//i)*n<=m:
			X=max(X, m//i)
print(X)

Buggy submission (verdict: Runtime Error):
import math
n, m = map(int, input().split()) X=1
for i in range(1,32000):
	if m%i==0:
		if i*n<=m:
			X=max(X, i)
		if (m//i)*n<=m:
			X=max(X, m//i)
print(X)

Buggy submission (verdict: Runtime Error):
import math
n, m = map(long, input().split())
kotae=1

for i in range(1,long(math.sqrt(m))+1):
	if m%i==0:
		if i*n<=m:
			kotae=max(kotae, i)
		if (m/i)*n<=m:
			kotae=max(kotae, int(m/i))
print(kotae)

Buggy submission (verdict: Runtime Error):
import math
n, m = map(long, input().split())
kotae=1

for i in range(1,long(math.sqrt(m))+1):
	if m%i==0:
		if i*n<=m:
			kotae=max(kotae, i)
		if (m/i)*n<=m:
			kotae=max(kotae, m/i)
print(kotae)

Buggy submission (verdict: Runtime Error):
import math
n, m = map(int, input().split())
kotae=1

for i in range(1,int(math.sqrt(m))+1):
  if m%i==0:
    if i*n<=m:
	  kotae=max(kotae,i)
    if (m/i)*n<=m:
      kotae=max(kotae,i)
print(kotae)
Problem p03262 (python)

Fixed submission:
import math

def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x % y)

n, x = map(int,input().split())
li_x = list(map(int,input().split()))

for i in range(len(li_x)):
  if li_x[i] - x < 0:
    li_x[i] =x - li_x[i]
  else:
    li_x[i] = li_x[i] -x

if len(li_x)==1:
  print(li_x[0])

elif len(li_x)==2:
  print(gcd(li_x[0],li_x[1]))

else:
  g =gcd(li_x[0],li_x[1])
  k=2
  while k<len(li_x):
    g=gcd(g,li_x[k])
    k+=1
  print(g)

Buggy submission (verdict: Runtime Error):
import math


n, x = map(int,input().split())
li_x = list(map(int,input().split()))

for i in range(len(li_x)):
  if li_x[i] - x < 0:
    li_x[i] =x - li_x[i]
  else:
    li_x[i] = li_x[i] -x

if len(li_x)==1:
  print(li_x[0])

elif len(li_x)==2:
  print(gcd(li_x[0],li_x[1]))

else:
  g =gcd(li_x[0],li_x[1])
  k=2
  while k<len(li_x):
    g=gcd(g,li_x[k])
    k+=1
  print(g)

def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x % y)

Buggy submission (verdict: Runtime Error):
import math

def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x % y)
      

n, x = map(int,input().split())
li_x = list(map(int,input().split()))

for i in range(len(li_x)):
    if li_x[i] - x < 0:
        li_x[i] =x - li_x[i]
    else:
        li_x[i] = li_x[i] -x

g =gcd(li_x[0],li_x[1])
k=2
if len(li_x)>2:
  while k<len(li_x):
    g=gcd(g,li_x[k])
    k+=1
print(g)

Buggy submission (verdict: Runtime Error):
import math

def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x % y)
      

n, x = map(int,input().split())
li_x = list(map(int,input().split()))

for i in range(len(li_x)):
    if li_x[i] - x < 0:
        li_x[i] =x - li_x[i]
    else:
        li_x[i] = li_x[i] -x

g =gcd(li_x[0],li_x[1])
k=2
while k<len(li_x):
  g=gcd(g,li_x[k])
  k+=1
print(g)
Problem p03957 (python)

Fixed submission:
a=input()
c=False
f=False
for i in range(len(a)):
    if c==True:
        if a[i]=='F':
            f=True
    else:
        if a[i]=='C':
            c=True
if c==True and f==True:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a=input()
c=False
f=False
for i in range(len(a)):
  if c==True:
    if a[i]=='F':
    f=True
  else:
    if a[i]=='C':
    c=True
if c==True and f==True:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a=input()
c=False
f=False
for i in range(len(a))
  if c==True:
    if a[i]=='F':
    f=True
  else:
    if a[i]=='C':
    c=True
if c==True and f==True:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a=input()
c=False
f=False
for i in range(len(a))
  if c==True:
    if a[i]=='F'
    f=True
  else:
    if a[i]=='C'
    c=True
if c==True and f==True:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a=input()
c=False
f=False
for i in range(len(a))
  if c:
    if a[i]=='F'
    f=True
  else:
    if a[i]=='C'
    c=True
if c and f:
  print("Yes")
else:
  print("No")
Problem p03970 (python)

Fixed submission:
a=input()
ans="CODEFESTIVAL2016"
diff=0
for i in range(16):
  if a[i]!=ans[i]:
    diff+=1
print(diff)

Buggy submission (verdict: Runtime Error):
a=input()
ans="CODEFESTIVAL2016"
diff=0
for i in range(16):
  if a[i]!=ans[i]:
    diff++
print(diff)