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

Fixed submission:
from fractions import gcd


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


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

LCM = lcm(C, D)

x = B//C
y = B // D
z = B // LCM
ans = B-x-y+z

x = (A-1) // C
y = (A-1) // D
z = (A-1) // LCM

ans -= (A-1) - x - y + z

print(ans)

Buggy submission (verdict: Runtime Error):
from math import floor, ceil
from math import gcd
# from fractions import gcd


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


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

x = floor(B / C)
y = floor(B / D)
z = floor(B / LCM)
ans = B-x-y+z

x = floor((A-1) / C)
y = floor((A-1) / D)
z = floor((A - 1) / LCM)

ans -= (A - 1) - x - y + z

print(ans)

Buggy submission (verdict: Runtime Error):
from math import floor, ceil, gcd


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


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

multiple_of_C = floor(B / C) - ceil(A / C) + 1
multiple_of_D = floor(B / D) - ceil(A / D) + 1
multiple_of_CtimesD = floor(B / LCM) - ceil(A / LCM) + 1

print((B-A+1)-multiple_of_C-multiple_of_D+multiple_of_CtimesD)

Buggy submission (verdict: Runtime Error):
from math import floor, ceil, gcd


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


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

multiple_of_C = floor(B / C) - ceil(A / C) + 1
multiple_of_D = floor(B / D) - ceil(A / D) + 1
multiple_of_CtimesD = floor(B / LCM) - ceil(A / LCM) + 1

print((B-A+1)-multiple_of_C-multiple_of_D+multiple_of_CtimesD)
Problem p03079 (python)

Fixed submission:
a, b, c = list(map(int, input().split()))
print('Yes' if a == b == c and a > 0 else 'No')

Buggy submission (verdict: Runtime Error):
a, b, c = list(map(int, input().split())).sort(reverse=True)
print('Yes' if b - c < a and a < b + c else 'No')
Problem p03246 (python)

Fixed submission:
from collections import Counter

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

# most_commonを使うためにリストをCounterオブジェクトに渡す
Counter_evens = Counter(vlist[::2])
Counter_odds = Counter(vlist[1::2])


# even_indexes
top2_even = Counter_evens.most_common(2)  # [(一番多い要素,その出現回数),(2番目に多い要素,その出現回数)]

E_most_common = top2_even[0][0]
Emnum = top2_even[0][1]

if len(top2_even) == 2:
    E_2nd_common = top2_even[1][0]
    E2num = top2_even[1][1]
else:
    E_2nd_common = 'foo'
    E2num = 0

# odd_indexes
top2_odd = Counter_odds.most_common(2)

O_most_common = top2_odd[0][0]
Omnum = top2_odd[0][1]

if len(top2_odd) == 2:
    O_2nd_common = top2_odd[1][0]
    O2num = top2_odd[1][1]
else:
    O_2nd_common = 'foo'
    O2num = 0


if E_most_common == O_most_common:  # most commonどうしが衝突してしまっている。
    # もし偶数番目・奇数番目をどちらもmost commonに書き換えると、3つ目の条件「数列は1種類の数ではだめ」が満たされない。
    # なので奇数番目・偶数番目のどちらかは2番目に多いやつに書き換える必要がある

    # 偶数番目をmost commonに、oddsを2nd commonにそろえる場合に書き換えないといけない要素の数
    x = len(vlist[::2]) - Emnum + len(vlist[1::2]) - O2num
    # 逆の場合
    y = len(vlist[::2]) - E2num + len(vlist[1::2]) - Omnum

    print(min(x, y))
else:
    # most common は衝突していない、つまり異なる数。よって3つ目の条件「数列は1種類の数ではだめ」は満たされている。
    # 両方とも most commonに書き換えてOK
    print(len(vlist[::2]) - Emnum + len(vlist[1::2]) - Omnum)

Buggy submission (verdict: Runtime Error):
from statistics import mode
n = int(input())
vlist = list(map(int, input().split()))


a = vlist[::2]
b = vlist[1::2]

freq_a = mode(a)
freq_b = mode(b)


x = len(a) - freq_a
y = len(b) - freq_b


if len(set(vlist)) == 1:
    print(min(len(a), len(b)))
else:
    print(x+y)

Buggy submission (verdict: Runtime Error):
from statistics import mode
n = int(input())
vlist = list(map(int, input().split()))


a = vlist[::2]
b = vlist[1::2]

freq_a = mode(a)
freq_b = mode(b)


x = len(a) - freq_a
y = len(b) - freq_b

print(a)
print(b)
print(freq_a)
print(freq_b)

if len(set(vlist)) == 1:
    print(min(len(a), len(b)))
else:
    print(x+y)

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

a = max(vlist[::2])
b = max(vlist[1::2])

x = len(a) - vlist[::2].count(a)
y = len(b) - vlist[1::2].count(b)

print(x+y)
Problem p03471 (python)

Fixed submission:
n, Y = list(map(int, input().split()))
for i in range(n + 1):
    for j in range(n + 1 - i):
        if 10000 * i + 5000 * j + 1000 * (n - i - j) == Y:
            print(i, j, n - i - j)
            exit()
else:
    print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
n, Y = list(map(int, input().split()))
for i in range(N + 1):
    for j in range(n + 1 - i):
        if 10000 * i + 5000 * j + 1000 * (n - i - j) == Y:
            print(i, j, n - i - j)
            exit()
else:
    print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
N, Y = list(map(int, input().split()))
for i in range(N + 1):
    for j in range(n + 1 - i):
        if 10000 * i + 5000 * j + 1000 * (n - i - j) == Y:
            print(i, j, n - i - j)
            exit()
else:
    print('-1 -1 -1')
Problem p03607 (python)

Fixed submission:
N = int(input())
Alist = [int(input()) for i in range(N)]
Alist.sort()
Alist.append('END')
counter = 1
ans = 0

for i in range(1, len(Alist)):
    if Alist[i - 1] == Alist[i]:
        counter += 1
    else:
        if counter % 2 == 1:
            ans += 1
        counter = 1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
Alist = [int(input()) for i in range(N)]
Alist.sort()
Alist.append('END')
counter = 1
ans = 0

for i in range(1, len(alist)):
    if Alist[i - 1] == Alist[i]:
        counter += 1
    else:
        if counter % 2 == 1:
            ans += 1
        counter = 1

print(ans)
Problem p03695 (python)

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

colors = [0]*9

for rate in rates:
    if rate < 3200:
        colors[rate // 400] += 1
    else:
        colors[8] += 1

zeros = colors[0:8].count(0)
nonzeros = 8 - zeros

M = nonzeros + colors[8]

if nonzeros == 0:
    m = 1
else:
    m = nonzeros

print(m, M)

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

colors = [0]*9

for rate in rates:
    colors[rate // 400] += 1

zeros = colors[0:8].count(0)
nonzeros = 8 - zeros

M = nonzeros + colors[8]

if nonzeros == 0:
    m = 1
else:
    m = nonzeros

print(m, M)

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

colors = [0]*9

for rate in rates:
    colors[rate // 400] += 1

if colors[0:8] == [0] * 8:
    print(1, min(colors[8], 8))
else:
    zeros = colors[0:8].count(0)
    print(8-zeros, 8-zeros+min(zeros, colors[8]))

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

colors = [0]*9

for rate in rates:
    colors[rate // 400] += 1

if colors[0:8] == [0] * 8:
    print(1, min(colors[8], 8))
else:
    zeros = colors[0:8].count(0)
    print(8-zeros, 8-zeros+min(zeros, colors[8]))
Problem p03731 (python)

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


dabaaaaa = 0

for i in range(len(push_list)-1):
    if push_list[i + 1] - push_list[i] < T:
        dabaaaaa += push_list[i + 1] - push_list[i]
    else:
        dabaaaaa += T

    # 最後の人が押した後のT秒も加算

print(dabaaaaa+T)

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

dabaaaaa = 0

for i in range(len(dabaaaaa)-1):
    if push_list[i + 1] - push_list[i] < 5:
        dabaaaaa += push_list[i + 1] - push_list[i]
    else:
        dabaaaaa += 5

print(dabaaaaa)
Problem p03845 (python)

Fixed submission:
N = int(input())
Tlist = list(map(int, input().split()))
M = int(input())
PX = [list(map(int, input().split())) for i in range(M)]

for i in range(M):
    print(sum(Tlist)-Tlist[PX[i][0]-1]+PX[i][1])

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

for i in range(M):
    print(sum(Tlist)-Tlist[i]+PX[i][1])
Problem p02900 (python)

Fixed submission:
import collections
import fractions

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return set(a)


A, B = list(map(int, input().split()))
print(len(prime_factorize(fractions.gcd(A, B))) + 1)

Buggy submission (verdict: Runtime Error):
import collections
import fractions

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return set(a)

A, B = list(map(int, input().split()))
print(len(fractions.gcd(A, B)) + 1)
Problem p02982 (python)

Fixed submission:
import numpy as np

def main():
    N, D = list(map(int, input().split()))
    X = []
    for i in range(N):
	    line = [int(a) for a in input().split()]
	    X.append(line)
    X_np = np.array(X)

    ans = 0
    for i in range(N):
        for j in range(i+1, N):
            if(is_dist_int(X_np, D, i, j)):
                ans += 1
    print(ans)

def is_dist_int(X_np, D, i, j):
    dif = np.sum(np.square(np.abs(X_np[i] - X_np[j])))
    dis = np.sqrt(dif)
    return dis.is_integer()

main()

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

N, D = list(map(int, input().split()))
X = []
for i in range(D):
    x_i = [int(i) for i in input().split()]
    X.append(i)
X = np.array(X)

ans = 0
for i in range(D):
    for j in range(i + 1, D):
        if np.sqrt(np.sum(X[i] - X[j]) ** 2).is_integer():
            ans += 1
print(ans)

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

N, D = list(map(int, input().split()))
X = []
for i in range(D):
    x_i = [int(i) for i in input().split()]
    X.append(i)
X = np.array(X)

ans = 0
for i in range(D):
    for j in range(i + 1, D):
        if np.is_integer(np.sqrt(np.sum(X[i] - X[j]) ** 2)):
            ans += 1
print(ans)
Problem p02983 (python)

Fixed submission:
def main():
    L, R = list(map(int, input().split()))
    ans = 2018
    end = min(R+1, L+2019)
    for i in range(L, end-1):
        for j in range(i+1, end):
            ans = min(ans, (i*j)%2019)
    print(ans)

main()

Buggy submission (verdict: Runtime Error):
def main():
    L, R = list(map(int, input().split()))
    ans = 2018
    end = min(R+1, L+2019))
    for i in range(L, end-1):
        for j in range(i+1, end):
            print(ans, (i*j)%2019)
            ans = min(ans, (i*j)%2019)
    print(ans)

main()
Problem p03160 (python)

Fixed submission:
N = int(input())
h = [int(i) for i in input().split()]
dp = []
for i in range(N):
    if i == 0:
        dp.append(0)
        continue
    if i == 1:
        dp.append(abs(h[1] - h[0]))
        continue
    dp.append(min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2])))
print(dp[-1])

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

memo = [float("inf")] * N
memo[0], memo[1] = 0, abs(h[1] - h[0])


def frog(ith):
    if memo[ith] != float("inf"):
        return memo[ith]
    memo[ith] = min(
        frog(ith - 1) + abs(h[ith] - h[ith - 1]),
        frog(ith - 2) + abs(h[ith] - h[ith - 2]),
    )
    return memo[ith]


print(frog(N - 1))
Problem p03196 (python)

Fixed submission:
import collections as cl

N, P = map(int, input().split())
if P == 1:
    print(1)
    exit()
P_prime = []
while P % 2 == 0:
    P_prime.append(2)
    P //= 2
odd = 3
while odd * odd <= P:
    if P % odd == 0:
        P_prime.append(odd)
        P //= odd
    else:
        odd += 2
if P != 1:
    P_prime.append(P)

ans = 1
dic_P = cl.Counter(P_prime)
for prime, num in dic_P.items():
    ans *= pow(prime, num // N)
print(ans)

Buggy submission (verdict: Runtime Error):
N, P = map(int, input().split())
P_prime = []
while P % 2 == 0:
    P_prime.append(2)
    P //= 2
odd = 3
while odd * odd <= P:
    if P % odd == 0:
        P_prime.append(odd)
        P //= odd
    else:
        odd += 2
if P != 1:
    P_prime.append(P)
edge = [0]
for i in range(len(P_prime) - 1):
    if P_prime[i] != P_prime[i + 1]:
        edge.append(i)
edge.append(len(P_prime) - 1)
ans = 1
for i in range(len(edge) - 1):
    ans *= pow(P_prime[edge[i + 1]], (edge[i + 1] - edge[i]) // N)
print(ans)
Problem p03210 (python)

Fixed submission:
X = int(input())
if X == 7 or X == 5 or X == 3:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
X = int(input())
if X == 7 or X == 5 or X == 3:
    print("YES")
else"
    print("NO")
Problem p03293 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
if S == T:
    print("Yes")
    exit()
for i in range(N):
    S = S[-1] + S[0 : len(S) - 1]
    if S == T:
        print("Yes")
        exit()
print("No")
Problem p03311 (python)

Fixed submission:
N = int(input())
if N == 1:
    print(0)
    exit()
A = [int(i) for i in input().split()]
A = [A[i] - i - 1 for i in range(N)]
A.sort()
if N == 2:
    print(abs(A[0] - A[1]))
    exit()

sum_A = [0, 0]
for i in range(N):
    sum_A[0] += abs(A[i] - A[N // 2])
sum_2 = 0
for i in range(N):
    sum_A[1] += abs(A[i] - A[N // 2 + 1])
print(min(sum_A))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
A = [A[i] - i - 1 for i in range(N)]
A.sort()
# for a in [A[N // 2], A[N // 2 + 1]]:
sum_A = [0, 0]
for i in range(N):
    sum_A[0] += abs(A[i] - A[N // 2])
sum_2 = 0
for i in range(N):
    sum_A[1] += abs(A[i] - A[N // 2 + 1])
print(min(sum_A))
Problem p03316 (python)

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

Buggy submission (verdict: Runtime Error):
N = input()
if int(N) % sum([int(N[i] for i in range(len(N)))]) == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
if S == T:
    print("Yes")
    exit()
for i in range(N):
    S = S[-1] + S[0 : len(S) - 1]
    if S == T:
        print("Yes")
        exit()
print("No")
Problem p03337 (python)

Fixed submission:
A, B = list(map(int, input().split()))
print(max(A + B, max(A - B, A * B)))

Buggy submission (verdict: Runtime Error):
A, B = list(map(int, input().split()))
print(max(A + B, max(A - B.A * B)))
Problem p03385 (python)

Fixed submission:
if sorted(input()) == ["a", "b", "c"]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input().split()
if S[0] != S[1] != S[2]:
    print("Yes")
else:
    print("No")
Problem p03399 (python)

Fixed submission:
ABCD = []
for i in range(2):
    ticket = int(input())
    hodai = int(input())
    ABCD.append(min(ticket, hodai))

print(sum(ABCD))

Buggy submission (verdict: Runtime Error):
ABCD = []
for i in range(4):
    ticket = int(input())
    hodai = int(input())
    ABCD.append(min(ticket, hodai))

print(sum(ABCD))
Problem p03469 (python)

Fixed submission:
S = input()
for i in range(len(S)):
    if i == 3:
        print("8", end="")
    else:
        print(S[i], end="")

Buggy submission (verdict: Runtime Error):
import sys

N, Y = list(map(int, input().split()))
for i_yukichi in range(N + 1):
    for j_higuchi in range(N + 1 - i_yukichi):
        k_noguchi = N - i_yukichi - j_higuchi
        if 10000 * i_yukichi + 5000 * j_higuchi + 1000 * k_noguchi == Y:
            print(i_yukichi, j_higuchi, k_noguchi)
            sys.exit()

print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
import sys

N, Y = list(map(int, input().split()))
for i_yukichi in range(N + 1):
    for j_higuchi in range(N + 1 - i_yukichi):
        k_noguchi = N - i_yukichi - j_higuchi
        if 10000 * i_yukichi + 5000 * j_higuchi + 1000 * k_noguchi == Y:
            print(i_yukichi, j_higuchi, k_noguchi)
            sys.exit

print("-1 -1 -1")
Problem p03471 (python)

Fixed submission:
N, Y = list(map(int, input().split()))
ans = []
for i_yukichi in range(N + 1):
    for j_higuchi in range(N + 1 - i_yukichi):
        k_noguchi = N - i_yukichi - j_higuchi
        if 10000 * i_yukichi + 5000 * j_higuchi + 1000 * k_noguchi == Y:
            ans.append(i_yukichi)
            ans.append(j_higuchi)
            ans.append(k_noguchi)
            break
if len(ans) != 0:
    print(ans[0], ans[1], ans[2])
else:
    print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
N, Y = list(map(int, input().split()))
ans = []
for i_yukichi in range(N + 1):
    for j_higuchi in range(N + 1 - i_yukichi):
        k_noguchi = N - i_yukichi - j_higuchi
        if 10000 * i_yukichi + 5000 * j_higuchi + 1000 * k_noguchi == Y:
            ans.append(i_yukichi)
            ans.append(j_higuchi)
            ans.append(k_noguchi)
            break
if len(ans) != 0:
    print(ans[0], ans[1], ans[3])
else:
    print("-1 -1 -1")
Problem p03474 (python)

Fixed submission:
A, B = map(int, input().split())
S = input()
pos_hyphen = [i for i in range(len(S)) if S[i] == "-"]
if len(pos_hyphen) == 1 and pos_hyphen[0] == A:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
S = input()
pos_hyphen = [i if S[i] == "-" for i in range(len(S))]
if len(pos_hyphen) == 1 and pos_hyphen[0] == A:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
S = input()
if S.index("-") == A:
    print("Yes")
else:
    print("No")
Problem p03567 (python)

Fixed submission:
S = input()
for i in range(len(S) - 1):
    if S[i: i + 2] == "AC":
        print("Yes")
        exit()
print("No")

Buggy submission (verdict: Runtime Error):
S = input()
for i in range(len(S) - 1):
    if S[i, i + 1] == "AC":
        print("Yes")
        exit()
print("No")
Problem p03607 (python)

Fixed submission:
N = int(input())
A = {}
for i in range(N):
    a = int(input())
    if a in A:
        A[a] += 1
    else:
        A[a] = 1
ans = 0
for val in A.values():
    ans += val % 2
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = {}
for i in range(N):
    a = int(input())
    if a in A:
        A[a] += 1
    else:
        A[a] = 1
ans = 0
for val in A.values:
    ans += val % 2
print(ans)
Problem p03777 (python)

Fixed submission:
a, b = input().split()
if a == "H":
    print(b)
else:
    if b == "H":
        print("D")
    else:
        print("H")

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, input().split()))
if a == "H":
    print(b)
else:
    if b == "H":
        print("D")
    else:
        print("H")
Problem p03838 (python)

Fixed submission:
x, y = list(map(int, input().split()))
ans = []
if y - x >= 0:
    ans.append(y - x)
if y + x >= 0:
    ans.append(y + x + 1)
if -1 * y - x >= 0:
    ans.append(-1 * y - x + 1)
if -1 * y + x >= 0:
    ans.append(-1 * y + x + 2)
print(min(ans))

Buggy submission (verdict: Runtime Error):
x, y = list(map(int, input().split()))
if y - x >= 0:
    ans = y - x
if y + x >= 0:
    ans = min(ans, y + x + 1)
if -1 * y - x >= 0:
    ans = min(ans, -1 * y - x + 1)
if -1 * y + x >= 0:
    ans = min(ans, -1 * y + x + 2)
print(ans)

Buggy submission (verdict: Runtime Error):
x, y = list(map(int, input().split()))
if y - x >= 0:
    ans = y - x
if y + x >= 0:
    ans = min(ans, y + x + 1)
if -y - x >= 0:
    ans = min(ans, -y - x + 1)
if -y + x >= 0:
    ans = min(ans, -y + x + 2)
print(ans)
Problem p03844 (python)

Fixed submission:
equa = input().split()
if equa[1] == "+":
    print(int(equa[0]) + int(equa[2]))
else:
    print(int(equa[0]) - int(equa[2]))

Buggy submission (verdict: Runtime Error):
equa = input().split()
if equa[1] == "+":
    print(int(equa[0]) + int(equa[1]))
else:
    print(int(equa[0]) - int(equa[1]))
Problem p03943 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a + b + c == 2 * max(a, max(b, c)):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if sum(abc)//2 == a or sum(abc)//2 == b or sum(abc)//2 == c:
    print("Yes")
else:
    print("No")
Problem p04030 (python)

Fixed submission:
s = input()
ans = []
for i in s:
    if i != "B":
        ans.append(i)
        continue
    if len(ans) == 0:
        continue
    elif len(ans) != 0:
        ans.pop()
print(*ans, sep="")

Buggy submission (verdict: Runtime Error):
s = input()
ans = []
for i in s:
    if i != "B":
        ans.append(i)
        continue
    if len(i) == 0:
        continue
    elif len(i) != 0:
        ans.pop()
print(*ans, sep="")

Buggy submission (verdict: Runtime Error):
s = input()
ans = []
for i in s:
    if i != "B":
        ans.append(i)
    else:
        ans.pop()
print(*ans, sep="")
Problem p04043 (python)

Fixed submission:
ABC = [int(i) for i in input().split()]
ABC.sort()
if sum(ABC) == 17 and ABC[0] == 5 and ABC[2] == 7:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
ABC = [int(i) fo i  in input())
ABC.sort()
if sum(ABC) == 17 and ABC[0] == 5 and ABC[2] == 7:
    print("YES")
else:
    print("NO")
Problem p02621 (python)

Fixed submission:
a = int(input())
print(a + a**2 + a**3)

Buggy submission (verdict: Runtime Error):
a = input()
a + a ** 2 + a ** 3 = A
print(A)

Buggy submission (verdict: Runtime Error):
a = input()
a + a **2 + a ** 3 = A
print(A)

Buggy submission (verdict: Runtime Error):
a = input()
	print(a + a ** 2 + a ** 3)

Buggy submission (verdict: Runtime Error):
a = input()
a + a * 2 + a * 3 = Z
 print(Z)

Buggy submission (verdict: Runtime Error):
a = input()
 print(a + a * 2 + a * 3)

Buggy submission (verdict: Runtime Error):
a = input()
 print(a + a * 2 + a * 3 = Z)

Buggy submission (verdict: Runtime Error):
input(a)
 print(a + a * 2 + a * 3)

Buggy submission (verdict: Runtime Error):
input(a)
 print("a + a * 2 + a * 3")

Buggy submission (verdict: Runtime Error):
input(a)
 print(a + a * 2 + a * 3 = Z)

Buggy submission (verdict: Runtime Error):
input(a)
 
a + a * 2 + a * 3 = Z
	print("Z")

Buggy submission (verdict: Runtime Error):
input(a)
 
a * 2 + a * 3 + a * 4 = Z
	print("Z")

Buggy submission (verdict: Runtime Error):
input(a)
 
a ** 2 + a ** 3 + a ** 4 = Z
	print("Z")

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

a**2 + a**3 + a**4 = Z
print("Z")
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
     
if s == t[:len(s)]:
	if t[-1] in 'abcdefghijklmnopqrstuvwxyz':
		print('Yes')
		exit(0)       

print('No')

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
     
if s == t[:len(s)]:
	if t[-1] in 'abcdefghijklmnopqrstuvwxyz':
		print('Yes')
        exit(0)       
print('No')

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
     
if s == t[:len(s)]:
	if t[-1] in 'abcdefghijklmnopqrstuvwxyz':
		print('Yes')
        exit(0)
else:        
print('No')

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
     
if s == t[:len(s)]:
	if t[-1] in 'abcdefghijklmnopqrstuvwxyz'
		print('Yes')
        exit(0)
        
print('No')

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
     
if s == t[:len(s)]:
	if t[-1] in 'abcdefghijklmnopqrstuvwxyz'
		print('Yes')
        exit(0)
else:        
print('No')

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
     
if s == t[:len(s)]:
	if t[-1] in 'abcdefghijklmnopqrstuvwxyz'
		print('Yes')
        exit(0)
        
print('No')

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
     
if s == t[:len(s)]:
	if t[-1] in 'abcdefghijklmnopqrstuvwxyz'
		print('Yes')

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

if s = t[:len(s)]:
	if t[-1] in 'abcdefghijklmnopqrstuvwxyz'
		print('Yes')