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

A, B = map(int, input().split())

def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x

n = gcd(A, B)

is_prime = np.array([True] * (n + 1))
is_prime[0] = False
is_prime[1] = True

for i in range(2, int(n**0.5) + 1):
    if is_prime[i]:
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False

take_l = [i for i in range(1, n + 1) if is_prime[i] and n%i == 0]
print(len(take_l))

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

# 最大公約数
def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x

GCD = gcd(A, B)

# 最大公約数の素因数を求める
prime_factor = []

# 素因数で可能な限り割る
def divide_by_prime_factor(GCD, p):
    if GCD%p == 0:
        prime_factor.append(p)
        while GCD%p == 0:
            GCD /= p
    return GCD, prime_factor

GCD, prime_factor = divide_by_prime_factor(GCD, 2)

for i in range(3, int(GCD**0.5)+1, 2):
    GCD, prime_factor = divide_by_prime_factor(GCD, i)

# GCDそれ自身が素数の場合を考慮。GCD==1の場合を除くことに注意
if GCD > 2:
    GCD, prime_factor = divide_by_prime_factor(GCD, GCD)

# 素因数の数+1を出力
print(len(prime_factor)+1)

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

def gcd(x, y):
    while y != 0:
        x, y = y, x%y
    return x

n = gcd(max(A,B),min(A,B))

is_prime = [True] * (n + 1)
is_prime[0] = False
is_prime[1] = True

for i in range(2, int(n**0.5) + 1):
    if is_prime[i]:
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False

take_l = [i for i in range(1, n + 1) if all([is_prime[i], A%i == 0, B%i == 0])]
print(len(take_l))

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

# 最大公約数
def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x

GCD = gcd(A, B)

# 最大公約数の素因数を求める
prime_factor = []

# 素因数で可能な限り割る
def divide_by_prime_factor(GCD, p):
    if GCD%p == 0:
        prime_factor.append(p)
        while GCD%p == 0:
            GCD /= p
    return GCD, prime_factor

GCD, prime_factor = divide_by_prime_factor(GCD, 2)

for i in range(3, int(GCD**0.5)+1, 2):
    GCD, prime_factor = divide_by_prime_factor(GCD, i)

# GCDそれ自身が素数の場合を考慮。GCD==1の場合を除くことに注意
if GCD > 2:
    GCD, prime_factor = divide_by_prime_factor(GCD, GCD)

# 素因数の数+1を出力
print(len(prime_factor)+1)

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

def gcd(x, y):
    while y != 0:
        x, y = y, x%y
    return x

n = gcd(A,B)

is_prime = [True] * (n + 1)
is_prime[0] = False
is_prime[1] = True

for i in range(2, int(n**0.5) + 1):
    if is_prime[i]:
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False

take_l = [i for i in range(1, n + 1) if all([is_prime[i], A%i == 0, B%i == 0])]
print(len(take_l))

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

# 最大公約数
def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x

GCD = gcd(A, B)

# 最大公約数の素因数を求める
prime_factor = []

# 素因数で可能な限り割る
def divide_by_prime_factor(GCD, p):
    if GCD%p == 0:
        prime_factor.append(p)
        while GCD%p == 0:
            GCD /= p
    return GCD, prime_factor

GCD, prime_factor = divide_by_prime_factor(GCD, 2)

for i in range(3, int(GCD**0.5)+1, 2):
    GCD, prime_factor = divide_by_prime_factor(GCD, i)

# GCDそれ自身が素数の場合を考慮。GCD==1の場合を除くことに注意
if GCD > 2:
    GCD, prime_factor = divide_by_prime_factor(GCD, GCD)

# 素因数の数+1を出力
print(len(prime_factor)+1)