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

Fixed submission:
import numpy as np
N, M, C = map(int, input().split()) 
B = np.array(list(map(int, input().split())))
A = np.array([list(map(int,list(input().split()))) for i in range(N)])
 
ans = 0
for i in range(N):
    val = np.sum(A[i, :] * B) + C
    if val > 0:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M, C = map(int, input().split()) 
B = np.array(list(map(int, input().split())))
A = np.array([list(map(int,list(input()))) for i in range(N)])

ans = 0
for i in range(N):
    val = np.sum(A[i, :] * B) + C
    if val > 0:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M, C = map(int, input().split()) 
B = np.array(list(map(int, input().split())))
A = np.array([list(map(int,list(input()))) for i in range(N)])

ans = 0
for i in range(M):
  if np.sum(A[:, i] * B) + C > 0:
    ans += 1
print(ans)
Problem p03549 (python)

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

sec = M * 1900 + (N - M) * 100
print(sec * 2 ** M)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
s=m*1900+(n-m)*100
print(sec*2**m)
Problem p03574 (python)

Fixed submission:
# ABC075 B-Minesweeper
import numpy as np

H, W = map(int, input().split())
s = np.zeros((H+2, W+2))

for i in range(H):
    S = input()
    for j, v in enumerate(S):
        if v == '#':
            s[i+1, j+1] = 1

for i in range(H):
    ans = ''
    for j in range(W):
        if s[i+1, j+1] == 1:
            ans += '#'
        else:
            ans += str(np.sum(s[i:i+3, j:j+3], dtype=np.int))
    print(ans)

Buggy submission (verdict: Runtime Error):
# ABC075 B-Minesweeper
import numpy as np

H, W = map(int, input().split())
s = np.zeros((H+2, W+2))

for i in range(H):
    S = input()
    for j, v in enumerate(S):
        if v == '#':
            s[i+1, j+1] = 1

for i in range(H):
    ans = ''
    for j in range(W):
        if s[i+1, j+1] == 1:
            ans += '#'
        else:
            ans += str(np.sum(s[i:i+3, j:j+3], dtype=np.int))
    print(ans)
Problem p03611 (python)

Fixed submission:
import numpy as np
N = int(input())
a = list(map(int, input().split()))
V = np.zeros((max(a)+4))

for v in a:
    V[v:v+3] += 1 
print(int(np.max(V)))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
a = list(map(int, input().split()))
V = np.zeros((max(a)+4, N))

for i, v in enumerate(a):
    V[v:v+3, i] = 1
#print(V)
print(np.max(np.sum(V, axis=1, dtype=np.int)))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
a = list(map(int, input().split()))
V = np.zeros((max(a)+3, N))

for i, v in enumerate(a):
    V[v:v+3, i] = 1
print(np.max(np.sum(V, axis=1, dtype=np.int)))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
a = list(map(int, input().split()))
V = np.zeros((max(a)+3, N))

for i, v in enumerate(a):
    V[v:v+3, i] = 1
print(np.max(np.sum(V, axis=1, dtype=np.int)))
Problem p03633 (python)

Fixed submission:
from fractions import gcd
from functools import reduce

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))

ans = lcm(*T)
print(ans)

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

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))

ans = lcm_list(T)
print(ans)

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

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))

ans = lcm_list(T)
print(ans)
Problem p03845 (python)

Fixed submission:
N = int(input())
T = list(map(int, input().split()))
M = int(input())
P, X = [], []
for _ in range(M):
    p, x = map(int, input().split())
    P.append(p)
    X.append(x)

t_sum = sum(T)

for i in range(M):
    print(t_sum - T[P[i]-1] + X[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
T = list(map(int, input().split()))
M = int(input())
P, X = [], []
for _ in range(M):
    p, x = map(int, input().split())
    P.append(p)
    X.append(x)

t_sum = sum(T)

for i in range(M):
    print(t_sum - T[P[i]-1] + X[P[i] - 1])
Problem p03971 (python)

Fixed submission:
N, A, B = map(int, input().split())
S = input()

qualified = 0
qualified_foreign = 0.
for s in S:
    if s == 'c':
        print('No')
    elif s == 'a':
        if qualified < A + B:
            print('Yes')
            qualified += 1
        else:
            print('No')
    else:
        if (qualified < A + B) & (qualified_foreign < B):
            print('Yes')
            qualified += 1
            qualified_foreign += 1
        else:
            print('No')

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

qualified = 0
qualified_foreign = 0.
for s in S:
    if s == 'c':
        print('No')
    elif s == 'a':
        if qualified < A + B:
            print('Yes')
            qualified += 1
        else:
            print('No')
    else:
        if (qualified < A + B) & (qualified_foreign < B):
            print('Yes')
            qualified += 1
            qualified_foreign += 1
        else:
            print('No')
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 1
if a[0] == 0:
  print(0)
else:
  for i in range(len(a)):
    ans *= a[i]
    if ans > 10**18:
      print("-1")
      exit()
    elif i == len(a)-1:
      print(ans)

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 1
if a[0] == 0:
  print(0)
else:
  while a[0] == 1:
    a.remove(1)
  for i in range(len(a)):
    ans *= a[i]
    if ans > 10**18:
      print("-1")
      sys.exit()
    elif i == len(a)-1:
      print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 1
if a[0] == 0:
  print(0)
else:
  while a[0] == 1:
    a.remove(1)
  for i in range(len(a)):
    ans *= a[i]
    if ans > 10**18:
      print("-1")
      exit()
    elif i == len(a)-1:
      print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 1
if a[0] == 0:
  print(0)
else:
  while a[0] == 1:
    a.remove(1)
  for i in range(len(a)):
    ans *= a[i]
    if ans > 10**18:
      print(-1)
      exit()
    elif i == len(a)-1:
      print(ans)
Problem p02741 (python)

Fixed submission:
print([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][int(input())-1])

Buggy submission (verdict: Runtime Error):
print([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][int(input())-1]
Problem p02747 (python)

Fixed submission:
s = input()
if len(s)%2 == 0:
  for i in range(len(s)//2):
    if s[2*i] != "h" or s[2*i+1] != "i":
      print("No")
      exit()
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if len(s)%2 == 0:
  for i in len(s)//2:
    if s[2*i] != "h" and s[2*i+1] != "i":
      print("No")
      exit()
  print("Yes")
else:
  print("No")
Problem p02899 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = [0]*n
for i in range(n):
  ans[a[i]-1] = i+1
for i in range(n):
  print(ans[i],end=" ")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
ans = [0]*n
for i in range(n):
  ans[a.pop(i)-1] = i+1
for i in range(n):
  print(ans,end=" ")
Problem p02999 (python)

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

Buggy submission (verdict: Runtime Error):
x,a = map(int,input().split())
pritn(0 if x < a else 10)
Problem p03085 (python)

Fixed submission:
b = input()
if b == "A":
  b = "T"
elif b == "T":
  b = "A"
elif b == "C":
  b = "G"
elif b == "G":
  b = "C"
print(b)

Buggy submission (verdict: Runtime Error):
b = input()
if b = "A":
  b = "T"
elif b = "T":
  b = "A"
elif b = "C":
  b = "G"
elif b = "G":
  b = "C"
print(b)
Problem p03109 (python)

Fixed submission:
s = input()
if int(s[5]) == 1:
  print("TBD")
elif int(s[6]) <= 4:
  print("Heisei")
else:
  print("TBD")

Buggy submission (verdict: Runtime Error):
s = map(str,input().split())
if int(s[5]) == 1:
  print("TBD")
elif int(s[6]) <= 4:
  print("Heisei")
else:
  print("TBD")
Problem p03206 (python)

Fixed submission:
d = input()
if d == "25":
  print("Christmas")
elif d == "24":
  print("Christmas Eve")
elif d == "23":
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
d = int(input())
if d = 25:
  print("Christmas")
elif d = 24:
  print("Christmas Eve")
elif d = 23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")
Problem p03210 (python)

Fixed submission:
n = input()
print("YES" if n == "3" or n == "5" or n == "7" else "NO")

Buggy submission (verdict: Runtime Error):
print("YES" if input() == "3" or input() == "5" or input() == "7" else "NO")
Problem p03434 (python)

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
l = sorted(a, reverse = True)
count = 0
for i in range(N):
    if i % 2 == 0:
        count += l[i]
    else:
        count -= l[i]
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
l = sorted(a)
count = 0
for i in range(3):
    if i % 2 == 0:
        count += l[i]
    else:
        count -= l[i]
print(count)

Buggy submission (verdict: Runtime Error):
input()
A = list(map(int,input().split()))
A = A.sort(reverse=True)
Alice = sum(A[1::2])
Bob = sum(A[::2])
print(Alice-Bob)
Problem p03437 (python)

Fixed submission:
x,y = map(int,input().split())
if x%y == 0:
  print(-1)
else:
  print(x)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
if x%y == 0
  print(-1)
else:
  print(x)
Problem p03448 (python)

Fixed submission:
A, B, C, X = [int(input()) for i in range(4)]
print(sum(500*a+100*b+50*c == X for a in range(A+1) for b in range(B+1) for c in range(C+1)))

Buggy submission (verdict: Runtime Error):
A,B,C,X = int(input()) for i in range(4)
print(sum(500*a+100*b+50*c == X for a in range(A+1) for b in range(B+1) for c in range(C+1)))
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
print("Even" if a * b % 2 == 0:"Odd");

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

Fixed submission:
N = int(input())
s = set(int(input()) for i in range(N))
print(len(s))

Buggy submission (verdict: Runtime Error):
N = int(input())
s = set(for i in range(N+1): int(input()))
print(len(s))
Problem p03574 (python)

Fixed submission:
h,w = map(int,input().split())
s = [list(input()) for _ in range(h)]
bomb_count = 0
for i in range(h):
  for j in range(w):
    if s[i][j] == "#":
      continue
    else:
      for k in range(3):
        for l in range(3):
          a = i-1+k
          b = j-1+l
          if a < 0:
            continue
          elif a > h-1:
            continue
          if b < 0:
            continue
          elif b > w-1:
            continue
          if s[a][b] == "#":
            bomb_count += 1
      s[i][j] = str(bomb_count)
      bomb_count = 0
for i in range(h):
  print("".join(s[i]))

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
s = [list(map(str,input())) for _ in range(h)]
for i in range(h):
  for j in range(w):
    if s[i][j] == ".":
      if i == 0 and j == 0:
        s[i][j] = str([s[0][1],s[1][0],s[1][1]].count("#"))
      elif i == 0 and j == w-1:
        s[i][j] = str([s[i][j-1],s[i+1][j-1],s[i+1][j]].count("#"))
      elif i == h-1 and j == 0:
        s[i][j] = str([s[i-1][0],s[i-1][1],s[i][1]].count("#"))
      elif i == h-1 and j == w-1:
        s[i][j] = str([s[i-1][j-1],s[i-1][j],s[i][j-1]].count("#"))
      elif i == 0:
        s[i][j] = str([s[i][j-1],s[i][j+1],s[i+1][j-1],s[i+1][j],s[i+1][j+1]].count("#"))
      elif i == h-1:
        s[i][j] = str([s[i][j-1],s[i][j+1],s[i-1][j-1],s[i-1][j],s[i-1][j+1]].count("#"))
      elif j == 0:
        s[i][j] = str([s[i-1][j],s[i+1][j],s[i-1][j+1],s[i][j+1],s[i+1][j+1]].count("#"))
      elif j == w-1:
        s[i][j] = str([s[i-1][j],s[i+1][j],s[i-1][j-1],s[i][j-1],s[i+1][j-1]].count("#"))
      else:
        s[i][j] = str([s[i-1][j-1],s[i-1][j],s[i-1][j+1],s[i][j-1],s[i][j+1],s[i+1][j-1],s[i+1][j],s[i+1][j+1]].count("#"))

for i in range(h):
  print("".join(s[i]))
Problem p03672 (python)

Fixed submission:
s = input()
n = len(s)
for i in range(1,len(s)//2):
  if s[:(n-2*i)//2] == s[(n-2*i)//2:n-2*i]:
    print(n-2*i)
    exit()

Buggy submission (verdict: Runtime Error):
s = input()
for i in range(1,len(s)//2):
  if s[:(n-2*i)//2] == s[(n-2*i)//2:n-2*i]:
    print(n-2*i)
    exit()
Problem p03697 (python)

Fixed submission:
a,b = map(int,input().split())
print(a+b if a+b < 10 else "error")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
print(a+b if a+b < 10 else "error")
Problem p03943 (python)

Fixed submission:
a, b, c = map(int,input().split())
if a+b==c or b+c==a or c+a==b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int,input().split())
if a+b=c or b+c=a or c+a=b:
  print(Yes)
else:
  print(No)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = [int(input()) for _ in range(2)]
print(a*b)
Problem p02658 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
p = 1
for i in a: 
    if i==0:
        print(0)
        exit(0)
for i in a:
    p*=i
    if p>10**18:
        p=-1
        break
print(p)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
p = 1
for i in a:
	p*=i
	if p==0:
    	break
	if p>10**18:
		p=-1
        break
if p>10**18:
	p=-1
print(p)
Problem p02573 (python)

Fixed submission:
def find(n):
    if parent[n] < 0:
        return n
    else:
        parent[n] = find(parent[n])
        return parent[n]


def union(x, y):
    root_x = find(x)
    root_y = find(y)
    if root_x == root_y:
        return
    if parent[root_x] > parent[root_y]:
        root_x, root_y = root_y, root_x
    parent[root_x] += parent[root_y]
    parent[root_y] = root_x


def get_size(x):
    return -parent[find(x)]


n, m = map(int, input().split())
parent = [-1 for _ in range(n)]

for _ in range(m):
    a, b = map(lambda x: int(x) - 1, input().split())
    union(a, b)
ans = 0
for i in range(n):
    ans = max(ans, get_size(i))
print(ans)

Buggy submission (verdict: Runtime Error):
from statistics import mode
N, M = map(int, input().split())
f, k = [], []

for i in range(M):
    A, B = map(int, input().split())
    if [A, B] not in k and [B, A] not in k:
        k.append([A, B])
        f.append(A)
        f.append(B)

print(f.count(mode(f))+1)
Problem p02576 (python)

Fixed submission:
N,X,T=map(int,input().split())
if N%X==0:
    ans=T*(N//X)
else:
    ans=T*((N//X)+1)
print(ans)

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

ans=sum(A)
s=N+1
j=s

if A==sorted(A):
    print(0)
    exit()

for i in range(N//2):
    x=max(A[:s])
    s=A.index(x)
    A[s:j]=[x]*len(A[s:j])
    j=s
    if  A==sorted(A):
        break

print(sum(A)-ans)
Problem p02675 (python)

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

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

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

Buggy submission (verdict: Runtime Error):
 s = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
 k = input()
 k = int(K)
 print(s[k+1])

Buggy submission (verdict: Runtime Error):
s = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
s[input()-1]

Buggy submission (verdict: Runtime Error):
s = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
print(s[input()-1])

Buggy submission (verdict: Runtime Error):
s = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
print(s[input()-1])

Buggy submission (verdict: Runtime Error):
suuretu = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51,)
k = input()
suuretu[k+1]

Buggy submission (verdict: Runtime Error):
suuretu = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
k = input()
suuretu[k]

Buggy submission (verdict: Runtime Error):
suuretu = (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)
input(k)
suuretu[k]
Problem p02742 (python)

Fixed submission:
H,W=map(int, input().split())

if H == 1 or W == 1:
    print(1)
elif H * W % 2 == 0:
    print(int(H * W / 2))
elif H * W % 2 != 0:
    print(int(H * W // 2 + 1))

Buggy submission (verdict: Runtime Error):
h w = int(input())
if h*w == 0:
  print(h*w/2)
 else:
  print(h*w//2+1)

Buggy submission (verdict: Runtime Error):
h w = input()
if h*w == 0:
  print(h*w/2)
 else:
  print(h*w//2+1)
Problem p03281 (python)

Fixed submission:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N=int(input())
ans=0
for i in range(1,N+1,2):
    if len(make_divisors(i))==8:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy
N=int(input())
ans=0
for i in range(1,N+1,2):
    if len(sympy.divisors(i))==8:
        ans+=1
print(ans)
Problem p03328 (python)

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

x = b - a
s = 0
for i in range(1,x,1):
  s += i

ans = s - a
print(ans)

Buggy submission (verdict: Runtime Error):
def fib(n):
    if n>0:
        return n+fib(n-1)
    else:
         return 0

a,b=map(int,input().split())
s=b-a
print(fib(s)-b)

Buggy submission (verdict: Runtime Error):
def fib(n):
    if n>0:
        return n+fib(n-1)
    else:
         return n

a,b=map(int,input().split())
memo=[0 for i in range(1000)]
s=b-a
for i in range(1000):
    if fib(i+1)-fib(i)==s:
        print(fib(i)-a)
        break
Problem p02658 (python)

Fixed submission:
def main():
    input()
    a = list(map(int, input().split()))
    ans = 1
    for el in a:
        if el == 0:
            print(0)
            return
    for el in a:
        ans *= el
        if ans > 1e18:
            print(-1)
            return
    else:
        print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
input()
a = list(map(int, input().split()))
ans = 1
for el in a:
    ans *= el
    if ans > 1e18:
        print(-1)
        return
else:
    print(ans)
Problem p02608 (python)

Fixed submission:
import math

n = int(input())

ans = [0] * n

r = math.floor(math.sqrt(n))
for x in range(1,r+1):
  for y in range(x,r+1):
    for z in range(y,r+1):
      sum = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if sum <= n:
        if x == y and y == z:
          ans[sum-1] += 1
        elif x == y or y == z or z == x:
          ans[sum-1] += 3
        else:
          ans[sum-1] += 6

for p in ans:
  print(p)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())

ans = 0

for i in range(1,n+1):
  r = math.floor(math.sqrt(i))
  for x in range(1,r+1):
    for y in range(x,r+1):
      for z in range(y,r+1):
        if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
          if i == 12:
          if x == y and y == z:
            ans += 1
          elif x == y or y == z or z == x:
            ans += 3
          else:
            ans += 6
  print(ans)
  ans = 0
Problem p02641 (python)

Fixed submission:
x,n = map(int,input().split())
if n == 0:
  print(x)
  exit()
p = list(map(int,input().split()))
t = [i for i in range(0,102)]

p.sort()
diff = list(set(t) ^ set(p))

for i in range(len(diff)):
  diff[i] -= x

ans = diff[0]
for i in range(1,len(diff)):
  if abs(ans) > abs(diff[i]):
    ans = diff[i]
    
ans += x
print(ans)

Buggy submission (verdict: Runtime Error):
x,n = map(int,input().split())
if n == 0:
  print(x)
  exit()
p = list(map(int,input().split()))
t = [i for i in range(1,101)]

p.sort()
diff = list(set(t) ^ set(p))

for i in range(len(diff)):
  diff[i] -= x

ans = diff[0]
for i in range(1,len(diff)):
  if abs(ans) > abs(diff[i]):
    ans = diff[i]
    
ans += x
print(ans)

Buggy submission (verdict: Runtime Error):
x,n = map(int,input().split())
if n == 0:
  print(x)
  exit()
p = list(map(int,input().split()))
t = [i for i in range(1,101)]

p.sort()
diff = list(set(t) ^ set(p))

for i in range(len(diff)):
  diff[i] -= x

ans = diff[0]
for i in range(1,len(diff)):
  if abs(ans) > abs(diff[i]):
    ans = diff[i]
    
ans += x
print(ans)
Problem p02705 (python)

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

Buggy submission (verdict: Runtime Error):

print(2*math.pi*(int(input())))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=list(map(int,input().split()))
if(sum(l)>n):
	print(-1)
else:
	print(n-sum(l))
Problem p02719 (python)

Fixed submission:
n,k=map(int,input().split())
if(n>k):
    if(n%k==0):
        print(0)
    else:
        print(min((n%k),(n//k+1)*k-n))
elif(n==k):
    print(0)
elif(n==0):
    print(0)
else:
    if(k%n==0):
        print(n)
    else:
        if(k-n)<=n:
            print(k-n)
        else:
            print(n)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
if(n>k):
    if(n%k==0):
        print(0)
    else:
        print(min((n%k),(n//k+1)*k-n))
elif(n==k):
    print(0)
else:
    if(k%n==0):
        print(n)
    else:
        if(k-n)<=n:
            print(k-n)
        else:
            print(n)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
if(n>k):
    if(n%k==0):
        print(0)
    else:
        print(min((n%k),(n//k+1)*k-n))
elif(n==k):
    print(0)
else:
    if(k%n==0):
        print(n)
    else:
        if(k-n)<n:
            print(k-n)
        else:
            print(n)