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

Fixed submission:
a = [0,1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(a[int(input())])

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

a, b, c = map(int, input().split())

if c - a - b > 0 and 4*a*b - (c-a-b)**2 < 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
from decimal import *

a, b, c = map(int, input().split())
if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import decimal

a, b, c = map(int, input().split())
a = decimal.Decimal(a)
b = decimal.Decimal(b)
b = decimal.Decimal(b)

if 4*a*b - (c-a-b)**2 < 0:
    print("Yes")
else:
    print("No")
Problem p02743 (python)

Fixed submission:
import decimal

a, b, c = map(int, input().split())
a = decimal.Decimal(a)
b = decimal.Decimal(b)
c = decimal.Decimal(c)

if c - a - b > 0 and 4*a*b - (c-a-b)**2 < 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
a = decimal.Decimal(a)
b = decimal.Decimal(b)
b = decimal.Decimal(b)

if 4*a*b - (c-a-b)**2 < 0:
    print("Yes")
else:
    print("No")
Problem p02995 (python)

Fixed submission:
from fractions import gcd

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

cnt = B//C -(A - 1)//C + B//D - (A - 1)//D - ((B//((C * D) // gcd(C, D))) - (A - 1)//((C * D) // gcd(C, D)))
cnt1 = B - (A - 1) -cnt

print(cnt1)

Buggy submission (verdict: Runtime Error):
import math

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

cnt = B//C -(A - 1)//C + B//D - (A - 1)//D - ((B//((C * D) // math.gcd(C, D))) - (A - 1)//((C * D) // math.gcd(C, D)))
cnt1 = B - (A - 1) -cnt

print(cnt1)
Problem p02705 (python)

Fixed submission:
import math

X = int(input())
A = X*2*math.pi
print(A)

Buggy submission (verdict: Runtime Error):
import math

S =  list(map(int,input().split()))
N = S[0]
M = S[1]
A =  list(map(int,input().split()))
ans = N-sum(A)
if ans < 0:
    ans = -1
    
print(ans)
Problem p02730 (python)

Fixed submission:
import math

S=input()

if S[0:math.floor((len(S)/2))] == S[math.floor((len(S)/2))+1:len(S)]:
    p = S[0:math.floor((len(S)/2))]
    q = S[math.floor((len(S)/2))+1:len(S)]
    if p == p[len(p)::-1]:
        if q == q[len(q)::-1]:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import xgboost as xgb
from sklearn.model_selection import GridSearchCV
import math
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns  # pip install seaborn
import re
import statsmodels.api as sm
import statsmodels.formula.api as smf
from sklearn.model_selection import cross_val_score
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split

S=input()

if S[0:math.floor((len(S)/2))] == S[math.floor((len(S)/2))+1:len(S)]:
    p = S[0:math.floor((len(S)/2))]
    q = S[math.floor((len(S)/2))+1:len(S)]
    print('Yes')
else:
    print('No')
Problem p02696 (python)

Fixed submission:
from math import floor

a, b, n = map(int, input().split())
        
x = min(n, b-1)
if x < 0:
    x = 0
    
print(floor(a*x / b) - a * floor(x / b))

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

a, b, n = map(int, input().split())
# a, b, n = 4628, 3261783, 3421421

res_arr = np.vectorize(lambda x: floor(a*x / b) - a * floor(x / b))(np.arange(1, n+1))
# np.nanmax(res_arr)
print(np.nanmax(res_arr))

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

a, b, n = map(int, input().split())
arr = np.arange(1, n+1)

res_arr = np.vectorize(lambda x: math.floor(a*x / b) - a * math.floor(x / b))(np.arange(1, n+1))

print(np.nanmax(res_arr))
# np.vectorize(lambda x: math.floor(a*x / b) - a * math.floor(x / b))( np.arange(1, n+1)).max()

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

a, b, n = map(int, input().split())
arr = np.arange(1, n+1)

print(np.vectorize(lambda x: math.floor(a*x / b) - a * math.floor(x / b))( np.arange(1, n+1)).max())
# np.vectorize(lambda x: math.floor(a*x / b) - a * math.floor(x / b))( np.arange(1, n+1)).max()
Problem p02747 (python)

Fixed submission:
import sys

lines = sys.stdin.readlines()
 
text = lines[0]

import re
if re.match(r'^(hi)+$', text):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys

lines = sys.stdin.readlines()

num_a ,num_b, num_m = [int(v) for v in lines[0].split()]
# ----

a_list = [int(v) for v in lines[1].split()[:num_a+1]]
b_list = [int(v) for v in lines[2].split()[:num_b+1]]

# print(a_list)
# print(b_list)

result = max(a_list) + max(b_list)
# ignores = set()
for c in lines[3:num_m+3]:
    a_i, b_i, discount = map(int, c.split())
    try:
#         ignores.add((int(a_i), int(b_i)))    
        price = a_list[a_i-1] + b_list[b_i-1] - discount
        
        if price < result:
            result = price
    except IndexError:
        print('------')
        print(c)
        pass

res1 = [
    a_list[a_i-1]+b_list[b_i-1]-discount for a_i, b_i, discount in [map(int, l.split())  for l in lines[3:num_m+3]]]


res2 = [a+b for b in b_list
        for a in a_list]

print(min(min(res1), min(res2)))

Buggy submission (verdict: Runtime Error):
import sys
 
lines = sys.stdin.readlines()
num_a ,num_b, num_m = [int(v) for v in lines[0].split()]
# ----
 
a_list = [int(v) for v in lines[1].split()[:num_a+1]]
b_list = [int(v) for v in lines[2].split()[:num_b+1]]
 
# print(a_list)
# print(b_list)
 
result = max(a_list) + max(b_list)
ignores = set()
for c in lines[3:num_m+3]:
    a_i, b_i, discount = map(int, c.split())
    try:
        ignores.add((int(a_i), int(b_i)))
        
        price = a_list[a_i-1] + b_list[b_i-1] - discount
        
        if price < result:
            result = price
    except IndexError:
        print('------')
        print(c)
        pass
 
# ---
# result = max(a_list) + max(b_list)
for i, a in enumerate(a_list):
    for j, b in enumerate(b_list):
        if (i+1, j+1) not in ignores:
            price = a + b
            result = price if price < result else result
            
    
print(result)
Problem p02760 (python)

Fixed submission:
import sys
import numpy as np

lines = sys.stdin.readlines()
bingo_card = np.zeros([3,3])
for i, l in enumerate(lines):
    if i <= 2:
        bingo_card[i] = [int(num) for num in l.split()]
    else:
        bingo_card[bingo_card == int(l)] = None
        
check_arr = np.isnan(bingo_card)
if check_arr[0].sum() == 3 or check_arr[1].sum() == 3 or check_arr[2].sum() == 3:
    print('Yes')
elif check_arr[:, 0].sum() == 3 or check_arr[:, 1].sum() == 3 or check_arr[:, 2].sum() == 3:
    print('Yes')
elif check_arr[0,0] and check_arr[1,1] and check_arr[2,2]:
    print('Yes')
elif check_arr[0,2] and check_arr[1,1] and check_arr[2,0]:
    print('Yes')
else:
    print('No')

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

lines = sys.stdin.readlines()
bingo_card = np.zeros([3,3])
for i, l in enumerate(input()):
    if i <= 2:
        bingo_card[i] = [int(num) for num in l.split()]
    else:
        bingo_card[bingo_card == int(l)] = None
        
check_arr = np.isnan(bingo_card)
if check_arr[0].sum() == 3 or check_arr[1].sum() == 3 or check_arr[2].sum() == 3:
    print('Yes')
elif check_arr[:, 0].sum() == 3 or check_arr[:, 1].sum() == 3 or check_arr[:, 2].sum() == 3:
    print('Yes')
elif check_arr[0,0] and check_arr[1,1] and check_arr[2,2]:
    print('Yes')
elif check_arr[0,2] and check_arr[1,1] and check_arr[2,0]:
    print('Yes')
else:
    print('No')
Problem p02700 (python)

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

tk_count = -(-c // b)
ao_count = -(-a // d)

if tk_count <= ao_count:
    print('Yes')
else:
    print('No')

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


if (-(-c // b)) <= (-(-a // d):
    print('Yes')
else:
    print('No')

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


if (-(-c // b)) >= (-(-a // d):
    print('Yes')
else:
    print('No')
Problem p02705 (python)

Fixed submission:
R = int(input())
L = 2 * 3.14159265358979 * R
print(L)

Buggy submission (verdict: Runtime Error):
R = float(input())
L = 2*math.pi*R
print(L)
Problem p02784 (python)

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


ans = 'Yes'


if sum(A) < H:
    ans = 'No'


print(ans)

Buggy submission (verdict: Runtime Error):
H,N = map(int,input().split())
A = list(map(int,input().split()))
new_A = sorted(A,reverse=True)

ans = 'yes'

for i in range(N + 1):
    if new_A[1] + new_A[2] < H:
        ans = 'No'
    if N < 2:
        ans = 'No'

print(ans)
Problem p03206 (python)

Fixed submission:
D = int(input())
#かわむら

today = "Christmas"

x = 25 - D

today += x * " Eve"

print(today)

Buggy submission (verdict: Runtime Error):
D = input()

today = "Christmas"

x = 25 - D

today += x * " Eve"

print(today)
Problem p04033 (python)

Fixed submission:
ab=raw_input().split()
a=int(ab[0])
b=int(ab[1])
num=1
if a <=0 and b>=0:
    print 'Zero'
elif a>0:
    print 'Positive'
elif (b-a)%2==0:
    print 'Negative'
else:
    print'Positive'

Buggy submission (verdict: Runtime Error):
ab=raw_input().split()
a=int(ab[0])
b=int(ab[1])
num=1
if a <=0 and b>=0:
    print 'Zero'
else:
    for val in range(a,b+1,1):
        num*=val
    if num > 0:
        print 'Positive'
    elif num==0:
        print 'Zero'
    else :
        print'Negative'

Buggy submission (verdict: Runtime Error):
ab=raw_input().split()
a=int(ab[0])
b=int(ab[1])
num=1
for val in range(a,b+1,1):
    num*=val

if num > 0:
    print 'Positive'
elif num==0:
    print 'Zero'
else :
    print'Negative'
Problem p02690 (python)

Fixed submission:
# input
X = int( input() )
maxA = 1000
pow5 = list()
for aa in range(maxA):
    pow5.append( aa**5 )
    
# calc    
ans = False
for ii in range(maxA):  
    if( ans==False ):
        X1 = X - pow5[ii]
        X2 = X + pow5[ii]
        if( X1 in pow5 ):
            b = - ii
            a = pow5.index( X1 )
            ans = True
        
    if( ans==False ):
        if( X2 in pow5 ):
            b = ii
            a = pow5.index( X2 )
            ans = True

# out
if(ans):
    print( str(a)+' '+str(b) )

Buggy submission (verdict: Runtime Error):

# input
X = int( input() )
maxA = 1000
pow5 = list()
for aa in range(maxA):
    pow5.append( aa**5 )
    
# calc    
ans = False
a = 0
b = 0
for ii in range(maxA):  
    if( ans==False ):
        X1 = X - pow5[ii]
        X2 = X + pow5[ii]
        if( X1 in pow5 ):
            b = - ii
            a = pow5.index( X1 )
            ans = True
        
    if( ans==False ):
        if( X2 in pow5 ):
            b = ii
            a = pow5.index( X1 )
            ans = True

# out
print( str(a)+' '+str(b) )

Buggy submission (verdict: Runtime Error):
# input
X = int( input() )
maxA = 70
pow5 = list()
for aa in range(maxA):
    pow5.append( aa**5 )
    
# calc    
ans = False
a = 0
b = 0
for ii in range(maxA):  
    if( ans==False ):
        X1 = X - pow5[ii]
        X2 = X + pow5[ii]
        if( X1 in pow5 ):
            b = - ii
            a = pow5.index( X1 )
            ans = True
        
    if( ans==False ):
        if( X2 in pow5 ):
            b = ii
            a = pow5.index( X1 )
            ans = True

# out
print( str(a)+' '+str(b) )
Problem p02780 (python)

Fixed submission:
# input
N, K = map( int, input().split() )
P    = [int(x) for x in input().split()]

# calc cumsum
C    = list()
cumsum = 0
for ii in range( len(P) ):
    E = (1+P[ii])/2
    C.append( cumsum + E )
    cumsum += E

ans = 0.0
if( N==K ):
    ans = C[-1]
for ii in range( K, N ):
    E = C[ii] - C[ii-K]
    if( ans < E ):
        ans = E

# output        
print( ans )

Buggy submission (verdict: Runtime Error):
def find_max_expectation( P, K ):
    # P is a np.array( N, )
    # K is a int
    
    if( len(P)==0 ):
        return np.nan
    
    st_idx  = 0
    max_sum = 0
    for nn in range( K ):
        max_sum += P[nn]
    
    tmp = max_sum
    for nn in range( K, len(P) ):
        tmp -= P[nn-K]
        tmp += P[nn]
        if( tmp > max_sum ):
            st_idx = nn-K+1
        
    ans = 0
    for nn in range( st_idx, st_idx+K ):
        tmp = 1 + 0.5*( P[nn]-1 )
        ans += tmp
    
    return ans


# input
N, K = map( int, input().split() )
P    = np.array( [int(x) for x in input().split()] )

print( find_max_expectation( P, K ) )
Problem p03998 (python)

Fixed submission:
A, B, C = [list(input()) for i in range(3)]


turn = "a"

while True:
    if turn == 'a':
        if len(A) != 0:
            turn = A.pop(0)
        else:
            print('A')
            break
    elif turn == 'b':
        if len(B) != 0:
            turn = B.pop(0)
        else:
            print('B')
            break
    elif turn == 'c':
        if len(C) != 0:
            turn = C.pop(0)
        else:
            print('C')
            break

Buggy submission (verdict: Runtime Error):

A, B, C = list(input() for i in range(3))

turn = "a"

while True:
    if turn == 'a':
        if len(A) != 0:
            turn = A.pop(0)
        else:
            print('A')
            break
    elif turn == 'b':
        if len(B) != 0:
            turn = B.pop(0)
        else:
            print('B')
            break
    elif turn == 'c':
        if len(C) != 0:
            turn = C.pop(0)
        else:
            print('C')
            break
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if (a * b) % 2 != 0:
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split)
if (a * b) % 2 != 0:
  print('Odd')
else:
  print('Even')
Problem p02713 (python)

Fixed submission:
import math
from functools import reduce

K=int(input())

ans=K*(1+K)/2
for i in range(1, K+1):
    for j in range(i+1, K+1):
        ans+=math.gcd(i,j)*6
        for k in range(j+1,K+1):
            ans+=reduce(math.gcd, [i,j,k])*6
print(str(int(ans)))

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

K=int(input())

ans=K*(1+K)/2
for i in range(1, K+1):
    for j in range(i+1, K+1):
        ans+=functions.gcd(i,j)*6
        for k in range(j+1,K+1):
            ans+=reduce(functions.gcd, [i,j,k])*6
print(str(int(ans)))
Problem p02694 (python)

Fixed submission:
a = int(input())
b = 100
c = 0
while True:
  b += int(b / 100)
  c += 1
  if b >= a:
    print(c)
    exit()

Buggy submission (verdict: Runtime Error):
a = int(input())
b = 100
c = 0
while true:
  b += int(b / 100)
  c += 1
  if b >= a:
    print(c)
    exit()
Problem p02887 (python)

Fixed submission:
n = int(input())
data = list(input().rstrip())
ans = [data[0]]
cnt = 0
i = 0

for _ in range(n):
  if ans[-1] != data[i]:
    ans.append(data[i])
  i += 1
    
print(len(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
data = list(input().rstrip())
cnt = 0

if data.count(data[0]) == n:
	print(1)
	exit()

for i in range(0,len(data)):
	cnt = 0
	for j in range(i+1,len(data)):
		if data[i] == data[j]:
			cnt += 1
		else:
			break
	if cnt >= 1:
		print(i+1,j,data)
		del data[i+1:j]
print(len(data))
print(data)
Problem p02687 (python)

Fixed submission:
s = input()
if (s[1] == "B"):
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
s = input()
if (s[1] == B):
  print("ARC")
else:
  print("ABC")
Problem p03324 (python)

Fixed submission:
d, n = map(int, input().split())

if (n != 100):
  if (d == 0):
    print(n)
  else:
    print(100**d*n)
else:
  if (d == 0):
    print("101")
  else:
    print((100**d)*101)

Buggy submission (verdict: Runtime Error):
d, n = map(int, input().split())

if (n != 100):
	if (d == 0):
      print(n)
    else:
      print(100**d*n)
else:
  if (d == 0):
    print(101)
  else:
    print(100**d*101)
Problem p03338 (python)

Fixed submission:
n = int(input())
s = str(input())

max = 0
for i in range(n):
  x = set(s[:i]) & set(s[i:])
  if max < len(x):
    max = len(x)
print(max)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())

max = 0
for i in n:
  max1 = count(s[n])
  if (max < max1):
    max = max1:

print(max)
Problem p03360 (python)

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

m = max(a, b, c)
ans = a + b + c - m + (2**k) * m

print(ans)

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

m = max(a, b, c)
ans = sum(a, b, c) - m + (2**k) * m

print(ans)

Buggy submission (verdict: Runtime Error):
num = [input(), input(), input()]
k = int(input())

m = max(num)
ans = sum(num) - m + 2**k * m

print(ans)
Problem p03370 (python)

Fixed submission:
n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

x -= sum(m)

print(n + x // min(m))

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

a = 0
for i in n:
  a += (i+1) * m[i]

print(n + (x - a) // min(m))

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

a = 0
for i in n:
  a += (i+1) * m[(i)]

print(n + (x - a) // min(m))

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

for i in n:
  x -= (i+1) * m[(i+1)]

print(x % min(m))

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

for i in n:
  x -= i * m[i]

print(x % min(m))
Problem p03378 (python)

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

ans = 0

for i in a:
  if i < x:
    ans += 1

print(min(ans, m-ans))

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

ans = 0

for i in x:
  if str(i) in a:
    ans += 1

print(min(ans, m-ans))

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

ans = 0

for i in x-1:
  if i in a:
    ans += 1

print(min(ans, m-ans))

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

ans = 0

for i in x:
  if (i in a):
    ans = ans + 1

print(min(ans, m-ans))

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

ans = 0

for i in x:
  if (i in a):
    ans = ans + 1
  else:
    continue

print(min(ans, m-ans))

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

n-x = b

for toll in b:
  if ( n + b in a):
    toll = toll + 1
else:
  print(toll)
Problem p03415 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c = map(str, input().split())
d, e, f = map(str, input().split())
g, h, i = map(str, input().split())
 
print(a+e+i)
Problem p03433 (python)

Fixed submission:
n= int(input())
a = int(input())
 
if (n%500 <= a):
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = int(input())

if (n%500>=0 and n%500=<1000):
	print('Yes')
else:
	print('No')
Problem p03447 (python)

Fixed submission:
x = int(input())
a = int(input())
b = int(input())
 
x1 = x - a
result  = x1 % b
 
print(result)

Buggy submission (verdict: Runtime Error):
x = input()
a = input()
b = input()
 
x1 = x - a
result  = x1 % b
 
print(result)

Buggy submission (verdict: Runtime Error):
x, a, b = map(int, input().split())
 
x1 = x - a
result  = x1 % b
 
print(result)

Buggy submission (verdict: Runtime Error):
x, a, b = map(int, input().split())
 
x1 = x - a
result  = x1 - (x1 % b) *b

print(result)
Problem p03455 (python)

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

c = a*b

if c%2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
 
if (a*b%2 == 0):
	print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
c = a*b

if (c%2 == 0):
	print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
if (a*b%2 == 0):
	print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
if (a*b%2 == 0):
	print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a = input()
b= input()
 
if (a*b%2 == 0):
	print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a = input()
b= input()

if (a*b//2 == 0):
	print('Even')
else:
    print('Odd')
Problem p02717 (python)

Fixed submission:
x, y, z = list(map(int, input().split()))
print(z, x, y)

Buggy submission (verdict: Runtime Error):
x, y, z = int(input().split())
print(z, x, y)
Problem p04030 (python)

Fixed submission:
s = list(input())

ans = ""
add = ""

for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    elif s[i] == "B":
            ans = ans[:-1]

if len(ans) == 0:
    for i in range(len(s)):
        if s[i] != "B":
            add = s[i]
    ans = add

print(ans)

Buggy submission (verdict: Runtime Error):
s = list(input())

ans = ""

for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    elif s[i] == "B":
        if len(ans) > 0:
            ans = ans.replace(ans[i-1], "", 1)
        else:
            pass

print(ans)