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

Fixed submission:
from collections import Counter

N = int(input())

index = 0
even_numbers = []
odd_numbers = []

for i in input().split():
    if index % 2 == 0:
        even_numbers.append(int(i))
    else:
        odd_numbers.append(int(i))
    index += 1

even = Counter(even_numbers).most_common(2)
odd = Counter(odd_numbers).most_common(2)

if even[0][0] == odd[0][0]:
    if len(even) == 1:
        print(N//2)
    else:
        print(N - even[0][1] - max(even[1][1], odd[1][1]))
else:
    print(N - even[0][1] - odd[0][1])

Buggy submission (verdict: Runtime Error):
from collections import Counter

N = int(input())

index = 0
even_numbers = []
odd_numbers = []

for i in input().split():
    if index % 2 == 0:
        even_numbers.append(int(i))
    else:
        odd_numbers.append(int(i))
    index += 1

even = Counter(even_numbers).most_common(2)
odd = Counter(odd_numbers).most_common(2)

if even[0][1] == odd[0][1]:
    print(min(N - even[0][1] - odd[1][1], N - even[1][1] - odd[0][1]))
else:
    print(N - even[0][1] - odd[0][1])

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
n = N // 2

index = 0
g_inputs = []
k_inputs = []

for i in input().split():
    if index % 2 == 0:
        g_inputs.append(int(i))
        index += 1
    else:
        k_inputs.append(int(i))
        index += 1

g = Counter(g_inputs)
k = Counter(k_inputs)

g_max = max([(v,k) for k,v in g.items()])[1] 
k_max = max([(v,k) for k,v in k.items()])[1]

if g_max == k_max:
    del g[g_max]
    del k[k_max]
    g_max_2 = max([(v,k) for k,v in g.items()])[1] 
    k_max_2 = max([(v,k) for k,v in k.items()])[1]
    print(min(N - g_max - k_max_2, N - g_max_2 - k_max))
else:
    print(N - g[g_max] - k[k_max])
Problem p03266 (python)

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

mod = [i for i in range(K, N+1, K)]
ans = len(mod) ** 3

if K % 2 == 0:
    items = [i for i in range(K//2, N+1, K)]
    ans += len(items) ** 3

print(ans)

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

mod = [i for i in range(K, N+1, K)]
ans += len(mod) ** 3

if K % 2 == 0:
    items = [i for i in range(K//2, N+1, K)]
    ans += len(items)

print(ans)
Problem p03281 (python)

Fixed submission:
import math

N = int(input())

ans = 0

def cal(n):
    limit = math.floor(math.sqrt(n))
    count = 0
    for i in range(1, limit+1):
        if n % i == 0:
            if n % i == i:
                count += 1
            else:
                count += 2
    return count

for i in range(1, N+1, 2):
    if cal(i) == 8:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import sympy

N = int(input())

ans = 0

for i in range(1, N+1):
    if i % 2 == 1 and sympy.divisor_count(i) == 8:
        ans += 1

print(ans)
Problem p03282 (python)

Fixed submission:
S = input()
K = input()

for i in range(int(K)):
    if S[i] != "1":
        print(S[i])
        break
else:
    print(1)

Buggy submission (verdict: Runtime Error):
S = input()
K = input()

if S[0] != "1":
    print(S[0])
else:
    if S[1] != "1":
        print(S[1])
    else:
        if S[2] != "1":
            print(S[2])
        else:
            if S[3] != "1":
                print(S[3])
            else:
                print(1)

Buggy submission (verdict: Runtime Error):
S = input()
K = input()

print(S[1])

if S[0] != "1":
    print(S[0])
else:
    if S[1] != "1":
        print(S[1])
    else:
        if S[2] != "1":
            print(S[2])
        else:
            if S[3] != "1":
                print(S[3])
            else:
                print(1)
Problem p03293 (python)

Fixed submission:
S = input()
T = input()
a = ""
for i in range(len(S)+1):
    if i == 0:
        a = (S[-1] + S[:-1])
    else:
        a = a[-1] + a[:-1]
    if a == T:
        print("Yes")
        break
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

if (len(S)%2==0)
    if T == S[::-1]:
        print("Yes")
    else:
        print("No")
else:
    if T == S[::-1]:
        print("No")
    else:
        print("Yes")
Problem p03309 (python)

Fixed submission:
N = int(input())

input_list = []
index = 1
for i in input().split():
    item = int(i) - index
    input_list.append(item)
    index += 1

input_list.sort()
b = input_list[N//2]

print(sum(map(lambda x: abs(x-b), input_list)))

Buggy submission (verdict: Runtime Error):
input_list = []
index = 1
for i in input().split():
    item = int(i) - index
    input_list.append(item)
    index += 1

input_list.sort()
b = input_list[N//2]
print(sum(map(lambda x: abs(x-b), input_list)))

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

ans1 = 0
ans2 = 0

for i in range(N):
    input_list[i] -= i+1

point1 = sum(input_list) // N
point2 = point + 1

for i in range(N):
    ans1 += abs(input_list[i] - point1)

for i in range(N):
    ans2 += abs(input_list[i] - point2)

print(min(ans1, ans2))
Problem p03316 (python)

Fixed submission:
N = input()
sum = 0

for i in range(len(N)):
    sum += int(N[i])
print("Yes" if int(N) % sum == 0 else "No")

Buggy submission (verdict: Runtime Error):
N = input()
mod = int(N[0] + N[1] + N[2])

print("Yes" if int(N) % mod == 0 else "No")

Buggy submission (verdict: Runtime Error):
N = input()
mod = int(N[0] + N[1] + N[2])

print("Yes" if int(N) % mod == 0 else "No")
Problem p03369 (python)

Fixed submission:
S = input()
count = 0

for i in range(0,3):
    if S[i] == 'o':
        count += 1 
print(700 + 100 * count)

Buggy submission (verdict: Runtime Error):
A, B, C, X, Y = (int(i) for i in input().split())  

min = min(X, Y)
max = max(X, Y)

if A + B > 2 * C :
    if A > 2 * C :
        print(min * 2 * C + (max-min) * C * 2)
    else:
        print(min * 2 * C + (max-min) * A)
else:
    print(A * X + B * Y)
Problem p03377 (python)

Fixed submission:
# Aは猫, Bはどっちかわからん
A, B, X = map(int, input().split())

if X - A < 0:
    print('NO')
elif X - A > B:
    print('NO')
else:
    print('YES')

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

print('NO' if X - A < 0 or X - A > B 'YES')

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

if list[2] < list[0] :
    print('NO')
elif list[2] == list[0] :
    print('YES')
else:
    if (list[2] - list[0]) <= list[1] :
        print('YES')
    else:
        print('NO')
Problem p03378 (python)

Fixed submission:
N, M, X = map(int, input().split())

count = 0
for i in input().split():
    if int(i) > X:
        break
    count += 1

print(min(count , M-count))

Buggy submission (verdict: Runtime Error):
list = map(int, raw_input().split())
List = map(int, raw_input().split())

countLatter = 0
countFormer = 0

for i in range(list[2] + 1, list[0]):
    if i in List :
        countLatter += 1
for i in range(0, list[2] - 1):
    if i in List :
        countFormer += 1

print(min(countLatter, countFormer))
Problem p03427 (python)

Fixed submission:
N = str(input())

for item in N[1:]:
    if item != '9':
        print(int(N[0]) - 1 + 9 * (len(N) - 1))
        break
else:
    print(int(N[0]) + 9 * len(N[1:]))

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

for item in N[1:]:
    if item != '9':
        print(int(N[0]) - 1 + 9 * (len(N) - 1))
        break
else:
    print(int(N[0]) + 9 * len(N[1]))

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

if int(N[1:]) % (9 * int('1' * len(N))) == 0:
    print(int(N[0] + 9 * (len(N)-1)))
else:
    print(int(N[0]) - 1 + 9 + 9 * len(N[2:]))
Problem p03457 (python)

Fixed submission:
N = int(input())
list = [[int(i) for i in input().split()] for i in range(N)]
list.insert(0, [0, 0, 0])

if N == 1:
    timeInterval = list[1][0] - list[0][0]
    distance = abs(list[1][1]+list[1][2]-list[0][1]-list[0][2])
    if timeInterval < distance:
        print("No")
    elif (timeInterval - distance)%2 == 0:
        print("Yes")
    else:
        print("No")
else:
    for i in range(N):
        timeInterval = list[i+1][0] - list[i][0]
        distance = abs(list[i+1][1]+list[i+1][2]-list[i][1]-list[i][2])
        if timeInterval < distance:
            print("No")
            break
        elif (timeInterval - distance)%2 == 0:
            if i == N-1:
                print("Yes")
        else:
            print("No")
            break

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

if N == 1:
    if list[0][0] - list[0][1] - list[0][2] < 0:
        print("No")
    elif (list[0] - list[1] - list[2]) % 2 == 0:
        print("Yes")
    else:
        print("No")
else:
    for i in range(N-1):
        if (list[i+1][0] - list[i][0]) < abs(list[i+1][1]+list[i+1][2]-list[i][1]-list[i][2]):
            print("No")
        elif ((list[i+1][0] - list[i][0]) - abs(list[i+1][1]+list[i+1][2]-list[i][1]-list[i][2]))%2 == 0:
            print("Yes")
        else:
            print("No")
Problem p03477 (python)

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

if A + B > C + D:
    print("Left")
elif A + B == C + D:
    print("Balanced")
else:
    print("Right")

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

if A + B > C + D:
    print("Left")
elif A + B = C + D:
    print("Balanced")
else:
    print("Right")
Problem p03633 (python)

Fixed submission:
from functools import reduce

N = int(input())
input_list = sorted([int(input()) for i in range(N)])

# ユークリッドの互除法
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(*input_list))

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

N = int(input())
input_list = sorted([int(input()) for i in range(N)])

# 最小公倍数を求めるだけ
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(*input_list))

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

N = int(input())
input_list = [int(input()) for i in range(N)]

# 最小公倍数を求めるだけ
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(*input_list))
Problem p03637 (python)

Fixed submission:
N = int(input())
input_list = [int(i) for i in input().split()]
four_count = 0
two_count = 0

for i in input_list:
    if i % 4 == 0:
        four_count += 1
    elif i % 2 == 0:
        two_count += 1

others_count = N - four_count - two_count

if two_count:
    if others_count <= four_count:
        print("Yes")
    else:
        print("No")
else:
    if others_count <= four_count + 1:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
# when input length is odd, n-1 / 2
# when input length is even, n / 2
# 6
# 2 7 1 8 2 8
# 1 8 7 8 2 2
# # # # # #
# 3個(len/2)４の倍数がYesを出力できる
# 4の倍数の個数がlen/2以下になるときその個数分*2個分２があれば、Yesを出力できる
N = int(input())
input_list = [int(i) for i in input().split()]
four_count = 0
two_count = 0

for i in input_list:
    if i % 4 == 0:
        four_count += 1
    elif i % 2 == 0:
        two_count += 1

const = N // 2

if const > four_count:
    if 2 * (const - four_count) =< two_count:
        print("Yes")
    else:
        print("No")
elif const == four_count:
    print("Yes")
else:
    print("Yes")
Problem p03673 (python)

Fixed submission:
from collections import deque

n = int(input())

result = deque()
index = 0

if n % 2 == 0:
    for i in input().split():
        if index % 2 == 1:
            result.appendleft(i)
            index += 1
        else:
            result.append(i)
            index += 1
else:
    for i in input().split():
        if index % 2 == 1:
            result.append(i)
            index += 1
        else:
            result.appendleft(i)
            index += 1

print(" ".join(result))

Buggy submission (verdict: Runtime Error):
from collections import deque

n = int(input())

result = deque()
index = 0

if n % 2 == 0
    for i in input().split():
        if index % 2 == 1:
            result.appendleft(i)
            index += 1
        else:
            result.append(i)
            index += 1
else:
    for i in input().split():
        if index % 2 == 1:
            result.append(i)
            index += 1
        else:
            result.appendleft(i)
            index += 1

print(" ".join(result))
Problem p03695 (python)

Fixed submission:
from collections import Counter

N = int(input())

count_counter = Counter()
result = 0
over = 0

for i in input().split():
    count_counter[int(i) // 400] += 1

for key in count_counter.keys():
    if key < 8:
        result += 1
    else:
        over += count_counter[key]

if result == 0:
    print(1, over)
else:
    print(result, result+over)

Buggy submission (verdict: Runtime Error):
from collections import Counter

N, K = map(int, input().split())
input_list = [[int(i) for i in input().split()] for j in range(N)]
input_list.sort()

input_counter = Counter()

for element in input_list:
    input_counter[element[0]] += element[1]

for element in input_list:
    K -= element[1]
    if K <= 0:
        print(element[0])
        break
Problem p03814 (python)

Fixed submission:
s = input()

start = s.index("A")

for i in range(len(s)-1, start, -1):
    if s[i] == "Z":
        print(i - start + 1)
        break

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

start = s.index("A")

for i in range(len(s), start, -1):
    if s[i] == "Z":
        print(i - start + 1)
        break
Problem p03838 (python)

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

if x >= 0 and y >= 0:
    if y >= x:
        print(y - x)
    else:
        if y == 0:
            print(1 + x - y)
        else:
            print(x - y + 2)
elif x < 0 and y < 0:
    if y >= x:
        print(y - x)
    else:
        print(2 + x - y)
else:
    if y == 0:
        print(abs(abs(x) - abs(y)))
    else:
        print(abs(abs(x) - abs(y)) + 1)

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())

if x >= 0 and y >= 0:
    if x =< y:
        print(y - x)
    else:
        if y == 0:
            print(1 + x - y)
        else:
            print(x - y + 2)
elif x < 0 and y < 0:
    if y >= x:
        print(y - x)
    else:
        print(2 + x - y)
else:
    if y == 0:
        print(abs(abs(x) - abs(y)) + 1)
    else:
        print(abs(abs(x) - abs(y)) + 2)
Problem p03844 (python)

Fixed submission:
A, op, B = input().split()
print(int(A) + int(B) if op == "+" else int(A) - int(B))

Buggy submission (verdict: Runtime Error):
A. op, B = input().split()
print(A + B if op == "+" else A - B)
Problem p03845 (python)

Fixed submission:
N = int(input())
T_list = [int(i) for i in input().split()]
M = int(input())
M_list = [[int(i) for i in input().split()] for i in range(M)]

base_value = sum(T_list)

for i in range(M):
    print(base_value - (T_list[M_list[i][0]-1] - M_list[i][1]))

Buggy submission (verdict: Runtime Error):
N = int(input())
T_list = [int(i) for i in input().split()]
M = int(input())
M_list = [[int(i) for i in input().split()] for i in range(M)]

base_value = sum(T_list)

for i in range(M):
    print(base_value - (T_list[M_list[i][0]-1] - M_list[i][1]))
Problem p03846 (python)

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

mod = 10 ** 9 + 7

if N % 2 == 1:
    if input_list[0] != 0:
        print(0)
    else:
        if N == 1:
            print(1)
        flag = 2
        limit = (N - 1) // 2
        for i in range(1, limit, 2):
            if input_list[i] == flag and input_list[i+1] == flag:
                flag += 2
                if i == limit-1:
                    print((2**limit) % mod)
            else:
                print(0)
                break
elif N % 2 == 0:
    flag = 1
    limit = N
    for i in range(0, limit, 2):
        if input_list[i] == flag and input_list[i+1] == flag:
            flag += 2
            if i == limit-2:
                print((2**(N//2)) % mod)
                break
        else:
            print(0)
            break

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

mod = 10 ** 9 + 7

if N = 1 and input_list[0] == 0:
    print(1)
else:
    if N % 2 == 1:
        if input_list[0] != 0:
            print(0)
        else:
            flag = 2
            limit = (N - 1) // 2
            for i in range(1, limit, 2):
                if input_list[i] == flag and input_list[i+1] == flag:
                    flag += 2
                    if i == limit-1:
                        print((2**limit) % mod)
                else:
                    print(0)
                    break
    elif N % 2 == 0:
        flag = 1
        limit = N // 2
        for i in range(0, limit, 2):
            if input_list[i] == flag and input_list[i+1] == flag:
                flag += 2
                if i == limit-2:
                    print((2**limit) % mod)
            else:
                print(0)
                break

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

mod = 10 ** 9 + 7

if N = 1 and input_list[0] == 0:
    print(1)

if N % 2 == 1:
    if input_list[0] != 0:
        print(0)
    else:
        flag = 2
        limit = (N - 1) // 2
        for i in range(1, limit, 2):
            if input_list[i] == flag and input_list[i+1] == flag:
                flag += 2
                if i == limit-1:
                    print((2**limit) % mod)
            else:
                print(0)
                break
elif N % 2 == 0:
    flag = 1
    limit = N // 2
    for i in range(0, limit, 2):
        if input_list[i] == flag and input_list[i+1] == flag:
            flag += 2
            if i == limit-2:
                print((2**limit) % mod)
        else:
            print(0)
            break


# 5
# 4 2 0 2 4
Problem p03937 (python)

Fixed submission:
H, W = map(int, input().split())
inputs = [input() for _ in range(H)]

y = 0
x = 0

goal_y = H - 1
goal_x = W - 1

counts = 0
for item in inputs:
    counts += item.count('#')

if counts != (H + W - 1):
    print('Impossible')
else:
    for _ in range(H + W - 2):
        if x + 1 < W and inputs[y][x + 1] == '#':
            x += 1
        elif y + 1 < H and inputs[y + 1][x] == '#':
            y += 1
    print('Possible' if y == goal_y and x == goal_x else 'Impossible')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
inputs = [input() for _ in range(H)]

y = 0
x = 0

goal_y = H - 1
goal_x = W - 1

ans = 'Impossible'
counts = 0
for item in inputs:
    counts += item.count('#')

if counts != (H + W - 1):
    ans = 'Impossible'
else:
    for i in range(H + W - 2):
        if 0 <= x <= W - 1 and inputs[y][x + 1] == '#':
            x = x + 1
        elif 0 <= y <= H - 1 and inputs[y + 1][x] == '#':
            y = y + 1
        else:
            ans = 'Impossible'
            break
    ans = 'Possible' if y == goal_y and x == goal_x else 'Impossible'

print(ans)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
inputs = [input() for _ in range(H)]

y = 0
x = 0

goal_y = H - 1
goal_x = W - 1

counts = 0
for item in inputs:
    counts += item.count('#')

if counts != (H + W - 1):
    ans = 'Impossible'
else:
    for i in range(H + W - 2):
        if 0 <= x <= W - 1 and inputs[y][x + 1] == '#':
            x = x + 1
        elif 0 <= y <= H - 1 and inputs[y + 1][x] == '#':
            y = y + 1
        else:
            ans = 'Impossible'
            break
    ans = 'Possible' if y == goal_y and x == goal_x else 'Impossible'

print(ans)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
inputs = [input() for _ in range(H)]

y = 0
x = 0

goal_y = H - 1
goal_x = W - 1

counts = 0
for item in inputs:
    counts += item.count('#')

if counts != (H + W - 1):
    print('Impossible')
else:
    for i in range(H + W - 2):
        if 0 <= x <= W - 1 and inputs[y][x + 1] == '#':
            x = x + 1
        elif 0 <= y <= H - 1 and inputs[y + 1][x] == '#':
            y = y + 1
    print('Possible' if y == goal_y and x == goal_x else 'Impossible')
Problem p03998 (python)

Fixed submission:
A = list(input())
B = list(input())
C = list(input())

owner = 'a'

while True:
    if owner == 'a':
        if len(A):
            owner = A[0]
            del(A[0])
        else:
            print('A')
            break
    if owner == 'b':
        if len(B):
            owner = B[0]
            del(B[0])
        else:
            print('B')
            break
    if owner == 'c':
        if len(C):
            owner = C[0]
            del(C[0])
        else:
            print('C')
            break

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

owner = 'a'

while True:
    if owner == 'a'
        if len(A):
            owner = A[0]
            del(A[0])
        else:
            print('a')
            break
    if owner == 'b'
        if len(B):
            owner = B[0]
            del(B[0])
        else:
            print('b')
            break
    if owner == 'c'
        if len(C):
            owner = C[0]
            del(C[0])
        else:
            print('c')
            break
Problem p03999 (python)

Fixed submission:
S = input()

ans = 0
count_list = [[2 ** (len(S)-1)]]

for i in range(1, len(S)):
    if i == 1:
        count_list.append([2 ** (len(S)-2), 2 ** (len(S)-2)])
    else:
        a = []
        for j in count_list[i-1][:i-1]:
            a.append(j)
        a.append(count_list[i-1][-1]//2)
        a.append(count_list[i-1][-1]//2)
        count_list.append(a)

count_list = count_list[::-1]

for i in range(len(S)):
    flag = 1
    for j in count_list[i]:
        ans += int(S[i]) * flag * j
        flag *= 10

print(ans)

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

ans = 0
count_list = [[2 ** (len(S)-1)]]

for i in range(1, len(S)):
    if i == 1:
        count_list.append([2 ** (len(S)-2), 2 ** (len(S)-2)])
    else:
        count_list.append([*count_list[i-1][:i-1], count_list[i-1][-1]//2, count_list[i-1][-1]//2])

count_list = count_list[::-1]

for i in range(len(S)):
    flag = 1
    for j in count_list[i]:
        ans += int(S[i]) * flag * j
        flag *= 10

print(ans)

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

ans = 0
count_list = [[2 ** (len(S)-1)]]

for i in range(1, len(S)):
    if i == 1:
        count_list.append([2 ** (len(S)-2), 2 ** (len(S)-2)])
    else:
        count_list.append([*count_list[i-1][:i-1], count_list[i-1][-1]//2, count_list[i-1][-1]//2])

count_list = count_list[::-1]

for i in range(len(S)):
    flag = 1
    for j in count_list[i]:
        ans += int(S[i]) * flag * j
        flag *= 10

print(ans)
Problem p04012 (python)

Fixed submission:
from collections import Counter

w = Counter(list(input()))

for value in w.values():
    if value % 2 != 0:
        print('No')
        break
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
w = input())
for s in set(w):
    if w.count(s) % 2 != 0:
        print('No')
        break
else:
    print('Yes')
Problem p04030 (python)

Fixed submission:
s = str(input())

while 'B' in s:
    if s[0] == 'B':
        s=s[1:]
    s=s.replace('0B','')
    s=s.replace('1B','')

print(s)

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

while 'B' in s:
    if s[0] == 'B':
    s=s[1:]
    s=s.replace('0B','')
    s=s.replace('1B','')

print(s)

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

result = []

for i in range(len(s)):
    if i == 1:
        if s[i] != 'B':
            result.append(s[i])
    else:
        if s[i] != 'B':
            result.append(s[i])
        else:
            result.pop()

print(''.join(result))