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

Fixed submission:
def func(n, a):
    mx = max(a)
    x = [0] * (mx + 1) # len(x)
    for i in a:
        x[i] += 1
    for i in range(1, mx + 1):
        if x[i] != 0:
            for j in range(2 * i, mx + 1, i):
                x[j] = 0
        if x[i] > 1:
            x[i] = 0
    print(sum(x)) # 31401

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

Buggy submission (verdict: Runtime Error):
def func(n, a):
    mx = max(a)
    x = [0] * (mx + 1) # len(x)
    for i in a:
        x[i] += 1
    for i in range(1, mx + 1):
        if x[i] != 0:
            for j in range(2 * i, mx + 1, i):
                x[j] = 0
        if x[i] > 1:
            x[i] = 0
    return sum(x) # 31401

n = int(input())
a = list(map(int, input().split()))
f(n, a)
Problem p02706 (python)

Fixed submission:
# ABC163B

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

ans = n - sum(a)
if ans >= 0:
    print(ans)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [0] * m
for i in range(m):
    a[i] = int(input())

ans = n - sum(a)
if ans > 0:
    print(ans)
else:
    print(-1)
Problem p02713 (python)

Fixed submission:
# ABC162C

from fractions import gcd
from math import gcd

k = int(input())
total = 0
for a in range(1, k+1):
    for b in range(1, k+1):
        for c in range(1, k+1):
            # print(a, b, c, gcd(a, gcd(b, c)))
            total += gcd(a, gcd(b, c))
print(total)

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

k = int(input())
total = 0
for a in range(1, k+1):
    t = gcd(a, b)
    for b in range(1, k+1):
        for c in range(1, k+1):
            # print(a, b, c, gcd(a, gcd(b, c)))
            total += gcd(t, c)
print(total) # sample_02 1982 ms

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

total = 0
for a in range(1, k+1):
    for b in range(1, k+1):
        for c in range(1, k+1):
            # print(a, b, c, gcd(a, gcd(b, c)))
            total += gcd(a, gcd(b, c))
print(total)
Problem p02720 (python)

Fixed submission:
# ABC161D
def f(k):
    if 1 <= k <= 9:
        print(k)
    else:
        nxt = [[0,1], [0,1,2], [1,2,3], [2,3,4], [3,4,5], [4,5,6], [5,6,7], [6,7,8], [7,8,9], [8,9]]
        cum_npi = [0, 9, 35, 110, 327, 956, 2782, 8089, 23527, 68468, 199368]
        for length, begin in enumerate(cum_npi):
            if k < begin:
                found = cum_npi[length - 1]
                break
        begin = 10 ** (length - 1)
        length, begin, found
        k -= found
        x = [[]] * (length + 1)
        x[1] = list(range(1, 10))
        x

        terminate = False
        i = 1
        while True:
            #print(f"a) i = {i}  x = {x}")
            if len(x[i]): # len(x[i])
                digit = x[i][0]
                if i < length: # i, length
                    i += 1
                    x[i] = nxt[digit].copy()
                    #print(f"x) digit = {digit}  nxt[digit] = {nxt[digit]}  i = {i}  x[i] = {x[i]}")
                    #print(f"b) i = {i}  x = {x}")
                    if i == length: # i, length
                        while len(x[i]): # i, x[i]
                            k -= 1
                            #print(f"c) i = {i}  x = {x}, k = {k}")
                            if k == 0:
                                x.pop(0)
                                #print("answer =", x)
                                ans = "".join([str(j.pop(0)) for j in x])
                                print(ans)
                                terminate = True
                                break
                            else:
                                x[i].pop(0)
                            #print(f"d) i = {i}  x = {x}")
                        else:
                            #print(f"e) i = {i}  x = {x}")
                            while len(x[i]) == 0:
                                i -= 1
                                x[i].pop(0)
                        if terminate:
                            break

f(int(input()))

Buggy submission (verdict: Runtime Error):
def f(k):
    def lunlun(n):
        s = [int(i) for i in str(n)]
        for i in range(len(s) - 1):
            if abs(s[i] - s[i + 1]) > 1:
                return False
        return True
    cum_npi = [0, 9, 35, 110, 327, 956, 2782, 8089, 23527, 68468, 199368]
    for i, begin in enumerate(cum_npi):
        if k < begin:
            begin = cum_npi[i-1]
            break
    print(f"begin = {begin}")
    found = begin
    while found != k:
        begin += 1
        if lunlun(begin):
            found += 1
            if found == k:
                break
    print(begin)

f(int(input()))

Buggy submission (verdict: Runtime Error):
def f(k):
    def lunlun(n):
        s = [int(i) for i in str(n)]
        for i in range(len(s) - 1):
            if abs(s[i] - s[i + 1]) > 1:
                return False
        return True
    i = 0
    while k > 0:
        i += 1
        if lunlun(i):
            k -= 1
    print(i)

f(int(input())
Problem p02756 (python)

Fixed submission:

s = input()
q = int(input())
ht = 1
head = ''
tail = ''
count = 0
for i in range(q):
    txt3 = input().split()
    if txt3[0] == '1':
        ht = 3 - ht
        count += 1
    else:
        if int(txt3[1]) == ht:
            head = txt3[2] + head
        else:
            tail = tail + txt3[2]
s = head + s + tail
if count % 2 == 1:
    s = s[::-1]
print(s)

Buggy submission (verdict: Runtime Error):
def ABC158D():
    s = input()
    q = int(input())
    for i in range(2, q):
        txt3 = input().split()
        print(f"txt3 = {txt3}")
        if txt3[0] == '1':
            s = s[::-1]
        else:
            if txt3[1] == '1':
                s = txt3[2] + s
            else:
                s = s + txt3[2]
    print(s)

ABC158D()

Buggy submission (verdict: Runtime Error):
def ABC158D():
    txt2 = txt.split("\n")
    s = txt2[0]
    q = int(txt2[1])
    for i in range(2, len(txt2)):
        txt3 = txt2[i].split()
        if txt3[0] == '1':
            s = s[::-1]
        else:
            if txt3[1] == '1':
                s = txt3[2] + s
            else:
                s = s + txt3[2]
    print(s)

f = open("foot/bar.dat")
txt = f.read()
f.close()
ABC158D(txt)

Buggy submission (verdict: Runtime Error):
def ABC158D():
    txt2 = txt.split("\n")
    s = txt2[0]
    q = int(txt2[1])
    for i in range(2, len(txt2)):
        txt3 = txt2[i].split()
        if txt3[0] == '1':
            s = s[::-1]
        else:
            if txt3[1] == '1':
                s = txt3[2] + s
            else:
                s = s + txt3[2]
    print(s)
                
ABC158D()

Buggy submission (verdict: Runtime Error):
def ABC158D(txt):
    txt2 = txt.split("\n")
    s = txt2[0]
    q = int(txt2[1])
    for i in range(2, len(txt2)):
        txt3 = txt2[i].split()
        if txt3[0] == '1':
            s = s[::-1]
        else:
            if txt3[1] == '1':
                s = txt3[2] + s
            else:
                s = s + txt3[2]
    print(s)
                
ABC158D(txt)
Problem p02767 (python)

Fixed submission:
import numpy as np
def f(n, x):
    mean =  np.mean(x)
    s1 = sum((x-np.floor(mean))**2)
    s2 = sum((x-np.ceil(mean))**2)
    print(int(min(s1, s2)))

n = int(input())
x = list(map(int, input().split()))
f(n, x)

Buggy submission (verdict: Runtime Error):
def f(n, x):
    mean =  np.mean(x)
    s1 = sum((x-np.floor(mean))**2)
    s2 = sum((x-np.ceil(mean))**2)
    print(int(min(s1, s2)))

n = int(input())
x = list(map(int, input().split()))
f(n, x)
Problem p02768 (python)

Fixed submission:
from functools import reduce
def comb(n, r, mod=10 ** 9 + 7):
    numerator = reduce(lambda x, y: x * y % mod, [n - r + k + 1 for k in range(r)])
    denominator = reduce(lambda x, y: x * y % mod, [k + 1 for k in range(r)])
    return numerator * pow(denominator, mod - 2, mod) % mod

n, a, b = map(int, input().split())
mod = 1000000007
print((pow(2, n, mod) - 1 - comb(n, a, mod) - comb(n, b, mod)) % mod)

Buggy submission (verdict: Runtime Error):
# ABC156D

import numpy as np
def f(n, x):
    mean =  np.mean(x)
    s1 = sum((x-np.floor(mean))**2)
    s2 = sum((x-np.ceil(mean))**2)
    print(int(min(s1, s2)))

n = int(input())
x = list(map(int, input().split()))
f(n, x)
Problem p02813 (python)

Fixed submission:
from math import factorial

def ABC150C(s):
    n = len(s)
    ans = 0
    while n > 1:
        o = s[0]
        ans += (o - 1) * factorial(n - 1)
        s.pop(0)
        n = len(s)
        if n == 0:
            break
        s = [i if i < o else i - 1 for i in s]
    return ans

n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
print(abs(ABC150C(p) - ABC150C(q)))

Buggy submission (verdict: Runtime Error):
from math import factorial
n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
ans = 0
while n > 1:
    o = s[0]
    ans += (o - 1) * factorial(n - 1, True)
    s.pop(0)
    n = len(s)
    if n == 0:
        break
    s = [i if i < o else i - 1 for i in s]
print(ans)

Buggy submission (verdict: Runtime Error):
# ABC150C

n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
ans = 0
while n > 1:
    o = s[0]
    ans += (o - 1) * factorial(n - 1, True)
    s.pop(0)
    n = len(s)
    if n == 0:
        break
    s = [i if i < o else i - 1 for i in s]
return ans
Problem p02830 (python)

Fixed submission:
# ABC148B

n = int(input())
s, t = input().split()
print(''.join([i+j for i, j in zip(s, t)]))

Buggy submission (verdict: Runtime Error):
# ABC148B

n = int(input)
s, t = input().split()
print(''.join([i+j for i, j in zip(s, t)]))

Buggy submission (verdict: Runtime Error):
# ABC148B

n = int(input)
s = input()
t = input()
print(''.join([i+j for i, j in zip(s, t)]))
Problem p02899 (python)

Fixed submission:
import numpy as np
n = int(input())
a = list(map(int, input().split()))
print(*(np.argsort(a)+1))

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = list(map(int, input().split())))
print(np.argsort(a)+1)
Problem p02945 (python)

Fixed submission:
# ABC137A

a, b = map(int, input().split())
print(max(a+b, a-b, a*b))

Buggy submission (verdict: Runtime Error):
from math import factorial
n = int(input())
k = int(input())
print(factorial(n+k-1)//factorial(k)//factorial(n-1) % 1000000007)

Buggy submission (verdict: Runtime Error):
from math import factorial
n = int(input())
k = int(input())
print(factorial(n+k-1)//factorial(k)//factorial(n-1) % 1000000007)
Problem p02952 (python)

Fixed submission:
# ABC136B

n = int(input())
if n <= 9:
    print(n)
elif n <= 99:
    print(9)
elif n <= 999:
    print(9 + n - 99)
elif n <= 9999:
    print(909)
elif n <= 99999:
    print(909 + n - 9999)
else:
    print(90909)

Buggy submission (verdict: Runtime Error):
# ABC136B

n = int(input())
if n <= 9:
    print(n)
elif n <= 99:
    print(9)
elif n <= 999:
    print(9 + n - 99)
elif n <= 9999:
    print(909
elif n <= 99999:
    print(909 + n - 9999)
else:
    print(90909)
Problem p02994 (python)

Fixed submission:
# ABC131B

import numpy as np
n, l = map(int, input().split())
x = l+np.arange(n)
print(sum(x) - x[np.argmin(abs(x))])

Buggy submission (verdict: Runtime Error):
# ABC131A

s = input()
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print('Bad')
else:
    print('Good')
Problem p02995 (python)

Fixed submission:
# ABC131C

def euclid(m, n):
    m0 = m = abs(m)
    n0 = n = abs(n)
    while n != 0:
        m, n = n, m % n
    qm = m0 // m
    lcm = qm * n0
    return lcm


def check(a, b, c):
    x = a // c
    y = b // c
    if x * c < a:
        x += 1
    return y - x + 1

a, b, c, d = map(int, input().split())
nc = check(a, b, c)
nd = check(a, b, d)
ncd = check(a, b, euclid(c, d))
print(b - a + 1 -(nc + nd - ncd))

Buggy submission (verdict: Runtime Error):
# ABC131C

def euclid(m, n):
    m0 = m = abs(m)
    n0 = n = abs(n)
    while n != 0:
        m, n = n, m % n
    qm = m0 // m
    lcm = qm * n0
    return lcm


def check(a, b, c):
    x = a // c
    y = b // c
    if x * c < a:
        x += 1
    return y - x + 1

a, b, c, d = map(int, input().split())
nc = check(a, b, c)
nd = check(a, b, d)
ncd = check(a, b, lcm(c, d))
print(b - a + 1 -(nc + nd - ncd))

Buggy submission (verdict: Runtime Error):
# ABC131C

def euclid(m, n):
    m0 = m = abs(m)
    n0 = n = abs(n)
    while n != 0:
        m, n = n, m % n
    qm = m0 // m
    lcm = qm * n0
    return lcm


def check(a, b, c):
    x = a // c
    y = b // c
    if x * c < a:
        x += 1
    return y - x + 1

a, b, c, d = map(int, input().split())
nc = check(a, b, c)
nd = check(a, b, d)
ncd = check(a, b, sp.lcm(c, d))
print(b - a + 1 -(nc + nd - ncd))

Buggy submission (verdict: Runtime Error):
# ABC131C

def check(a, b, c):
    x = a // c
    y = b // c
    if x * c < a:
        x += 1
    return y - x + 1

a, b, c, d = map(int, input().split())
nc = check(a, b, c)
nd = check(a, b, d)
ncd = check(a, b, sp.lcm(c, d))
print(b - a + 1 -(nc + nd - ncd))
Problem p03000 (python)

Fixed submission:
# ABC130B

n, x = map(int, input().split())
l = list(map(int, input().split()))
s = 0
for i in range(n):
    s += l[i]
    if s > x:
        print(i+1)
        break
else:
    print(n+1)

Buggy submission (verdict: Runtime Error):
# ABC130B

n, x = map(int, input().split())
l = list(map(int, input().split()))
s = 0
for i in range(n):
    s += l[i]
    if s > x:
        return i+1
return n+1
Problem p03035 (python)

Fixed submission:
# ABC127A

a, b = map(int, input().split())
if a >= 13:
    print(b)
elif a >= 6:
    print(b // 2)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
# ABC127A

a, b = map(int, input().split()
if a >= 13:
    print(b)
elif a >= 6:
    print(b / 2)
else:
    print(0)
Problem p03060 (python)

Fixed submission:
# ABC125B

n = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
x = 0
y = 0
for v, c in zip(V, C):
    if v > c:
        x += v
        y += c
print(abs(x - y))

Buggy submission (verdict: Runtime Error):
# ABC125B

n = int(input())
x = 0
y = 0
for i in range(n):
    v, c = map(int, input().split())
    if v > c:
        x += v
        y += c
print(abs(x - y))

Buggy submission (verdict: Runtime Error):
# ABC125B

n = int(input())
v = list()
c = list(map(int, input().split()))
x = 0
y = 0
for i in range(n):
    v, c = map(int, input().split())
    if v > c:
        x += v
        y += c
print(abs(x - y))
Problem p03061 (python)

Fixed submission:
from fractions import gcd
n = int(input())
a = list(map(int,input().split()))
l = [0]
r = [0]
ans = 0
for i in range(n-1):
    l.append(gcd(l[i],a[i]))
for i in range(n-1):
    r.append(gcd(r[i],a[n-1-i]))
for i in range(n):
    ans = max(ans,gcd(l[i],r[-i-1]))
print(ans)

Buggy submission (verdict: Runtime Error):
    from fractions import gcd
    n = int(input())
    a = list(map(int,input().split()))
    l = [0]
    r = [0]
    ans = 0
    for i in range(n-1):
        l.append(gcd(l[i],a[i]))
    for i in range(n-1):
        r.append(gcd(r[i],a[n-1-i]))
    for i in range(n):
        ans = max(ans,gcd(l[i],r[-i-1]))
    print(ans)

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

n = int(input())
a = list(set(map(int, input().split())))
n = len(a)
#a = [746130, 1385670, 4849845, 881790, 3233230, 1939938, 570570, 510510]
#a = [7,6,8]
#n = len(a)
max_value = 0
for i in range(n):
    memo = a.pop(0)
    x = reduce(gcd, a)
    if x > max_value:
        max_value = x
    a.append(memo)
print(max_value)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(set(map(int, input().split())))
n = len(a)
#a = [746130, 1385670, 4849845, 881790, 3233230, 1939938, 570570, 510510]
#a = [7,6,8]
#n = len(a)
max_value = 0
for i in range(n):
    memo = a.pop(0)
    x = reduce(gcd, a)
    if x > max_value:
        max_value = x
    a.append(memo)
print(max_value)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(set(map(int, input().split())))
n = len(a)
#a = [746130, 1385670, 4849845, 881790, 3233230, 1939938, 570570, 510510]
#a = [7,6,8]
#n = len(a)
max_value = 0
for i in range(n):
    memo = a.pop(0)
    x = reduce(gcd, a)
    if x > max_value:
        max_value = x
    a.append(memo)
print(max_value)

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

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

#a = [746130, 1385670, 4849845, 881790, 3233230, 1939938, 570570, 510510]
#a = [7,6,8]
#n = len(a)
max_value = 0
for i in range(n):
    memo = a.pop(0)
    x = reduce(gcd, b)
    if x > max_value:
        max_value = x
    a.append(memo)
print(max_value)

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

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

#a = [746130, 1385670, 4849845, 881790, 3233230, 1939938, 570570, 510510]
#a = [7,6,8]
#n = len(a)
max_value = 0
for i in range(n):
    b = a.copy()
    b.pop(i)
    x = reduce(gcd, b)
    if x > max_value:
        max_value = x
        max_pos = i
print(max_value)
Problem p03101 (python)

Fixed submission:
# ABC121A

H, W = map(int, input().split())
h, w = map(int, input().split())
#print(H*W-h*W-H*w+ h*w)
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
# ABC121A

H, W, h, w = map(int, input().split())
#print(H*W-h*W-H*w+ h*w)
print((H-h)*(W-w))
Problem p03110 (python)

Fixed submission:
# ABC119B

n = int(input())

z = 0
for i in range(n):
    x, y = input().split()
    x = float(x)
    if y == 'JPY':
        z += x
    else:
        z += x*380000
print(z)

Buggy submission (verdict: Runtime Error):
# ABC119B

n = int(input())

z = 0
for i in range(n):
    x, y = input().split()
    x = int(x)
    if y == 'JPY':
        z += x
    else:
        z += x*380000
print(z)

Buggy submission (verdict: Runtime Error):
# ABC119B

n = int(input()

z = 0
for i in range(n):
    x, y = input().split()
    x = int(x)
    if y == 'JPY':
        z += x
    else:
        z += x*380000
print(z)

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

z = 0
for i in range(len(xu)):
    x, y = input().split()
    x = int(x)
    if y == 'JPY':
        z += x
    else:
        z += x*380000
print(z)

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

z = 0
for i in range(len(xu)):
    x, y = input().split()
    x = int(x)
    if y == 'JPY':
        z += x
    else:
        z += x*380000
print(z)
Problem p03125 (python)

Fixed submission:
# ABC118A

a, b = map(int, input().split())
if b % a == 0:
    print(a+b)
else:
    print(b-a)

Buggy submission (verdict: Runtime Error):
　# ABC118A

a, b = map(int, input().split())
if b % a == 0:
    print(a+b)
else:
    print(b-a)
Problem p03126 (python)

Fixed submission:
import numpy as np
n, m = map(int, input().split())
k = [0] * n
for i in range(n):
    k[i] = list(map(int, input().split()))

b = np.zeros((n, m))
for i in range(n):
    w = k[i]
    for j in range(1, len(w)):
        b[i, int(w[j])-1] = 1
print(sum(b.sum(axis=0) == n))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = map(int, input().split())
k = [0] * n
for i in range(n):
    k[i] = list(map(int, input().split()))
b = np.zeros((n, m))
for i in range(n):
    w = a[i]
    for j in range(len(w)):
        b[i, int(w[j])-1] = 1
print(sum(b.sum(axis=0) == n))
Problem p03261 (python)

Fixed submission:
n = int(input())
w = [input() for i in range(n)]
ok = "Yes"
e = w[0][-1]
double = [w[0]]
for i in range(1, n):
    if double.count(w[i]) != 0:
        ok = "No"
        break
    double.append(w[i])
    s = w[i][0]
    if s != e:
        ok = "No"
        break
    e = w[i][-1]
print(ok)

Buggy submission (verdict: Runtime Error):
# ABC109B

n = int(input())
w = [int(input()) for i in range(n)]
ok = "Yes"
e = w[0][-1]
double = [w[0]]
for i in range(1, n):
    if double.count(w[i]) != 0:
        ok = "No"
        break
    double.append(w[i])
    s = w[i][0]
    if s != e:
        ok = "No"
        break
    e = w[i][-1]
print(ok)
Problem p03281 (python)

Fixed submission:
import numpy as np

def unique(w):
    d = {}
    for c in w:
        if c in d.keys():
            d[c] += 1
        else:
            d.setdefault(c, 1)
    return list(d.keys()), list(d.values())

def number_of_divisor(n):
	import numpy as np
	result = []
	while n > 1:
		div = divisor(n)
		result.append(div)
		n //= div
	index, result = unique(result)
	result = [x + 1 for x in result]
	return np.prod(result)

def divisor(n):
    if n % 2 == 0:
        return 2
    elif n % 3 == 0:
        return 3
    maxitr = intSqrt(n)
    i = 1
    while True:
        i += 4
        if i > maxitr:
            return n
        elif n % i == 0:
            return i
        i += 2
        if i > maxitr:
            return n
        elif n % i == 0:
            return i

def intSqrt(n):
    x = 1
    while True:
        x2 = (x + n // x) // 2
        if x2 ** 2 <= n and abs(x - x2) <= 1:
            break
        x = x2
    return x2

def ABC106B(n):
    count = 0
    for i in range(3, n+1, 2):
        if number_of_divisor(i) == 8:
            count += 1
    print(count)

n = int(input())
ABC106B(n)

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

def number_of_divisor(n):
	import numpy as np
	result = []
	while n > 1:
		div = divisor(n)
		result.append(div)
		n //= div
	index, result = np.unique(result, return_counts=True)
	return np.prod(result+1)

def divisor(n):
    if n % 2 == 0:
        return 2
    elif n % 3 == 0:
        return 3
    maxitr = intSqrt(n)
    i = 1
    while True:
        i += 4
        if i > maxitr:
            return n
        elif n % i == 0:
            return i
        i += 2
        if i > maxitr:
            return n
        elif n % i == 0:
            return i

def intSqrt(n):
    x = 1
    while True:
        x2 = (x + n // x) // 2
        if x2 ** 2 <= n and abs(x - x2) <= 1:
            break
        x = x2
    return x2

def ABC106B(n):
    count = 0
    for i in range(3, n+1, 2):
        if number_of_divisor(i) == 8:
            count += 1
    print(count)

n = int(input())
ABC106B(n)
Problem p03292 (python)

Fixed submission:
import numpy as np

a = list(map(int, input().split()))
def task(b):
    return abs(b[1] - b[0]) + abs(b[2] - b[1])
a = np.array(a)
p = np.array([[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]) - 1
Min = np.inf
for i in range(6):
    Min = min(Min, task(a[p[i,:]]))
print(Min)

Buggy submission (verdict: Runtime Error):
# ABC103A

import numpy as np

 = list(map(int, input().split()))
def task(b):
    return abs(b[1] - b[0]) + abs(b[2] - b[1])
a = np.array(a)
p = np.array([[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]) - 1
Min = np.inf
for i in range(6):
    Min = min(Min, task(a[p[i,:]]))
print(Min)

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

b = list(map(int, input().split()))
def task(b):
    return abs(b[1] - b[0]) + abs(b[2] - b[1])
a = np.array(a)
p = np.array([[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]) - 1
Min = np.inf
for i in range(6):
    Min = min(Min, task(a[p[i,:]]))
print(Min)
Problem p03308 (python)

Fixed submission:
# ABC102B

import numpy as np
n = int(input())
a = [int(x) for x in input().split()]
print(np.amax(abs(np.subtract.outer(a, a))))

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = [int(x) for x in input()]
print(np.amax(abs(np.subtract.outer(a, a))))

Buggy submission (verdict: Runtime Error):
mport numpy as np
n = int(input())
a = [int(input()) for x in range(n)]
print(np.amax(abs(np.subtract.outer(a, a))))