Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n= int(input())
s= [input() for i in range(n)]
p1=list(set(s))
N=len(p1)
c=[0]*N
for i in range(N):
	c[i]=s.count(p1[i])
m =max(c)
c1=c.count(m)
ans=[0]
for i in range(N):
	if c[i]==m:
		ans.append(p1[i])
ans1=sorted(ans)
for i in range(c1):
	print(ans1[i])

Fixed submission:
n= int(input())
s= sorted([input() for i in range(n)])
s.append("END")
ans=[]
max=-1
past=s[0]
c=1
for i in range(1,n+1):
	if past==s[i]:
		c+=1
	else:
		if c>max:
			max=c
			ans=[]
			ans.append(s[i-1])
		elif c==max:
			ans.append(s[i-1])
		c=1
	past=s[i]
for i in range(len(ans)):
	print(ans[i])

Buggy python submission (verdict: Runtime Error):
n= int(input())
s= [input() for i in range(n)]
p=set(s)
p1=list(p)
N=len(s)
c=[0]*N
for i in range(N):
	c[i]=s.count(p1[i])
m =max(c)
c1=c.count(m)
ans =[]
for i in range(N):
	if c[i]==m:
		ans.append(p1[i])
ans1 = sorted(ans)
for i in range(c1):
	print(ans1[i])

Fixed submission:
n= int(input())
s= sorted([input() for i in range(n)])
s.append("END")
ans=[]
max=-1
past=s[0]
c=1
for i in range(1,n+1):
	if past==s[i]:
		c+=1
	else:
		if c>max:
			max=c
			ans=[]
			ans.append(s[i-1])
		elif c==max:
			ans.append(s[i-1])
		c=1
	past=s[i]
for i in range(len(ans)):
	print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
n= int(input())
s= [input() for i in range(n)]
p=set(s)
p1=list(p)
N=len(p)
c=[0]*N
for i in range(N):
	c[i]=s.count(p1[i])
m =max(c)
c1=c.count(m)
ans =[]
for i in range(N):
	if c[i]==m:
		ans.append(p1[i])
ans1 = sorted(ans)
for i in range(c1):
	print(ans1[i])

Fixed submission:
n= int(input())
s= sorted([input() for i in range(n)])
s.append("END")
ans=[]
max=-1
past=s[0]
c=1
for i in range(1,n+1):
	if past==s[i]:
		c+=1
	else:
		if c>max:
			max=c
			ans=[]
			ans.append(s[i-1])
		elif c==max:
			ans.append(s[i-1])
		c=1
	past=s[i]
for i in range(len(ans)):
	print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=list(map(int, input().split()))
count2=0
for i in range(n):
  count1=0
  for j in range(i+1):
    if p[i] <= p[j]:
      count1 += 1
  if count1 == i+1:
    count2 += 1
print(count2)

Fixed submission:
n=int(input())
p=list(map(int, input().split()))
min = p[0]
count=0
for i in range(n):
  if p[i] <= min:
    min = p[i]
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
h, w, k = map(int, input().split())
s = [""] * h
for i in range(h):
    s[i] = input()

ans = [[0 for i in range(w)] for j in range(h)]
lcnt = [0] * h
cnt = 0

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            lcnt[i] += 1

flag = 0
mem = [0] * w

a = 1

for i in range(h):
    t = 0
    j = 0

    while t < lcnt[i]:

        if s[i][j] == "#":
            t += 1
            ans[i][j] = a
            a += 1
        else:
            ans[i][j] = a

        j += 1

    for l in range(j, w):
        ans[i][l] = a - 1

for i in range(h):
    if lcnt[i] > 0:
        for j in range(w):
            mem[j] = ans[i][j]
        break

t = 0
while lcnt[t] == 0:
    for i in range(w):
        ans[t][i] = mem[i]
    lcnt[i] = 1
    t += 1

for i in range(1, h):
    if lcnt[i] == 0:
        for j in range(w):
            ans[i][j] = ans[i - 1][j]

for i in range(h):
    for j in range(w):
        print(ans[i][j], end="")
        if j != w - 1:
            print(" ", end="")
    print()

Fixed submission:
h, w, k = map(int, input().split())
s = [""] * h
for i in range(h):
    s[i] = input()

ans = [[0 for i in range(w)] for j in range(h)]
lcnt = [0] * h
cnt = 0

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            lcnt[i] += 1

flag = 0
mem = [0] * w

a = 1

for i in range(h):
    t = 0
    j = 0

    while t < lcnt[i]:

        if s[i][j] == "#":
            t += 1
            ans[i][j] = a
            a += 1
        else:
            ans[i][j] = a

        j += 1

    for l in range(j, w):
        ans[i][l] = a - 1

for i in range(h):
    if lcnt[i] > 0:
        for j in range(w):
            mem[j] = ans[i][j]
        break

t = 0
while lcnt[t] == 0:
    for i in range(w):
        ans[t][i] = mem[i]
    lcnt[t] = 1
    t += 1

for i in range(1, h):
    if lcnt[i] == 0:
        for j in range(w):
            ans[i][j] = ans[i - 1][j]

for i in range(h):
    for j in range(w):
        print(ans[i][j], end="")
        if j != w - 1:
            print(" ", end="")
    print()
Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n =  map(int,input().split())
cnt=0
for i in range(n//r+1):
    for j in range(n//g+1):
        #print(i,j)
        #print(n-i*r-j*g)
        if int(n-(i*r)-(j*g)) % b ==0 and int(n-(i*r)-(j*g)) >=0 :
            #print("a")
            #print(i,j)
            cnt+=1
print(cnt)


Fixed submission:
r,g,b,n =  map(int,input().split())
cnt=0
for i in range(n//r+1):
    for j in range(n//g+1):
        #print(i,j)
        #print(n-i*r-j*g)
        if int(n-(i*r)-(j*g)) % b ==0 and int(n-(i*r)-(j*g)) >=0 :
            #print("a")
            #print(i,j)
            cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
m=int(input())
  print(48-m)

Fixed submission:
m=int(input())
print(48-m)
Buggy python submission (verdict: Runtime Error):
s=input()
t = set(s)
if len(s) ==1:
    print("YES")
    exit(0)
elif len(s) == 1 && len(t) ==2:
    print("YES")
    exit(0)
if len(t) != 3:
    print("NO")
else:
    a = s.count("a")
    b = s.count("b")
    c = s.count("c")
    M = max(a,b,c)
    m = min(a,b,c)
    if M - m >1 :
        print("NO")
    else:
        print("YES")



Fixed submission:
s=input()
t = set(s)
if len(s) ==1:
    print("YES")
    exit(0)
elif len(s) == 2 and len(t) ==2:
    print("YES")
    exit(0)
if len(t) != 3:
    print("NO")
else:
    a = s.count("a")
    b = s.count("b")
    c = s.count("c")
    M = max(a,b,c)
    m = min(a,b,c)
    if M - m >1 :
        print("NO")
    else:
        print("YES")
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[]*4
for i range(4):
  a[i]=int(input())
if(a[0]<a[1]):print(a[2]*a[0])
else:print(a[2]*(a[1]-1)+a[3]*(a[0]-a[1]+1))

Fixed submission:
a=[0]*4
for i in range(4):
  a[i]=int(input())
if(a[0]<a[1]):print(a[2]*a[0])
else:print(a[2]*(a[1])+a[3]*(a[0]-a[1]))
Buggy python submission (verdict: Runtime Error):
H, W, K = [int(s) for s in input().split()]

cs = []

for _ in range(H):
    if s == "AC":
        ac += 1
    elif s == "WA":
        wa += 1
    elif s == "TLE":
        tle += 1
    elif s == "RE":
        re += 1

print(f"AC x {ac}")
print(f"WA x {wa}")
print(f"TLE x {tle}")
print(f"RE x {re}")

Fixed submission:
N = int(input())

n = N % 1000
if n == 0:
    print(0)
else:
    print(1000-n)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

As = [int(a) for a in input().split()]


prod = 1

for a in As:
    prod *= a

if prod > 10**18:
    print("-1")
else:
    print(prod)


Fixed submission:
N = int(input())

As = [int(a) for a in input().split()]


prod = 1
overflow_flag = False

if 0 in As:
    print(0)
else:
    for a in As:
        prod *= a

        if prod > 10**18:
            overflow_flag = True
            break

    if overflow_flag:
        print("-1")
    else:
        print(prod)
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    A = list(map(int, input().split()))

    if N == 2:
        print(max(A[0]+A[1], (-A[0])+(-A[1])))
        return

    a_sum, a1, a2 = 0, A[0], A[1]
    b_sum, b1, b2 = 0, -A[0], -A[1]

    for i in range(2, N):

        if (a_sum + a1 + a2 + A[i]) > (b_sum + b1 + b2 + A[i]):
            new_a_sum = a_sum + a1
            new_a1 = a2
            new_a2 = A[i]
        else:
            new_a_sum = b_sum + b1
            new_a1 = b2
            new_a2 = A[i]

        if (a_sum + a1 - a2 - A[i]) > (b_sum + b1 - b2 - A[i]):
            new_b_sum = a_sum + a1
            new_b1 = -a2
            new_b2 = -A[i]
        else:
            new_b_sum = b_sum + b1
            new_b1 = -b2
            new_b2 = -A[i]

        a_sum, a1, a2 = new_a_sum, new_a1, new_a2
        b_sum, b1, b2 = new_b_sum, new_b1, new_b2

    print(max(a_sum+a1+a2, b_sum+b1+b2))

main()

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

print((t // a)*b)

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

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

    if len(A) == 2:
        print(max(A))
        return

    if len(A) == 3:
        gcd1 = gcd(A[0], A[1])
        gcd2 = gcd(A[0], A[2])
        gcd3 = gcd(A[1], A[2])
        print(max(gcd1, gcd2, gcd3))
        return

    gcd1 = gcd(A[0], A[1])
    gcd2 = gcd(A[0], A[2])
    gcd3 = gcd(A[1], A[2])
    yet_used_gcd = max(gcd1, gcd2, gcd3)
    not_used_gcd = gcd(gcd1, A[2])

    for i in range(3, N):
        yet_used_gcd = gcd(yet_used_gcd, A[i])
        if yet_used_gcd < not_used_gcd:
            yet_used_gcd = not_used_gcd
        not_used_gcd = gcd(not_used_gcd, A[i])

    if yet_used_gcd > not_used_gcd:
        print(yet_used_gcd)
    else:
        print(not_used_gcd)

main()

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

print((t // a)*b)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

cost_max = 0

for i in range(2 ** N):
    x = 0
    y = 0

    for j in range(N):
        if ((i >> j) & 1) == 1:
            x += V[j]
            y += C[j]
    if cost_max < (x - y):
        cost_max = x - y

print(cost_max)



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

cost = 0
for i in range(N):
    if V[i] > C[i]:
        cost += (V[i] - C[i])

print(cost)
Buggy python submission (verdict: Runtime Error):
import fractions

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

g_memo = {}

def my_gcd(i_list):
    global g_memo

    k = str(sorted(i_list))

    if k in g_memo.keys():
        return g_memo[k]

    if len(i_list) == 2:
        g_memo[k] = fractions.gcd(i_list[0], i_list[1])
        return g_memo[k]

    g_memo[k] = fractions.gcd(i_list[0], my_gcd(i_list[1:]))
    return g_memo[k]

if len(A) == 2:
    print(max(A))
else:
    max_gcd = 0
    for i in range(N):
        i_list = A[:i] + A[i+1:]
        gcd = my_gcd(i_list)
        if max_gcd < gcd:
            max_gcd = gcd

    print(max_gcd)

Fixed submission:
from fractions import gcd

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

    if len(A) == 2:
        print(max(A))
        return

    if len(A) == 3:
        gcd1 = gcd(A[0], A[1])
        gcd2 = gcd(A[0], A[2])
        gcd3 = gcd(A[1], A[2])
        print(max(gcd1, gcd2, gcd3))
        return

    gcd1 = gcd(A[0], A[1])
    gcd2 = gcd(A[0], A[2])
    gcd3 = gcd(A[1], A[2])
    yet_used_gcd = max(gcd1, gcd2, gcd3)
    not_used_gcd = gcd(gcd1, A[2])

    for i in range(3, N):
        yet_used_gcd = gcd(yet_used_gcd, A[i])
        if yet_used_gcd < not_used_gcd:
            yet_used_gcd = not_used_gcd
        not_used_gcd = gcd(not_used_gcd, A[i])

    if yet_used_gcd > not_used_gcd:
        print(yet_used_gcd)
    else:
        print(not_used_gcd)

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

    if N == 2:
        print(max(A[0]+A[1], (-A[0])+(-A[1])))
        return

    a_sum, a1, a2 = 0, A[0], A[1]
    b_sum, b1, b2 = 0, -A[0], -A[1]
    for i in range(2, N):
        #print(a_sum, a1, a2)
        #print(b_sum, b1, b2)
        #print(A[i])


        if (a_sum + a1 + a2 + A[i]) > (b_sum + b1 + b2 + A[i]):
            new_a_sum = a_sum + a1
            new_a1 = a2
            new_a2 = A[i]
        else:
            new_a_sum = b_sum + b1
            new_a1 = b2
            new_a2 = A[i]
        a_sum, a1, a2 = new_a_sum, new_a1, new_a2
        b_sum, b1, b2 = new_b_sum, new_b1, new_b2

    print(max(a_sum+a1+a2, b_sum+b1+b2))

main()


Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    if N == 2:
        print(max(A[0]+A[1], (-A[0])+(-A[1])))
        return

    a_sum, a1, a2 = 0, A[0], A[1]
    b_sum, b1, b2 = 0, -A[0], -A[1]
    for i in range(2, N):
        #print(a_sum, a1, a2)
        #print(b_sum, b1, b2)
        #print(A[i])
        

        if (a_sum + a1 + a2 + A[i]) > (b_sum + b1 + b2 + A[i]):
            new_a_sum = a_sum + a1
            new_a1 = a2
            new_a2 = A[i]
        else:
            new_a_sum = b_sum + b1
            new_a1 = b2
            new_a2 = A[i]

        if (a_sum + a1 - a2 - A[i]) > (b_sum + b1 - b2 - A[i]):
            new_b_sum = a_sum + a1
            new_b1 = -a2
            new_b2 = -A[i]
        else:
            new_b_sum = b_sum + b1
            new_b1 = -b2
            new_b2 = -A[i]

        a_sum, a1, a2 = new_a_sum, new_a1, new_a2
        b_sum, b1, b2 = new_b_sum, new_b1, new_b2
        
    print(max(a_sum+a1+a2, b_sum+b1+b2))

main()
Buggy python submission (verdict: Time Limit Exceeded):
import copy

def dfs(i, operations, rest_bs):
    if i == 0 and len(rest_bs) == 0:
        return operations

    for k, b in enumerate(rest_bs):
        j = k + 1
        if j <= i and j == b:
            copied_operations = copy.deepcopy(operations)
            copied_operations.append(j)
            res = dfs(i-1, copied_operations, rest_bs[:k] + rest_bs[k+1:])
            if res != -1:
                return res
    return -1


if __name__ == "__main__":
    N = int(input())
    bs = list(map(int, input().split()))

    res = dfs(N, [], bs)
    if res == -1:
        print(-1)
    else:
        for n in reversed(res):
            print(n)


Fixed submission:
if __name__ == "__main__":
    N = int(input())
    bs = list(map(int, input().split()))

    operations = []
    for i in range(N):
        j_remove = -1
        for j in range(N-i):
            if bs[j] == j+1:
                j_remove = j
        if j_remove == -1:
            print("-1")
            exit()
        operations.append(bs.pop(j_remove))
    for n in reversed(operations):
        print(n)
Buggy python submission (verdict: Runtime Error):
import fraction
from functools import reduce

N = int(input())
As = map(int, input().split())

print(reduce(fraction.gcd, As))


Fixed submission:
import fractions
from functools import reduce

N = int(input())
As = map(int, input().split())

print(reduce(fractions.gcd, As))

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

N = int(input())
As = map(int, input().split())

print(reduce(math.gcd, As))


Fixed submission:
import fractions
from functools import reduce

N = int(input())
As = map(int, input().split())

print(reduce(fractions.gcd, As))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
import math

N, M = [int(s) for s in input().strip().split()]

if N == 1:
    print(M)
    exit()

ROOT_M = int(math.sqrt(M))
divisors = []
for d in range(1, ROOT_M+1):
    if M % d == 0:
        divisors.append(d)
        divisors.append(M//d)

divisors.sort()
MAX_VAL = int(M/N)
for d in divisors:
    if d > MAX_VAL:
        break
    max_gcd = d

print(max_gcd)


Fixed submission:
# coding: utf-8

def main():
    N = int(input().strip())

    if N == 1:
        print("Hello World")
    else:
        A = int(input().strip())
        B = int(input().strip())
        print(A+B)


if __name__ == "__main__":
    main()

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

N = int(input().strip())

input_tuples = []
selected_tuple = None

for _ in range(N):
    x, y, h = [int(s) for s in input().strip().split()]
    if selected_tuple is None and h > 0:
        selected_tuple = ((x, y, h))
    else:
        input_tuples.append((x, y, h))

for cx in range(0, 101):
    for cy in range(0, 101):
        H = selected_tuple[2] + \
            abs(selected_tuple[0] - cx) + abs(selected_tuple[1] - cy)

        for x, y, h in input_tuples:
            if h != max(H - abs(x - cx) - abs(y - cy), 0):
                break
        else:
            break
        continue
    else:
        continue
    break

print("{} {} {}".format(cx, cy, H))


Fixed submission:
# coding: utf-8

def main():
    N = int(input().strip())

    if N == 1:
        print("Hello World")
    else:
        A = int(input().strip())
        B = int(input().strip())
        print(A+B)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
import math

N, M = [int(s) for s in input().strip().split()]

if N == 1:
    print(M)
    exit()

ROOT_M = int(math.sqrt(M))
divisors = []
for d in range(1, ROOT_M+1):
    if M % d == 0:
        divisors.append(d)
        divisors.append(M//d)

max_gcd = max([d for d in divisors if d < M/N])
print(max_gcd)


Fixed submission:
# coding: utf-8
import math

N, M = [int(s) for s in input().strip().split()]

if N == 1:
    print(M)
    exit()

ROOT_M = int(math.sqrt(M))
divisors = []
for d in range(1, ROOT_M+1):
    if M % d == 0:
        divisors.append(d)
        divisors.append(M//d)

divisors.sort()
MAX_VAL = int(M/N)
for d in divisors:
    if d > MAX_VAL:
        break
    max_gcd = d

print(max_gcd)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

n = int(input().strip())
vs = [int(s) for s in input().strip().split()]

as_i = [vs[i*2] for i in range(n//2)]
as_i2 = [vs[i*2+1] for i in range(n//2)]

count_i = [0] * 10001
for a in as_i:
    count_i[a] += 1

as_i2 = [vs[i*2+1] for i in range(n//2)]
count_i2 = [0] * 10001
for a in as_i2:
    count_i2[a] += 1


max_val_i = 0
max_count_i = 0
next_max_val_i = 0
next_max_count_i = 0
for i in range(1, 10001):
    if count_i[i] > max_count_i:
        next_max_count_i, next_max_val_i = max_count_i, max_val_i
        max_count_i, max_val_i = count_i[i], i

max_val_i2 = 0
max_count_i2 = 0
next_max_val_i2 = 0
next_max_count_i2 = 0
for i in range(1, 10001):
    if count_i2[i] > max_count_i2:
        next_max_count_i2, next_max_val_i2 = max_count_i2, next_max_val_i2
        max_count_i2, max_val_i2 = count_i2[i], i

# print(max_val_i, max_count_i)
# print(max_val_i2, max_count_i2)

keep_num = 0
if max_val_i != max_val_i2:
    keep_count = max_count_i + max_count_i2
else:
    if max_count_i > max_count_i2:
        keep_count = max_count_i + next_max_count_i2
    else:
        keep_count = next_max_count_i + max_count_i2

print(n - keep_count)


Fixed submission:
# coding: utf-8
import collections

n = int(input().strip())
vs = [int(s) for s in input().strip().split()]

e = [vs[i*2] for i in range(n//2)]
o = [vs[i*2+1] for i in range(n//2)]

e_counter = collections.Counter(e).most_common()
o_counter = collections.Counter(o).most_common()

e1, e1_count = e_counter[0]
try:
    e2, e2_count = e_counter[1]
except IndexError:
    e2_count = 0

o1, o1_count = o_counter[0]
try:
    o2, o2_count = o_counter[1]
except IndexError:
    o2_count = 0

if e1 != o1:
    keep_num_count = e1_count + o1_count
else:
    keep_num_count = e1_count + o2_count
    if keep_num_count < e2_count + o1_count:
        keep_num_count = e2_count + o1_count

print(n - keep_num_count)
Buggy python submission (verdict: Runtime Error):
wOFFSETS = [(-1,0),(0,-1),(0,1),(1,0)]

H, W = map(int, input().split())

Ses = []
for _ in range(H):
    Ses.append(input())

for y in range(H):
    for x in range(W):
        if Ses[y][x] == "#":
            found = False
            for dx, dy in OFFSETS:
                now_x = x+dx
                now_y = y+dy
                if now_x < 0 or now_x >= W:
                    continue
                if now_y < 0 or now_y >= H:
                    continue
                if Ses[now_y][now_x] == "#":
                    found = True
                    break
            if not found:
                print("No")
                exit()

print("Yes")


Fixed submission:
OFFSETS = [(-1,0),(0,-1),(0,1),(1,0)]

H, W = map(int, input().split())

Ses = []
for _ in range(H):
    Ses.append(input())

for y in range(H):
    for x in range(W):
        if Ses[y][x] == "#":
            found = False
            for dx, dy in OFFSETS:
                now_x = x+dx
                now_y = y+dy
                if now_x < 0 or now_x >= W:
                    continue
                if now_y < 0 or now_y >= H:
                    continue
                if Ses[now_y][now_x] == "#":
                    found = True
                    break
            if not found:
                print("No")
                exit()

print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

count = 0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z==S:
                count += 1

print(count)


Fixed submission:
K, S = map(int, input().split())

count = 0
for x in range(K+1):
    for y in range(K+1):
        if 0 <= S-x-y <= K:
            count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
a = int(raw_input())
print(a + a**2 + a**3)

Fixed submission:
a = int(input())
print(a + a**2 + a**3)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    l = []
    for x in range(1,101):
        for y in range(1, 101):
            for z in range(1, 101):
                l.append(x**2+y**2+z**2+x*y+y*z+z*x)

    for i in range(1,n+1):
        print(sum(i == j for j in l))
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = int(input())
    dp=[0]*(10000+1)
    for x in range(1,101):
        for y in range(1, 101):
            for z in range(1, 101):
                num = x**2+y**2+z**2+x*y+y*z+z*x
                if num <= 10000:
                    dp[num] += 1
    [print(dp[i]) for i in range(1,n+1)]

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import numpy as np

def main():
    #n = int(input())
    x,n = map( int, input().split())
    if n == 0:
        print(x)
    else:
        p = list(map( int, input().split()))

        l = []
        for i in range(1,101):
            if i not in p:
                l.append(i)
        
        l2 = []
        for j in range(1,101):
            nump = x+j
            numm = x-j
            if nump in l:
                l2.append(nump)
            if numm in l:
                l2.append(numm)
            if len(l2)>0:
                break
        print(np.min(l2))

        
    
if __name__ == '__main__':
    main()
   


Fixed submission:
import numpy as np

def main():
    #n = int(input())
    x,n = map( int, input().split())
    if n == 0:
        print(x)
    else:
        p = list(map( int, input().split()))

        l = []
        for i in range(-100,120):
            if i not in p:
                l.append(i)
        
        l2 = []
        if x not in p:
            print(x)
        else:
            for j in range(1,101):
                nump = x+j
                numm = x-j
                if numm in l:
                    l2.append(numm)
                if nump in l:
                    l2.append(nump)
                if len(l2)>0:
                    break
            print(l2[0])

        
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    a = input()
    if a == "ABC"
        print("ARC")
    else:
        print("ABC")
if __name__ == '__main__':
    main()


Fixed submission:
def main():
    a = input()
    if a == "ABC":
        print("ARC")
    else:
        print("ABC")
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = list(map(int, input().split()))
for i in range(1,a+1):
  n = 0
  for j in b:
    if i == j:
      n = n + 1
      print(n)

Fixed submission:
def main():
    pi = 3.14159265
    r = int(input())
    print(2*pi*r)

if __name__ == '__main__':
    main()