Buggy python submission (verdict: Runtime Error):
import sys
import fractions
input = sys.stdin.readline

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

n = fractions.gcd(A, B)
if n == 1:
    print(1)
    sys.exit()


def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = {2}
    limit = int(n**0.5)
    data = {i + 1 for i in range(2, n, 2)}
    while True:
        p = data[0]
        if limit <= p:
            return prime | data
        prime.add(p)
        data = {e for e in data if e % p != 0}


p = set(get_sieve_of_eratosthenes(n))
count = sum([1 for i in p if not n % i])

print(count + 1)


Fixed submission:
import sys
import fractions
input = sys.stdin.readline

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

n = fractions.gcd(A, B)
if n == 1:
    print(1)
    sys.exit()


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


a = {x[0] for x in factorization(A)}
b = {x[0] for x in factorization(B)}

print(len(a & b) + 1)

Buggy python submission (verdict: Runtime Error):
import sys
import fractions
input = sys.stdin.readline

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

n = fractions.gcd(A, B)
if n == 1:
    print(1)
    sys.exit()


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


p = set(primes(n))
count = sum([1 for i in p if not n % i])

print(count + 1)


Fixed submission:
import sys
import fractions
input = sys.stdin.readline

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

n = fractions.gcd(A, B)
if n == 1:
    print(1)
    sys.exit()


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


a = {x[0] for x in factorization(A)}
b = {x[0] for x in factorization(B)}

print(len(a & b) + 1)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import fractions
input = sys.stdin.readline

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

n = fractions.gcd(A, B)
if n == 1:
    print(1)
    sys.exit()


def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            if i != n // i:
                divisors.add(n//i)

    # divisors.sort()
    return divisors


def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = [2]
    limit = int(n**0.5)
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]


d = make_divisors(n)
p = set(get_sieve_of_eratosthenes(n))

print(len(d & p) + 1)


Fixed submission:
import sys
import fractions
input = sys.stdin.readline

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

n = fractions.gcd(A, B)
if n == 1:
    print(1)
    sys.exit()


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


a = {x[0] for x in factorization(A)}
b = {x[0] for x in factorization(B)}

print(len(a & b) + 1)

Buggy python submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline

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

n = math.gcd(A, B)
if n == 1:
    print(1)
    sys.exit()


def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            if i != n // i:
                divisors.add(n//i)

    # divisors.sort()
    return divisors


def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = [2]
    limit = int(n**0.5)
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]


d = make_divisors(n)
p = set(get_sieve_of_eratosthenes(n))

print(len(d & p) + 1)


Fixed submission:
import sys
import fractions
input = sys.stdin.readline

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

n = fractions.gcd(A, B)
if n == 1:
    print(1)
    sys.exit()


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


a = {x[0] for x in factorization(A)}
b = {x[0] for x in factorization(B)}

print(len(a & b) + 1)