Buggy python submission (verdict: Time Limit Exceeded):
import math
A, B = map(int, input().split())

def is_prime(n):
  if n == 1: return False

  for k in range(2, int(math.sqrt(n)) + 1):
    if n % k == 0:
      return False

  return True

cf=[]
cnt = 0
for i in range(1,min(A,B)+1):
  if A % i == 0 and B % i == 0:
    cf.append(i)
    if is_prime(i) == True:
      cnt += 1

print(cnt+1)

Fixed submission:
from fractions import gcd

def prime_factorize(n):
  factor = []
  for i in range(2, int(n**0.5)+1):
    while n % i == 0:
      n //= i
      factor.append(i)
  if n != 1:
    factor.append(n)
  return factor

A, B = map(int, input().split())
N = gcd(A, B)
l = set(prime_factorize(N))
print(len(l)+1)

Buggy python submission (verdict: Time Limit Exceeded):
import math
A, B = map(int, input().split())

cf=[]
for i in range(1,min(A,B)+1):
  if A % i == 0 and B % i == 0:
    cf.append(i)

def is_prime(n):
  if n == 1: return False

  for k in range(2, int(math.sqrt(n)) + 1):
    if n % k == 0:
      return False

  return True
    
cnt = 0
for i in range(len(cf)):
  if is_prime(cf[i]) == True:
    cnt += 1

print(cnt+1)

Fixed submission:
from fractions import gcd

def prime_factorize(n):
  factor = []
  for i in range(2, int(n**0.5)+1):
    while n % i == 0:
      n //= i
      factor.append(i)
  if n != 1:
    factor.append(n)
  return factor

A, B = map(int, input().split())
N = gcd(A, B)
l = set(prime_factorize(N))
print(len(l)+1)

Buggy python submission (verdict: Time Limit Exceeded):
import math
A, B = map(int, input().split())

def cf(x1,x2):
  cf=[]
  for i in range(1,min(x1,x2)+1):
    if x1 % i == 0 and x2 % i == 0:
      cf.append(i)
  return cf

def using_sqrt(limit):
    n = 0
    for k in range(2, limit+1):
        factor = 0
        
        # 2以外の偶数は素数ではないので無視する
        if k % 2 == 0 and k != 2:
            continue
        
        # 繰り返しの上限を対象の平方根にする
        for divisor in range(2, math.floor(math.sqrt(k))+1):
            if k % divisor == 0:
                factor += 1
                
        if factor == 0:
            n += 1
            
    return n

l = cf(A, B)

cnt = 0
for i in range(len(l)):
  if using_sqrt(l[i]) <= 2:
    cnt += 1
  else:
    break

print(cnt)

Fixed submission:
from fractions import gcd

def prime_factorize(n):
  factor = []
  for i in range(2, int(n**0.5)+1):
    while n % i == 0:
      n //= i
      factor.append(i)
  if n != 1:
    factor.append(n)
  return factor

A, B = map(int, input().split())
N = gcd(A, B)
l = set(prime_factorize(N))
print(len(l)+1)

Buggy python submission (verdict: Time Limit Exceeded):
import math
A, B = map(int, input().split())

def cf(x1,x2):
  cf=[]
  for i in range(1,min(x1,x2)+1):
    if x1 % i == 0 and x2 % i == 0:
      cf.append(i)
  return cf

def using_sqrt(limit):
    n = 0
    for k in range(2, limit+1):
        factor = 0
        
        # 2以外の偶数は素数ではないので無視する
        if k % 2 == 0 and k != 2:
            continue
        
        # 繰り返しの上限を対象の平方根にする
        for divisor in range(2, math.floor(math.sqrt(k))+1):
            if k % divisor == 0:
                factor += 1
                
        if factor == 0:
            n += 1
            
    return n

l = cf(A, B)

cnt = 0
for i in range(len(l)):
  if using_sqrt(l[i]) <= 2:
    cnt += 1

print(cnt)

Fixed submission:
from fractions import gcd

def prime_factorize(n):
  factor = []
  for i in range(2, int(n**0.5)+1):
    while n % i == 0:
      n //= i
      factor.append(i)
  if n != 1:
    factor.append(n)
  return factor

A, B = map(int, input().split())
N = gcd(A, B)
l = set(prime_factorize(N))
print(len(l)+1)