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

Fixed submission:
import numpy as np
N=int(input())
a=[0]*N
b=[0]*N
s=0
for i in range(N):
    a[i], b[i] = map(int, input().split())
for i in range(N):
  for j in range(N):
    vec=[a[i]-a[j], b[i]-b[j]]
    s+=np.linalg.norm(vec)
print(s/N)

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
a=[0]*N
b=[0]*N
s=0
for i in range(N):
    a[i], b[i] = map(int, input().split())
for i in range(N):
  for j in range(j):
    vec=[a[i]-a[j] b[i]-b[j]]
    s+=sqrt(np.linalg.norm(vec))
print(s/N)
Problem p02898 (python)

Fixed submission:
x = [int(x) for x in input().split()]
y = [int(x) for x in input().split()]
c=0
for i in range(x[0]):
  if y[i]>=x[1]:
    c+=1
    continue
print(c)

Buggy submission (verdict: Runtime Error):
x = [int(x) for x in input().split()]
y = [int(x) for x in input().split()]
c=0
for i in range(x[0]):
  if y[i]>=x[1]:
    c++
    continue
print(c)

Buggy submission (verdict: Runtime Error):
x = [int(x) for x in input().split()]
y = [int(x) for x in input().split()]
c=0
for i in range(x[0]):
  if y[i]>=x[1]:
    c++
print(c)
Problem p02687 (python)

Fixed submission:
a=input()
if a=="ABC":
    print("ARC")
elif a=="ARC":
    print("ABC")

Buggy submission (verdict: Runtime Error):
a=intput("enter")
if a=="ABC":
    print("ARC")
elif a=="ARC":
    print("ABC")

Buggy submission (verdict: Runtime Error):
a=intput()
if a=="ABC":
    print("ARC")
elif a=="ARC":
    print("ABC")
Problem p02687 (python)

Fixed submission:
s = input()

if(s == 'ABC'):
  print("ARC")

else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
if(input() == "ABC"):
  return "ARC"

else:
  return "ABC"
Problem p03071 (python)

Fixed submission:

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


print(max(a+a-1,b+b-1,a+b))

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


print(max(a+a-1,b+b-1,a+br))
Problem p02714 (python)

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

r = s.count('R')
g = s.count('G')
b = s.count('B')

# 1つ目の条件を満たす組の数
ans = r * g * b

# 2つ目の条件を満たす組の数
c = 0
for i in range(n):
    for j in range(i+1,n):
        k = 2 * j -i
        if k > n-1:
            break
        if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            c += 1

print(ans - c)

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

r = [i for i, x in enumerate(l_dup) if x == 'R']
g = [i for i, x in enumerate(l_dup) if x == 'G']
b = [i for i, x in enumerate(l_dup) if x == 'B']

c = 0

for k in r:
    for j in g:
        for i in b:
            a = list(k, j, i)
            a.sort
            if a[0] - a[1] != a[1] - a[2]:
                c += 1

print(c)
Problem p02732 (python)

Fixed submission:
import numpy as np

c = np.zeros(int(2e5))
c_1 = np.ones(int(2e5))

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

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

ans = int(sum(c * (c - c_1) / 2))

for i in range(n):
    print(ans - int(c[a[i]-1]-1))

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

c = np.zeros(int(2e5))
c_1 = np.ones(int(2e5))

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

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

ans = int(sum(c * (c - c_1) / 2))

for i in range(n):
    print(ans - int(c[a[i]-1]-1))
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 = int(input())
print(a[K-1])

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

if (4 * math.sqrt(a * b)) < (c - a - b):
    print('Yes')
else:
    print('No')

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

if 4 * math.sqrt(a * b) < c - a - b:
    print('Yes')
else:
    print('No')

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

if 4 * a * b < (c - a - b) ** 2:
    print('Yes')
else:
    print('No')
Problem p04011 (python)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n > k:
    print(k * x + (n-k)*y)
else:
    print(n*x)

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

counter = [0] * 26

for i in s:
    counter[ord(i)-97] += 1

flag = 'Yes'
for i in counter:
    if (i % 2) == 1:
        flag = 'No'

print(flag)
Problem p02705 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[int(_) for _ in input().split()]
b=[0 for _ in range(n)]
for i in a:
    b[i-1]+=1
for i in range(n):
    print(b[i])
Problem p02900 (python)

Fixed submission:
import fractions
import math
def pFactorize(num):
    factor_list = []
    for i in range(2, math.floor(math.sqrt(num))+ 1):
        if num % i == 0:
            factor_list.append([i,1])
            num //= i
        while num % i == 0:
            factor_list[-1][1] += 1
            num //= i
    if not num == 1:
        factor_list.append([num,1])
    return factor_list
a,b=[int(_) for _ in input().split()]
c=pFactorize(fractions.gcd(a,b))
print(len(c)+1)

Buggy submission (verdict: Runtime Error):
import math
def pFactorize(num):
    factor_list = []
    for i in range(2, math.floor(math.sqrt(num))+ 1):
        if num % i == 0:
            factor_list.append([i,1])
            num //= i
        while num % i == 0:
            factor_list[-1][1] += 1
            num //= i
    if not num == 1:
        factor_list.append([num,1])
    return factor_list
a,b=[int(_) for _ in input().split()]
c=pFactorize(math.gcd(a,b))
print(len(c)+1)
Problem p02960 (python)

Fixed submission:
s=input()[::-1]
l=len(s)
dp=[[0 for j in range(13)] for i in range(l)]
if s[0] == "?":
    for j in range(10):dp[0][j]=1
else:
    dp[0][int(s[0])]=1
for i in range(1,l):
    mod = pow(10,i,13)
    if s[i] == "?":
        for j in range(10):
            for k in range(13):
                dp[i-1][k] %= 10**9+7
                dp[i][(k+j*mod)%13] += dp[i-1][k]
    else:
        for k in range(13):
            dp[i-1][k] %= 10**9+7
            dp[i][(k+int(s[i])*mod)%13] += dp[i-1][k]
print(dp[-1][5]%(10**9+7))

Buggy submission (verdict: Runtime Error):
s=input()[::-1]
l=len(s)
dp=[[0 for j in range(13)] for i in range(l)]
if s[0] == "?":
    for j in range(10):dp[0][j]=1
else:
    dp[0][int(s[0])]=1
for i in range(1,l):
    mod = 10**i % 13
    if s[i] == "?":
        for j in range(10):
            for k in range(13):
                dp[i][(k+j*mod)%13] += dp[i-1][k]
                dp %= 10**9+7
    else:
        for k in range(13):
            dp[i][(k+int(s[i])*mod)%13] += dp[i-1][k]
            dp %= 10**7
print(dp[-1][5]%(10**9+7))
Problem p02997 (python)

Fixed submission:
from math import factorial
n,k=[int(_) for _ in input().split()]
if n == 2 and k == 1:
    print(-1)
elif n == 2 and k == 0:
    print(1)
    print(1,2)
else:
    max = factorial(n-1)//factorial(n-3)//2
    if k > max:
        print(-1)
    else:
        cnt=max-k
        print(n+cnt-1)
        for i in range(2,n+1):
            print(1,i)
        nn=2
        while cnt > 0:
            print((nn%(n-1)+2),((nn%(n-1)+2)+((nn-2)//(n-1)-1))%(n-1)+2)
            nn+=1
            cnt-=1

Buggy submission (verdict: Runtime Error):
from math import factorial
n,k=[int(_) for _ in input().split()]
max = factorial(n-1)//factorial(n-3)//2
if k > max or k < max-n+1:
    print(-1)
else:
    cnt=max-k
    for i in range(2,n+1):
        print(1,i)
    nn=2
    while cnt > 0:
        print(nn,nn+1)
        nn+=1
        cnt-=1
Problem p03061 (python)

Fixed submission:
import math
def get_div_list(num):
    if num == 1:
        return [1]
    else:
        div_list = []
        div_list.append(1)
        div_list.append(num)
        for i in range(2, math.floor(math.sqrt(num))+ 1):
            if num % i == 0:
                div_list.append(i)
                div_list.append(num // i)
        list(set(div_list))
        div_list.sort(reverse = True)
        return div_list
n = int(input())
a = [int(_) for _ in input().split()]
d = sorted(list(set(get_div_list(a[0])+get_div_list(a[1]))))[::-1]
for i in range(len(d)):
    cnt = 0
    for j in range(n):
        if a[j]%d[i]==0:cnt+=1
    if cnt >= n-1:
        print(d[i])
        break

Buggy submission (verdict: Runtime Error):
from math import gcd
from functools import reduce
def gcd_list(numbers):
    return reduce(gcd, numbers)
n = int(input())
a = [int(_) for _ in input().split()]
a.sort()
ir = [a[0]]
for i in range(1,n):
    ir.append(gcd(a[0], a[i]))
mi = ir[1:].index(min(ir[1:]))+1
mr = []
for i in range(n):
    mr.append(gcd(a[mi], a[i]))
if ir.count(min(ir)) > mr.count(min(mr)):
    print(gcd_list(a[1::]))
elif ir.count(min(ir)) == mr.count(min(mr)):
    print(a[0])
elif ir.count(min(ir)) < mr.count(min(mr)):
    a.pop(mi)
    print(gcd_list(a))

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

def gcd_list(numbers):
    return reduce(gcd, numbers)

n = int(input())
a = [int(_) for _ in input().split()]
a.sort()
ir = [a[0]]
for i in range(1,n):
    ir.append(gcd(a[0], a[i]))
mi = ir.index(min(ir))
mr = []
for i in range(n):
    mr.append(gcd(a[mi], a[i]))
if ir.count(min(ir)) > mr.count(min(mr)):
    print(gcd_list(a[1::]))
elif ir.count(min(ir)) == mr.count(min(mr)):
    print(a[0])
elif ir.count(min(ir)) < mr.count(min(mr)):
    a.pop(mi)
    print(gcd_list(a))

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

def gcd_list(numbers):
    return reduce(gcd, numbers)

n = int(input())
a = [int(_) for _ in input().split()]
a.sort()
ir = [a[0]]
for i in range(1,n):
    ir.append(gcd(a[0], a[i]))
mi = ir.index(min(ir))
mr = []
for i in range(n):
    mr.append(gcd(a[mi], a[i]))
if ir.count(min(ir)) > mr.count(min(mr)):
    print(gcd_list(a[1::]))
elif ir.count(min(ir)) == mr.count(min(mr)):
    print(a[0])
elif ir.count(min(ir)) < mr.count(min(mr)):
    b = a[:mi] + a[mi+1:]
    print(gcd_list(b))
Problem p03262 (python)

Fixed submission:
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

n,x = [int(i) for i in input().split()]
pos = [abs(int(i) - x) for i in input().split()]

print(gcd_list(pos))

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

def gcd_list(numbers):
    return reduce(fraction.gcd, numbers)

n,x = [int(i) for i in input().split()]
pos = [abs(int(i) - x) for i in input().split()]

print(gcd_list(pos))
Problem p03486 (python)

Fixed submission:
s = list(input())
t = list(input())
s.sort()
t.sort(reverse = True)
if ''.join(s) < ''.join(t) :
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s,t = [i for i in input().split()]
list(s).sort()
list(t).sort(reverse = True)
if s < t :
  print('Yes')
else:
  print('No')
Problem p02717 (python)

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

x,y = y,x
x,z = z,x
print(x,y,z)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
n,k = map(int,input().split())

def process(a,b):
	flag = True
	while flag:
		a,b = max(a,b),min(a,b)
		a = a%b
		if a == 0:
			flag = False

	for i in range(1000):
		a = min(a,abs(a-b))
	return a
if n == 0:
	print(0)
elif k == 1 or n == 1:
	print(0)
else:
	print(process(n,k))

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

a,b = b,a
a,c = c,a
print(a,b,c)
Problem p02719 (python)

Fixed submission:
from fractions import gcd
n,k = map(int,input().split())

def process(a,b):
	if a%b == 0:
		return 0
	a = a%b

	for i in range(100000):
		a = min(a,abs(a-b))
	return a
if n == 0:
	print(0)
elif n ==1:
	if k == 1:
		print(0)
	else:
		print(1)
elif k == 1:
	print(0)
else:
	print(process(n,k))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
n,k = map(int,input().split())

def process(a,b):
	while flag:
		a,b = max(a,b),min(a,b)
		a = a%b
		if a == 0:
			flag = False

	for i in range(1000):
		a = min(a,abs(a-b))
	return a
if n == 0:
	print(0)
elif k == 1 or n == 1:
	print(0)
else:
	print(process(n,k))

Buggy submission (verdict: Runtime Error):
from math import gcd
n,k = map(int,input().split())

def process(a,b):
	a = gcd(a,b)
	for i in range(1000):
		a = min(a,abs(a-b))
	return a
if n == 0:
	print(0)
elif k == 1 or n == 1:
	print(0)
else:
	print(process(n,k))

Buggy submission (verdict: Runtime Error):
import math
n,k = map(int,input().split())
if n == 0:
	print(0)
elif k == 1:
	print(0)
else:
	print(math.gcd(n,k))

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

if k == 1:
	print(0)
else:
	print(math.gcd(n,k))

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

if k == 1:
	print(0)
else:
	print(math.gcd(n,k))

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

if k == 1:
	print(0)
else:

print(math.gcd(n,k))

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


print( 0 if k == 1 else math.gcd(n,k))
Problem p02743 (python)

Fixed submission:
from decimal import Decimal
from math import sqrt
a,b,c = map(int,input().split())

a = Decimal(a)
b = Decimal(b)
c = Decimal(c)
ans = a.sqrt()+b.sqrt()-c.sqrt()
if ans <0:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
a,b,c = map(int,input().split())

a = Decimal(a)
b = Decimal(b)
c = Decimal(c)
ans = a**0.5+b**0.5-c**0.5

if ans <0:
	print("Yes")
else:
	print("No")
Problem p02801 (python)

Fixed submission:

C = input()



print(chr(ord(C)+1))

Buggy submission (verdict: Runtime Error):
import sys
N,M = map(int,input().split())
if M == 0:
	print('0 0')
	sys.exit()


p = [0]*M#問題の番号
s = [0]*M#結果 AC,WA

for i in range(M):
	p[i],s[i] = input().split()

cor_count = 0
pen_count = 0
AC_list = []

for i in range(M):
	if not p[i] in AC_list:
		if s[i] == 'AC':
			AC_list.append(p[i])
		else:
			pen_count += 1

#print(AC_list)
cor_count = len(set(AC_list))
if M != 0:
	print(cor_count,pen_count)
Problem p02899 (python)

Fixed submission:
n = int(input())
ans = []
A = list(map(int,input().split()))
A2 = [[0,i+1] for i in range(n)]

for i in range(n):
	A2[i][0] = A[i]
#print(A2)
A2 = sorted(A2,key = lambda x:x[0])

for i in range(n):
	ans.append(A2[i][1])
print(*ans)

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

n = int(input())
a = input().split()
s = ''

s = np.argsort(a)

for i in range(n):
	s[i] += 1 
s.strip("[")
s.strip("]")


print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split()
s = ''
iList = [[ 0 for i in range(n)] for i in range(n)]


MIN = 100
#iの時にa[i]人いた
#a[i]が小さい順に並べてその時のiを順番に出力
for i in range(n):
	a[i] = int(a[i])
	iList[i][0] = a[i]
	iList[i][1] = i+1

for i in range(n):
	for j in range(n):
		if iList[i][0] < iList[j][0]:
			t = iList[i]
			iList[i] = iList[j]
			iList[j] = t

s += str(iList[0][1])
for i in range(1,n):
	s += ' '
	s += str(iList[i][1])
	


print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split()
s = ''
iList = [[ 0 for i in range(n)] for i in range(n)]


MIN = 100
#iの時にa[i]人いた
#a[i]が小さい順に並べてその時のiを順番に出力
for i in range(n):
	a[i] = int(a[i])
	iList[i][0] = a[i]
	iList[i][1] = i+1
for i in range(n):
	for j in range(n):
		if iList[i][0] < iList[j][0]:
			t = iList[i]
			iList[i] = iList[j]
			iList[j] = t
for i in range(n):
	s += str(iList[i][1])
	s += ' '


print(s)
Problem p02971 (python)

Fixed submission:
n = int(input())
a = []
for i in range(n):
	a.append(int(input()))

sort_a = sorted(a)

for i in range(n):
	if a[i] == sort_a[-1]:
		print(sort_a[-2])
	else:
		print(sort_a[-1])

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

sort_a = sorted(list(set(a)))

for i in range(n):
	if a[i] == sort_a[-1]:
		print(sort_a[-2])
	else:
		print(sort_a[-1])
Problem p03000 (python)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]

for i in range(n):
	d.append(d[i] + l[i])

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

print(ans)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = 0
cnt = 0
for i in range(n+1):
	cnt += 1
	d += l[i]
	if x < d:
		print(cnt)
		exit()
Problem p03212 (python)

Fixed submission:
n = int(input())

def dfs(s):
	if int(s) > n:#nより大きいならカウントしない
		#print(int(s))
		return 0

	ret = 1 if all(s.count(c) > 0 for c in '753') else 0
	#753,全てが含まれているなら1
	
	for c in '753':
		ret += dfs(s+c)
		#print(s+c)
	return ret

print(dfs('0'))

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



def dfs(s):
	if int(s)>limit:
		return 0

	ret = 1 if all(s.count(c)>0 for c in "753") else 0
	for c in "753":
		ret += dfs(s+c)
	return ret
print(dfs("0"))
Problem p03837 (python)

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

dist = [[10**10 for i in range(n)]for j in range(n)]
for i in range(n):
	dist[i][i] == 0

a = [0]*m
b = [0]*m
c = [0]*m

for i in range(m):
	a[i], b[i], c[i] = map(int,input().split())
	dist[a[i]-1][b[i]-1] = c[i]
	dist[b[i]-1][a[i]-1] = c[i]


#nは頂点、mは辺、a、bは頂点、cはaとbの距離


for k in range(n):
	for i in range(n):
		for j in range(n):
			dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])


res = 0
for i in range(m):
	if c[i] > dist[a[i]-1][b[i]-1]:
		res += 1

print(res)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
dist = []
a = []
b = []
c = []

for i in range(m):
	a[i], b[i], c[i] = map(int,input().split())
	dist[a[i]-1][b[i]-1] = c[i]
	dist[b[i]-1][a[i]-1] = c[i]



#nは頂点、mは辺、a、bは頂点、cはaとbの距離


for i in range(n):
	for j in range(n):
		for k in range(n):
			dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

res = 0
for i in range(m):
	if c[i] > dist[a[i]-1][b[i]-1]:
		res += 1

print (res)
Problem p02706 (python)

Fixed submission:
N,M = (input()).split()
task = input().split()
list1 = []
sum = 0
for i in task:
    list1.append(i)
for j in list1:
    sum = sum + int(j)
result = int(N) - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy submission (verdict: Runtime Error):
M,N = map(int,input().split())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + int(i)
result = M - int(sum)
if result < 0:
    print("-1")
else:
    print(int(result))

Buggy submission (verdict: Runtime Error):
M,N = map(eval,input().split())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + int(i)
result = M - sum
if result < 0:
    print("-1")
else:
    print(int(result))

Buggy submission (verdict: Runtime Error):
M,N = map(eval,input().split())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + int(i)
result = M - sum
if result < 0:
    print("-1")
else:
    print(result)

Buggy submission (verdict: Runtime Error):
M,N = map(eval,input().split())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
result = M - sum
if result < 0:
    print("-1")
else:
    print(result)

Buggy submission (verdict: Runtime Error):
M,N = map(eval,input().split())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
result = M - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy submission (verdict: Runtime Error):
N = eval(input())
M = eval(input())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
result = N - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy submission (verdict: Runtime Error):
user1 = eval(input().replace(" ",","))
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
result = list(user1)[0] - sum
if result < 0:
    print(-1)
else:
    print(result)

Buggy submission (verdict: Runtime Error):
user1 = eval(input().replace(" ",","))
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
result = list(user1)[0] - sum
if result <= 0:
    print(-1)
else:
    print(result)

Buggy submission (verdict: Runtime Error):
user1 = eval(input().replace(" ",","))
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
print(list(user1)[0] - sum)

Buggy submission (verdict: Runtime Error):
user1 = eval(input())
user2 = eval(input())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
print(user1 - 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("ABC")
Problem p04043 (python)

Fixed submission:
import sys
a = list(map(int,input().split()))
seven = a.count(7)
five = a.count(5)
if five==2 and seven==1:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(input().split())
for i in range(n,n+10001):
    chk = True
    
    for st in list(str(i)):
        if st in l:
            chk = False
    if chk:
        print(i)
        exit()
Problem p02700 (python)

Fixed submission:
a, b, c,d = map(int, input().split())
aa=a
cc=c
for i in range(a//d+1):
    cc = cc - b

    if cc<1:
      print("Yes")
      break;
    aa = aa - d

    if aa <1:
      print("No")
      break;

Buggy submission (verdict: Runtime Error):
a, b, c d = map(int, input().split())
aa=a
cc=c
for i in range(a//d+1):
    cc = cc - b
    print(cc)
    if cc<1:
      print("Yes")
      break;
    aa = aa - d
    print(aa)
    if aa <1:
      print("No")
      break;
Problem p02713 (python)

Fixed submission:
N = int(input())
sum=0
import math
for i in range(N):
  for j in range(N):
       t=math.gcd(i+1,j+1)
       for k in range(N):
          sum =sum + math.gcd(t, k+1)
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
sum=0
import math
for i in range(N):
  for j in range(N):
       t=gcd(i+1,j+1)
       for k in range(N):
          sum =sum + gcd(t, k+1)
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
sum=0
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
from itertools import product
pools = product(N,N,N)
for i, j ,k in pools:
  sum =sum + gcd(i, j, k)
Problem p02772 (python)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
 
x=0
for i in A:

  if i%2==0:
    if not i%3==0 and not i%5==0:
      print("DENIED")
      x=1
      break
    else:
      continue
    
  else:
   	continue
  break
if x ==0:
	print("APPROVED")

Buggy submission (verdict: Runtime Error):
N = input()
A = [int(x) for x in input().split()]
x=0
for i in A:
  if A%2==0:
    if not A%3==0 or A%5==0:
      print("DENIED")
      x=1
      break
    
  else:
   	continue
  break
if x !=0:
	print("APPROVED")
Problem p02778 (python)

Fixed submission:
S= input()
t= len(S)
print("x" * t)

Buggy submission (verdict: Runtime Error):
S = input()
i= len(S)
for j in  range(i):
  S[j]="x"
print(S)

Buggy submission (verdict: Runtime Error):
S = input()
T = S.replace("*","x")[
print(T)
Problem p02706 (python)

Fixed submission:
N, M = map(int, input().split())
a = list(map(int, input().split()))
if(N>=sum(a)):
    print(N-sum(a))
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
N=int(input())
M=int(input())
array = list(map(int, input().strip().split()))
if(N>=sum(array)):
    print(N-sum(array))
else:
    print('-1')
Problem p02713 (python)

Fixed submission:
import math
d=0
k=int(input())
for a in range(1,k+1) :
    for b in range(1,k+1):
        x=math.gcd(a,b)
        for c in range(1,k+1):
            d+=math.gcd(x,c)
print(d)

Buggy submission (verdict: Runtime Error):
k=int(input())
d=0
for a in range(1,k+1) :
    for b in range(1,k+1):
        i=gcd(a,b)
        for c in range(1,k+1):
            d+=gcd(i,c)
print(d)

Buggy submission (verdict: Runtime Error):
k=int(input())
d=0
for a in range(1,k+1) :
    for b in range(1,k+1):
        for c in range(1,k+1):
            d+=gcd(a,b,c)
print(d)

Buggy submission (verdict: Runtime Error):
import numpy as np
k=int(input())
d=0
for a in range(1,k+1) :
    for b in range(1,k+1):
        for c in range(1,k+1):
            d+=gcd(a,b,c)
print(d)