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

Fixed submission:
a, b = map(int,input().split())
print(round(a+b//2))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
P = [0] * M
Y = [0] * M
check = [[] for i in range(N)]

for i in range(M):
    P[i], Y[i] = map(int, input().split())
    check[P[i]-1].append(Y[i])

for i in range(N):
    check[i].sort()

for i in range(M):
    tmp1 = ('00000' + str(P[i]))[-6:] 
    tmp2 = ('00000' + str(check[P[i]-1].index(Y[i])+1))[-6:]
    tmp = tmp1 + tmp2
    print(tmp)
Problem p03238 (python)

Fixed submission:
N = int(input())
if N == 1 :
  print('Hello World')
else :
  a = int(input())
  b = int(input())
  print(a+b)

Buggy submission (verdict: Runtime Error):
N = int(input())
x = [0] * N
y = [0] * N
h = [0] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())

top = [[] for _ in range(101*101)]

for i in range(101):
    for j in range(101):
        top[i*101+j] = [i, j]

#print(top)

H = 0

for i in range(len(top)):
    topx = top[i][0]
    topy = top[i][1]
    H = 0
    h_list = []
    for j in range(N):
        if h[j] != 0:
            tmp = abs(topx - x[j]) + abs(topy - y[j]) + h[j]
            h_list.append(tmp)
    if h_list.count(h_list[0]) == N - h.count(0) :
        ansx = topx
        ansy = topy
        ansH = h_list[0]
        break

print(ansx, ansy, ansH)
Problem p03240 (python)

Fixed submission:
N = int(input())
x = [0] * N
y = [0] * N
h = [0] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())

top = [[] for _ in range(101*101)]

for i in range(101):
    for j in range(101):
        top[i*101+j] = [i, j]

#print(top)

H = 0
ansx = -100

for i in range(len(top)):
    topx = top[i][0]
    topy = top[i][1]
    H = 0
    h_list = []
    for j in range(N):
        tmp = abs(topx - x[j]) + abs(topy - y[j]) + h[j]
        h_list.append(tmp)
    if h_list.count(h_list[0]) == N :
        ansx = topx
        ansy = topy
        ansH = h_list[0]
        break

if ansx == -100:
    for i in range(len(top)):
        topx = top[i][0]
        topy = top[i][1]
        H = 0
        h_list = []
        for j in range(N):
            if h[j] != 0:
                tmp = abs(topx - x[j]) + abs(topy - y[j]) + h[j]
                h_list.append(tmp)
        if h_list.count(h_list[0]) == N - h.count(0) :
            ansx = topx
            ansy = topy
            ansH = h_list[0]
            break

print(ansx, ansy, ansH)

Buggy submission (verdict: Runtime Error):
N = int(input())
x = [0] * N
y = [0] * N
h = [0] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())

top = [[] for _ in range(101*101)]

for i in range(101):
    for j in range(101):
        top[i*101+j] = [i, j]

#print(top)

H = 0

for i in range(len(top)):
    topx = top[i][0]
    topy = top[i][1]
    H = 0
    h_list = []
    for j in range(N):
        tmp = abs(topx - x[j]) + abs(topy - y[j]) + h[j]
        h_list.append(tmp)
    if h_list.count(h_list[0]) >= N - h.count(0) :
        ansx = topx
        ansy = topy
        ansH = h_list[0]
        break

print(ansx, ansy, ansH)

Buggy submission (verdict: Runtime Error):
N = int(input())
x = [0] * N
y = [0] * N
h = [0] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())

top = [[] for _ in range(101*101)]

for i in range(101):
    for j in range(101):
        top[i*101+j] = [i, j]

#print(top)

H = 0

for i in range(len(top)):
    topx = top[i][0]
    topy = top[i][1]
    H = 0
    h_list = []
    for j in range(N):
        tmp = abs(topx - x[j]) + abs(topy - y[j]) + h[j]
        h_list.append(tmp)
    if h_list.count(h_list[0]) == N :
        ansx = topx
        ansy = topy
        ansH = h_list[0]
        break

print(topx, topy, ansH)
Problem p03260 (python)

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

Buggy submission (verdict: Runtime Error):
l = list(map(int,input().split().split()))
l.sort()
print(l[0]*10 +l[1]+l[2])

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
if a*b %2 != 0:
  print('Yes')
else :
  print('No')
Problem p03282 (python)

Fixed submission:
S = list(input())
K = int(input())
check = 0

for i in range(len(S)):
    if S[i] != "1" :
        tmp = i+1
        check = 1
        break

if check == 0:
    ans = 1
else:
    if tmp > K :
        ans = 1
    else:
        ans = S[tmp-1]

print(ans)

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

for i in range(len(S)):
    if S[i] != "1" :
        tmp = i+1
        break

if tmp > K :
    ans = 1
else:
    ans = S[tmp-1]

print(ans)
Problem p03290 (python)

Fixed submission:
import itertools
D, G = map(int, input().split())
p = [0] * D
c = [0] * D
pc = [0] * D
for i in range(D):
    p[i], c[i] = map(int, input().split())

l = list(itertools.product(range(2), repeat=D))

comp = []
for i in range(len(l)-1):
    score = 0
    count = 0
    m = -100
    for j in range(D):
        if l[i][j] == 1:
            score += (j+1) * 100 * p[j] + c[j]
            count += p[j]
        elif l[i][j] == 0:
            m = max(m, j)
    tmp = [score, count]
    comp.append(tmp)
    for j in range(p[m]-1):
        score += (m+1) * 100 * 1
        count += 1
        tmp = [score, count]
        comp.append(tmp)

score = 0
count = 0
for i in range(D):
    score += (i+1) * 100 * p[i] + c[i]
    count += p[i]
tmp = [score, count]
comp.append(tmp)    

#print(comp)

ans = []
for i in range(len(comp)):
    if comp[i][0] >= G:
        ans.append(comp[i][1])

ans = min(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
#%%
import itertools

D, G = map(int, input().split())
p = [0] * D
c = [0] * D
com = [0] * D
for i in range(D):
    p[i], c[i] = map(int, input().split())
    com[i] = [100 * (i+1) * p[i] + c[i], p[i]]

l = list(itertools.product(range(2), repeat=D))
score_list = []
for i in range(len(l)):
    tmp1 = 0
    tmp2 = []
    tmp3 = -1
    tmp5 = 0
    for j in range(D):
        if l[i][j] == 0:
            tmp2.append(j)
            pass
        else:
            tmp1 += com[j][0]
            tmp5 += com[j][1]
    if len(tmp2) != 0:
        tmp3 = tmp2[-1]
    if tmp3 != -1:
        tmp4 = tmp1 + (tmp3+1) * 100 * (p[tmp3]-1)
    else:
        tmp4 = tmp1
    
    score_list.append([tmp1, tmp3, tmp4, tmp5])

#print(score_list)

ans_list = []

for i in range(len(score_list)):
    if score_list[i][2] != -1:
        if score_list[i][0]<= G and score_list[i][2] >= G:
            tmp = (G - score_list[i][0]) // ((score_list[i][1]+1)*100)
            ans = score_list[i][3] + tmp
            ans_list.append(ans)
#            print(score_list[i][3], ans)
    else:
        if score_list[i][0]>= G:
            ans_list.append(score_list[i][3])

#print(ans_list)
print(min(ans_list))
Problem p03292 (python)

Fixed submission:
l = list(map(int,input().split()))
l.sort()
ans = []
for i in range(len(l)-1):
  ans.append(l[i+1] - l[i])
print(sum(ans))

Buggy submission (verdict: Runtime Error):
l = list(map(int,input().split()))
l.sort()
ans = []
for i in range(N-1):
  ans.append(l[i+1] - l[i])
print(sum(ans))
Problem p03302 (python)

Fixed submission:
a, b = map(int, input().split())
if a+b == 15:
  print('+')
elif a*b == 15:
  print('*')
else:
  print('x')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
if a+b == 15:
  print('+')
if a*b == 15:
  print('*')
else:
  print('x')
Problem p03331 (python)

Fixed submission:
N = int(input())
l = []

for i in range(1,N):
    tmp1 = list(str(i))
    tmp2 = list(str(N-i))
    s1 = 0
    s2 = 0
    for j in range(len(tmp1)):
        s1 += int(tmp1[j])
    for j in range(len(tmp2)):
        s2 += int(tmp2[j])
    tmp3 = abs(s1+s2)
    l.append(tmp3)

ans = min(l)
print(ans)

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

for i in range(1,N-1):
    tmp1 = list(str(i))
    tmp2 = list(str(N-i))
    s1 = 0
    s2 = 0
    for j in range(len(tmp1)):
        s1 += int(tmp1[j])
    for j in range(len(tmp2)):
        s2 += int(tmp2[j])
    tmp3 = abs(s1+s2)
    l.append(tmp3)

ans = min(l)
print(ans)
Problem p03361 (python)

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

count = [[0] * W for _ in range(H)]
for i in range(H):
    for j in range(W):
        if S[i][j] == '.':
            count[i][j] = 10**7
        else:
            count[i][j] = 0

for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            if j != W-1: 
                if S[i][j+1] == '#':
                    count[i][j] += 1
            if j != 0: 
                if S[i][j-1] == '#':
                    count[i][j] += 1
            if i != H-1: 
                if S[i+1][j] == '#':
                    count[i][j] += 1
            if i != 0: 
                if S[i-1][j] == '#':
                    count[i][j] += 1

check = 0
for i in range(H):
    for j in range(W):
        if count[i][j] < 1:
            check = 1

if check == 0:
    print('Yes')
else:
    print('No')

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

count = [[0] * W for _ in range(H)]
for i in range(H):
    for j in range(W):
        if S[i][j] == '.':
            count[i][j] = 10**7
        else:
            count[i][j] = 0

for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            if j != W-1 and S[i][j+1] == '#':
                count[i][j] += 1
            if j != 0 and S[i][j-1] == '#':
                count[i][j] += 1
            if i != W-1 and S[i+1][j] == '#':
                count[i][j] += 1
            if i != 0 and S[i-1][j] == '#':
                count[i][j] += 1

check = 0
for i in range(H):
    for j in range(W):
        if count[i][j] < 1:
            check = 1

if check == 0:
    print('Yes')
else:
    print('No')
Problem p03393 (python)

Fixed submission:
#%%
alpha2num = lambda c: ord(c) - ord('a') + 1
num2alpha = lambda c: chr(c+64)
S = list(input())

S = S[::-1]
alpha = 'abcdefghijklmnopqrstuvwxyz'
alpha = list(alpha)

a = 0

if len(S) != 26:
    for i in range(len(alpha)):
        if alpha[i] not in S:
            b = alpha[i]
            break
    ans = ''.join(S)[::-1] + b
else:
    for i in range(1,len(S)):
        if S[i] < S[i-1]:
            a = i
            break
    if a == 0:
        ans = -1
    else:
        for i in range(len(alpha)):
            if alpha[i] not in S[a+1:] and alpha[i] > S[a]:
                c = alpha[i]
                break
        ans = (c + ''.join(S[a+1:]))[::-1]

print(ans)

#%%

Buggy submission (verdict: Runtime Error):
S = list(input())
S_unique = list(set(S))

alpha = list("abcdefghijklmnopqrstuvwxyz")


if len(S_unique) != 26:
    for i in range(len(alpha)):
        if alpha[i] not in S_unique:
            ans = alpha[i]
            break

a = ''.join(S) + ans
print(a)
Problem p03407 (python)

Fixed submission:
A,B,C = map(int, input().split())
if A+B >= C:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A,B,C = map(int, input().split())
if A+B >= C:
  print('Yes')
else:
  print('No)
Problem p03433 (python)

Fixed submission:
N = int(input())
A = int(input())
N_500 = N%500
if A >= N_500 :
  print('Yes')
else :
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
N_500 = N%500
if A >= N_500 :
  print('Yes')
else :
  pritn('No')
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
if : a % 2 = 0　and b % 2 =0
  print("even")
elif
Problem p03463 (python)

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

if (b-a)  % 2 == 0:
    ans = 'Alice'
else:
    ans = 'Borys'

print(ans)

Buggy submission (verdict: Runtime Error):
print('Draw')n, a, b = map(int, input().split())

if (b-a)  % 2 == 0:
    ans = 'Alice'
else:
    ans = 'Borys'

print(ans)
Problem p03546 (python)

Fixed submission:
#%%
import copy 

H, W = map(int, input().split())
c = [[int(_) for _ in input().split()] for _ in range(10)]
A = [[int(_) for _ in input().split()] for _ in range(H)]

d = copy.deepcopy(c)

for k in range(10):
    for i in range(10):
        for j in range(10):
            d[i][j] = min(d[i][j], d[i][k]+d[k][j])


ans = 0
for i in range(H):
    for j in range(W):
        if A[i][j] == 0 or A[i][j] >= 2:
            ans += d[A[i][j]][1]


print(ans)

Buggy submission (verdict: Runtime Error):
#%%
import copy 

H, W = map(int, input().split())
c = [[int(_) for _ in input().split()] for _ in range(10)]
A = [[int(_) for _ in input().split()] for _ in range(H)]

d = copy.deepcopy(c)

for i in range(10):
    for j in range(10):
        for k in range(10):
            d[i][j] = min(d[i][j], d[i][k]+d[k][j])


ans = 0
#for i in range(H):
#    for j in range(W):
#        if A[i][j] == 0 or A[i][j] >= 2:
#            ans += d[A[i][j]][1]


for i in a:
    for j in i:
        if j > 1 or j == 0:
            ans += d[j][1]

print(ans)
Problem p03587 (python)

Fixed submission:
print(list(input()).count('1'))

Buggy submission (verdict: Runtime Error):
print(list(input).count(1))
Problem p03627 (python)

Fixed submission:
import collections

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

c = list(collections.Counter(A).items())
c.sort(reverse=True)

a = 0
b = 0
e = -1

for i in range(N):
    if c[i][1] >= 4:
        a = c[i][0]
        b = c[i][0]
        break
    elif c[i][1] >= 2:
        a = c[i][0]
        e = i
        break

if a == 0:
    print(0)
elif e !=-1:
    for i in range(e+1, N):
        if c[i][1] >= 2:
            b = c[i][0]
            break
    if b == 0:
        print(0)
    else:
        print(a*b)
else:
    print(a*b)

Buggy submission (verdict: Runtime Error):
import collections

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

c = list(collections.Counter(A).items())
c.sort(reverse=True)

a = 0

for i in range(N):
    if c[i][1] >= 4:
        a = c[i][0]
        b = c[i][0]
        break
    elif c[i][1] >= 2:
        a = c[i][0]
        e = i
        break

b = 0

if a == 0:
    print(0)
else:
    for i in range(e+1, N):
        if c[i][1] >= 2:
            b = c[i][0]
            break
    if b == 0:
        print(0)
    else:
        print(a*b)
Problem p03657 (python)

Fixed submission:
a,b = map(int,input().split())
c = a+b
if c%3 == 0 or a%3 ==0 or b%3 == 0:
  print('Possible')
else:
  print('Impossible')

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
c = a+b
if c%3 == 0:
  print('Possible')
else:
  print('Impossible
')
Problem p03673 (python)

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


if n%2 == 0:
    for i in range(n-1,-1,-2):
        print(a[i], end=' ')
    for i in range(0, n, 2):
        print(a[i], end=' ')
    
elif n%2 == 1:
    for i in range(n-1,-1,-2):
        print(a[i], end=' ')
    for i in range(1, n, 2):
        print(a[i], end=' ')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = []
c = []

for i in range(n):
    if i%2 == 0:
        b.appendleft(str(a[i]))
    else:
        b.append(str(a[i]))

if n%2 == 0:
    ans = b[::-1]
else:
    ans = b

ans = ' '.join(ans)
print(ans)
Problem p03687 (python)

Fixed submission:
import collections
s = list(input())
#print(s)
c = collections.Counter(s)
l = list(c.items())
l = sorted(l, key = lambda x : x[1], reverse=True)
#print(l)

h = []
tmp = l[0][1]

for i in range(len(l)):
          h.append(l[i][0])


#print(h)

ans = []

for i in range(len(h)):
    tmp = [_ for _, x in enumerate(s) if x == h[i]]
#    print(h[i])
#    print(tmp)
    lll = []
    for j in range(len(tmp)):
        if j == 0:
            lll.append(tmp[j])
        else:
            lll.append(tmp[j] - tmp[j-1] - 1)
    lll.append(len(s) - tmp[len(tmp) - 1] - 1)
    ans.append(max(lll))
#    print(lll)


#print(ans)
print(min(ans))

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

l = list(input())

mode = statistics.mode(l)
mode = l.count(mode)

check = 0

"""
mode * 2 ** i  >  len(l) - i 
"""

for i in range(len(l)):
    if mode * (2**i)  >= len(l) -i :
        ans = i
        break

print(ans)
Problem p03693 (python)

Fixed submission:
A,B,C = map(int,input().split())
X = 10*B +C
if X%4 == 0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
X = 10*B +c
if X%4 == 0:
  print('YES')
else:
  print('NO')
Problem p03696 (python)

Fixed submission:
#%%
N = int(input())
S = list(input())

T = S.copy()

flag = False

#print(S)


for i in range(N):
    flag = False
    i = 0
    while True:
        if i > len(S) - 1:
            break
        if S[i] == '(':
            tmp = i
            flag = True
        if flag and S[i] == ')':
            S.pop(i)
            S.pop(tmp)
            flag = False
        i += 1

#print(S)
#print(T)

a = S.count('(')
b = S.count(')')

ans = '('*b + ''.join(T) + ')'*a
print(ans)

Buggy submission (verdict: Runtime Error):
#%%
N = int(input())
S = list(input())

T = S.copy()

flag = False

#print(S)


for i in range(N):
    flag = False
    i = 0
    while True:
        if i > len(S) - 1:
            break
        if S[i] == '(':
            tmp = i
            flag = True
        if flag and S[i] == ')':
            S.pop(tmp)
            S.pop(i)
            flag = False
        i += 1

#print(S)
#print(T)

a = S.count('(')
b = S.count(')')

ans = '('*b + ''.join(T) + ')'*a
print(ans)

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

a = 0
b = 0
c = 0
d = 0

a = [i for i, x in enumerate(S) if x == '('][0]
b = [i for i, x in enumerate(S) if x == ')'][-1]

light_a = S[:b+1].count('(')
light_b = S[:b+1].count(')')
left_a = S[a:].count('(')
legt_b = S[a:].count(')')

#print(light_a, light_b, left_a, legt_b)
c = max(0, light_b - light_a)
d = max(0, left_a - legt_b)
#print(c, d)

#print(a, b)
S = '('*c + ''.join(S) + ')'*d
print(S)
Problem p03711 (python)

Fixed submission:
def judge(x):
  if x==4 or x==6 or x==9 or x==11:
    y = 'a'
  elif x==2:
    y = 'b'
  else:
    y = 'c'
  return y
 
a,b = map(int,input().split())
if judge(a) == judge(b) :
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
def judge(x):
  if x==4 or x==6 or x==9 or x==11:
    y = a
  elif x==12:
    y = b
  else:
    y = c
  return y

a,b = map(int,input().split())
if judge(a) == judge(b) :
  print('Yes')
else:
  print('No')
Problem p03844 (python)

Fixed submission:
a,b,c = input().split()
if b =='+':
  print(int(a)+int(c))
else:
  print(int(a)-int(c))

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
if b =='+':
  print(int(a)+int(b))
else:
  print(int(a)-int(b))
Problem p03854 (python)

Fixed submission:
S = input()
S_list = list(S)

while len(S_list) >= 5 :
    a = len(S_list)
    if S_list[0:5] == ['e', 'r', 'a', 's', 'e']:
        if a >= 6 :
            if S_list[5] == 'r' :
                del S_list[0:6]
            else:
                del S_list[0:5]
        else:
            del S_list[0:5]
    elif S_list[0:5] == ['d', 'r', 'e', 'a', 'm']:
        if a >= 8 :
            if S_list[5:8] == ['e', 'r', 'a'] :
                del S_list[0:5]
            elif S_list[5:7] == ['e', 'r'] :
                del S_list[0:7]
            else :
                del S_list[0:5]
        elif a >= 7 :
            if S_list[5:7] == ['e', 'r'] :
                del S_list[0:7]
            else:
                del S_list[0:5]
        else :
            del S_list[0:5]
    else:
        print('NO')
        break


if len(S_list) == 0:
    print('YES')
elif 0<len(S_list)<5:
    print('NO')

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

while len(S_list) >= 5 :
    if S_list[0:5] == ['e', 'r', 'a', 's', 'e']:
        if S_list[5] == 'r' and len(S_list) >= 6:
            del S_list[0:6]
        else:
            del S_list[0:5]
    elif S_list[0:5] == ['d', 'r', 'e', 'a', 'm']:
        if S_list[5:8] == ['e', 'r', 'a'] and len(S_list) >= 8:
            del S_list[0:5]
        elif S_list[5:7] == ['e', 'r'] and S_list[7] != ['a'] and len(S_list) >= 8:
            del S_list[0:7]
        else :
            del S_list[0:5]
    else:
        print('NO')
        break


if len(S_list) == 0:
    print('YES')
elif 0<len(S_list)<5:
    print('NO')

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

while len(S_list) >= 5 :
    if S_list[0:5] == ['e', 'r', 'a', 's', 'e']:
        if S_list[5] == 'r':
            del S_list[0:6]
        else:
            del S_list[0:5]
    elif S_list[0:5] == ['d', 'r', 'e', 'a', 'm']:
        if S_list[5:8] == ['e', 'r', 'a']:
            del S_list[0:5]
        elif S_list[5:7] == ['e', 'r'] and S_list[7] != ['a']:
            del S_list[0:7]
        else :
            del S_list[0:5]
    else:
        print('NO')
        break


if len(S_list) == 0:
    print('YES')
elif 0<len(S_list)<5:
    print('NO')

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

while len(S_list) >= 5 :
    if S_list[0:5] == ['e', 'r', 'a', 's', 'e']:
        if S_list[5] == 'r':
            del S_list[0:6]
        else:
            del S_list[0:5]
    elif S_list[0:5] == ['d', 'r', 'e', 'a', 'm']:
        if S_list[5:8] == ['e', 'r', 'a']:
            del S_list[0:5]
        elif S_list[5:7] == ['e', 'r'] and S_list[7] != ['a']:
            del S_list[0:7]
        else :
            del S_list[0:5]
    else:
        print('No')
        break


if len(S_list) == 0:
    print('Yes')
elif 0<len(S_list)<5:
    print('No')
Problem p03992 (python)

Fixed submission:
a = input()
ans = a[:4] + ' ' + a[4:]
print(ans)

Buggy submission (verdict: Runtime Error):
a = list(input())
ans = a[:4] + ' ' + a[4:]
print(a)
Problem p04015 (python)

Fixed submission:
#%%
n, a = map(int, input().split())
x = list(map(int, input().split()))
x.insert(0, 0)

dp = [[[0] * max((max(x)*n+1), a*n+1) for _ in range(n+1)] for _ in range(n+1)]
dp[0][0][0] = 1
#print(dp)

for i in range(1, n+1):
    for j in range(0, n+1):
        for k in range(0, max(x)*n+1):
            if i == 0:
                pass
            else:
                if j == 0:
                    dp[i][j][k] = dp[i-1][j][k]
                else:
                    if k < x[i]:
                        dp[i][j][k] = dp[i-1][j][k]
                    else:
                        dp[i][j][k] = dp[i-1][j][k] + dp[i-1][j-1][k-x[i]] 
                        #print(x[i])

ans = 0
i = n
for j in range(n+1):
    ans += dp[i][j][j*a]
ans -= 1
print(ans)


#for i in range(n+1):
#    print(dp[i])

Buggy submission (verdict: Runtime Error):
#%%
n, a = map(int, input().split())
x = list(map(int, input().split()))
x.insert(0, 0)

dp = [[[0] * (max(x)*n+1) for _ in range(n+1)] for _ in range(n+1)]
dp[0][0][0] = 1
#print(dp)

for i in range(1, n+1):
    for j in range(0, n+1):
        for k in range(0, max(x)*n+1):
            if i == 0:
                pass
            else:
                if j == 0:
                    dp[i][j][k] = dp[i-1][j][k]
                else:
                    if k < x[i]:
                        dp[i][j][k] = dp[i-1][j][k]
                    else:
                        dp[i][j][k] = dp[i-1][j][k] + dp[i-1][j-1][k-x[i]] 
                        #print(x[i])

ans = 0
i = n
for j in range(n+1):
    ans += dp[i][j][j*a]
ans -= 1
print(ans)


#for i in range(n+1):
#    print(dp[i])
Problem p04029 (python)

Fixed submission:
N = int(input())
s = 0
for i in range(N+1):
    s += i
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = 0
for i in range(N+1):
    s += i
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input()
s = 0
for i in range(N+1):
    s += i
print(s)
Problem p04043 (python)

Fixed submission:
l = list(map(int,input().split()))
if l.count(5) == 2 and l.count(7)==1 :
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
l = list(map(int,input().split()))
if l.count(5) == 2, and l.count(7)==1 :
  print('YES')
else:
  print('NO')