Buggy python submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    return divisors


def furui(data):
    for d in data:
        data = [x for x in data if (x == d or x % d != 0)]
    return data


a, b = map(int, input().split())
# a, b = 100000000000000, 1000000000000000
a = make_divisors(a)
a = furui(a)
b = make_divisors(b)
b = furui(b)
print(len(set(a) & set(b)) + 1)


Fixed submission:
from collections import defaultdict

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


def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)


d = gcd(A, B)
# print(d)


def f(v):
    dic = defaultdict(int)
    if v == 1:
        dic[1] = 1
        return dic
    for i in range(2, v):
        if i * i > v:
            break
        while v % i == 0:
            v //= i
            dic[i] += 1
    if v != 1:
        dic[v] += 1
    dic[1] = 1
    return dic


divisor = f(d)
# print(divisor)
print(len(divisor))

Buggy python submission (verdict: Time Limit Exceeded):
def is_prime(n, cf):
    for i in cf:
        if i * i > n:
            return 1  # False
        if n % i == 0:
            return 0  # True
    else:
        return 1


def cf(a, b):
    return [i for i in range(2, (min(a, b)) + 1) if a % i == 0 and b % i == 0]


a, b = map(int, input().split())
# a, b = 12, 18
data = cf(a, b)
ans = 0
for n in data:
    ans += is_prime(n, data)
print(ans + 1)
# def sieve(n):
#     is_prime = list(repeat(True, len(n)))
#     prime = []
#     p = 0
#     for i in range(len(n)):
#         if is_prime[i]:
#             p += 1
#             prime.append(n[i])
#             for j in range(2 * n[i], n, i):
#                 is_prime[j] = False
#     return p, prime

# def sieve(n):
#     is_prime = list(repeat(True, n))
#     prime = []
#     p = 0
#     for i in range(2, n):
#         if is_prime[i]:
#             p += 1
#             prime.append(i)
#             for j in range(2 * i, n, i):
#                 is_prime[j] = False
#     return p, prime

# print(sieve(n))
# print(sieve(10000))


Fixed submission:
from collections import defaultdict

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


def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)


d = gcd(A, B)
# print(d)


def f(v):
    dic = defaultdict(int)
    if v == 1:
        dic[1] = 1
        return dic
    for i in range(2, v):
        if i * i > v:
            break
        while v % i == 0:
            v //= i
            dic[i] += 1
    if v != 1:
        dic[v] += 1
    dic[1] = 1
    return dic


divisor = f(d)
# print(divisor)
print(len(divisor))

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
# a, b = 12, 18


def cf(a, b):
    return [i for i in range(2, (min(a, b)) + 1) if a % i == 0 and b % i == 0]


def furui(data):
    for d in data:
        data = [x for x in data if (x == d or x % d != 0)]
    return data


data = cf(a, b)
ans = furui(data)
print(len(ans) + 1)


Fixed submission:
from collections import defaultdict

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


def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)


d = gcd(A, B)
# print(d)


def f(v):
    dic = defaultdict(int)
    if v == 1:
        dic[1] = 1
        return dic
    for i in range(2, v):
        if i * i > v:
            break
        while v % i == 0:
            v //= i
            dic[i] += 1
    if v != 1:
        dic[v] += 1
    dic[1] = 1
    return dic


divisor = f(d)
# print(divisor)
print(len(divisor))

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
# a, b = 12, 18


def cf(a, b):
    return [i for i in range(2, (min(a, b)) + 1) if a % i == 0 and b % i == 0]


def furui(data):
    for d in data:
        data = [x for x in data if (x == d or x % d != 0)]
    return data


data = cf(a, b)
ans = furui(data)
print(len(ans) + 1)


Fixed submission:
from collections import defaultdict

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


def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)


d = gcd(A, B)
# print(d)


def f(v):
    dic = defaultdict(int)
    if v == 1:
        dic[1] = 1
        return dic
    for i in range(2, v):
        if i * i > v:
            break
        while v % i == 0:
            v //= i
            dic[i] += 1
    if v != 1:
        dic[v] += 1
    dic[1] = 1
    return dic


divisor = f(d)
# print(divisor)
print(len(divisor))