Buggy python submission (verdict: Runtime Error):
def prime_factorize(n):
    a = set([1])
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n not in a:
        a.add(n)
    return a
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
a, b = list(map(int, input().split()))
x = gcd(a, b)
print(len(prime_factorize(x)))


Fixed submission:
def prime_factorize(n):
    a = set([1])
    while n % 2 == 0:
        a.add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.add(f)
            n //= f
        else:
            f += 2
    a.add(n)
    return a
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
  
a, b = list(map(int, input().split()))
x = gcd(a, b)
print(len(prime_factorize(x)))

Buggy python submission (verdict: Time Limit Exceeded):
def cul(a, b):
  return [i for i in range(1,min(a,b)+1) if a%i==0 and b%i==0]
a, b = list(map(int, input().split()))
cf = cul(a, b)
n = len(cf)
i = 1
while True:
  if n==1:
    print(1)
    break
  tmp = cf[i]
  for c in cf[i:]:
      if c==tmp:
        continue
      elif c%tmp==0:
        cf.remove(c)
  if cf[-1]==tmp:
    print(len(cf))
    break
  else:
    i += 1

Fixed submission:
def prime_factorize(n):
    a = set([1])
    while n % 2 == 0:
        a.add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.add(f)
            n //= f
        else:
            f += 2
    a.add(n)
    return a
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
  
a, b = list(map(int, input().split()))
x = gcd(a, b)
print(len(prime_factorize(x)))

Buggy python submission (verdict: Runtime Error):
def cul(a, b):
  return [i for i in range(1,min(a,b)+1) if a%i==0 and b%i==0]
a, b = list(map(int, input().split()))
cf = cul(a, b)
n = len(cf)
i = 1
while True:
  tmp = cf[i]
  for c in cf[i:]:
    if c==tmp:
      continue
    elif c%tmp==0:
      cf.remove(c)
  if cf[-1]==tmp:
    print(len(cf))
    break
  else:
    i += 1

Fixed submission:
def prime_factorize(n):
    a = set([1])
    while n % 2 == 0:
        a.add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.add(f)
            n //= f
        else:
            f += 2
    a.add(n)
    return a
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
  
a, b = list(map(int, input().split()))
x = gcd(a, b)
print(len(prime_factorize(x)))

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a, b):
  while b!=0:
    a,b=b,a%b
  return a
def cul(a, b):
  return [i for i in range(1,min(a,b)+1) if a%i==0 and b%i==0]

a, b = list(map(int, input().split()))
cf = cul(a, b)
n = len(cf)
c = 0
for i in range(0, n):
  d = 0
  for j in range(0, i):
    if gcd(cf[i], cf[j])!=1:
      d = 1
      break
  	
  if d==0:
    c+=1
print(c)


Fixed submission:
def prime_factorize(n):
    a = set([1])
    while n % 2 == 0:
        a.add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.add(f)
            n //= f
        else:
            f += 2
    a.add(n)
    return a
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
  
a, b = list(map(int, input().split()))
x = gcd(a, b)
print(len(prime_factorize(x)))

Buggy python submission (verdict: Time Limit Exceeded):
def cul(a, b):
  return [i for i in range(1,min(a,b)+1) if a%i==0 and b%i==0]

a, b = list(map(int, input().split()))
cf = cul(a, b)
n = len(cf)
c = 0
for i in range(0, n):
  d = []
  for j in range(0, i):
    d.extend(cul(cf[i], cf[j]))
  if len(d)==i:
    c+=1
print(c)


Fixed submission:
def prime_factorize(n):
    a = set([1])
    while n % 2 == 0:
        a.add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.add(f)
            n //= f
        else:
            f += 2
    a.add(n)
    return a
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
  
a, b = list(map(int, input().split()))
x = gcd(a, b)
print(len(prime_factorize(x)))