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

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if (a*b) % 2 == 0:
  print('Even')
else:
  print(Odd)
Problem p02645 (python)

Fixed submission:
a = str(input())
print(a[0:3])

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

f = a + (b*e)
g = c + (d*e)

if f > g:
	print("YES")
else:
	print("NO")

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

f = a + (b*e)
g = c + (d*e)

if f >= g:
	print("YES")
else:
	print("NO")
Problem p02702 (python)

Fixed submission:
s=input()
a=0
m={}
d=1
for i in range(len(s)):
  b=int(s[len(s)-1-i])*d+a
  b=b%2019
  a=b
  d=d*10%2019
  if b in m:
    m[b]+=1
  else:
    m[b]=1
if 0 in m:
  sum=m[0]
else:
  sum=0
for i in m:
  sum+=m[i]*(m[i]-1)/2
print(int(sum))

Buggy submission (verdict: Runtime Error):
s=input()
a=0
m={}
for i in range(len(s)):
  b=int(s[len(s)-1-i])*10**i+a
  b=b%2019
  a=b
  if b in m:
    m[b]+=1
  else:
    m[b]=1
sum=m[0]
for i in m:
  sum+=m[i]*(m[i]-1)/2
print(int(sum))
Problem p02641 (python)

Fixed submission:
x, n = map(int, input().split())
num_list = list(map(int, input().split()))
dif = 100000
o_list = []

if len(num_list) == 0:
    print(x)
    exit()
#
# for i in range(1, max(num_list)):
#     if i not in num_list:
#         o_list.append(i)

for i in range(-1000, 1000):
    if i not in num_list:
        o_list.append(i)

o_list.sort(reverse=True)

for num in o_list:
    if abs(x - num) <= dif:
        # if x not in num_list:
        dif = abs(x -num)
        ans = num

print(ans)

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
num_list = list(map(int, input().split()))
dif = 101
o_list = []
num_list.sort(reverse=True)

if len(num_list) == 0:
    print(x)
    exit()
#
# for i in range(1, max(num_list)):
#     if i not in num_list:
#         o_list.append(i)

for i in range(1, 101):
    if i not in num_list:
        o_list.append(i)

o_list.sort(reverse=True)

for num in o_list:
    if abs(x - num) <= dif:
        # if x not in num_list:
        dif = abs(x -num)
        ans = num

print(ans)

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
num_list = list(map(int, input().split()))
dif = 101
o_list = []
num_list.sort(reverse=True)

if len(num_list) == 0:
    print(x)
    exit()

for i in range(1, max(num_list)):
    if i not in num_list:
        o_list.append(i)

o_list.sort(reverse=True)

for num in o_list:
    if abs(x - num) <= dif:
        # if x not in num_list:
        dif = abs(x -num)
        ans = num

print(ans)
Problem p03210 (python)

Fixed submission:
x = input()

if x == '7' or x == '5' or x == '3':
    print("YES")
else:
    print("NO")

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

if x == '7' or '5' or '3'
    print("YES")
else:
    print("NO")
Problem p03129 (python)

Fixed submission:
n, k = (int(i) for i in input().split())
if n%2 == 1:
  n = (n//2) + 1
  if k > n:
    print("NO")
  else: print("YES")
else:
  n = n/2
  if k > n:
    print("NO")
  else: print("YES")

Buggy submission (verdict: Runtime Error):
N = argv[1]
K = argv[2]
if N > K:
  return "YES"
else:
  return "NO"

Buggy submission (verdict: Runtime Error):
N
Problem p02664 (python)

Fixed submission:
T = list(input())
ex=None
for i in range(len(T)):
  if T[i] == "?":
    if ex == "P" or ex == None:
      T[i] = "D"
    else:
      if len(T)-1 == i:
        T[i] = "D"
      elif T[i+1] == "D" or T[i+1] == "?":
        T[i] = "P"
      else:
        T[i] = "D"
  ex = T[i]
print("".join(T))

Buggy submission (verdict: Runtime Error):
T = list(input())
ex=None
for i in range(len(T)):
  if T[i] == "?":
    if ex == "P" or ex == None:
      T[i] = "D"
    else:
      if len(T)-1 == i:
        T[i] = "D"
      if T[i+1] == "D" or T[i+1] == "?":
        T[i] = "P"
      else:
        T[i] = "D"
  ex = T[i]
print("".join(T))

Buggy submission (verdict: Runtime Error):
T = list(input())
ex=None
for i in range(len(T)):
  if T[i] == "?":
    if ex == "P":
      T[i] = "D"
    else:
      if T[i+1] == "D":
        T[i] = "P"
      else:
        T[i] = "D"
  ex = T[i]
print("".join(T))
Problem p02786 (python)

Fixed submission:
H=int(input())

def rec(h):
  if h==1:
    return 1
  else:
    return rec(h//2)*2 + 1
print(rec(H))

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

def rec(h):
  if h==1:
    return 1
  else:
    return rec(h/2)*2 + 1
print(rec(H))
Problem p03102 (python)

Fixed submission:
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
count=0
for i in range(N):
    A=list(map(int,input().split()))
    p=C
    for j in range(M):p+=A[j]*B[j]
    if p>0:count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,M,C=map(int, input().split())
B=list(map(int(input().split())))
cnt=0

for i in range(N):
  A=list(map(int, input().split()))
  p=C
  for j in range(M):
    p+=A[j]*B[J]
    if p>0:
      cnt+=1
print(cnt)
Problem p03434 (python)

Fixed submission:
N=int(input())
A=list(map(int, input().split()))
sortedA=sorted(A, reverse=True)
Bob=0
Alice=0
for i in range(len(A)):
  # print(i)
  if i == 0 or i%2==0:
    Alice+=sortedA[i]
  else:
    Bob +=sortedA[i]
print(Alice-Bob)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[map(int, input().split())]
sortedA=sorted(A, reverse=True)
Bob=0
Alice=0
for i in range(len(A)):
  # print(i)
  if i == 0 or i%2==0:
    Alice+=sortedA[i]
  else:
    Bob +=sortedA[i]
print(Alice-Bob)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=map(int, input().split())
sortedA=sorted(A, reverse=True)
Bob=0
Alice=0
for i in range(len(A)):
  # print(i)
  if i == 0 or i%2==0:
    Alice+=sortedA[i]
  else:
    Bob +=sortedA[i]
print(Alice-Bob)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=map(int, input())
sortedA=sorted(A, reverse=True)
Bob=0
Alice=0
for i in range(len(A)):
  # print(i)
  if i == 0 or i%2==0:
    Alice+=sortedA[i]
  else:
    Bob +=sortedA[i]
print(Alice-Bob)
Problem p03971 (python)

Fixed submission:
N,A,B=map(int, input().split())
S=input()
cntA=0
cntB=0
for s in S:
  if s == 'c':
    print('No')
    continue
  if s == 'a' and (cntA+cntB) < A+B:
    print('Yes')
    cntA +=1
  elif (s == 'b') and ((cntA+cntB) < A+B) and (cntB < B):
    print('Yes')
    cntB +=1
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
N,A,B=map(int, input().split())
S=int(input().split())
cntA=0
cntB=0
for s in S:
  if s == 'c':
    print('No')
    continue
  if s == 'a' and (cntA+cntB) < A+B:
    print('Yes')
    cntA +=1
  elif (s == 'b') and ((cntA+cntB) < A+B) and (cntB < B):
    print('Yes')
    cntB +=1
  else:
    print('No')

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

for s in S:
  if s == 'c':
    print('No')
    continue
  if s == 'a' and (cntA+cntB) < A+B:
    print('Yes')
    cntA +=1
  elif (s == 'b') and ((cntA+cntB) < A+B) and (cntB < B):
    print('Yes')
    cntB +=1
  else:
    print('No')
Problem p02621 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
print(a+a**2+a**3)
Problem p02741 (python)

Fixed submission:
l=[]
s = "1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51"
s = s.replace(' ','')
l = s.split(',')
k = input()
print(l[int(k)-1])

Buggy submission (verdict: Runtime Error):
l=[]
s = "1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51"
s = s.replace(' ','')
l = s.split(',')
k = input()
print(l[int(k)])
Problem p02705 (python)

Fixed submission:

import math
a=int(input())
print(2*math.pi*a)


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

Buggy submission (verdict: Runtime Error):
import sys
sys.stdin=open('input.txt','r')
sys.stdout=open('output.txt','w')
import math
a=int(input())
print(2*math.pi*a)


#a,b=map(input(),int.split())
Problem p02646 (python)

Fixed submission:
A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())
if A <= B:
    if A + V * T >= B + W * T:
        print('YES')
    else:
        print('NO')
else:
    if A - V * T <= B -  W * T:
        print('YES')
    else:
        print('NO')

Buggy submission (verdict: Runtime Error):
A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())
if A >= B
    if A + V * T >= B + W * T:
        print('YES')
    else:
        print('NO')
else:
    if V >= W:
        print('NO')
    elif A + V * T >= B + W * T:
        print('YES')
    else:
        print('NO')
Problem p02663 (python)

Fixed submission:
a,b,c,d,e = map(int,input().split())
kis = a * 60 + b
nel = c * 60 + d
print(nel - e - kis)

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f = map(int,input().split())
kis = a * 60 + b
nel = c * 60 + d
print(nel - f - kis)
Problem p02664 (python)

Fixed submission:
T = input()
print(T.replace('?','D'))

Buggy submission (verdict: Runtime Error):
T = input()
	print(T.replace('?','D'))

Buggy submission (verdict: Runtime Error):
T = input()
	print(T.replace("?","D"))

Buggy submission (verdict: Runtime Error):
t = input()
if t[len(t)]=="?":
    g == "D"
for i in range(len(t-1)):
    if t[i+1] == "?":
        if i == 0 and t[i+2] =="D":
            f="P"
        elif i == 0:
            f="D"
        if i > 1 and (t[i]=="P" or s[i] =="P"):
            f="D"
    s=s+f
print(s+g)

Buggy submission (verdict: Runtime Error):
t = input()
if t[len(t)]=="?":
    g == "D"
for i in range(len(t-1)):
    if t[i+1] == "?":
        if i == 0 and t[i+2] =="D":
            f="P"
        elif i == 0:
            f="D"
        if i > 1 and t[i]=="P" or s[i] =="P":
            f="D"
    s=s+f
print(s+g)

Buggy submission (verdict: Runtime Error):
t = input()
if t[len(t)]=="?":
    g == "D"
for i in range(len(t-1)):
    if t[i+1] == "?":
        if i == 0 and t[i+2] =="D":
            f="P"
        elif i == 0:
            f="D"
        if t[i]=="P" or s[i] =="P":
            f="D"
    s=s+f
print(s+g)

Buggy submission (verdict: Runtime Error):
t = input()
if t[len(t)]=="?":
    g == "D"
for i in range(len(t-1)):
    if t[i+1] == "?":
        if i == 0 and t[i+2] =="D":
            f="P"
        elif i == 0:
            f="D"
        s[i+1] = t[i+1]
        if t[i]=="P" or s[i] =="P":
            f="D"
    s=s+f
print(s+g)

Buggy submission (verdict: Runtime Error):
t = input()
if t[len(t)]=="?":
  s[len(t)] == "D"
for i in range(len(t-1)):
    if t[i+1] == "?":
        if i == 0 and t[i+2] =="D":
            s[i+1]="P"
        elif i == 0:
            s[i+1]="D"
        s[i+1] = t[i+1]
        if t[i]=="P" or s[i] =="P":
            s[i+1]="D"
    s=s+s[i+1]
print(s+s[len(t)])
Problem p02675 (python)

Fixed submission:
a = str(input())
if a[-1] == '3':
    print('bon')
elif a[-1]=='0' or a[-1]=='1' or a[-1]=='6' or a[-1]=='8':
    print('pon')
else:
    print('hon')

Buggy submission (verdict: Runtime Error):
a = int(input())
if a[-1] == 3:
    print('bon')
elif a[-1]==0 or a[-1]==1 or a[-1]==6 or a[-1]==8:
    print('pon')
else:
    print('hon')
Problem p02694 (python)

Fixed submission:
import math 
X = int(input())
yen = 100
n = 0
while yen < X:
    n = n + 1
    yen = math.floor(yen*1.01)
    if X <= yen:
        print(n)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
import math 
X = int(input())
yen = 100
n = 1
while yen < X:
    yen = decimal(math.floor(yen*1.01*n))
    if X <= yen:
        print(n)
    n = n + 1

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
import math 
X = int(input())
yen = 100
n = 1
while True:
    yen = decimal(math.floor(yen*1.01*n))
    if X <= yen:
        print(n)
        break
    n = n + 1

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
from floor import math 
X = int(input())
yen = 100
n = 1
while True:
    yen = decimal(math.floor(yen*1.01*n))
    if X <= yen:
        print(n)
        break
    n = n + 1

Buggy submission (verdict: Runtime Error):
import decimal
import math 
X = int(input())
yen = 100
n = 1
while True:
    yen = decimal(math.floor(decimal(yen*1.01*n)))
    if X <= yen:
        print(n)
        break
    n = n + 1

Buggy submission (verdict: Runtime Error):
import decimal
import math 
X = int(input())
yen = desimal(100)
n = 1
while True:
    yen = math.floor(decimal(yen*1.01*n))
    if X <= yen:
        print(n)
        break
    n = n + 1
Problem p02922 (python)

Fixed submission:
args = input().split()
a = int(args[0])
b = int(args[1])
 
tap = 0
socket = 1
while socket < b:
  socket -= 1
  tap += 1
  socket += a
  
print(tap)

Buggy submission (verdict: Runtime Error):
args = [int(input()) for in range(2)]

a = args[0]
b = args[1]

tap = 1
socket = a
while socket < b:
  tap += 1
  socket = socket + a - 1

print(tap)

Buggy submission (verdict: Runtime Error):
import sys
args = []
for l in sys.stdin:
  args.append(int(l))

a = args[0]
b = args[1]

tap = 1
kuti = a
while kuti < b:
  tap += 1
  kuti += (a - 1)
  
print(tap)
Problem p02923 (python)

Fixed submission:
args = [input() for _ in range(2)]

N = int(args[0])
H = [int(l) for l in args[1].split()]

max_len = 0
val = H[0]
st = 0
for i in range(1, N):
  next_val = H[i]
  if val < next_val:
    max_len = max(max_len, i - st - 1)
    st = i
    if st + max_len >= N:
      break
  val = next_val

if (N != 1) and (i == N - 1):
  max_len = max(max_len, N - 1 - st)
  
print(max_len)

Buggy submission (verdict: Runtime Error):
if n == 1:
  print(0)
else:
  st = 0
  val = h[st]
  max_len = 0
  for i in range(1, n):
    next_val = h[i]
    if val < next_val:
      max_len = max(max_len, i - st -1)
      if i + max_len >= n:
        break
      st = i
    val = next_val
  
  if i == n - 1:
    max_len = max(max_len, n - 1 - st)
  
  print(max_len)

Buggy submission (verdict: Runtime Error):
args = [input() for _ in range(2)]

N = int(args[0])
H = [int(l) for l in args[1].split()]

max_len = 0
val = H[0]
st = 0
for i in range(1, N):
  next_val = H[i]
  if val < next_val:
    max_len = max(max_len, i - st - 1)
    st = i
    if st + max_len >= N:
      break
  val = next_val

if i == N - 1:
  max_len = max(max_len, N - 1 - st)
  
print(max_len)

Buggy submission (verdict: Runtime Error):
args = [input() for _ in range(2)]

N = int(args[0])
H = [int(l) for l in args[1].split()]

import numpy as np

H = np.array(H)

def get_max_len(arr):
  
  max_ind = np.argmax(arr)
  next_ind = max_ind + 1
  val = arr[max_ind]
  if next_ind >= len(arr):
    max_len = 0
  else:
    next_val = arr[next_ind]

    while val > next_val:
      val = next_val
      next_ind += 1
      if next_ind >= len(arr):
        break

      next_val = arr[next_ind]
    max_len = next_ind - max_ind - 1
	
  if max_ind >= max_len:
  	tmp_max_len = get_max_len(arr[:max_ind])
  	max_len = max(max_len, tmp_max_len)
  if len(arr[next_ind:]) - 1 > max_len:
  	tmp_max_len = get_max_len(arr[next_ind:])
  	max_len = max(max_len, tmp_max_len)
    
  return max_len

print(get_max_len(H))
Problem p02641 (python)

Fixed submission:
import sys
X, N = map(int, input().split())
if (N==0):
    print(X)
    sys.exit()
p = list(map(int, input().split()))

n_ans = 0
sa = 200
for k in range(0,102,1):
    if (k in p):
        continue
    if(abs(k-X) < sa):
        n_ans = k
        sa = abs(k-X)
    else:
        break
print(n_ans)

Buggy submission (verdict: Runtime Error):
import sys
X, N = map(int, input().split())
if (N==0):
    print(100)
    sys.exit()
p = list(map(int, input()))

n_ans = 1
sa = 100
for k in range(1,100,1):
    if (k in p):
        continue
    if(abs(k-X) < sa):
        n_ans = k
        sa = abs(k-X)
    else:
        break
print(n_ans)
Problem p02646 (python)

Fixed submission:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
if(V<W):
    print("NO")
elif(abs(A-B)>T*(V-W)):
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
if(V < W):
    print("NO")
elif(abs(A-B)>T*(V-W)):
    print("NO")
else:
    print("YES")
Problem p02664 (python)

Fixed submission:
PDList = list(input())


for index, PD in enumerate(PDList):
    if PD != '?': continue

    if PD == '?' and len(PDList) == 1:
        PDList[index] = 'D'
        break

    if index == 0:
        if PDList[index + 1] == 'D' or PDList[index + 1] == '?': PDList[index] = 'P'
        else: PDList[index] = 'D'
        continue

    if PD == '?' and index == len(PDList) - 1:
        PDList[index] = 'D'
        continue


    if PDList[index - 1] == 'P':
        PDList[index] = 'D'
        continue

    if PDList[index + 1] == 'D':
        PDList[index] = 'P'
        continue

    if PDList[index - 1] == 'D' and PDList[index + 1] == '?':
        PDList[index] = 'P'
        continue


    PDList[index] = 'D'
    continue


print(''.join(PDList))

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


for index, PD in enumerate(PDList):
    if PD != '?': continue

    if PD == '?' and len(PDList) == 1:
        PDList[index] = 'D'
        break

    if index == 1:
        if PDList[index + 1] == 'D' or PDList[index + 1] == '?': PDList[index] = 'P'
        else: PDList[index] = 'D'
        continue

    if PD == '?' and index == len(PDList) - 1:
        PDList[index] = 'D'
        continue


    if PDList[index - 1] == 'P':
        PDList[index] = 'D'
        continue

    if PDList[index + 1] == 'D':
        PDList[index] = 'P'
        continue

    if PDList[index - 1] == 'D' and PDList[index + 1] == '?':
        PDList[index] = 'P'
        continue


    PDList[index] = 'D'
    continue


print(''.join(PDList))

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


for index, PD in enumerate(PDList):
    if PD != '?': continue

    if PD == '?' and len(PDList) == 1:
        PDList[index] = 'D'
        break

    if index == 1:
        if PDList[index + 1] == 'D' or PDList[index + 1] == '?': PDList[index] = 'P'
        else: PDList[index] = 'D'
        continue

    if PDList[index - 1] == 'P':
        PDList[index] = 'D'
        continue

    if PDList[index + 1] == 'D':
        PDList[index] = 'P'
        continue

    if PDList[index - 1] == 'D' and PDList[index + 1] == '?':
        PDList[index] = 'P'
        continue


    PDList[index] = 'D'
    continue


print(''.join(PDList))

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


for index, PD in enumerate(PDList):
    if PD != '?': continue

    if index == 1:
        if PDList[index + 1] == 'D' or PDList[index + 1] == '?': PDList[index] = 'P'
        else: PDList[index] = 'D'
        continue

    if PDList[index - 1] == 'P':
        PDList[index] = 'D'
        continue

    if PDList[index + 1] == 'D':
        PDList[index] = 'P'
        continue

    if PDList[index - 1] == 'D' and PDList[index + 1] == '?':
        PDList[index] = 'P'
        continue


    PDList[index] = 'D'
    continue


print(''.join(PDList))
Problem p02681 (python)

Fixed submission:
oldID = input()
newID = input()

print("Yes" if oldID + newID[-1] == newID else "No")

Buggy submission (verdict: Runtime Error):
import sys
import itertools

num = int(input())
S = []
for _ in range(num):
    S.append(input())

result = False
for i in itertools.permutations(S):
    checkedArray = list(''.join(i))
    if checkedArray[0] == ")": continue

    cost = 0
    for index, item in enumerate(checkedArray):
        if item == "(": cost += 1
        else: cost -= 1

        if cost < 0: break
        if cost == 0 and index == len(checkedArray) - 1:
            result = True
            break

    if result == True: break

print("Yes" if result == True else "No")

Buggy submission (verdict: Runtime Error):
oneCard, zeroCard, miniusOneCard, getCardNum = map(int, input().split())

if oneCard >= getCardNum: print(oneCard)
elif oneCard + zeroCard >= getCardNum: print(oneCard)
else: print(oneCard - (getCardNum - oneCard - zeroCard))
Problem p04043 (python)

Fixed submission:

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

if numArray.count(5) == 2 and numArray.count(7) == 1: print("YES")
else: print("NO")

Buggy submission (verdict: Runtime Error):

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

if numArray.count(5) == 2 && numArray.count(7) == 1: print("YES")
else: print("NO")
Problem p02678 (python)

Fixed submission:
n, m = map(int,input().split())
li = [[] for i in range(n)]
for i in range(m):
    a, b = map(int,input().split())
    li[a-1].append(b-1)
    li[b-1].append(a-1)
sign = {0: 0}
step = {0: 1}
now = {0}
flg = False
while len(now) > 0:
    if flg:
        print('No')
        exit()
    flg = True
    next = set()
    for i in now:
        for j in li[i]:
            if not j in sign:
                sign[j] = i
                step[j] = step[i] + 1
                next.add(j)
                flg = False
    now.clear()
    now = next

print('Yes')
for i in range(n - 1):
    print(sign[i + 1] + 1)

Buggy submission (verdict: Runtime Error):
n, m = map(int,input().split())
li = [[] for i in range(m)]
for i in range(m):
    a, b = map(int,input().split())
    li[a-1].append(b-1)
    li[b-1].append(a-1)
sign = {0: 0}
step = {0: 0}
now = {0}

while len(now) > 0:
    next = set()
    for i in now:
        for j in li[i]:
            if not j in sign:
                sign[j] = i
                step[j] = step[i] + 1
                next.add(j)
    now.clear()
    now = next

print('Yes')
for i in range(n - 1):
    print(sign[i + 1] + 1)
Problem p02718 (python)

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
a.sort(reverse = True)
k = s/(4*m)
if a[m-1] < k:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
N,M =map(int,input().split())
a = list(map(int, input().split())) 
a.sort(reverse = True)

m = 4*M
c = 0 
for i  in range(0,M):
  if a[i] >=m:
    c +=1
   
  
  
if c = M:
  print('Yes')
else:
  print('No')
Problem p02741 (python)

Fixed submission:
a =[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = input()
K = int(K)
K -= 1
print(a[K])

Buggy submission (verdict: Runtime Error):
from decimal import *

getcontext().prec = 1000000000
a,b,c =map(int,input().split())
d=math.sqrt(a)
e=math.sqrt(b)
f=math.sqrt(c)
h= d+e
if h<f:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
def nroot(a, n, x=1.0, eps=1e-10000000000):
    while abs(a - x**n) > eps:
        x = ( (n-1)*x + a/(x**(n-1)) ) / n
    return x

a,b,c =map(int,input().split())
d=nroot(a,2)
e=nroot(b,2)
f=nroot(c,2)

if d+e<f:
  print('Yes')
else:
  print('No')
Problem p02743 (python)

Fixed submission:
a,b,c = map(int, input().split())
s =c-a-b
t = s**2 - 4*a*b
if s >=0 and t > 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
from decimal import *

getcontext().prec = 1000000000
a,b,c =map(int,input().split())
d=math.sqrt(a)
e=math.sqrt(b)
f=math.sqrt(c)
h= d+e
if h<f:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
from decimal import *

getcontext().prec = 1000000000
a,b,c =map(int,input().split())
d=math.sqrt(a)
e=math.sqrt(b)
f=math.sqrt(c)
h= d+e
if h<f:
  print('Yes')
else:
  print('No')
Problem p02772 (python)

Fixed submission:
N = input()
N = int(N)
A = list(map(int,input().split()))
B = [ i for i in A if i % 2 ==0]
C = [ d for d in B if  d % 3 == 0 or d % 5 == 0]
R = len(C)
Q = len(B)
if R == Q:
  print("APPROVED")
  
else:
  print("DENIED")

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)
A = list(map(int,input().split()))
B = [ i for i in A if i % 2 == 0 or ]
C = [ d for d in B if i % 3 == 0 or i % 5 == 0]
R = len(C)
if R == 0:
  print("APPROVED")
else:
  print("DENIED")