Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

num = gcd(A, B)

if num < 2:
    print(1)
    quit()

length = int(num ** 0.5) + 2
isPrime = [True for i in range(length)]
isPrime[2] = True
for i in range(2, length):
    if isPrime[i]:
        for j in range(2 * i, length, i):
            isPrime[j] = False

count = 1

cur = 2
while num != 1:
    if isPrime[cur] and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print(count)


Fixed submission:
A, B = map(int, input().split())

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

num = gcd(A, B)

if num < 2:
    print(1)
    quit()

length = int(num ** 0.5) + 2
isPrime = [True for i in range(length)]
isPrime[2] = True
for i in range(2, length):
    if isPrime[i]:
        for j in range(2 * i, length, i):
            isPrime[j] = False

count = 1

cur = 2
while num != 1 and cur < length:
    if isPrime[cur] and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print(count + (num != 1))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

num = gcd(A, B)

if num < 2:
    print(1)
    quit()

length = int(num ** 0.5) + 1
isPrime = [True for i in range(length)]
isPrime[2] = True
for i in range(2, length):
    if isPrime[i]:
        for j in range(2 * i, length, i):
            isPrime[j] = False

count = 1

cur = 2
while num != 1:
    if isPrime[cur] and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print(count)


Fixed submission:
A, B = map(int, input().split())

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

num = gcd(A, B)

if num < 2:
    print(1)
    quit()

length = int(num ** 0.5) + 2
isPrime = [True for i in range(length)]
isPrime[2] = True
for i in range(2, length):
    if isPrime[i]:
        for j in range(2 * i, length, i):
            isPrime[j] = False

count = 1

cur = 2
while num != 1 and cur < length:
    if isPrime[cur] and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print(count + (num != 1))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

num = gcd(A, B)

isPrime = [True for i in range(num + 1)]
isPrime[2] = True
for i in range(2, num+1):
    if isPrime[i]:
        for j in range(2 * i, num+1, i):
            isPrime[j] = False

count = 1

cur = 2
while num != 1:
    if isPrime[cur] and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print(count)


Fixed submission:
A, B = map(int, input().split())

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

num = gcd(A, B)

if num < 2:
    print(1)
    quit()

length = int(num ** 0.5) + 2
isPrime = [True for i in range(length)]
isPrime[2] = True
for i in range(2, length):
    if isPrime[i]:
        for j in range(2 * i, length, i):
            isPrime[j] = False

count = 1

cur = 2
while num != 1 and cur < length:
    if isPrime[cur] and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print(count + (num != 1))

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

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

def isPrime(x):
    for i in range(2, int(x ** 0.5) + 1):
        if x % i == 0: return False
    return True

count = 1
num = gcd(A, B)
cur = 2
while num != 1:
    if isPrime(cur) and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print(count)


Fixed submission:
A, B = map(int, input().split())

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

num = gcd(A, B)

if num < 2:
    print(1)
    quit()

length = int(num ** 0.5) + 2
isPrime = [True for i in range(length)]
isPrime[2] = True
for i in range(2, length):
    if isPrime[i]:
        for j in range(2 * i, length, i):
            isPrime[j] = False

count = 1

cur = 2
while num != 1 and cur < length:
    if isPrime[cur] and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print(count + (num != 1))

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

isPrime = [True for i in range(max(A, B)+1)]
isPrime[0] = False
isPrime[1] = False

for i in range(2, max(A, B) + 1):
    if isPrime[i]:
        for j in range(2*i, max(A, B)+1, i):
            isPrime[j] = False


print(sum(p for i, p in enumerate(isPrime) if i>0 and A%i==0 and B%i==0) + 1)


Fixed submission:
A, B = map(int, input().split())

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

num = gcd(A, B)

if num < 2:
    print(1)
    quit()

length = int(num ** 0.5) + 2
isPrime = [True for i in range(length)]
isPrime[2] = True
for i in range(2, length):
    if isPrime[i]:
        for j in range(2 * i, length, i):
            isPrime[j] = False

count = 1

cur = 2
while num != 1 and cur < length:
    if isPrime[cur] and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print(count + (num != 1))