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

Fixed submission:
a,b,c=map(int,input().split())
if a+b+c==17 and a*b*c==175:
 print("YES")
else:
 print("NO")

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

if a+b+c==17 and a*b*c==175:
　print("YES")
else:
　print("NO")
Problem p04030 (python)

Fixed submission:
s = input()
r = []
for i in range(len(s)):
    if s[i] == "0":
        r.append("0")
    elif s[i] == "1":
        r.append("1")
    elif s[i] == "B" and len(r) != 0:
        del r[-1]

    else:
        continue
print("".join(r))

Buggy submission (verdict: Runtime Error):
s = input()
r = []
for i in range(len(s)):
    if s[i] == "0":
        r.append("0")
    elif s[i] == "1":
        r.append("1")
    elif s[0] == "B":
        continue
    else:
        del r[-1]



print("".join(r))
Problem p02995 (python)

Fixed submission:
from fractions import gcd

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

adivc = A//C
if A%C != 0:
    adivc = A//C + 1
bdivc = B//C
countC = bdivc - adivc + 1

adivd = A//D
if A%D != 0:
    adivd = A//D + 1
bdivd = B//D
countD = bdivd - adivd + 1

lcm = (int)(C * D / gcd(C, D))
adivlcm = A // lcm
if A%lcm != 0:
    adivlcm = A // lcm + 1
bdivlcm = B // lcm
countlcm = bdivlcm - adivlcm + 1

print(B-A+1-(countC+countD-countlcm))

Buggy submission (verdict: Runtime Error):
import math

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

adivc = A//C
if A%C != 0:
    adivc = A//C + 1
bdivc = B//C
countC = bdivc - adivc + 1

adivd = A//D
if A%D != 0:
    adivd = A//D + 1
bdivd = B//D
countD = bdivd - adivd + 1

lcm = (int)(C * (D / math.gcd(C, D)))
adivlcm = A // lcm
if A%lcm != 0:
    adivlcm = A // lcm + 1
bdivlcm = B // lcm
countlcm = bdivlcm - adivlcm + 1

print(B-A+1-(countC+countD-countlcm))

Buggy submission (verdict: Runtime Error):
import math

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

adivc = A//C
if A%C != 0:
    adivc = A//C + 1
bdivc = B//C
countC = bdivc - adivc + 1

adivd = A//D
if A%D != 0:
    adivd = A//D + 1
bdivd = B//D
countD = bdivd - adivd + 1

lcm = (int)(C * D / math.gcd(C, D))
adivlcm = A // lcm
if A%lcm != 0:
    adivlcm = A // lcm + 1
bdivlcm = B // lcm
countlcm = bdivlcm - adivlcm + 1

print(B-A+1-(countC+countD-countlcm))

Buggy submission (verdict: Runtime Error):
import math

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

adivc = A//C
if A%C != 0:
    adivc = A//C + 1
bdivc = B//C
countC = bdivc - adivc + 1

adivd = A//D
if A%D != 0:
    adivd = A//D + 1
bdivd = B//D
countD = bdivd - adivd + 1

lcm = (int)(C * D / math.gcd(C, D))
adivlcm = A // lcm
if A%lcm != 0:
    adivlcm = A // lcm + 1
bdivlcm = B // lcm
countlcm = bdivlcm - adivlcm + 1

print(B-A+1-(countC+countD-countlcm))

Buggy submission (verdict: Runtime Error):
import math

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

adivc = A//C
if A%C != 0:
    adivc = A//C + 1
bdivc = B//C
print(adivc,bdivc)
countC = bdivc - adivc + 1

adivd = A//D
if A%D != 0:
    adivd = A//D + 1
bdivd = B//D
print(adivd,bdivd)
countD = bdivd - adivd + 1

lcm = (int)(C * D / math.gcd(C, D))
adivlcm = A // lcm
if A%lcm != 0:
    adivlcm = A // lcm + 1
bdivlcm = B // lcm
countlcm = bdivlcm - adivlcm + 1

print(B-A+1-(countC+countD-countlcm))

Buggy submission (verdict: Runtime Error):
import math

A,B,C,D = map(int,input().split())
#print(A,B,C,D)
lcm = C * D / math.gcd(C,D)
count = 0
for i in range(A,B+1):
    if i%lcm != 0:
        count+=1
print(count)
Problem p02993 (python)

Fixed submission:
a,b,c,d = input()
if a==b or b==c or c==d:
    print ("Bad")
else:
    print ("Good")

Buggy submission (verdict: Runtime Error):
a,b,c,d = sorted(input())
print (Bad)
Problem p02993 (python)

Fixed submission:
S = input()
prev = S[0]
for s in S[1:]:
  if s == prev:
    print("Bad")
    exit()
  prev = s
    
print("Good")

Buggy submission (verdict: Runtime Error):
def f(X,Y):
    return X//Y

A,B,C,D = map(int, input().split())
X = B-A+1
if (C>D):
    x = C
    y = D
else:
    y = C
    x = D

r = x % y
while(r!=0):
    x = y
    y = r
    r = x % y

print("%d" % (X - f(X, C) - f(X, D) + f(X, C*D//y)))
Problem p02993 (python)

Fixed submission:
x = input()
def samenum(string):
  for i in range(3):
    if string[i] == string[i+1]:
        return "Bad"
        quit()
  return "Good"
 
print(samenum(x))

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

for i in range(3):
    if str(a)[i] == str(a)[i+1]:
        print(i)
        print("Good")
        break
    elif i == 2:
        print("Bad")
Problem p03591 (python)

Fixed submission:
s= input()
if len(s)>3 and s[0]=='Y' and  s[1]=='A' and s[2]=='K' and s[3]=='I':
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s= input()
if s[0]=='Y' and  s[1]=='A' and s[2]=='K' and s[3]=='I':
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s= input()
if s[0]=='Y' and  s[1]=='A' and s[2]=='K' and s[3]=='I':
    print("Yes");
else:
    print("No")
Problem p02999 (python)

Fixed submission:
a,b = map(int,input().split())
if a < b :
  print("0")
else:
  print("10")

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

I = 0
A = 1
for i in L:
  I+=i
  if I <= X:
    A += 1
print(A)
Problem p03126 (python)

Fixed submission:
n,m = map(int,input().split())
k = 0
alist = []
while k < n :
  a = list(map(int,input().split()))
  alist.append(a)
  k += 1
#
if n == 1 :
  print(len(alist[0])-1)
else:
  for blist in alist :
    b = blist[0]
    blist.remove(b)
#
  anslist = []
  ans = 0
  i_roop = len(alist[0])
  while i_roop >= 0 :
    if i_roop == 0 :
      break
    else:
      c = min(alist[0])
      for j in range(1,n) :
        if c in alist[j] :
          anslist.append("OK")
          if j == n-1 :
            if len(anslist) == n-1 :
              ans += 1
        else:
          if j == n-1 :
            if len(anslist) == n-1 :
              ans += 1
          break
      alist[0].remove(c)
    anslist = []
    i_roop += -1

if n != 1 :
  print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = 0
alist = []
while k < n :
  a = list(map(int,input().split()))
  alist.append(a)
  k += 1
#
for blist in alist :
  b = blist[0]
  blist.remove(b)
#
anslist = []
ans = 0
i_roop = len(alist[0])
while i_roop >= 0 :
  if i_roop == 0 :
    break
  else:
    c = min(alist[0])
    for j in range(1,n) :
      if c in alist[j] :
        anslist.append("OK")
        if j == n-1 :
          if len(anslist) == n-1 :
            ans += 1
      else:
        if j == n-1 :
          if len(anslist) == n-1 :
            ans += 1
        break
    alist[0].remove(c)
  anslist = []
  i_roop += -1

print(ans)
Problem p03059 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
v_list = list(map(int, input().split()))
c_list = list(map(int, input().split()))
sum = 0

for v, c in zip(v_list, c_list):
    if v - c > 0:
        sum += v - c

print(sum)
Problem p03085 (python)

Fixed submission:
b = input()

if b == 'A':
    print('T')
elif b == 'T':
    print('A')
elif b == 'C':
    print('G')
elif b == 'G':
    print('C')
else:
    pass

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

if b = 'A':
    print('T')
elif b = 'T':
    print('A')
elif b = 'C':
    print('G')
elif b = 'G':
    print('C')
else:
    pass
Problem p03086 (python)

Fixed submission:
s = input()
max_count = 0
count = 0

for i in range(len(s)):
    if s[i] in ['A', 'C', 'G', 'T']:
        count += 1
    else:
        if count > max_count:
            max_count = count
            count = 0

print(max(max_count, count))

Buggy submission (verdict: Runtime Error):
s = input()
max = 0
count = 0

for i in range(len(s)):
    if s[i] in ['A', 'C', 'G', 'T']:
        count += 1
    else:
        if count > max:
            max = count
            count = 0

print(max(max, count))
Problem p03101 (python)

Fixed submission:
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H - h) * (W - w))

Buggy submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b_list = list(map(int, input().split()))
count = 0

for _ in range(n):
    a_list = list(map(int, input().split()))
    sum = c

    for i in range(m):
        sum += a_list[i] * b_list[i]

    if sum > 0:
        count += 1

print(count)
Problem p03105 (python)

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

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

for i in range(1, min(a, b) + 1):
    if a % i == 0 and b % i == 0:
        divisers.append(i)

print(divisers[-k])

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

for i in range(1, max(a, b) + 1):
    if a % i == 0 and b % i == 0:
        divisers.append(i)

print(divisers[-k])

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

for i in range(1, max(a, b) + 1):
    if a % i == 0 and b % i == 0:
        divisers.append(i)

print(divisers[-k])
Problem p03106 (python)

Fixed submission:
a, b, k = map(int, input().split())
divisers = []

for i in range(1, min(a, b) + 1):
    if a % i == 0 and b % i == 0:
        divisers.append(i)

print(divisers[-k])

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

for i in range(1, max(a, b)):
    if a % i == 0 and b % i == 0:
        divisers.append(i)

print(divisers[-k])
Problem p03126 (python)

Fixed submission:
n, m = map(int, input().split())
ans = [0] * m
for _ in range(n):
    a = list(map(int, input().split()))
    
    for i in a[1:]:
        ans[i-1] += 1

print(ans.count(n))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ans = [0] * m

for _ in range(n):
    a = list(map(int, input().split()))
    for i in a[1:]:
        ans[i] += 1

print(ans.count(n))
Problem p03146 (python)

Fixed submission:
s = int(input())
a = [s]

for i in range(2, 1000001):
  if s % 2 == 0:
    s = s / 2
  else:
    s = 3 * s + 1
  
  if s in a:
    print(i)
    break
   
  a.append(s)

Buggy submission (verdict: Runtime Error):
s = int(input())
a = [s]

for i in range(2, 1000001):
  if s % 2 == 0:
    s = s / 2
  else:
    s = 3 * s + 1
  
  if s in a:
    print(i)
    break
   
  s.append(s)
Problem p03220 (python)

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

H = [abs(A - T + h * 0.006) for h in H]

print(H.index(min(H)) + 1)

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

min = float('inf')
idx = None
for i in range(len(H)):
    if min > abs(A - T + H[i] * 0.006):
        idx = i + 1å

print(i)
Problem p03264 (python)

Fixed submission:
K = int(input())

even = K // 2
odd = K - even
print(even * odd)

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

even = K // 2
odd = K - enve
print(even * odd)
Problem p03337 (python)

Fixed submission:
a, b = map(int, input().split())
print(max(a + b, a - b, a * b))

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

Fixed submission:
s = list(input())

if 'a' in s and 'b' in s and 'c' in s:
  print('Yes')
else:
  print('No')

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

if s.find('a') and s.find('b') and s.find('c'):
  print('Yes')
else:
  print('No')
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b, c = map(int, input().split())
s= input()
print("{} {}".format(a+b+c, s))
Problem p03477 (python)

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

if res == 0:
  print("Balanced")
elif res > 0:
  print("Left")
else:
  print("Right")

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

if res == 0:
  pritn("Balanced")
elif res > 0:
  print("Left")
else:
  print("Right")
Problem p03485 (python)

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

Buggy submission (verdict: Runtime Error):
from math import round

a, b = map(int, input().split())
print(round(avg([a, b])))

Buggy submission (verdict: Runtime Error):
from math import round

a, b = map(int, input().split())
print(round(avg(a, b)))

Buggy submission (verdict: Runtime Error):
import math

a, b = map(int, input().split())
print(round(avg(a, b)))
Problem p03547 (python)

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

if a > b:
  print(">")
elif a == b:
  print("=")
else:
  print("<")

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

if a > b:
  print(">")
elif a == b:
  print("=")
else:
  print("<")
Problem p03001 (python)

Fixed submission:
W,H,x,y=map(int,input().split());print(W*H/2,1*(W/2==x and H/2==y))

Buggy submission (verdict: Runtime Error):
W,H,x,y=map(int,input().split());print(W*H/2,(W%x==0 and H%y==0)*1)

Buggy submission (verdict: Runtime Error):
W,H,x,y=map(int,input().split());print(str(W*H/2)+' 1' if W%x==0 and H%y==0 else str(W*H/2)+' 0')
Problem p03206 (python)

Fixed submission:
d = int(input())
if(d==25):
    print("Christmas")
elif(d==24):
    print("Christmas Eve")
elif(d==23):
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
N,K=list(map(int,input().split()))
h=[int(input()) for i in range(N)]
 
h.sort()
 
m="a"
for i in range(N-K+1):
	if m=="a" or m>h[i+K-1]-h[i]: m=h[i+K-1]-h[i]
 
print(m)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int,input().split()))
h =  [int(input()) for i in range(N)]
h.sort()
m = "a"
for i in range(N - K + 1):
    if m=="a" or m>h[i+K-1]:
        m = h[i+K-1] - h[i]
print(m)

Buggy submission (verdict: Runtime Error):
N = int(input())
p = []
for i in range(N):
    _p = int(input())
    p.append(_p)
biggest = 0
j = 0
for i in range(N):
    if(p[i]>=biggest):
        j = i
        biggest=p[i]
p[j] = p[j] / 2
print(int(sum(p)))

Buggy submission (verdict: Runtime Error):
N = int(input())
p = []
for i in range(N):
    _p = int(input())
    p.append(_p)
biggest = 0
j = 0
for i in range(N):
    if(p[i]>biggest):
        j = i
        biggest=p[i]
p[j] = p[j] / 2
print(int(sum(p)))
Problem p03219 (python)

Fixed submission:
x, y = map(int,input().split())
y = 1/2 * y
ans = int(x + y)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))
#iは番号
ans = 0
base = T - 0.006*h[0]
for i,n in enumerate(h):
    if(i==0):
        pass
    tem = T - 0.006*n
    if(abs(tem - A)<abs(base - A)):
        base = tem
        ans = i+1
    else:
        ans = 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))
#iは番号
ans = 0
base = T - 0.06*h[0]
for i,n in enumerate(h):
    if(i==0):
        pass
    tem = T - 0.006*n
    if(abs(tem - A)<abs(base - A)):
        base = tem
        ans = i+1
    else:
        ans = 1
print(ans)
Problem p04043 (python)

Fixed submission:
A, B, C = list(map(int, input().split()))
if A + B + C == 17:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
L, N = list(map(int, input().split()))
S = [input() for i in range(N)]
S.sort()
ans = "";
for j in range(N):
    ans += S[j]
print(ans)
Problem p04044 (python)

Fixed submission:
n,l = map(int,input().split())
A = [input() for _ in range(n)]
A.sort()
ans = ''
for i in range(n):
    ans += A[i]
 
print(ans)

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for i in range(L)]
S.sort()
ans = ''
for i in range(N):
    ans += S[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for i in range(L)]
S.sort()
ans = ""
for i in S:
    ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for i in range(L)]
S.sort()
print("".join(S))

Buggy submission (verdict: Runtime Error):
L, N = map(int, input().split())
S = [input() for i in range(N)]
S.sort()
ans = '';
for j in range(N):
    ans += S[j]
print(ans)

Buggy submission (verdict: Runtime Error):
L, N = list(map(int, input().split()))
S = []
for i in range(N):
    s = input()
    S.append(s)
S.sort()
ans = "";
for j in S:
    ans += j
print(str(ans))

Buggy submission (verdict: Runtime Error):
L, N = list(map(int, input().split()))
S = []
for i in range(N):
    s = input()
    S.append(s)
S.sort()
ans = "";
for j in S:
    ans += j
print(ans)
Problem p02993 (python)

Fixed submission:
s = raw_input()
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
  print('Bad')
else:
  print('Good')

Buggy submission (verdict: Runtime Error):
code = str(input())
if code[0]==code[1] or code[1]==code[2] or code[2]==code[3]:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
code = len(set(list(str(input()))))
if code==4:
  print("Good")
else:
  print("Bad")
Problem p03071 (python)

Fixed submission:
# -*- coding: utf-8 -*-
from sys import stdin
a, b = [int(x) for x in stdin.readline().rstrip().split()]
res = 0
if a > b:
    res += a
    a -= 1
else:
    res += b
    b -= 1
res += a if a > b else b
print("{}".format(res))

Buggy submission (verdict: Runtime Error):
from sys import stdin
n = int(stdin.readline().rstrip())
h = [int(x) for x in stdin.readline().rstrip().split()]
ans = 1
tmp = h[0]
for i in range(n - 1):
    ans += 1 if tmp <= h[i + 1] else 0
    tmp = max(tmp, h[i + 1])
print("{}".format(ans))
Problem p03029 (python)

Fixed submission:
A,P = map(int,input().split())
print((A * 3+ P) // 2)

Buggy submission (verdict: Runtime Error):
A,P = map(int,input(),split())
print((A*3+P)//2)
Problem p03035 (python)

Fixed submission:
a,b = map(int,input().split())
if a >=13:
    print(b)
elif a <= 5:
        print(0)
else:
    print(b // 2)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
    if a >=13:
        print(b)
    elif a <= 5:
        print(0)
    else:
        print(b // 2)
Problem p03323 (python)

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

if a>8 or b>8 or a<0 or b<0:
  print(":(")
else:
  print("Yay!")

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

if a>8 or b>8 or a<0 or b<0:
  print(":(")
else:
  print("Yay!")

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

if A>8 or B>8 or A<0 or B<0:
  print(":(")
else:
  print("Yay!")

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

if A>8 or B>8:
  print(":(")
else:
  print("Yay!")
Problem p03386 (python)

Fixed submission:
def main():
  A, B, K = [int(x) for x in input().split()]
  for i in range(A, min(B + 1, A + K)):
    print(i)
  for i in range(max(A + K, B - K + 1), B + 1):
    print(i)


if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
A, B, N = [int(x) for x in input().split()]
array = list(range(A, B+1))

array = list(filter(lambda x: B-(N-1) <= x or x <= A+(N-1), array))

print('\n'.join([str(x) for x in array]))
Problem p03425 (python)

Fixed submission:
n = int(input())
 
M = 0
A = 0
R = 0
C = 0
H = 0
 
res = 0
 
for i in range(n):
    char = input()[0]
    if char == "M":
        M += 1
    elif char == "A":
        A += 1
    elif char == "R":
        R += 1
    elif char == "C":
        C += 1
    elif char == "H":
        H += 1

res += M * A * R;
res += M * A * C;
res += M * A * H;
res += M * R * C;
res += M * R * H;
res += M * C * H;
 
res += A * R * C;
res += A * R * H;
res += A * C * H;
 
res += R * C * H;
 
print(res)

Buggy submission (verdict: Runtime Error):
    n = int(input())
     
    M = 0
    A = 0
    R = 0
    C = 0
    H = 0
     
    res = 0
     
    for i in range(n):
        char = input()[0]
        if char == "M":
            M += 1
        elif char == "A":
            A += 1
        elif char == "R":
            R += 1
        elif char == "C":
            C += 1
        elif char == "H":
            H += 1
     
    res += M * A * R;
    res += M * A * C;
    res += M * A * H;
    res += M * R * C;
    res += M * R * H;
    res += M * C * H;
     
    res += A * R * C;
    res += A * R * H;
    res += A * C * H;
     
    res += R * C * H;
     
    print(res)
Problem p03000 (python)

Fixed submission:
N, X = map(int, input().split())
steps = list(map(int,input().split()))
 
x = 0
count = 1

for i in steps:
    x += i
    if x <= X:
        count += 1
 
print(count)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
steps = list(int,input().split())
 
x = 0
count = 1

for i in steps:
    x += i
    if x <= X:
        count += 1
 
print(count)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
steps = list(input().split())
 
x = 0
count = 0
 
while x <= X and count <= N:
    x += int(steps[int(count)])
    count += 1
 
print(count)

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

x = 0
count = 0

while x < X:
    x += int(steps[int(count)])
    count +=1

print(count)

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

x = 0
count = 0

while x <= X:
    x += int(steps[int(count)])
    count +=1

print(count)
Problem p02993 (python)

Fixed submission:
from collections import Counter
code = input()
cnt = 0
for i in range(len(code) - 1):
  if code[i] == code[i + 1]:
    cnt += 1
    break
if cnt:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
from collections import Counter
code = input()
cnt = 0
for i in range(len(code) - 1):
  if c[i] == c[i + 1]:
    cnt += 1
    break
if cnt:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
from collections import Counter
code = input()
max_c = Counter(list(code)).most_common()[0]
if max_c > 1:
  print("Bad")
else:
  print("Good")