Buggy python submission (verdict: Runtime Error):
def prime_factorize(n):
    a = []
    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 != 1:
        a.append(n)
    return a
  
  def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)

A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)

koyaku_insu = prime_factorize(koyaku)


print(len(koyaku_insu))

Fixed submission:
def prime_factorize(n):
    a = [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 != 1:
        a.append(n)
    return a
  
def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)
 
A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)
 
koyaku_insu = list(set(prime_factorize(koyaku)))
 
 
print(len(koyaku_insu))

Buggy python submission (verdict: Time Limit Exceeded):
def yakusu(n):
    max_yakusu = int(n**0.5)
    arr = [1]
    tmp = 2

    while n > 1:
        for i in range(tmp,min(n+1,max_yakusu+1)):
            if n % i == 0:
                arr.append(i)
                while n % i == 0:
                    n = int(n/i)
                    tmp = i + 1
                break
    return arr

def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)

A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)

koyaku_insu = yakusu(koyaku)


print(len(koyaku_insu))

Fixed submission:
def prime_factorize(n):
    a = [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 != 1:
        a.append(n)
    return a
  
def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)
 
A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)
 
koyaku_insu = list(set(prime_factorize(koyaku)))
 
 
print(len(koyaku_insu))

Buggy python submission (verdict: Time Limit Exceeded):
def yakusu(n):
    max_yakusu = int(n**0.5)
    arr = [1]
    tmp = 2

    while n > 1:
        for i in range(tmp,max(n+1,max_yakusu+1)):
            if n % i == 0:
                arr.append(i)
                while n % i == 0:
                    n = int(n/i)
                    tmp = i + 1
                break
    return arr

def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)

A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)

koyaku_insu = yakusu(koyaku)


print(len(koyaku_insu))

Fixed submission:
def prime_factorize(n):
    a = [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 != 1:
        a.append(n)
    return a
  
def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)
 
A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)
 
koyaku_insu = list(set(prime_factorize(koyaku)))
 
 
print(len(koyaku_insu))

Buggy python submission (verdict: Time Limit Exceeded):
def yakusu(n):
    max_yakusu = int(n**0.5)
    arr = [1]
    tmp = 2

    while n > 1:
        for i in range(tmp,max(n+1,max_yakusu+1)):
            if n % i == 0:
                while n % i == 0:
                    arr.append(i)
                    n = int(n/i)
                    tmp = i + 1
                break
    return arr

def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)

A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)

koyaku_insu = set(yakusu(koyaku))


print(len(koyaku_insu))

Fixed submission:
def prime_factorize(n):
    a = [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 != 1:
        a.append(n)
    return a
  
def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)
 
A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)
 
koyaku_insu = list(set(prime_factorize(koyaku)))
 
 
print(len(koyaku_insu))

Buggy python submission (verdict: Time Limit Exceeded):
def yakusu(n):
    max_yakusu = int(n**0.5)
    arr = [1]

    while n > 1:
        for i in range(2,max(n+1,max_yakusu+1)):
            if n % i == 0:
                while n % i == 0:
                    arr.append(i)
                    n = int(n/i)
                break
    return arr

def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)

A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)

koyaku_insu = set(yakusu(koyaku))


print(len(koyaku_insu))

Fixed submission:
def prime_factorize(n):
    a = [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 != 1:
        a.append(n)
    return a
  
def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)
 
A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)
 
koyaku_insu = list(set(prime_factorize(koyaku)))
 
 
print(len(koyaku_insu))

Buggy python submission (verdict: Time Limit Exceeded):
def yakusu(n):
    max_yakusu = int(n**0.5)
    arr = [1]

    while n > 1:
        for i in range(2,max(n+1,max_yakusu+1)):
            if n % i == 0:
                arr.append(i)
                n = int(n/i)
                break
    return arr

def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)

A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)

koyaku_insu = set(yakusu(koyaku))


print(len(koyaku_insu))

Fixed submission:
def prime_factorize(n):
    a = [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 != 1:
        a.append(n)
    return a
  
def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)
 
A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)
 
koyaku_insu = list(set(prime_factorize(koyaku)))
 
 
print(len(koyaku_insu))

Buggy python submission (verdict: Time Limit Exceeded):
def yakusu(n):
    max_yakusu = int(n**0.5)
    arr = [1]

    while n > 1:
        for i in range(2,max(n+1,max_yakusu+1)):
            if n % i == 0:
                arr.append(i)
                n = int(n/i)
                break
    return arr

A,B = [int(x) for x in input().split()]

A_insu = set(yakusu(A))
B_insu = set(yakusu(B))
print(len(list(A_insu & B_insu)))

Fixed submission:
def prime_factorize(n):
    a = [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 != 1:
        a.append(n)
    return a
  
def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)
 
A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)
 
koyaku_insu = list(set(prime_factorize(koyaku)))
 
 
print(len(koyaku_insu))