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

Fixed submission:
n, m, x = map(int, input().split())
b = 10**18
tm = []
for i in range(n):
    tm.append(list(map(int, input().split())))
for i in range(2**n):
    c = [0 for i in range(m)]
    sum = 0
    for j in range(n):
        if (i >> j) & 1:
            sum += tm[j][0]
            for k in range(m):
                c[k] += tm[j][k+1]
    if min(c) >= x:
        b = min(b, sum)
if b == 10**18:
    print('-1')
else:
    print(b)

Buggy submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
b = 10**18
tm = []
for i in range(m):
    tm.append(list(map(int, input().split())))
for i in range(2**n):
    c = [0 for i in range(m)]
    sum = 0
    for j in range(n):
        if (i >> j) & 1:
            sum += tm[j][0]
            for k in range(m):
                c[k] += tm[j][k+1]
    if min(c) >= x:
        b = min(b, sum)
if min == 10**18:
    print('-1')
else:
    print(b)

Buggy submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
b = 10**18
tm = []
for i in range(m):
    tm.append(list(map(int, input().split())))
for i in range(2**n):
    c = [0 for i in range(m)]
    sum = 0
    for j in range(n):
        if (i >> j) & 1:
            sum += tm[j][0]
            for k in range(m):
                c[k] += tm[j][k+1]
    if min(c) >= x:
        b = min(b, sum)
if min == 10**18:
    print('-1')
else:
    print(b)
Problem p02731 (python)

Fixed submission:
l = int(input())
x = (l / 3)
print(pow(x, 3))

Buggy submission (verdict: Runtime Error):
L = int(input())
x = (l / 3)
print(pow(x, 3))
Problem p03014 (python)

Fixed submission:
import numpy as np

H, W = map(int, input().split())
S_list = [list(input()) for _ in range(H)]
S_list=(np.array(S_list) ==".")*1

L = np.zeros((H, W), int)
R = np.zeros((H, W), int)
U = np.zeros((H, W), int)
D = np.zeros((H, W), int)

for w in range(W):
    if w == 0:
        L[:,w] = S_list[:,w]
        R[:,W-w-1] = S_list[:,W-w-1]
    else:
        L[:,w] = (L[:,w-1]+1) * S_list[:,w]
        R[:,W-w-1] = (R[:,W-w]+1) * S_list[:,W-w-1]

for h in range(H):
    if h == 0:
        U[h,:] = S_list[h,:]
        D[H-h-1,:] = S_list[H-h-1,:]
    else:
        U[h,:] = (U[h-1,:]+1) * S_list[h,:]
        D[H-h-1,:] = (D[H-h,:]+1) * S_list[H-h-1,:]
        
ans = max(np.max(L+R+U+D-3), 0)

print(ans)

Buggy submission (verdict: Runtime Error):
import re

H, W = map(int, input().split())
S_list = [list(input()) for _ in range(H)]

l_count = [[i.span()[0] for i in re.finditer('#', s+'#')] for s in S_list]

r_count = [[i.span()[0] for i in re.finditer('#', ''.join(s)+'#')] for s in list(zip(*S_list))]

ans = 0
    
for h in range(H):
    for w in range(W):
        if line[h][w] == '.':
            l_light = 0
            r_light = 0
            for l in l_count[h]:
                if(w < l):
                    l_light = l - l_light
                    break
                l_light = l+1
            for r in r_count[w]:
                if(h < r):
                    r_light = r - r_light
                    break
                r_light = r+1
            
            ans = max(ans, l_light+r_light-1)

print(ans)
Problem p02690 (python)

Fixed submission:
import sys

x = int(input())
flag = False
a = 0

while True:
    for b in range(-a+1,a):
        if  a ** 5 - b  ** 5 == x:
            print(a,int(b))
            sys.exit()
    a += 1

Buggy submission (verdict: Runtime Error):
import sys

x = int(input())
flag = False
a = 0

while True:
    if x - a**5 <= 0:
        b_sub = pow(x - a**5,1/5)
    else:
        b_sub = (-1)*pow(x - a**5,1/5)
    # if int(b_sub) - b_sub == 0:
    if b_sub.is_integer():
        # flag = True
        print(a,int(b_sub))
        sys.exit()
    a += 1

Buggy submission (verdict: Runtime Error):
x = int(input())
flag = False
a = 0

while flag == False:
    if x - a**5 <= 0:
        b_sub = pow(x - a**5,1/5)
    else:
        b_sub = (-1)*pow(x - a**5,1/5)
    if b_sub.is_integer():
        flag = True
        print(a,int(b_sub))
    a += 1
Problem p02716 (python)

Fixed submission:

n = int(input())
a_list = list(map(int,input().split()))

if n == 2 or n == 3:
    print(max(a_list))
elif n % 2 == 0: # 1パス使える
    dp = [[-float('inf') for _ in range(n)] for __ in range(2)]
    dp[1][-1] = a_list[-1]

    for j in reversed(range(2)):
        for i in reversed(range(n)):
            if j == 1 and i >= n-2:
                pass
            elif j == 1:
                dp[j][i] = dp[j][i+2] + a_list[i]
            elif i == n-2:
                dp[j][i] = dp[j+1][i+1]
            elif i > n-2:
                pass
            else:
                dp[j][i] = max(dp[j+1][i+1],dp[j][i+2] + a_list[i])
    print(dp[0][0])
else: # 2パス使える
    dp = [[-float('inf') for _ in range(n)] for __ in range(3)]
    dp[2][-1] = a_list[-1]

    for j in reversed(range(3)):
        for i in reversed(range(n)):
            if j == 2 and i >= n-2:
                pass
            elif j == 2:
                dp[j][i] = dp[j][i+2] + a_list[i]
            elif i == n-2:
                dp[j][i] = dp[j+1][i+1]
            elif i > n-2:
                pass
            else:
                dp[j][i] = max(dp[j+1][i+1],dp[j][i+2] + a_list[i])
    print(dp[0][0])

Buggy submission (verdict: Runtime Error):

n = int(input())
a_list = list(map(int,input().split()))

if n % 2 == 0: # 1パス使える
    dp = [[-float('inf') for _ in range(n)] for __ in range(2)]
    dp[1][-1] = a_list[-1]

    for j in reversed(range(2)):
        for i in reversed(range(n)):
            if j == 2 and i >= n-2:
                pass
            elif j == 2:
                dp[j][i] = dp[j][i+2] + a_list[i]
            elif i == n-2:
                dp[j][i] = dp[j+1][i+1]
            elif i > n-2:
                pass
            else:
                dp[j][i] = max(dp[j+1][i+1],dp[j][i+2] + a_list[i])
    print(dp[0][0])
else: # 2パス使える
    dp = [[-float('inf') for _ in range(n)] for __ in range(3)]
    dp[2][-1] = a_list[-1]

    for j in reversed(range(3)):
        for i in reversed(range(n)):
            if j == 2 and i >= n-2:
                pass
            elif j == 2:
                dp[j][i] = dp[j][i+2] + a_list[i]
            elif i == n-2:
                dp[j][i] = dp[j+1][i+1]
            elif i > n-2:
                pass
            else:
                dp[j][i] = max(dp[j+1][i+1],dp[j][i+2] + a_list[i])
    print(dp[0][0])
Problem p03076 (python)

Fixed submission:
num_list = [int(input()) for i in range(5)]

remains = []
divs = []

for num in num_list:
    remains.append(num % 10)
    divs.append(num // 10)

zeros = remains.count(0)

for i in range(remains.count(0)):
    remains.remove(0)

if len(remains) == 0:
    print(sum(divs) * 10)
else:
    print(sum(divs) * 10 + 40 - zeros * 10 + min(remains))

Buggy submission (verdict: Runtime Error):
num_list = [int(input()) for i in range(5)]

remains = []
divs = []

for num in num_list:
    remains.append(num % 10)
    divs.append(num // 10)

zeros = remains.count(0)

for i in range(remains.count(0)):
    remains.remove(0)

print(sum(divs) * 10 + 40 - zeros * 10 + min(remains))
Problem p03355 (python)

Fixed submission:
import math as ma
import sys
from sys import exit
from decimal import Decimal as dec
from itertools import permutations


def li():
	return list(map(int , input().split()))


def num():
	return map(int , input().split())


def nu():
	return int(input())


def find_gcd(x , y):
	while (y):
		x , y = y , x % y
	return x


s=input()
k=nu()
n=len(s)
m=k
z=set()
for i in range(n):
	pp=""
	for j in range(i,i+m):
		if(j>=n):
			break
		pp+=s[j]
		z.add(pp)
fin=list(z)
fin.sort()
print(fin[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=nu()
n=len(s)
z=set()
for i in range(n):
	pp=""
	for j in range(i,n):
		pp+=s[j]
		z.add(pp)
fin=list(z)
fin.sort()
print(fin[k-1])
Problem p02681 (python)

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

# import numpy as np
# from itertools import *
# from collections import *

# S = input()
# N = int(input())
# K, N = [int(x) for x in input().split()]

S = input()

T = input()

if T[0:len(S)] == S and len(S) + 1 == len(T):
    print("Yes")
else:
    print("No")

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

# import numpy as np
# from itertools import *
# from collections import *

# S = input()
# N = int(input())
# K, N = [int(x) for x in input().split()]

N = int(input())

S = []
score = [(0,0)] * N

for n in range(N):
    S.append(input())
    while "()" in S[n]:
        S[n] = S[n].replace("()", "")

    if len(S[n]) >= 1:
        beg = S[n].count("(")
        end = S[n].count(")")

        if S[n][0] == "(":
            score[n] = (0, beg)
        else:
            score[n] = (-end, beg)
    else:
        score[n] = (0, 0)

score.sort(reverse=True)

cr = 0
for n in range(N):
    if score[n][0] == 0:
        cr += score[n][1]

for n in range(N):
    if score[n][0] > 0:
        if cr - score[n][0] < 0:
            print("No")
            exit(0)
        cr += sum(score[n])

for n in range(N):
    if score[n][0] < 0:
        cr += sum(score[n])
        if cr < 0:
            print("No")
            exit(0)

if cr == 0:
    print("Yes")
else:
    print("No")
Problem p03457 (python)

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

import numpy as np

N = int(input())
prev_dst = [0,0,0]

for n in range(N):
    t, x, y = map(int, input().split(" "))
    a = (t - prev_dst[0]) - (np.abs(prev_dst[1]-x) + np.abs(prev_dst[2]-y))
    if a >= 0 and a % 2 == 0:
        prev_dst = [t, x, y]
    else:
        print("No")
        exit(0)

print("Yes")

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

import numpy as np

N = int(input())
dst = np.array([[int(x) for x in input().split(" ")] for z in range(N)])
prev_dst = np.array([0] * 3)

for n in range(N):
    t,x,y = map(int, input().split(" "))
    a = (prev_dst[0] - t) - (np.abs(prev_dst[1]-x) + np.abs(prev_dst[2]-y))
    if a >= 0 and a % 2 == 0:
        prev_dst = [t,x,y]
    else:
        print("No")
        exit(0)

print("Yes")
Problem p03564 (python)

Fixed submission:
n=int(input())
k=int(input())
i=0
while i < n and 2**i<=k:
    i+=1
print(2**i+k*(n-i))

Buggy submission (verdict: Runtime Error):
n=int(input())
k=int(input())
i=0
while i < n && 2**i<=k:
    i+=1
print(2**i+k*(n-i))
Problem p02789 (python)

Fixed submission:
I,U = input().split()
print("Yes" if I==U else "No")

Buggy submission (verdict: Runtime Error):
I,U = input().split()
print("Yes" if I==U else No)
Problem p02687 (python)

Fixed submission:
str = input()

if str == "ABC":
    print("ARC")
else:
    print("ABC")

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

if str == "ABC":
    print(ARC)
else:
    print(ABC)
Problem p03455 (python)

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

i = s[0] * s[1]
if i % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
#print("Enter Number")
a = int(input())
b = int(input())

i = a * b
if i % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
print("Enter Number")
a = int(input())
b = int(input())

i = a * b
if i % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p02681 (python)

Fixed submission:
s = input()
t = input()

if (s == t[0:len(t)-1]):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
def can_reach_the_goal(u, x):
    return min(u) >= x

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

c = []
a = []
for i in range(n):
    ca = [int(row) for row in input().split()]
    c.append(ca[0])
    a.append(ca[1:])

INF = 10**7
min_cost = INF
for k in range(2**n):
    purchase = [True if c == '1' else False for c in list(format(k, '0{}b'.format(n)))]
    cost = 0
    u = [0]*m
    for i in range(n):
        cost += c[i] if purchase[i] else 0
        for j in range(m):
            u[j] += a[i][j] if purchase[i] else 0

    if can_reach_the_goal(u, x) and cost < min_cost:
        min_cost = cost

if min_cost == INF:
    print(-1)
else:
    print(min_cost)
Problem p02683 (python)

Fixed submission:
def can_reach_the_goal(u, x):
    return min(u) >= x

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

c = []
a = []
for i in range(n):
    ca = [int(row) for row in input().split()]
    c.append(ca[0])
    a.append(ca[1:])

INF = 10**7
min_cost = INF
for k in range(2**n):
    purchase = [True if c == '1' else False for c in list(format(k, '0{}b'.format(n)))]
    cost = 0
    u = [0]*m
    for i in range(n):
        cost += c[i] if purchase[i] else 0
        for j in range(m):
            u[j] += a[i][j] if purchase[i] else 0

    if can_reach_the_goal(u, x) and cost < min_cost:
        min_cost = cost

if min_cost == INF:
    print(-1)
else:
    print(min_cost)

Buggy submission (verdict: Runtime Error):
ef can_reach_the_goal(u, x):
    return min(u) >= x

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

c = []
a = []
for i in range(n):
    ca = [int(row) for row in input().split()]
    c.append(ca[0])
    a.append(ca[1:])

INF = 10**7
min_cost = INF
for k in range(2**n):
    purchase = [True if c == '1' else False for c in list(format(k, '0{}b'.format(n)))]
    cost = 0
    u = [0]*m
    for i in range(n):
        cost += c[i] if purchase[i] else 0
        for j in range(m):
            u[j] += a[i][j] if purchase[i] else 0

    if can_reach_the_goal(u, x) and cost < min_cost:
        min_cost = cost

if min_cost == INF:
    print(-1)
else:
    print(min_cost)

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

def can_reach_the_goal(u, x):
    return min(u) >= x

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

c = []
a = []
u = [0]*m
u_sum = [0]*n
for i in range(n):
    ca = [int(row) for row in input().split()]
    c.append(ca[0])
    a.append(ca[1:])
    u_sum[i] += sum(a[i])
    for j in range(m):
        u[j] += a[i][j]

if not can_reach_the_goal(u, x):
    print(-1)
    sys.exit(-1)

idx_c = list(np.argsort(-1 * np.array(c)))
c_sum = sum(c)
for i in idx_c:
    u_tmp = [u[j] - a[i][j] for j in range(m)]
    if can_reach_the_goal(u_tmp, x):
        c_sum -= c[i]
        u = u_tmp

print(c_sum)

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

def can_reach_the_goal(u, x):
    return min(u) >= x

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

c = []
a = []
u = [0]*m
u_sum = [0]*n
for i in range(n):
    ca = [int(row) for row in input().split()]
    c.append(ca[0])
    a.append(ca[1:])
    u_sum[i] += sum(a[i])
    for j in range(m):
        u[j] += a[i][j]

if not can_reach_the_goal(u, x):
    print(-1)
    sys.exit(-1)

idx_c = list(np.argsort(-1 * np.array(c)))
c_sum = sum(c)
for i in idx_c:
    print(c[i])
    u_tmp = [u[j] - a[i][j] for j in range(m)]
    if can_reach_the_goal(u_tmp, x):
        c_sum -= c[i]
        u = u_tmp

print(c_sum)
Problem p02687 (python)

Fixed submission:
s = input()
if s == 'ABC':
	print('ARC')
else:
	print('ABC')

Buggy submission (verdict: Runtime Error):
s = input()
if s == 'ABC':
	print('ARC)
else:
	print('ARC')

Buggy submission (verdict: Runtime Error):
s = input()
if s = 'ABC':
	print('ARC)
else:
	print('ARC')
Problem p02999 (python)

Fixed submission:
x, a = map(int, input().split())
print(10 if x - a >= 0 else 0)

Buggy submission (verdict: Runtime Error):
x, a = map(int, input())
print(10 if x - a >= 0 else 0)
Problem p03030 (python)

Fixed submission:
from operator import itemgetter

n = int(input())
 
data = []
for i in range(n):
    city, point = input().split()
    data.append([city, int(point), i+1])

data = sorted(data, key=itemgetter(1), reverse=True)
data = sorted(data, key=itemgetter(0), reverse=False)

for i in range(n):
    print(data[i][2])

Buggy submission (verdict: Runtime Error):
import numpy as np
import pandas as pd
n = int(input())

df = pd.DataFrame([], columns=['num','city','score'],index=range(n))
for i in range(n):
    s, p = input().split()
    df.iloc[i,:] = np.array([i + 1, s, int(p)])

for i in df.sort_values(['city','score'], ascending=[True,False])['num']:
    print(i)
Problem p02681 (python)

Fixed submission:
S=input()
T=input()
if (S==T[:len(T)-1]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A,B,C,K=map(int,input().split())
if (A>=K):
	print(K)
else:
	K = K-A
	if (B>=K):
		print(A)
	else:
		K = K-B
		print(A-K)

Buggy submission (verdict: Runtime Error):
A,B,C,K=map(int,input().split())
if (A>=K):
  print(K)
else:
  K = K-A
  if (B>=D):
    print(A)
  else:
    K = K-B
    print(A-K)

Buggy submission (verdict: Runtime Error):
A,B,C,K=map(int,input().split())
if (A>=K):
  print(K)
else:
  D = K-A
  if (B>=D):
    print(A)
  else:
    D = D-B
    print(A-D)
Problem p03029 (python)

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

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

Fixed submission:
def gcd(a,b):
	if a==0:
		return b
	return gcd(b%a,a)

def find_lcm(num1, num2):
    if(num1>num2):
        b = num1
        a = num2
    else:
        b = num2
        a = num1
    G = gcd(a,b)
    lcm = (num1*num2)//G
    return lcm
     
N=int(input())
A=list(map(int,input().split()))
lcm = find_lcm(A[0],A[1])
for I in range(2, N):
    lcm = find_lcm(lcm, A[I])
Ans=0
lcm-=1
for I in range(N):
	Ans+=(lcm%A[I])
print(Ans)

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
	if a==0:
		return b
	return gcd(b%a,a)

def find_lcm(num1, num2):
    if(num1>num2):
        b = num1
        a = num2
    else:
        b = num2
        a = num1
    G = gcd(a,b)
    lcm = int(int(num1 * num2)/int(G))
    return lcm
     
N=int(input())
A=list(map(int,input().split()))
lcm = find_lcm(A[0],A[1])
for I in range(2, N):
    lcm = find_lcm(lcm, A[I])
Ans=0
lcm-=1
for I in range(N):
	Ans+=(lcm%A[I])
print(Ans)

Buggy submission (verdict: Runtime Error):
def find_lcm(num1, num2):
    if(num1>num2):
        num = num1
        den = num2
    else:
        num = num2
        den = num1
    rem = num % den
    while(rem != 0):
        num = den
        den = rem
        rem = num % den
    gcd = den
    lcm = int(int(num1 * num2)/int(gcd))
    return lcm
     
N=int(input())
A=list(map(int,input().split()))
N1 = A[0]
N2 = A[1]
lcm = find_lcm(N1,N2)
for i in range(2, N):
    lcm = find_lcm(lcm, A[i])
Ans=0
lcm-=1
for I in range(N):
	Ans+=(lcm%A[I])
print(Ans)
Problem p03351 (python)

Fixed submission:
A,B,C,D=map(int,input().split())
E=abs(A-B)
F=abs(A-C)
G=abs(B-C)
if F<=D or (E<=D and G<=D):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
X=int(input())
C=1
if (X==1):
	print(1)
else:
	for J in range(2,100):
		for I in range(2,X+1):
			if pow(I,J)<=X:
				if pow(I,J)>C:
					C=pow(I,J)
			else:
				break
print(C)
Problem p03359 (python)

Fixed submission:
a,b=map(int,input().split())
if a==b:
	print(b)
elif b<a:
	print(a-1)
else:
	print(a)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>=b:
	print(b)
else
	print(a)
Problem p03447 (python)

Fixed submission:
X=int(input())
A=int(input())
B=int(input())
print((X-A)%B)

Buggy submission (verdict: Runtime Error):
def countSol(coeff, start, end, rhs, a):
	if (rhs == 0):
		return 1
	result = 0
	for I in range(start,end+1):
		if (coeff[I]<=rhs and a[I]>=0):
			a[I]-=1
			result+=countSol(coeff, I, end, rhs - coeff[I],a)
	return result 
A=int(input())
B=int(input())
C=int(input())
X=int(input())
D=[A,B,C]
print(countSol([500,100,50],0,2,X,D))
Problem p02681 (python)

Fixed submission:
S=input()
T=input()
if 1<=len(S)<=10 and (S.islower() and S.islower()) and S==T[:-1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
maxi=2*A-K+B
print(maxi)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
K=int(input())
maxi=2*A-K+B
print(maxi)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
K=int(input())
maxi=2*A-K+B
print(maxi)
Problem p02681 (python)

Fixed submission:
S=input()
T=input()
if S==T[:-1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
list = list(map(int,input().split()))
a = 1
list2=[]
begin = 0
time = 0
flag=False
while flag==False:
    a = list[a-1]
    for i,x in enumerate(list2):
        if x == a:
            begin=i
            time = len(list2)-begin
            flag=True
    list2.append(a)
if K<=begin:
    print(list2[K-1])
else:
    print(list2[begin:begin+time][(K-begin)%time-1])
Problem p03076 (python)

Fixed submission:
l = [int(input()) for _ in range(5)]
ans = 0
m = []
for i in range(5):
    if l[i] % 10 != 0:
        m.append(l[i] % 10)
m.sort()
for i in l:
    if i % 10 != 0:
        ans += ((i // 10) + 1) * 10
    else:
        ans += i
if m != []:
    print(ans - 10 + m[0])
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
l = [int(input()) for _ in range(5)]
ans = 0
m = []
for i in range(5):
    if l[i] % 10 != 0:
        m.append(l[i] % 10)
m.sort()
for i in l:
    if i % 10 != 0:
        ans += ((i // 10) + 1) * 10
    else:
        ans += i
print(ans - 10 + m[0])
Problem p02957 (python)

Fixed submission:
a, b = map(int, input().split())
v = (a + b) // 2
if abs(a - v) == abs(b - v):
    print(v)
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
v = (a + b) // 2
if abs(a - v) == abs(b - v)
    print(v)
else:
    print('IMPOSSIBLE')
Problem p03061 (python)

Fixed submission:
from fractions import gcd

n = int(raw_input())
a = list(map(int, raw_input().split()))
p = list(a)
s = list(a)
for i in range(1, n):
    p[i] = gcd(p[i - 1], p[i])
for i in range(n - 2, -1, -1):
    s[i] = gcd(s[i], s[i + 1])

ans = max(p[-2], s[1])
if n > 2:
    ans = max(ans, max(gcd(p[i - 1], s[i + 1]) for i in range(1, n - 1)))

print(ans)

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

n = int(input())
a = list(map(int, input().split()))
p = list(a)
s = list(a)
for i in range(1, n):
    p[i] = gcd(p[i - 1], p[i])
for i in range(n - 2, -1, -1):
    s[i] = gcd(s[i], s[i + 1])

ans = max(p[-2], s[1])
if n > 2:
    ans = max(ans, max(gcd(p[i - 1], s[i + 1]) for i in range(1, n - 1)))

print(ans)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

n = int(input())
a = list(map(int, input().split()))
p = list(a)
s = list(a)
for i in range(1, n):
    p[i] = gcd(p[i - 1], p[i])
for i in range(n - 2, -1, -1):
    s[i] = gcd(s[i], s[i + 1])

ans = max(p[-2], s[1])
ans = max(ans, max(gcd(p[i - 1], s[i + 1]) for i in range(1, n - 1)))
print(ans)

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

n = int(input())
a = list(map(int, input().split()))
p = list(a)
s = list(a)
for i in range(1, n):
    p[i] = gcd(p[i - 1], p[i])
for i in range(n - 2, -1, -1):
    s[i] = gcd(s[i], s[i + 1])

ans = max(p[-2], s[1])
ans = max(ans, max(gcd(p[i - 1], s[i + 1]) for i in range(1, n - 1)))
print(ans)
Problem p03262 (python)

Fixed submission:
from functools import reduce
from fractions import gcd
n, x = map(int, input().split())
y = [abs(int(v) - x) for v in input().split()]
g = y[0] if len(y) == 1 else reduce(gcd, y)
print(g)

Buggy submission (verdict: Runtime Error):
from functools import reduce
from math import gcd
n, x = map(int, input().split())
y = [int(v) - x for v in input().split()]
y.append(0)
g = reduce(gcd, y)
print(g)
Problem p03605 (python)

Fixed submission:
s = input()
if '9' in s:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for _ in range(n):
  l, r = map(int, input().split())
  ans += r - l + 1
  
print(ans)
Problem p03607 (python)

Fixed submission:
s = set()
n = int(input())
for _ in range(n):
    x = int(input())
    if x in s:
        s.remove(x)
    else:
        s.add(x)

print(len(s))

Buggy submission (verdict: Runtime Error):
s = set()
n = int(input())
for _ in range(n):
  x = int(input())
  if x in s:
    s.remove(x)
  else:
    s.add(x)
    
print(len(x))