Problem p02900 (python)

Fixed submission:
from fractions import gcd
def f(n):
    tmp = n
    cnt = 0
    i = 2
    while i <= n**0.5 + 1:
        if tmp < i:
            break
        if tmp % i == 0:
            cnt += 1
            while tmp % i == 0:
                tmp //= i
        i += 1
    if tmp != 1:
        cnt += 1
    return cnt

A, B = map(int, input().split())
g = gcd(A, B)
ans = f(g) + 1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
import fractions
def isprime(number):
    for i in range(2, round(math.sqrt(number)) + 1):
        if number % i == 0:
            return False
    return True

A, B = map(int, input().split())
count = 1
N = fractions.gcd(A, B)

for i in range(2, N + 1):
  	if i != 2 and i % 2 == 0:
    	continue
    if N % i == 0:
        if isprime(i):
            count += 1

print(str(count))

Buggy submission (verdict: Runtime Error):
import math
import fractions
def isprime(number):
    for i in range(2, round(math.sqrt(number)) + 1):
        if number % i == 0:
            return False
    return True

A, B = map(int, input().split())
count = 1
N = fractions.gcd(A, B)

for i in range(2, N + 1):
  	if i != 2 and i % 2 == 0:
        continue
    if N % i == 0:
        if isprime(i):
            count += 1

print(str(count))

Buggy submission (verdict: Runtime Error):
import math
import fractions
def isprime(number):
    for i in range(2, round(math.sqrt(number)) + 1):
        if number % i == 0:
            return False
    return True

A, B = map(int, input().split())
count = 1
N = fractions.gcd(A, B)

for i in range(2, N + 1):
  	if i != 2 and i % 2 == 0:
      continue
    if N % i == 0:
        if isprime(i):
            count += 1

print(str(count))

Buggy submission (verdict: Runtime Error):
import math

def isprime(number):
    for i in range(2, round(math.sqrt(number)) + 1):
        if number % i == 0:
            return False
    return True

A, B = map(int, input().split())
count = 1
N = math.gcd(A, B)

for i in range(2, N + 1):
    if N % i == 0:
        if isprime(i):
            count += 1

print(str(count))

Buggy submission (verdict: Runtime Error):
import math

def isprime(number):
    for i in range(2, round(math.sqrt(number)) + 1):
        if number % i == 0:
            return False
    return True

A, B = map(int, input().split())
count = 1
N = math.gcd(A, B)

for i in range(2, N + 1):
    if N % i == 0:
        if isprime(i):
            count += 1

print(str(count))

Buggy submission (verdict: Runtime Error):
import math

def isprime(number):
    for i in range(2, round(math.sqrt(number)) + 1):
        if number % i == 0:
            return False
    return True

A, B = map(int, input().split())
count = 1
N = math.gcd(A, B)

for i in range(2, N + 1):
    if N % i == 0:
        if isprime(i):
            count += 1
print(str(count))

Buggy submission (verdict: Runtime Error):
import math

def isprime(number):
    for i in range(2, round(math.sqrt(number)) + 1):
        if number % i == 0:
            return False
    return True

A, B = map(int, input().split())
count = 1
N = math.gcd(A, B)

for i in range(2, N + 1):
    if N % i == 0:
        if isprime(i):
            count += 1
            print(str(i))
print(str(count))

Buggy submission (verdict: Runtime Error):
import math

def isprime(number):
    for i in range(2, number):
        if number % i == 0:
            return False
    return True

A, B = map(int, input().split())
count = 1

if B < A:
    C = B
    B = A
    A = C
# A <= B

for i in range(2, round(A / 2 + 1):
    if A % i == 0:
        if B % i == 0:
            if isprime(i):
                count += 1

print(str(count))