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

Fixed submission:
A = [list(map(int,input().split())) for i in range(3)]
A_flat=[]
for i in range(len(A)):
    A_flat.append(A[i][0])
    A_flat.append(A[i][1])
    A_flat.append(A[i][2])

N = int(input())
b = [int(input()) for i in range(N)]
for i in range(len(b)):
    if b[i] in A_flat:
        index = A_flat.index(b[i])
        A_flat[index] = 0

judge=False
for i in range(3):
    if A_flat[0+i] == A_flat[3+i] == A_flat[6+i]:
        print("Yes")
        judge = True
        break
    elif A_flat[0+i*3]==A_flat[1+i*3]==A_flat[2+i*3]:
        print("Yes")
        judge = True
        break
    elif A_flat[0]==A_flat[4]==A_flat[8] or A_flat[2]==A_flat[4]==A_flat[6]:
        print("Yes")
        judge = True
        break

if judge is False:
    print("No")

Buggy submission (verdict: Runtime Error):
A = [list(map(int,input().split())) for i in range(3)]
A_flat=[]
for i in range(len(A)):
    A_flat.append(A[i][0])
    A_flat.append(A[i][1])
    A_flat.append(A[i][2])

N = int(input())
b = [int(input()) for i in range(N)]
for i in range(len(b)):
    if b[i] in A_flat:
        index = A_flat.index(b[i])
        A_flat[index] = 0

 judge=False
for i in range(3):
    if A_flat[0+i] == A_flat[3+i] == A_flat[6+i]:
        print("Yes")
        judge = True
        break
    elif A_flat[0+i*3]==A_flat[1+i*3]==A_flat[2+i*3]:
        print("Yes")
        judge = True
        break
    elif A_flat[0]==A_flat[4]==A_flat[8] or A_flat[2]==A_flat[4]==A_flat[6]:
        print("Yes")
        judge = True
        break

if judge is False:
    print("No")
Problem p02761 (python)

Fixed submission:
N,M = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(M)]

s = [sc[i][0] for i in range(len(sc))]
c = [sc[i][1] for i in range(len(sc))]

judge=False
for i in range(len(s)):
    for j in range(len(s)):
        if s[i]==s[j] and c[i] != c[j]:
            print(-1)
            judge=True
            break
        break




target = [0 for i in range(N)]

if N != 1 and target[0]==0:
    target[0]=1

for i in range(M):
    target[sc[i][0]-1] = sc[i][1]

if judge==False:
    res=0
    for i in range(N):
        res = res + target[i]*(10**(N-i-1))
    if len(str(res)) != N:
        print(-1)
    else:
        print(res)

Buggy submission (verdict: Runtime Error):
judge = False
target = [-1 for i in range(N)]
for i in range(M):
    if sc[i][1] + target[sc[i][0]-1] == sc[i][1]-1 or sc[i][1] + target[sc[i][0]-1] == 2*sc[i][1]:
        target[sc[i][0]-1] = sc[i][1]
    else:
        print(-1)
        judge = True
        break

if judge is False:
    for i in range(N):
        if len(target) == 1:
            if target[0] == -1:
                target[0] = 0
        else:
            if i == 0 and target[i] == -1:
                target[i] = 1
            elif target[i] == -1:
                target[i] = 0

    res = 0
    for i in range(N):
        res = res+target[i]*(10**(N-i-1))
    if len(str(res)) != N:
        print(-1)
    else:
        print(res)
Problem p03401 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A = [0] + A + [0]
wa = 0
rem1=[]
rem2=[]
add=[]

for i in range(1,len(A)):
    wa = wa + abs(A[i-1] - A[i])
    rem1.append(abs(A[i-1]-A[i]))
    rem2.append(abs(A[i]- A[i+1]) if i+1 < len(A) else 0)
    add.append(abs(A[i-1]-A[i+1]) if i+1 < len(A) else abs(A[i-1]))

for j in range(0,len(A)-2):
    print(wa-rem1[j]-rem2[j]+add[j])

Buggy submission (verdict: Runtime Error):
 = int(input())
A = list(map(int, input().split()))
A_index = [i for i in range(N)]
dic = dict(zip(A_index, A))

for j in range(len(A)):
    if j < len(A)-1:
        dic[j] = dic[j+1]
    else:
        del dic[j]

    for i in range(0,len(dic)):
        if i == 0:
            wa = abs(dic[0])
        elif i == len(dic)-1:
            wa = wa + abs(dic[i-1]-dic[i]) + abs(dic[i])
        else:
            wa = wa + abs(dic[i-1]-dic[i])
    print(wa)
    dic[j] = A[j]
Problem p03423 (python)

Fixed submission:
N = int(input())

print(N // 3)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(map(str, input().split()))
if 'Y' in S:
    print('Four')
else:
    print('Three')
Problem p03434 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
sum1 = 0
sum2 = 0
for j in range(N):
    if j%2 == 0:
        sum1 = sum1 + a[j]
    elif j%2 ==1:
        sum2 = sum2 + a[j]
print(sum1 - sum2)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(input()) for i in range(N)]
a.sort(reverse=True)
sum1 = 0
sum2 = 0
for j in range(N):
    if j%2 == 0:
        print(a[j])
        sum1 = sum1 + a[j]
    elif j%2 ==1:
        print(a[j])
        sum2 = sum2 + a[j]
print(sum1 - sum2)
Problem p03128 (python)

Fixed submission:
num_A = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
A.reverse()

INF = 10 ** 6
dp = [-INF for i in range(N + 1)]    # get the max digit size using i matches
dp[0] = 0
for i in range(1, N + 1):
    next_num = [Ai for Ai in A if num_A[Ai] <= i]
    if next_num != []:
        dpi_candidate = [dp[i - num_A[next_numi]] + 1
                         for next_numi in next_num]
        dp[i] = max(dpi_candidate)

remain_match = N
ans = "0"
while remain_match > 0:
    for Ai in A:
        if remain_match >= num_A[Ai] and dp[remain_match - num_A[Ai]] == dp[remain_match] - 1:
            ans += str(Ai)
            remain_match -= num_A[Ai]
            break

print(int(ans[1:]))

Buggy submission (verdict: Runtime Error):
num_A = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
A.reverse()

INF = 10 ** 6
dp = [-INF for i in range(N + 1)]    # get the max digit size using i matches
dp[0] = 0
for i in range(1, N + 1):
    next_num = [Ai for Ai in A if num_A[Ai] <= i]
    if next_num != []:
        dpi_candidate = [dp[i - num_A[next_numi]] + 1
                         for next_numi in next_num]
        dp[i] = max(dpi_candidate)

remain_match = N
ans = "0"
while remain_match > 0:
    for Ai in A:
        if dp[remain_match - num_A[Ai]] == dp[remain_match] - 1:
            ans += str(Ai)
            remain_match -= num_A[Ai]
            break

print(int(ans[1:]))

Buggy submission (verdict: Runtime Error):
num_A = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
A.reverse()

INF = 10 ** 6
dp = [-INF for i in range(N + 1)]    # get the max digit size using i matches
dp[0] = 0
for i in range(1, N + 1):
    next_num = [Ai for Ai in A if num_A[Ai] <= i]
    if next_num != []:
        dpi_candidate = [dp[i - num_A[next_numi]] + 1
                         for next_numi in next_num]
        dp[i] = max(dpi_candidate)

remain_match = N
ans = ""
while 1:
    for Ai in A:
        if dp[remain_match - num_A[Ai]] == dp[remain_match] - 1:
            ans += str(Ai)
            remain_match -= num_A[Ai]
            break
    if remain_match == 0:
        break
print(int(ans))

Buggy submission (verdict: Runtime Error):
num_A = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
A.reverse()

INF = 10 ** 6
dp = [-INF for i in range(N + 1)]    # get the max digit size using i matches
dp[0] = 0
for i in range(1, N + 1):
    next_num = [Ai for Ai in A if num_A[Ai] <= i]
    if next_num != []:
        dpi_candidate = [dp[i - num_A[next_numi]] + 1
                         for next_numi in next_num]
        dp[i] = max(dpi_candidate)

remain_match = N
ans = ""
while remain_match > 0:
    for Ai in A:
        if dp[remain_match - num_A[Ai]] == dp[remain_match] - 1:
            ans += str(Ai)
            remain_match -= num_A[Ai]
            break

print(int(ans))
Problem p03147 (python)

Fixed submission:
def main():
    N = int(input())
    h_lst = list(map(int, input().split()))
    while h_lst[0] == 0:
        del h_lst[0]
        if h_lst == []:
            break
    ans = 0
    while len(h_lst) > 0:
        r = len(h_lst) - 1
        for i in range(len(h_lst) - 1):
            if h_lst[i + 1] == 0:
                r = i
                break

        block_min = min(h_lst[:r + 1])
        for i in range(r + 1):
            h_lst[i] -= block_min
        ans += block_min

        while h_lst[0] == 0:
            del h_lst[0]
            if h_lst == []:
                break

    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    h_lst = list(map(int, input().split()))
    while h_lst[0] == 0:
        h_lst = h_lst[1:]
    ans = 0
    while len(h_lst) > 0:
        r = len(h_lst) - 1
        for i in range(len(h_lst) - 1):
            if h_lst[i + 1] == 0:
                r = i
                break

        block_min = min(h_lst[:r + 1])
        for i in range(r + 1):
            h_lst[i] -= block_min
        ans += block_min

        while h_lst[0] == 0:
            del h_lst[0]
            if h_lst == []:
                break

    print(ans)


if __name__ == "__main__":
    main()
Problem p03469 (python)

Fixed submission:
str = input()
print(str[:3] + "8" + str[4:])

Buggy submission (verdict: Runtime Error):
n = int(input())
list = []
i = 0
for k in range(n):
    d = int(input())
    if d in list:
        pass
    else:
        list.append(d)
print(len(list))
Problem p03477 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
l = a + b
r = c + d
if l == r:
    print("Balanced")
elif l < r:
    print("Right")
else:
    print("Left")

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
l = a + b
r = c + d
if l == r:
    print(Balanced)
elif l < r:
    print(Right)
else:
    print(Left)
Problem p03293 (python)

Fixed submission:
s = input(); t = input()
c = 0 #無限ループを防ぐためのカウンターを設置
     
while (s != t):
	s = s[-1] + s[:-1]
	c += 1
	if c == len(s):
		print('No')
		break
        
if s == t:
	print('Yes')

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
a=0
while(s!=t):
	s =s[-1]+s[:-1]
	a+=1
    if a==len(s):
    	print("NO")
        break
if s==t:
	print("YES")
Problem p03997 (python)

Fixed submission:
a,b,h = [int(input()) for i in range(3)]
print(int((a + b)*h/2))

Buggy submission (verdict: Runtime Error):
a,b,h = [int(input()) for i in range(3)
print((a + b)*h/2)
Problem p04043 (python)

Fixed submission:
word = list(map(int,input().split()))
#print(word) ['5', '5', '7']
a=0
b=0
for i in range(3):
    if word[i]==int(5):
        a=a+1
for i in range(3):
    if word[i]==int(7):
        b=b+1
if a==2 and b==1:
	print("YES")
else:
  	print("NO")

Buggy submission (verdict: Runtime Error):
    num = list(map(int,input().split()))
    a=0
    b=0
    for i in range(3):
    	if num[i]==5:
    		a+=1
    	if num[i]==7:
    		b+=1
    if a==2 and b==1:
    	print("YES")
    else:
    	print("NO")

Buggy submission (verdict: Runtime Error):
num = list(map(int,input().split()))
a=0
b=0
for i in range(3):
	if num[i]==5:
		a+=1
	if num[i]==7:
		b+=1
if a==2 and b==1:
	print(YES)
else:
	print(NO)

Buggy submission (verdict: Runtime Error):
word = list(input())
#print(word) ['5', '5', '7']
a=0
b=0
for i in range(3):
	if word[i]==5:
    	a=a+1
for i in range(3):
	if word[i]==7:
      	b=b+1
if a=2 and b=1:
	print("YES")
else:
  	print("NO")
Problem p04044 (python)

Fixed submission:
n = list(map(int,input().split()))
word = [input() for i in range(n[0])]
print(''.join(sorted(word)))

Buggy submission (verdict: Runtime Error):
num = list(map(input().split()))
word = [input() for i in range(num[0])]
print(''.join(sorted(word)))

Buggy submission (verdict: Runtime Error):
num = list(map(int,input().split()))
word = [input for i in range(n[0])]
print(''.join(sorted(num)))

Buggy submission (verdict: Runtime Error):
n = list(map(int,input().split()))
word = [input() for i in range(n[1])]
print(''.join(sorted(word)))

Buggy submission (verdict: Runtime Error):
n = list(map(int,input().split()))
word = [input() for i in range(n[1])]
print(word)
print(''.join(sorted(word)))
Problem p02765 (python)

Fixed submission:
tmp = list(input().split(" "))

N = int(tmp[0])
R = int(tmp[1])

if N < 10:
  print(100 * (10 - N) + R)
else:
  print(R)

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

N = int(tmp[0])
R = int(tmp[1])

if N < 10:
  print(100 * (10 - N) + R)
else:
  print(R)
Problem p02767 (python)

Fixed submission:
import numpy as np

N = int(input())
x = np.array(list(map(int, input().split())))
s = np.sum(np.square(x))

for i in range(1, 101):
    s = min(s, np.sum(np.square(x-i)))

print(s)

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

N = int(input())
x = np.array(list(map(int, input().split())))
s = np.sum(np.square(x))

for i in range(1, 101):
    s = min(s, np.sum(np.square(x-i)))

print(s)
Problem p02946 (python)

Fixed submission:
K, X = map(int, input().split())
for i in range(X-K+1, K+X):
    print(i, end=" ")

Buggy submission (verdict: Runtime Error):
# My answer. (In doubt!!)
# K, X = map(int, input().split())
# for i in range(X-K+1, K+X):
#     print(i, end=" ")

# This is the most optimal code as Coder I believe.
K, X = map(int, input().split())
l = max(-1000000, x - k + 1)
r = min(1000000, x + k - 1)
for i in range(l, r + 1):
    print(i)

# The official answer is as below.
# https://img.atcoder.jp/abc137/editorial.pdf
Problem p03220 (python)

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
z=[abs(t-x*0.006-a) for x in h]
print(z.index(min(z))+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
h = list(map(int, input().split()))
t = [abs(T - i * 0.006 - A) for i in h]
print(h.index(min(t)) + 1)
Problem p03471 (python)

Fixed submission:
N, Y = map(int, input().split())
ans = -1, -1, -1

for x in range(N+1):
    for y in range(N-x+1):
        z = N - x - y
        if z <= 2000 and \
                x*10000 + y*5000 + z*1000 == Y:
            ans = x, y, z
            break
    else:
        continue
    break

print(*ans)

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

for z in range(N+1):
    for y in range(N-x+1):
        if (Y-y-z)*10000 + y*5000 + z*1000 == Y:
            print((Y-y-z), y, z)
            exit()
else:
    print("-1 -1 -1")
Problem p02768 (python)

Fixed submission:
import numpy as np
N,a,b = np.array(input().split()).astype(int)
mod = 10**9+7
def power(x, n):
    ans = 1
    while(n > 0):
        if(bin(n & 1) == bin(1)):
            ans = ans*x%mod
        x = (x*x)%mod
        n = n >> 1 #ビットシフト
    return ans
def fact(m, n):
    val = 1
    for i in range(m, n+1):
        val = val*i % mod
    return val
    
def cmb1(N, r):
    A = fact(N-r+1, N)%mod
    B = fact(1, r)%mod
    return A, B, (A*power(B, mod-2))%mod
def cmb2(a, b, A, B):
    A = fact(N-a+1, N-b)*A%mod
    B = fact(b+1, a)*B%mod
    return (A*power(B, mod-2))%mod
if(a>N//2):
    a = N-a
if(b>N//2):
    b = N-b
tmp = max(a,b)
b = min(a,b)
a = tmp
A, B, K1 = cmb1(N, b)
K2 = cmb2(a, b, A, B)
print((power(2, N)-1-K1-K2)%mod)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,a,b = np.array(input().split()).astype(int)
mod = 10**9+7
import math
def power(x, n):
    ans = 1
    while(n > 0):
        if(bin(n & 1) == bin(1)):
            ans = ans*x%mod
        x = x*x%mod
        n = n >> 1 #ビットシフト
    return ans
def fact(m, n):
    val = 1
    for i in range(m, n + 1):
        val = (val*i)%mod
    return val
def cmb(N, r):
print((power(2, N)-1-cmb(N, a)-cmb(N, b))%mod)

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
N,a,b = np.array(input().split()).astype(int)
def cmb(N, r, mod):
  A = math.factorial(N)
  B = math.factorial(r)
  C = math.factorial(N-r)
  return A*B**(10**9+5)*C**(10**9+5)
print(2**N-1-cmb(N, a)-cmb(N, b))

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
N,a,b = np.array(input().split()).astype(int)
def cmb(N, r, mod):
  A = math.factorial(N)
  B = math.factorial(r)
  C = math.factorial(N-r)
  return A*B**(10**9+5)*C**(10**9+5)
print(2**N-1-cmb(N, a)-cmb(N, b))

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
N,a,b = np.array(input().split()).astype(int)
print(2**N-1-math.factorial(N)//(math.factorial(a)*math.factorial(N-a))-math.factorial(N)//(math.factorial(b)*math.factorial(N-b))

Buggy submission (verdict: Runtime Error):
import numpy as np
N,a,b = np.array(input().split()).astype(int)
for i in range(1,N+1):
  S = 0
  if((i!=a)&(i!=b)):
    S += math.factorial(N)/(math.factorial(i)*math.factorial(N-1))
print(S%(10**9+7))

Buggy submission (verdict: Runtime Error):
N,a,b = np.array(input().split()).astype(int)
for i in range(1,N+1):
  S = 0
  if((i!=a)&(i!=b)):
    S += math.factorial(N)/(math.factorial(i)*math.factorial(N-1))
print(S%(10**9+7))
Problem p02791 (python)

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

pmin = p[0]
ans = 0
for i in range(n):
    if p[i] <= pmin:
        ans += 1
        pmin = p[i]

print(ans)

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

pmin = p[0]
ans = 0
for i in range(n):
    if p[i] <= pmin:
        ans += 1
    pmin = min(pmin, p[i])

print(ans
Problem p02802 (python)

Fixed submission:
n, m = map(int, input().split())
ac = 0
wa = 0

ac_tf = [0] * n
wa_num = [0] * n

for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == "AC":
        if ac_tf[p] == 0:
            ac += 1
            wa += wa_num[p]
            ac_tf[p] = 1
    else:
        wa_num[p] += 1
            
print(ac, wa)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
p = [list(input().split()) for _ in range(m)]

ac = 0
wa = 0
prob = 0

for i in range(m):
    if p[i][0] != prob:
        if p[i][1] == "WA":
            wa += 1
        elif p[i][1] == "AC":
            ac += 1
            prob = p[i][0]
            
print(ac, wa
Problem p02818 (python)

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

if a <= k :
	k = k - a
	a = 0	
	if b < k :
		b = 0
	else :
		b = b - k

else :
	a = a - k

print(a, b)

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

if a < k :
	k = k - a
	a = 0	
	if b < k :
		b = 0
	else :
		b = b - k

else :
	a = a - k

print(a, b
Problem p02899 (python)

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

ans = [0] * n

for i in range(n):
    s = a[i]
    ans[s-1] = i + 1

print(*ans)

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

ans = []

for i in range(n):
    s = a[i]
    ans[s-1] = i + 1
    
print(ans)

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

random.shuffle(a)

print(a)
Problem p02900 (python)

Fixed submission:
a,b = map(int,input().split())
 
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:   
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
  
s = set(prime_decomposition(a))
t = set(prime_decomposition(b))
 
print(len(s&t) + 1)

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

def prime_factorization(x):
    table = []
    i = 2
    while i * i <= x :
        if x % i == 0 :
          	n /= i
            table.append(i)
        i += 1

    if x > 1 :
        table.append(x)
    return table

v = set(prime_factorization(a))
w = set(prime_factorization(b))

print(len(v&w) + 1)
Problem p02923 (python)

Fixed submission:
n = int(input())

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

ans = 0
result = 0

for x in range(n - 1):
    if h[x] >= h[x + 1] :
        result += 1
    else :
        ans = max(ans, result)
        result = 0
ans = max(ans, result)

print(ans)

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

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

ans = []
result = 0

for x in range(n - 1):
    if h[x] >= h[x + 1] :
        result += 1
        ans.append(result)
    else :
        ans.append(result)
        result = 0

print(max(ans))
Problem p02969 (python)

Fixed submission:
r = int(input())

print(3 * r * r)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
b = sorted(a)

for A in a:
    if A == b[n - 1]:
        print(b[n - 2])
    else:
        print(b[n - 1])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
b = sorted(a)

for A in a:
    if A == b[n - 1]:
        print(b[n - 2])
    else:
        print(b[n - 1])
Problem p02761 (python)

Fixed submission:


n, m = map(int, input().split())

digits = {i: None for i in range(n)}
def main():
    string = ""
    for i in range(m):
        s, c = map(int, input().split())
        if digits[s-1] is not None and digits[s-1] != c:
            return -1
        digits[s-1] = c

    if n==1 and m==0:
        return 0

    for i, d in digits.items():
        if d is not None:
            if i==0 and d == 0:
                if n==1:
                    return 0
                return -1
            string += str(d)
        else:
            if i==0:
                string+= "1"
            else:
                string += "0"
    return int(string)

print(main())

Buggy submission (verdict: Runtime Error):

v = []
m = [False for _ in range(9)]
for i in range(3):
    a, b, c = map(int, input().split())
    v += [a, b, c]

n = int(input())
for i in range(n):
    a = int(input())
    if a in v:
        m[v.index(a)] = True

def control():
    for i in range(3):
        if all(m[3*i:3*i+3]):
            return True
        if all(m[i::3]):
            return True

    if all(m[::4]) or all(m[2:8:2]):
        return True
    return False

print("Yes" if control() else "No")
Problem p02772 (python)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
def test():
  for i in l:
    if i%2 == 0 and i%3!=0 and i%5!=0:
      return "DENIED"
  return "APPROVED"
print(test())

Buggy submission (verdict: Runtime Error):
    n = int(input())
    l = list(map(int, input().split()))
    def test():
      for i in l:
        if i%2 != 0 and i%3!=0 and i%5!=0:
          return "DENIED"
      return "APPROVED"
    print(test())
Problem p02811 (python)

Fixed submission:
k , x = map(int,input().split())

if k*500 >= x:
  print('Yes')
else:
  print('No')

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

if k*500 >= x:
  print('Yes')
else:
  print('No')
Problem p02830 (python)

Fixed submission:
n = int(input())
s,t = input().split()
l = ''
for i in range(n):
    l += s[i]
    l += t[i]
print(l)

Buggy submission (verdict: Runtime Error):
n = int(input)
s, t= map(str,input().split())

l = ' '

for i in range(n)
  l += s[i]
  l += t[i]

  print(l)