Buggy python submission (verdict: Time Limit Exceeded):
import itertools, fractions
A, B = map(int, input().split())
cd_list = []
if A >= B:
    for n in range(1, B+1):
        if A%n == 0 and B%n == 0:
            cd_list.append(n)
else:
    for n in range(1, A+1):
        if A%n == 0 and B%n == 0:
            cd_list.append(n)
prime_list = [1]
for i in range(1, len(cd_list)):
        res = 0
        for n in cd_list[:i]:
            if fractions.gcd(cd_list[i], n) == 1:
                res += 1
        if res == len(cd_list[:i]):
                prime_list.append(cd_list[i])
print(len(prime_list))

Fixed submission:
import fractions, math
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, 2])
    return arr
A, B = map(int, input().split())
N = fractions.gcd(A, B)
prime_list = factorization(N)
if N == 1:
    print(1)
else:
    print(len(prime_list)+1)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools, fractions
A, B = map(int, input().split())
cd_list = []
if A >= B:
    for n in range(1, B+1):
        if A%n == 0 and B%n == 0:
            cd_list.append(n)
else:
    for n in range(1, A+1):
        if A%n == 0 and B%n == 0:
            cd_list.append(n)
prime_list = [1]
for i in range(1, len(cd_list)):
    if all([1 if fractions.gcd(cd_list[i], n)==1 else 0 for n in cd_list[:i]]):
        prime_list.append(cd_list[i])
print(len(prime_list))


Fixed submission:
import fractions, math
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, 2])
    return arr
A, B = map(int, input().split())
N = fractions.gcd(A, B)
prime_list = factorization(N)
if N == 1:
    print(1)
else:
    print(len(prime_list)+1)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools, fractions
A, B = map(int, input().split())
if A>=B:
    cd_list = [n for n in range(1, B+1) if A%n==0 and B%n==0]
else:
    cd_list = [n for n in range(1, A+1) if A%n==0 and B%n==0]
prime_list = [1]
for i in range(1, len(cd_list)):
    true_list = [1 if fractions.gcd(cd_list[i], n)==1 else 0 for n in cd_list[:i]]
    if sum(true_list) == len(cd_list[:i]):
        prime_list.append(cd_list[i])
print(len(prime_list))


Fixed submission:
import fractions, math
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, 2])
    return arr
A, B = map(int, input().split())
N = fractions.gcd(A, B)
prime_list = factorization(N)
if N == 1:
    print(1)
else:
    print(len(prime_list)+1)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools, fractions
A, B = map(int, input().split())
cd_list = []
if A >= B:
    cd_list = [n for n in range(1, B+1) if A%n==0 and B%n==0]
else:
    cd_list = [n for n in range(1, A+1) if A%n==0 and B%n==0]
prime_list = [1]
for i in range(1, len(cd_list)):
    if all([1 if fractions.gcd(cd_list[i], n)==1 else 0 for n in cd_list[:i]]):
        prime_list.append(cd_list[i])
print(len(prime_list))


Fixed submission:
import fractions, math
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, 2])
    return arr
A, B = map(int, input().split())
N = fractions.gcd(A, B)
prime_list = factorization(N)
if N == 1:
    print(1)
else:
    print(len(prime_list)+1)