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

Fixed submission:
n, m, x = map(int,input().split())
c = [list(map(int, input().split())) for i in range(n)]
ans = float('inf')
money = [float('inf')]

for i in range(2**n):
  temp_money = 0
  temp_skill = [0]*m
  for j in range(n):
    if (i >> j) & 1:
      temp_money += c[j][0]
      temp_skill = [a + b for a, b in zip(temp_skill, c[j][1:m+1])]
    if all([i >= x for i in temp_skill])==True:
      money.append(temp_money)

ans = min(ans,min(money))
if ans == float("inf"):
  ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
n, m, x = map(int,input().split())
c = [list(map(int, input().split())) for i in range(n)]
ans = float('inf')
money = []

for i in range(2**n):
  temp_money = 0
  temp_skill = [0]*m
  for j in range(n):
    if (i >> j) & 1:
      temp_money += c[j][0]
      temp_skill = [a + b for a, b in zip(temp_skill, c[j][1:m+1])]
    if all([i >= x for i in temp_skill])==True:
      money.append(temp_money)

ans = min(ans,min(money))
if ans == float("inf"):
  ans = -1

print(ans)
Problem p02684 (python)

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
 
t = 0
now = 1
footprint = [1]
past = [0]*N
past[0] = 1

while t < K:
  if past[A[now-1]-1] == 0:
    now = A[now-1]
    footprint.append(now)
    past[now-1]=1
    t += 1
  else:
    s = footprint.index(A[now-1])
    l = t - s + 1
    e = (K-s) % l
    now = footprint[s+e]
    break
    
print(now)

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

t = 0
now = 1
footprint = [1]

while t < K:
  if A[now-1] not in footprint:
    footprint.append(A[now-1])
    now = A[now-1]
    t += 1
  else:
    s = footprint.index(A[now-1])
    l = t - s + 1
    e = (K-s) % l
    now = footprint[i+e]
    break

print(now)

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

t = 0
now = 1
footprint = [1]

while t < K:
  if A[now-1] not in footprint:
    footprint.append(A[now-1])
    now = A[now-1]
    t += 1
  else:
    s = footprint.index(A[now-1])
    l = t - s + 1
    e = K % l
    now = footprint[i+e]
    break

print(now)

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

t = 0
now = 1
footprint = [1]

while t < K:
  if A[now-1] not in footprint:
    footprint.append(A[now-1])
    now = A[now-1]
    t += 1
    continue
  else:
    s = footprint.index(A[now-1])
    l = t - s + 1
    e = K % l
    now = footprint[i+e]
    break

print(now)
Problem p02705 (python)

Fixed submission:
import math
R = int(input())
print(2*R*math.pi)

Buggy submission (verdict: Runtime Error):
import math
R = int(input())
print(2*R*math.Pi)
Problem p02612 (python)

Fixed submission:
N = int(input())
n = N%1000
if n==0:
  	print(0)
else:
  	print(1000-n)

Buggy submission (verdict: Runtime Error):
N = int(input())
n = N % 1000
if n == 0;
  	print(0)
else;
  	print(1000-n)

Buggy submission (verdict: Runtime Error):
N = int(input())
n = N%1000
if n=0;
  	print(0)
else;
  	print(1000-n)

Buggy submission (verdict: Runtime Error):
N = int(input())
n = N%1000
if n=0:
  	print(0)
else:
  	print(1000-n)
Problem p02658 (python)

Fixed submission:

N = int(input())

aaa = list(map(int, input().split()))
ans = 1

if 0 in aaa:
    ans = 0
else:
    for i in range(N):
        if ans > 10 ** 18:
            ans = -1
            break
        else:
            ans = ans * aaa[i]


if ans > 10 ** 18:
    ans = -1


print(ans)

Buggy submission (verdict: Runtime Error):

N = int(input())

aaa = list(map(int, input().split()))



ans = 1

for i in range(N):
    if ans > 10 ** 18:
    ans = -1
    break
    else:
        ans = ans * aaa[i]

print(ans)

Buggy submission (verdict: Runtime Error):

N = int(input())

aaa = list(map(int, input().split()))



ans = 1

for i in range(N):
    if ans > 10 ** 18:
    print(-1)
    else:
        ans = ans * aaa[i]
print(ans)
Problem p02687 (python)

Fixed submission:

#提出時にコメントアウトを外す。
a = input()
if a == 'ABC':
  print('ARC')
elif a == 'ARC':
  print('ABC')

Buggy submission (verdict: Runtime Error):
a = int(input)
if a == 'ABC':
  print('ARC')
elif a == 'ARC':
  print('ABC')
Problem p02639 (python)

Fixed submission:
a = list(map(int,input().split()))
for i in range(0,5):
    if a[i]==0:
        print(i+1)

Buggy submission (verdict: Runtime Error):
a = map(int,input().split())
for i in range(0,4):
    if a[i]==0:
        print(i+1)
Problem p02640 (python)

Fixed submission:
x,y = map(int,input().split())
ans='No'
for i in range(x+1):
    if y == 2*i+4*(x-i):
        ans='Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
for i in range (0,x+1):
    if y==2*i+4*(x-i):
        print(Yes)
    else:
        if i==x:
            print(No)
Problem p02705 (python)

Fixed submission:
print(int(input())*6.28)

Buggy submission (verdict: Runtime Error):
print(int(input())*math.pi*2)

Buggy submission (verdict: Runtime Error):
R=int(input())
  print(2*math.pi*R)
Problem p02640 (python)

Fixed submission:
def solve(X, Y):
    from numpy.linalg import solve
    left = [[1, 1], [2, 4]]
    right = [X, Y]
    res = solve(left, right)
    x = res[0]
    y = res[1]

    if x == float(int(x)) and y == float(int(y)) and x >= 0 and y >= 0:
        print('Yes')
    else:
        print('No')
 
X, Y = map(int, open(0).read().split())
solve(X, Y)

Buggy submission (verdict: Runtime Error):
def solve(X, Y):
    import sympy as sp
    sp.init_printing()
    sp.var('a, b')
    eq1 = sp.Eq(2 * a + 4 * b, Y)
    eq2 = sp.Eq(a + b, X)
    res = sp.solve([eq1, eq2], [a, b])
    x = res[a]
    y = res[b]
    if x == int(x) and y == int(y) and x >= 0 and y >= 0:
        print('Yes')
    else:
        print('No')

X, Y = map(int, open(0).read().split())
solve(X, Y)
Problem p02675 (python)

Fixed submission:
def solve(N):
    last = int(str(N)[len(N)-1])
    if last == 0 or last == 1 or last == 6 or last == 8:
        print("pon")
    elif last == 3:
        print("bon")
    else:
        print("hon")

N = input()
solve(N)

Buggy submission (verdict: Runtime Error):
def solve(N):
    last = int(str(N)[len(N)-1])
    if last == 0 or last == 1 or last == 6 or last == 8:
        print("pon")
    elif last == 3:
        print("bon")
    else:
        print("hon")

N = open(0).read()
solve(N)
Problem p02717 (python)

Fixed submission:
a, b, c = map(int, open(0).read().split())
print("{} {} {}".format(c, a, b))

Buggy submission (verdict: Runtime Error):
k = int(input())
 
lunlun = []
 
end = False
while True:
    val = 0
    while True:
        val += 1
        val_list = [int(x) for x in list(str(val))]
        is_lun = True 
        for x in range(len(val_list) - 1):
            if abs(val_list[x] - val_list[x + 1]) <= 1:
                continue
            else:
                is_lun = False
        if is_lun:
            lunlun.append(val)
        else:
            continue
        if len(lunlun) == k:
            end = True
            break
    if end:
        break
 
print(lunlun[k - 1])
Problem p02720 (python)

Fixed submission:
k = int(input())

nums = []
def inc(num):
    if num > 3234566667:
        return None
    if num <= 3234566667:
      nums.append(num)

    num_str = str(num)
    end = num_str[-1:]
    end_num = int(end)

    if end_num < 9:
        inc(int(num_str + str(end_num + 1)))
   
    inc(int(num_str + end))
    
    if end_num > 0:
        inc(int(num_str + str(end_num - 1)))

for i in range(1, 10):
    inc(i)

sort_nums = sorted(nums)
print(sorted(nums)[k - 1])

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

k = int(input())

lunlun = []

end = False
while True:
    val = 0
    while True:
        val += 1
        val_list = [int(x) for x in list(str(val))]
        is_lun = True 
        for x in range(len(val_list) - 1):
            if abs(val_list[x] - val_list[x + 1]) <= 1:
                continue
            else:
                is_lun = False
        if is_run:
            lunlun.append(val)
        else:
            continue
        if len(lunlun) == k:
            end = True
            break
    if end:
        break

print(lunlun[k - 1])
Problem p02606 (python)

Fixed submission:
import numpy as np
a, b, c = map(int,input().split())
count = 0

for i in range(a,b+1):
    if i % c == 0:
        count += 1

print(count)

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

N = int(input())

ans = np.zeros(int(N))

if N<10001 and N>3:
    maxa = int(np.sqrt(N-2))
    for x in range(1,maxa):
        for y in range(1,x):
            for z in range(1,y):
                p = x*x+y*y+z*z+x*y+y*z+z*x
                if p<N+1:
                    ans[p-1] += 6


    for x in range(1,maxa):
        for y in range(1,x):
            p = x*x*3+y*y+x*y*2
            if p<N+1:
                ans[p-1] += 3
            p = y*y*3+x*x+x*y*2
            if p<N+1:
                ans[p-1] += 3

    for x in range(1,maxa):
        p = x*x*6
        if p<N+1:
            ans[p-1] += 1

for x in range(0,N):
    print(int(ans[x]))
Problem p02882 (python)

Fixed submission:
import numpy as np

pi = np.pi

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

S = x/a

if S >= a*b/2:
    h = x/(a**2)
    ans = np.arctan((b - h)/(a/2)) / (2 * pi) * 360
elif S <= a*b/2:
    ans = np.arctan(b/(2*S/b)) / (2 * pi) * 360

print(ans)

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

pi = np.pi

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

S = x/a

if S >= a*b/2:
    h = x/(a**2)
    ans = np.arctan(a / 2 / (b - h)) / (2 * pi) * 360
elif S <= a*b/2:
    ans = np.arctan(b/(2*S/b)) / (2 * pi) * 360

print(ans)

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

pi = np.pi

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

S = x/a

if S >= a*b/2:
    ans = np.arctan(a / 2 / (b - h)) / (2 * pi) * 360
elif S <= a*b/2:
    ans = np.arctan(b/(2*S/b)) / (2 * pi) * 360

print(ans)
Problem p02717 (python)

Fixed submission:
X,Y,Z = list(map(int, input().split()))

print(Z, X, Y)

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


if N == 0:
    print(N)

initialK = K

if N <= initialK/2:
    print(N)
while True:
    K = N%K
    if K <= initialK/2:
        print(K)
        break

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


if N == 0:
    print(N)

initialK = K
while True:
    if N <= initialK/2:
        print(N)
        break
    K = N%K
    if K <= initialK/2:
        print(K)
        break
Problem p02664 (python)

Fixed submission:
T=input()
res=''
for i in range(len(T)):
	if T[i]=='?':
		if i==0:
			if len(T)==1:
				res+='D'
			else:
				if T[i+1]=='P':
					res+='D'
				else:
					res+='P'
		else:
			if i+1<len(T):
				if res[i-1]=='P' or T[i+1]=='P':
					res+='D'
				else:
					res+='P'
			else:
				res+='D'
	else:
		res+=T[i]
print(res)

Buggy submission (verdict: Runtime Error):
T=input()
res=''
for i in range(len(T)):
	if T[i]=='?':
		if i==0:
			if T[i+1]=='P':
				res+='D'
			else:
				res+='P'
		else:
			if i+1<len(T):
				if res[i-1]=='P' or T[i+1]=='P':
					res+='D'
				else:
					res+='P'
			else:
				res+='D'
	else:
		res+=T[i]
print(res)

Buggy submission (verdict: Runtime Error):
T=input()
res=''
for i in range(len(T)):
	if T[i]=='?':
		if  not i-1<0:
			if res[i-1]=='P':
				res+='D'
			else:
				if not i+1>=len(T):
					if T[i+1]=='P':
						res+='D'
					else:
						res+='P'
				else:
					res+='D'
		else:
			if T[i+1]=='D':
				res+='P'
			else:
				res+='D'
	else:
		res+=T[i]

print(res)
Problem p02927 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

M, D = map(int, input().split())

count=0
for i in range(4, M+1):
    for j in range(22, D+1):
        str_j = str(j)
        if int(str_j[1]) <= 1:
            continue
        if (int(str_j[0]) * int(str_j[1])) == i:
            count += 1
print(count)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

M, D = map(int, input().split())

count=0
for i in range(4, M+1):
    for j in range(22, D+1):
        str_j = str(j)
        if str_j[0] <= 1:
            continue
        if (int(str_j[0]) * int(str_j[1])) == i:
            count += 1
print(count)
Problem p02657 (python)

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

print(a*b)

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

res = 1
for i in a:
    res *= i

if res > 10**18:
    print(-1)
else:
    print(res)
Problem p02743 (python)

Fixed submission:
from decimal import *
def resolve():
    a, b, c = map(int, input().split())
    if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
        print("Yes")
    else:
        print("No")

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    a, b,c = map(int, input().split())
    if math.sqrt(a) + math.sqrt(b) < math.sqrt(c):
        print("Yes")
    else:
        print("No")

resolve()
Problem p02812 (python)

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

def res():
    ct=0
    for i in range(n):
        if i+2 > n-1:
            return ct
        if s[i] =="A"and s[i+1]=="B" and s[i+2]=="C":
            ct+=1

print(res())

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

def res():
    ct=0
    for i in range(n):
        if i+2 > n:
            return ct
        if s[i] =="A"and s[i+1]=="B" and s[i+2]=="C":
            ct+=1

print(res())
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
PI = 1
for i in range(N):
    PI = PI*A[i]
if PI > 10**(18):
    print(-1)
print(PI)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
PI = 1
for i in range(N):
    PI = PI*A[i]
if PI > 10**(18):
    print(-1)
print(PI)
Problem p02658 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
PI = 1
if 0 in A:
    PI = 0
else:
    for i in range(N):
        PI = PI*A[i]
        if PI > 10**(18):
            PI = -1
            break
print(PI)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
PI = 1
if 0 in A:
    PI = 0
else:
    for i in range(N):
        PI = PI*A[i]
        elif PI > 10**(18):
            PI = -1
            break
print(PI)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
PI = 1
for i in range(N):
    PI = PI*A[i]
if PI > 10**(18):
    print(-1)
    else:
      print(PI)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
PI = 1
for i in range(N):
    PI = PI*A[i]
if PI > 10**(18):
    print(-1)
    break
print(PI)
Problem p02660 (python)

Fixed submission:
import math
N = int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(cnt)

    if temp!=1:
        arr.append(1)

    if arr==[]:
        arr.append(1)

    return arr
A = factorization(N)
if N == 1:
    print(0)
else:
    for i in range(len(A)):
        if A[i] == 1:
            A[i] = 1
        else:
            s = (-1+int(math.sqrt(1+8*A[i])))/2
            A[i] = int(s)
    print(int(sum(A)))

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
arr = []
temp = n
for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
        cnt=0
        while temp%i==0:
            cnt+=1
            temp //= i
        arr.append(cnt)

if temp!=1:
    arr.append(1)
if arr==[]:
    arr.append(1)
for i in range(len(arr)):
    if arr[i] == 1:
        arr[i] = 1
    else:
        s = (-1+math.sqrt(1+8*arr[i]))/2
        arr[i] = s
if n = 1:
    print(0)
else:
    print(int(sum(arr)))
Problem p02690 (python)

Fixed submission:
X=int(input())
for i in range(-200,201):
    for j in range(-200,201):
        if i**5-j**5==X:
            print(i,j)
            exit()

Buggy submission (verdict: Runtime Error):
x=int(input())
t=True
for i in range(1,36):
  a5=i**5
  for j in range(36):
    if x==a5-j**5:
      a=i
      b=j
      t=False
      break
    elif x==a5+j**5:
      a=i
      b=-j
      t=False
      break
  if not t:
    break
print(a,b)
Problem p02702 (python)

Fixed submission:
s=input()
n=len(s)
l=[0]*2019
l[0]=1
k=0
mod=2019
r=1
for i in range(n-1,-1,-1):
  k+=int(s[i])*r
  k%=mod
  r*=10
  r%=mod
  l[k]+=1
ans=0
for i in l:
  ans+=i*(i-1)//2
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
l=[0]*2019
l[0]=1
k=0
mod=2019
r=1
for i in range(n-1,-1,-1):
  k+=int(s[i])*r
  r*=10
  r%=mod
  l[k]+=1
ans=0
for i in l:
  ans+=i*(i-1)//2
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
l=[0]*2019
l[0]=1
k=0
mod=2019
r=1
for i in range(n-1,-1,-1):
  k+=s[i]*r
  r*=10
  r%=mod
  l[k]+=1
ans=0
for i in l:
  ans+=i*(i-1)//2
print(ans)
Problem p02765 (python)

Fixed submission:
n,r=map(int,input().split())
if n>9:
  print(r)
else:
  print(r+100*(10-n))

Buggy submission (verdict: Runtime Error):
n,r=int(input())
if n>9:
  print(r)
else:
  print(r+100*(10-n))
Problem p02706 (python)

Fixed submission:
N, M = [int(s) for s in input().split(' ')]
A = [int(s) for s in input().split(' ')]

task_days = sum(A)

if N < task_days:
    print(-1)
else:
    print(N - task_days)

Buggy submission (verdict: Runtime Error):
N, M = [int(s) for s in input().split(' ')]
A = [int(s) for s in input().split(' ')]

task_days = sum(A)

if N < task_days:
    return -1
else:
    return N - task_days
Problem p02621 (python)

Fixed submission:
n = int(input())

print(n + pow(n,2)+pow(n,3))

Buggy submission (verdict: Runtime Error):
n=int(intput())

print(n+n**n+n***n)
Problem p02885 (python)

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

Buggy submission (verdict: Runtime Error):
n, *l = map(int, open(0).read().split())
sl = sorted(l,reverse=True)
ans = 0
for i in range (n):
  for j in range (i+1,n):
    for k in range(j+1,n):
      if sl[i]-sl[j] < sl[j] and sl[i]<sl[j]+sl[k]:
        ans = ans + 1
print(ans)
Problem p02909 (python)

Fixed submission:
s = input()
if s == "Sunny":
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
elif s == "Rainy":
  print("Sunny")
else:
  print("Check")

Buggy submission (verdict: Runtime Error):
#一日ごとに晴れ(Sunny)、くもり(Cloudy)、雨(Rainy)、
w = int(input())
if w == "Sunny":
  print("Cloudy")
elif w == "Cloudy":
  print("Rainy")
elif w == "Rainy":
  print("Sunny")
else:
  print("Check")
Problem p02969 (python)

Fixed submission:
r = int(input())
D = 3 * (r**2)
print(D)

Buggy submission (verdict: Runtime Error):
D = 3 * (r**2)

Buggy submission (verdict: Runtime Error):
D = 3 * r**2
Problem p02675 (python)

Fixed submission:
n = input()
if n[-1] == "2" or n[-1] == "4" or n[-1] == "5" or n[-1] == "7" or n[-1] == "9" :
    print("hon")
elif n[-1] == "0" or n[-1] == "1" or n[-1] == "6" or n[-1] == "8" :
    print("pon")
else:
    print("bon")

Buggy submission (verdict: Runtime Error):
n = int(input())
if n = 2 or n = 4 or n = 5 or n = 7 or n = 9 :
    print("hon")
elif n = 0 or n = 1 or n = 6 or n = 8 :
    print("pon")
else:
    print("bon")
Problem p03385 (python)

Fixed submission:
print("Yes" if len(set(input()))==3 else"No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input().replace(".","")
lists = s.split()
print(lists.count("TAKAHASHIKUN")+lists.count("takahashikun")+lists.count("Takahashikun")
Problem p03485 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
ss = sorted(s)
tt = sorted(t)
print("Yes" if ss < tt[::-1] else "No")
Problem p03494 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 0
while all(A%2 == 0 for A in a):
	a = [i/2 for i in a ]
	ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
ans = 0
while all(A%2 == 0 for A in a):
a = (i/2 for i in a )
ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
ans = 0
while all(A%2 == 0 for A in a):
a = (i/2 for i in a )
ans += 1
print(ans)
Problem p03555 (python)

Fixed submission:
a = input()
b = input()
print("YES" if a == b[::-1] else"NO")

Buggy submission (verdict: Runtime Error):
n = int(input())
m = int(n**0.5)
print(int(m**2))
Problem p03624 (python)

Fixed submission:
s = input()
all = "abcdefghijklmnopqrstuvwxyz"
ans = sorted(set(s)^set(all)) 
print("None" if len(ans) == 0 else ans[0])

Buggy submission (verdict: Runtime Error):
s = input()
all = "abcdefghijklmnopqrstuvwxyz"
ans = sorted(set(s)^set(all)) 
print("None" if ans == 0 else ans[0])
Problem p03737 (python)

Fixed submission:
a,b,c = input().split()
print(a[0].upper()+b[0].upper()+c[0].upper())

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print("GREATER" if a > b else "EQUAL" if a == b else "LESS")
Problem p03814 (python)

Fixed submission:
s = input()
print(len(s)-s[::-1].index("Z")-s.index("A"))

Buggy submission (verdict: Runtime Error):
s = input()
print(len(s)-s[::-1].index("z")-s.index("a"))
Problem p04043 (python)

Fixed submission:
a = list(map(int,input().split()))
b = [x for x in a if x !=" "]
c = sorted(b)
d =[5,5,7]
print("YES" if c == d else "NO")

Buggy submission (verdict: Runtime Error):
n,l = map(int,input().split())
s = sorted([input() for i in range(n)] )
print(*s,sep="")
Problem p02640 (python)

Fixed submission:
X,Y=map(int, input().split())
ans = 'No'
for a in range(X + 1):
  b=X-a
  if 2 * a + 4 * b == Y:
    ans = 'Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split()) ans = 'No'
for a in range(X + 1):
b=X-a
if 2 * a + 4 * b == Y:
ans = 'Yes' print(ans)
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):
a,b = (int, input().split())
if a*b%2 == 0:
  print("Even")
else:
  print("Odd")
Problem p02678 (python)

Fixed submission:
n,m=map(int,input().split())
l=[[] for _ in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    l[a-1].append(b-1)
    l[b-1].append(a-1)

from collections import deque

p=[0]*n
ans=[0]*n
d=deque()
d.append(0)
while len(d)!=0:
    now=d.popleft()
    for to in l[now]:
        if p[to]==0:
            p[to]=p[now]+1
            d.append(to)
            ans[to]=now
print("Yes")
for i in range(1,n):
    print(ans[i]+1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[[] for _ in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    l[a-1].append(b-1)
    l[b-1].append(a-1)

p=[0]*n
p[0]=1
now=1
cnt=0
while 0 in p and k>0:
    for to in l[now-1] and cnt<=m:
        if p[to]==0:
            p[to]=now
            cnt+=1
    now=to+1
    k-=1
if 0 in p:
    print("No")
else:
    print("Yes")
    for i in range(1,n):
        print(p[i])