Buggy python submission (verdict: Time Limit Exceeded):
import math

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

# 2整数の公約数一覧 // 2num common divisor -> list
def commonDivisor (n1, n2):
    common_divisor=[]
    for i in range(2, min(n1, n2) + 1):
        if n1 % i == 0 and n2 % i == 0:
            common_divisor.append(i)
    return common_divisor

# 素数判定 // is prime? -> bool
def isPrime(n):
    if n != 2 and n % 2 == 0:
        return False
    for i in range(2, n):
        if n % i == 0:
            return False
    return True

cd = commonDivisor(a, b)
cd.insert(0, 1)
res = []
for num in cd:
    if isPrime(num) and res.count(num) == 0:
        res.append(num)

print("{}".format(len(res)))

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

# 最大公約数
def gcd(a, b):
    while b: a, b = b, a % b
    return abs(a)

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

n = gcd(a, b)
pf = factorization(n)
if pf == [[1, 1]]:
    print("{}".format(len(pf)))
else:
    print("{}".format(len(pf)+1))

Buggy python submission (verdict: Time Limit Exceeded):
import math

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

# 2整数の公約数一覧 // 2num common divisor -> list
def commonDivisor (n1, n2):
    common_divisor=[]
    for i in range(2, min(n1, n2) + 1):
        if n1 % i == 0 and n2 % i == 0:
            common_divisor.append(i)
    return common_divisor

# 素数判定 // is prime? -> bool
def isPrime(n):
    if n != 2 and n % 2 == 0:
        return False
    for i in range(2, n):
        if n % i == 0:
            return False
    return True

cd = commonDivisor(a, b)
cd.insert(0, 1)
res = []
for num in cd:
    if isPrime(num) and res.count(num) == 0:
        res.append(num)

print("{}".format(len(res)))

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

# 最大公約数
def gcd(a, b):
    while b: a, b = b, a % b
    return abs(a)

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

n = gcd(a, b)
pf = factorization(n)
if pf == [[1, 1]]:
    print("{}".format(len(pf)))
else:
    print("{}".format(len(pf)+1))

Buggy python submission (verdict: Time Limit Exceeded):
import math

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

# 2整数の公約数一覧 // 2num common divisor -> list
def commonDivisor (n1, n2):
    common_divisor=[]
    for i in range(2, min(n1, n2) + 1):
        if n1 % i == 0 and n2 % i == 0:
            common_divisor.append(i)
    return common_divisor

# 素数判定 // is prime? -> bool
def isPrime(n):
    for i in range(2, n):
        if n % i == 0:
            return False
    return True

cd = commonDivisor(a, b)
cd.insert(0, 1)
res = []
for num in cd:
    if isPrime(num) and res.count(num) == 0:
        res.append(num)

print("{}".format(len(res)))

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

# 最大公約数
def gcd(a, b):
    while b: a, b = b, a % b
    return abs(a)

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

n = gcd(a, b)
pf = factorization(n)
if pf == [[1, 1]]:
    print("{}".format(len(pf)))
else:
    print("{}".format(len(pf)+1))