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

Fixed submission:
import sys
input = sys.stdin.readline
N, K, Q = [int(value) for value in input().split(' ')]
A = [int(input()) for _ in range(Q)]

points = [K - Q] * N

for value in A:
    points[value - 1] += 1

for point in points:
    if point <= 0:
        print('No')
    else:
        print('Yes')

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

N, K, Q = [int(value) for value in input().split(' ')]
A = [int(input()) for _ in range(Q)]

points = [K] * N

for value in A:
    for i in range(len(points)):
        if i != value - 1:
            points[i] = points[i] - 1

for point in points:
    if point > 0:
        print('Yes')
    else:
        print('No')

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

N, K, Q = [int(value) for value in input().split(' ')]
A = [int(input()) for _ in range(Q)]

points = np.full(N, K)

for i in range(Q):
    points = points - 1
    points[A[i] - 1] += 1

for point in points:
    if point > 0:
        print('Yes')
    else:
        print('No')
Problem p03068 (python)

Fixed submission:
N = int(input())
S = input()
K = int(input())

str_list = list(S)

for i in range(N):
    if str_list[K - 1] != str_list[i]:
        str_list[i] = '*'

S = "".join(str_list)
print(S)

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


for i in range(N):
    if S[K - 1] != S[i]:
        S[i] = '*'
        
print(S)
Problem p02898 (python)

Fixed submission:
if __name__ == '__main__':
    N, K = map(int, input().split())
    people_hight = list(input().split())
    ok = 0

    for person_hight in people_hight:
        if K <= int(person_hight) :
            ok = ok + 1
    print(ok)

Buggy submission (verdict: Runtime Error):
f __name__ == '__main__':
    N, K = map(int, input().split())
    people_hight = list(input().split())
    ok = 0

    for person_hight in people_hight:
        if K <= int(person_hight) :
            ok = ok + 1
    print(ok)
Problem p02887 (python)

Fixed submission:
n = int(input())
s = input()
ans = s[0]
for i in range(1, n):
    if ans[-1] == s[i]:
        continue
    else:
        ans += s[i]
print(len(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
ans = s[1]
for i in range(1, n):
    if ans[-1] == s[i]:
        continue
    else:
        ans += s[i]
print(len(ans))
Problem p04043 (python)

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

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
d = set(map(str, input().split()))
for i in range(n, 10*n):
    if len(d & set(str(i))) == 0:
        print(i)
        break
Problem p04045 (python)

Fixed submission:
n, k = map(int, input().split())
d = set(map(str, input().split()))
for i in range(n, 10*n):
    if len(d & set(str(i))) == 0:
        print(i)
        break

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
d = sorted(list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} - set(map(int, input().split()))))
n = str(n)
ans = ''
for i in n:
    for j in d:
        if j >= int(i):
            ans += str(j)
            break
print(int(ans))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
d = sorted(list({0, 1, 2, 3, 4, 5, 6, 7, 8, 9} - set(map(int, input().split()))))
n = str(n)
ans = ''
for i in n:
    for j in d:
        if j >= int(i):
            ans += str(j)
            break
print(int(ans))
Problem p03049 (python)

Fixed submission:
N = int(input())
a, b, bxxa, ab = 0, 0, 0, 0

for i in range(N):
    s = input()
    if s[-1] == 'A':
        a += 1
    if s[0] == 'B':
        b += 1
    if s[0]=='B' and s[-1]=='A':
        bxxa += 1 
    ab += s.count('AB')

if a>b :
    print(ab+b)
elif a!=0 and a==b and bxxa==a:
    print(ab+a-1)
else: 
    print(ab+a)

Buggy submission (verdict: Runtime Error):
N = int(input())
a, b, bxxa, ab = 0, 0, 0, 0

for i in range(N):
    s = input()
    if s[-1] == 'A':
        a += 1
    if s[0] == 'B':
        b +=1
    if s[0]=='B' and s[-1]=='A'
        bxxa += 1 
    ab += s.count('AB')

if a>b :
    print(ab+b)
elif a==b and bxxa==a:
    print(ab+a-1)
else: 
    print(ab+a)
Problem p03061 (python)

Fixed submission:
import fractions
 
N = int(input())
A = list(map(int, input().split()))

max_gcd = 1

L, R, M = [0]*(N+1), [0]*(N+1), []

def gcd(a, b):
        if a == 0:
                return b
        elif b == 0:
                return a
        else:
                return fractions.gcd(a,b)

for i in range(N):
        L[i+1] = gcd(L[i], A[i])
for i in range(N-1,0,-1):
        R[i] = (gcd(R[i+1], A[i]))
for i in range(N):
        M.append(gcd(L[i], R[i+1]))

print(max(M))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
 
N = int(input())
A = list(map(int, input().split()))

max_gcd = 1

def L(i):
        if i == 0:
                return 0
        else:
                return gcd(L(i-1),A[i-1])

def R(i):
        if i == N:
                return 0
        else:
                return gcd(R(i+1),A[i])

M = []

for i in range(N):
        # print(M)
        M.append(gcd(L(i), R(i+1)))

print(max(M))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

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

def gcd(numbers):
        return reduce(math.gcd, numbers)

max_gcd = 1
for i in range(N):
        tmp_list =[]
        tmp_list.extend(A[:i])
        tmp_list.extend(A[i+1:])
        tmp_gcd = gcd(tmp_list)
        if max_gcd < tmp_gcd:
                max_gcd = tmp_gcd

print(max_gcd)
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):
H, W = map(int, input())
h, w = map(int, input())

print((H-h)*(W-w))
Problem p03145 (python)

Fixed submission:
AB, BC, CA = map(int, input().split())
print(int(AB*BC/2))

Buggy submission (verdict: Runtime Error):
ABC = map(int, input().split())
print(ABC[0]*ABC[1]/2)
Problem p03206 (python)

Fixed submission:
d = int(input())
str = "Christmas"
for i in range(0, 25-d):
    str += " Eve"

print(str)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
h = [int(input()) for i in range(n)] 
h.sort()

crr_min = 10^9

for i in range(0,n-k+1):
    tmp = h[n-k+i] - h[0+i]
    if tmp<crr_min:
        crr_min=tmp

print(crr_min)
Problem p03212 (python)

Fixed submission:
def add(a):
	if int(a)>n:
		return 0
	else:
		ans = 0
		a = '' if int(a)==0 else a
		if a.find('3')>-1 and a.find('5')>-1 and a.find('7')>-1:
			ans+=1
		for i in [3,5,7]:
			ans+=add(a+str(i))
		return ans

n = int(input())
print(add('0'))

Buggy submission (verdict: Runtime Error):
def add(a):
	if int(a)>n:
		return 0
	else:
		ans = 0
		a = '' if int(a)==0 else a
		if a.find('3')>-1 and a.find('5')>-1 and a.find('7')>-1:
			ans+=1
		for i in [3,5,7]:
			ans+=add(a+str(i))
		return ans

n = int(input())
print(add(''))
Problem p03485 (python)

Fixed submission:
from math import ceil 
a, b = map(int, input().split())
print(ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
import ceil from math
a, b = map(int, input().split())
print(ceil((a+b)/2))
Problem p03547 (python)

Fixed submission:
from sys import stdin

x,y = stdin.readline().split( )

if x<y :
	print('<')
elif x>y :
	print('>')
else:
	print('=')

Buggy submission (verdict: Runtime Error):
x, y = map(hex, input().split())

if x<y :
	print('<')
elif x>y :
	print('>')
else:
	print('=')

Buggy submission (verdict: Runtime Error):
x, y = map(hex, input().split())

if(x<y){
	print('<')
} else if(x>y){
	print('>')
} else{
	print('=')
	}
Problem p03548 (python)

Fixed submission:
from sys import stdin
import math
 
x, y, z = stdin.readline().split()
 
print (math.floor(( ( int(x)-int(z) ) / ( int(y) + int(z) ) )))

Buggy submission (verdict: Runtime Error):
from sys import stdin
 
x,y,z = stdin.readline().split( )

print (int(x)-int(z))/(int(y)+int(z))

Buggy submission (verdict: Runtime Error):
from sys import stdin
 
x,y,z = stdin.readline().split()

print (int(x)-int(z))/(int(y)+int(z))

Buggy submission (verdict: Runtime Error):
from sys import stdin
 
x,y,z = stdin.readline().split()

print (int(x)-int(z))/(int(y)+int(z))

Buggy submission (verdict: Runtime Error):
from sys import stdin
 
x,y,z = stdin.readline().split()

print (int(x)-int(z))/(int(y)+int(z))

Buggy submission (verdict: Runtime Error):
x, y, z = map(int, input().split())

print (x-z)%(x+y)
Problem p02917 (python)

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

sum = 0
for i in range(N):
    if i == 0:
        sum += list_B[i]
#         print('i == 0')
#         print('i=', i, 'sum=', sum)
    elif i == N-1:
        sum += list_B[i-1]
#         print('i == N-1')
#         print(list_B[i-1])
#         print('i=', i, 'sum=', sum)
    else:
        if (list_B[i] >= list_B[i-1]):
            sum += list_B[i-1]
        else:
            sum += list_B[i]
#         print('i=', i, 'sum=', sum)
print(sum)

Buggy submission (verdict: Runtime Error):
sum = 0
for i in range(N):
    if i == 0:
        sum += list_B[i]
#         print('i == 0')
#         print('i=', i, 'sum=', sum)
    elif i == N-1:
        sum += list_B[i-1]
        print('i == N-1')
#         print(list_B[i-1])
#         print('i=', i, 'sum=', sum)
    else:
        if (list_B[i] >= list_B[i-1]):
            sum += list_B[i-1]
        else:
            sum += list_B[i]
#         print('i=', i, 'sum=', sum)
print(sum)
Problem p03076 (python)

Fixed submission:
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

if(time_residual_notZero != []):
    ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
else:
    ans = sum(time)
print(ans)

Buggy submission (verdict: Runtime Error):
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
#print(ans)

Buggy submission (verdict: Runtime Error):
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
print(ans)

Buggy submission (verdict: Runtime Error):
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

min_index = time_residual.index(min(time_residual_notZero))
# print(min_index)

ans = sum([-(-i//10)*10 for i in time]) + time_residual[min_index] - 10
print(ans)
Problem p03211 (python)

Fixed submission:
#2019/10/25
S = open(0).read()
# print(S)
# for i in range(len(S)-2):
#     print(abs(int(S[i:i+3])-753))
print(min([abs(int(S[i:i+3])-753) for i in range(len(S)-2)]))

Buggy submission (verdict: Runtime Error):
A,B,K = map(int, open(0).read().split())
intList = [i for i in range(A,B+1)]
ansList = set(intList[:K]+intList[::-1][:K])
# print(intList)
# print(ansList)
for j in sorted(ansList):
    print(j)
Problem p03544 (python)

Fixed submission:
#2019/10/12
N = int(open(0).read())
L0 = 2
L1 = 1
L2 = 3
for i in range(N):
    L2 = L1 + L0
    L1, L0 = L2, L1
    #print(i, L2)
print(L0)

Buggy submission (verdict: Runtime Error):
#2019/10/12
N = int(open(0).read())
L0 = 2
L1 = 1
for i in range(N-1):
    L2 = L1 + L0
    L1, L0 = L2, L1
    #print(i, L2)
print(L2)
Problem p03437 (python)

Fixed submission:
a, b = (int(i) for i in input().split())  

if a == b: 
    print(-1)
elif a < 0 or b < 0: 
    print (-1)
else:
    for i in range(1, int(10 ** 10 / a)):
        if a * i % b != 0:
            print(a * i)
            exit()
        else:
            continue
    print(-1)

Buggy submission (verdict: Runtime Error):
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('integers', metavar='N', type=int, nargs='+',
               help='an integer for the accumulator')

args = parser.parse_args()
int_list = args.integers

if int_list[0] == int_list[1]: 
    print(-1)
elif int_list[0] < 0 or int_list[1] < 0: 
    print (-1)
else:
    for i in range(1, int(10 ** 10 / int_list[0])):
        if int_list[0] * i % int_list[1] != 0:
            print(int_list[0] * i)
            exit()
        else:
            continue
    print(-1)

Buggy submission (verdict: Runtime Error):
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('integers', metavar='N', type=int, nargs='+',
               help='an integer for the accumulator')

args = parser.parse_args()

if args[0] == args[1]: 
    print(-1)
elif args[0] < 0 or args[1] < 0: 
    print (-1)
else:
    for i in range(1, 10 ** 10 / args[0]):
        if args[0] * i % args[1] != 0:
            print args[0] * i
            break
print(-1)

Buggy submission (verdict: Runtime Error):
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('integers', metavar='N', type=int, nargs='+',
               help='an integer for the accumulator')

args = parser.parse_args()

if args[0] == args[1]: 
    print(-1)
elif args[0] < 0 or args[1] < 0: 
    print (-1)
else:
    for i in range(1, 10 ** 10 / args[0]):
        if args[0] * i % args[1] == 0:
            print args[0] * i
            break
print(-1)
Problem p02882 (python)

Fixed submission:
import math
a, b, x = map(int, input().split())
n = a * b
x /= a
if x / n < 0.5:
    d = 2 * x / b
    atan = math.degrees(math.atan(d / b))
    ans = 90 - atan
else:
    y = n - x
    d = 2 * y / a
    ans = math.degrees(math.atan(d / a))

print(ans)

Buggy submission (verdict: Runtime Error):
import math
a, b, x = map(int, input().split())
n = a * b
x /= a
if x / n < 0.5:
    c = (2 * (n - x)) / b - a
    d = a - c
    atan = math.degrees(math.atan(d / b))
else:
    c = 2 * x / a - b
    d = b - c
    atan = math.degrees(math.atan(a / d))

print(90 - atan)
Problem p02900 (python)

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

def getPrimeFactors(x):
    ans = []
    for d in range(2, int(x**0.5)+1):
        while x%d == 0:
            ans.append(d)
            x //= d
    if x != 1:
        ans.append(x)
    return ans

res_a = getPrimeFactors(a)
res_b = getPrimeFactors(b)

res = len(set(res_a) & set(res_b))
print(res + 1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
n = min(a, b) // 2
*t, = [True] * (n + 1)
#for i in range(len(t)):
#    if not t[i]:
#        continue
#    if a % t[i] == 0 and b % t[i] == 0:
#        for j in range(i+1, len(t)):
#            if t[j] == -1:
#                continue
#            if t[j] % t[i] == 0:
#                print(t[j], t[i])
#                t[j] = -1
#    else:
#        t[i] = -1
print(1)

Buggy submission (verdict: Runtime Error):
import fractions
a, b = map(int, input().split())
n = fractions.gcd(a, b)
*t, = range(2, n+1)
#for i in range(len(t)):
#    if t[i] == -1:
#        continue
#    if a % t[i] == 0 and b % t[i] == 0:
#        for j in range(i+1, len(t)):
#            if t[j] == -1:
#                continue
#            if t[j] % t[i] == 0:
#                print(t[j], t[i])
#                t[j] = -1
#    else:
#        t[i] = -1
print(1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
n = min(a, b) // 2
t = list(range(2, n+1))
#for i in range(len(t)):
#    if t[i] == -1:
#        continue
#    if a % t[i] == 0 and b % t[i] == 0:
#        for j in range(i+1, len(t)):
#            if t[j] == -1:
#                continue
#            if t[j] % t[i] == 0:
#                print(t[j], t[i])
#                t[j] = -1
#    else:
#        t[i] = -1
print(1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
n = min(a, b) // 2
t = list(range(2, n+1))
for i in range(len(t)):
    if t[i] == -1:
        continue
    if a % t[i] == 0 and b % t[i] == 0:
        for j in range(i+1, len(t)):
            if t[j] == -1:
                continue
            if t[j] % t[i] == 0:
                print(t[j], t[i])
                t[j] = -1
    else:
        t[i] = -1

print(sum([1 for v in t if v != -1]) + 1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
n = min(a, b) // 2
t = list(range(1, n+1))
for i in t:
    if i in (-1, 1):
        continue
    if a % i == 0 and b % i == 0:
        for j in t[i:]:
            if j == -1:
                continue
            if j % i == 0:
                t[j-1] = -1
    else:
        t[i-1] = -1
c = sum([1 for i in t if i != -1])
if c:
    print(c)
else:
    print(1)
Problem p03680 (python)

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
tmp = a[0]
ans = -1
count = 0
for i in range(n):
    count += 1
    if tmp == 2:
        ans = count
        break
    tmp = a[tmp - 1]
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
tmp = a[0]
if a.index(2) == -1:
    print(-1)
else:
    ans = -1
    count = 0
    for i in range(n):
        count += 1
        if tmp == 2:
            ans = count
            break
        tmp = a[tmp - 1]
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
tmp = a[0]
if a.index(2) == -1:
    print(-1)
else:
    ans = -1
    count = 0
    while(tmp != 1):
        count += 1
        if tmp == 2:
            ans = count
            break
        tmp = a[tmp - 1]
print(ans)
Problem p04043 (python)

Fixed submission:
from collections import defaultdict

dd = defaultdict(int)
for i in input().split():
    dd[i] += 1

if dd['5'] == 2 and dd['7'] == 1:
    print('YES')
else:
    print('NO')

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

args = sys.argv
dd = defaultdict(int)

for arg in args:
    dd[arg] += 1

if dd[5] == 2 and dd[7] == 1:
    print('YES')
else:
    print('NO')
Problem p04030 (python)

Fixed submission:
# -*- coding: utf-8 -*-

s = list(input())
ans = []

for j in range(len(s)):
    # print("j=%d word=%s length=%d ans=%s" % (j, s[j], len(ans), "".join(ans)))
    if (s[j]) == "B":
        l = len(ans)
        if l == 0:
            continue
        else:
            del ans[-1]
    else:
        ans.append(s[j])

print("".join(ans))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

s = list(input())
ans = []

for j in range(len(s)):
    if (s[j]) == "B":
        l = len(ans)
        if l == 0:
            continue
        else:
            del ans[j-1]
    else:
        ans.append(s[j])

print("".join(ans))
Problem p02909 (python)

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


S = input().strip()

if S == 'Sunny':
    print('Cloudy')

if S == 'Cloudy':
    print('Rainy')

if S == 'Rainy':
    print('Sunny')

Buggy submission (verdict: Runtime Error):

from heapq import heappush, heappop, heapify


obj = input().strip().split(' ')
N, M = map(int, obj)

obj = input().strip().split(' ')
val_list = [-1 * item for item in list(map(int, obj))]

heapify(val_list)

for _ in range(M):
    val = (-1) * ((heappop(val_list) * (-1)) // 2)
    heappush(val_list, val)

print(-1 * sum(val_list))

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


obj = input().strip().split(' ')
N, K, Q = map(int, obj)

winner_list = []
for _ in range(Q):
    A_i = int(input().strip())
    winner_list.append(A_i)

point_list = [K for _ in range(N)]

for A_i in winner_list:
    point_list = [k if i == A_i else k - 1 for i in range(1, N + 1)]

is_win = [True if point_list[i] > 0 else False for i in range(N) ]

for i in range(N):
    if is_win[i]:
        print('Yes')
    else:
        print('No')
Problem p02911 (python)

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


obj = input().strip().split(' ')
N, K, Q = map(int, obj)

win_count = [0] * N
for _ in range(Q):
    A_i = int(input().strip())
    win_count[A_i - 1] += 1

is_ok = [True if Q - cnt < K else False for cnt in win_count]

for i in range(N):
    if is_ok[i]:
        print('Yes')
    else:
        print('No')

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


obj = input().strip().split(' ')
N, K, Q = map(int, obj)

winner_list = []
for _ in range(Q):
    A_i = int(input().strip())
    winner_list.append(A_i)

point_list = [K for _ in range(N)]

for A_i in winner_list:
    point_list = [k if i == A_i else k - 1 for i in range(1, N + 1)]

is_win = [True if point_list[i] > 0 else False for i in range(N) ]

for i in range(N):
    if is_win[i]:
        print('Yes')
    else:
        print('No')
Problem p03274 (python)

Fixed submission:
n, k = (int(v) for v in input().split())
x = [int(v) for v in input().split()]

m = 99999999999999999999
for l in range(n-k+1):
    r = l + k - 1
    m = min(m, abs(x[l]) + abs(x[r] - x[l]))
    m = min(m, abs(x[r]) + abs(x[l] - x[r]))
print(m)

Buggy submission (verdict: Runtime Error):
from bisect import (
    bisect_left,
    bisect_right,
)


n, k = map(int, input().split())
x = list(map(int, input().split()))

zi = bisect_left(x, 0)
queue = []
queue.append((zi, zi, zi, 1, x[zi]))
if zi - 1 >= 0:
    queue.append((zi-1, zi-1, zi-1, 1, -x[zi-1]))

mind = 9999999999999999999999999999
while len(queue) > 0:
    i, li, ri, cnt, d = queue.pop()
    #print(i, li, ri, cnt, d)
    if cnt == k:
        mind = d if d < mind else mind
        continue
    if li - 1 >= 0:
        queue.append((li-1, li-1, ri, cnt+1, d+abs(x[li-1] - x[i])))
    if ri + 1 < n:
        queue.append((ri+1, li, ri+1, cnt+1, d+abs(x[ri+1] - x[i])))

print(mind)
Problem p03282 (python)

Fixed submission:
s = list(map(int, list(input())))
k = int(input())

i = 0
while s[i] == 1 and k != 1:
    k -= 1
    i += 1
print(s[i])

Buggy submission (verdict: Runtime Error):
*s, = map(int, list(input()))
k = int(input())

i = 0
while s[i] == 1 and k > 0:
    k -= 1
    i += 1
print(s[i])

Buggy submission (verdict: Runtime Error):
*s, = map(int, list(input()))
k = int(input())

while s[0] == 1 and k > 0:
    k -= 1
    s = s[1:]
print(s[0])
Problem p03777 (python)

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

if a == 'H':
    if b == 'H':
        print('H')
    elif b == 'D':
        print('D')

elif a == 'D':
    if b == 'H':
        print('D')
    elif b == 'D':
        print('H')

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

if a == 'H':
    if b == 'H':
        print('H')
    elif b == 'D':
        print('D')

elif a == 'D':
    if b == 'H':
        print('D')
    elif b == 'D':
        print('H')
Problem p02910 (python)

Fixed submission:
a=list()
b=list()
a="R", "U","D"
b="L", "U", "D"
s=input()
count=0
ans=True
for i in s:
    if count%2==0:
        if i not in a:
            ans=False
    if count%2!=0:
        if i not in b:
            ans=False
    count+=1

if ans==True:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):

            a=list()
b=list()
a="R", "U","D"
b="L", "U", "D"
s=input()
count=0
ans=True
for i in s:
    if count%2==0:
        if i not in a:
            ans=False
    if count%2!=0:
        if i not in b:
            ans=False
    count+=1

if ans==True:
    print('Yes')
else:
    print('No')