Buggy python submission (verdict: Runtime Error):
#coding: utf-8
import math
# from fractions import gcd

# GCDの約数を素因数分解する
def primeFactor(n):
    flg = 0
    count = 0
    tmp = math.sqrt(n)
    i = 2

    if n == 1:
        return 1

    while i <= tmp:
        # print(str(i)+str(',')+str(gcd_cnt))
        if n % i == 0:
            if flg == 0:
                flg = 1
                count += 1
            n = n // i
        else:
            flg = 0
            i += 1
    # if flg == 1:
    #     count += 1
    # print(str('素数=')+str(count)+str(' n=')+str(n)+str(' i=')+str(i))
    if n > 1:
        count += 1
    # 1を足す
    count += 1
    return count


# # print(len(div))
m,n = map(int,input().split())
p = math.gcd(m,n)
# print(str('gcd=')+ str(p))
ans = primeFactor(p)
print(ans)


Fixed submission:
#coding: utf-8
from fractions import gcd
import math

# GCDの約数を素因数分解する
def primeFactor(n):
    flg = 0
    count = 0
    tmp = math.sqrt(n)
    i = 2

    if n == 1:
        return 1

    while i <= tmp:
        # print(str(i)+str(',')+str(gcd_cnt))
        if n % i == 0:
            if flg == 0:
                flg = 1
                count += 1
            n = n // i
        else:
            flg = 0
            i += 1
    # if flg == 1:
    #     count += 1
    # print(str('素数=')+str(count)+str(' n=')+str(n)+str(' i=')+str(i))
    if n > 1:
        count += 1
    # 1を足す
    count += 1
    return count


# # print(len(div))
m,n = map(int,input().split())
p = gcd(m,n)
# print(str('gcd=')+ str(p))
ans = primeFactor(p)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
import math
from fractions import gcd

# GCDの約数を素因数分解する
def primeFactor(n):
    flg = 0
    count = 0
    i = 2

    if n == 1:
        return 1

    while i <= n:
        # print(str(i)+str(',')+str(gcd_cnt))
        if n % i == 0:
            if flg == 0:
                flg = 1
                count += 1
            n = n // i
        else:
            flg = 0
            i += 1
    # if flg == 1:
    #     count += 1
    count += 1
    return count


# # print(len(div))
m,n = map(int,input().split())
p = gcd(m,n)
ans = primeFactor(p)
print(ans)


Fixed submission:
#coding: utf-8
from fractions import gcd
import math

# GCDの約数を素因数分解する
def primeFactor(n):
    flg = 0
    count = 0
    tmp = math.sqrt(n)
    i = 2

    if n == 1:
        return 1

    while i <= tmp:
        # print(str(i)+str(',')+str(gcd_cnt))
        if n % i == 0:
            if flg == 0:
                flg = 1
                count += 1
            n = n // i
        else:
            flg = 0
            i += 1
    # if flg == 1:
    #     count += 1
    # print(str('素数=')+str(count)+str(' n=')+str(n)+str(' i=')+str(i))
    if n > 1:
        count += 1
    # 1を足す
    count += 1
    return count


# # print(len(div))
m,n = map(int,input().split())
p = gcd(m,n)
# print(str('gcd=')+ str(p))
ans = primeFactor(p)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
import math
m,n = map(int,input().split())
ans = 1

# GCD(Grate Common Divisier) を求める
def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)

gcd_cnt = gcd(m,n)
# print(gcd_cnt)

# GCDの約数を素因数分解する
flg = 0
i = 2
aaa = gcd_cnt
while i <= gcd_cnt:
    # print(str(i)+str(',')+str(gcd_cnt))
    if gcd_cnt % i == 0:
        flg = 1
        gcd_cnt = gcd_cnt // i
    else:
        if flg == 1:
            ans +=1
            flg = 0
        i+=1
    if i > aaa/2:
        i = aaa
if flg == 1:
    ans += 1

# if m % 2 == 0 and n % 2 == 0:
#     div.append(2)

# for i in range(1,m+1):
#     # print(i)
#     if m % i == 0 and n % i == 0:
#         ans += 1
#         # m = m / i
#         # n = n / i
#         div.append(i)
#         # for j in range(2,len(div)):
#         #     if i % div[j] == 0:
#         #         flg = 1
#         #         break
#         # if flg == 0:
#         #     div.append(i)
#         # else:
#         #     flg = 0
    
# print(" ".join(map(str,div)))
# div.sorted(reversed=True)

# for j in range(1,div[0]):
#     div[0] % j


# # print(len(div))
print(ans)


Fixed submission:
#coding: utf-8
from fractions import gcd
import math

# GCDの約数を素因数分解する
def primeFactor(n):
    flg = 0
    count = 0
    tmp = math.sqrt(n)
    i = 2

    if n == 1:
        return 1

    while i <= tmp:
        # print(str(i)+str(',')+str(gcd_cnt))
        if n % i == 0:
            if flg == 0:
                flg = 1
                count += 1
            n = n // i
        else:
            flg = 0
            i += 1
    # if flg == 1:
    #     count += 1
    # print(str('素数=')+str(count)+str(' n=')+str(n)+str(' i=')+str(i))
    if n > 1:
        count += 1
    # 1を足す
    count += 1
    return count


# # print(len(div))
m,n = map(int,input().split())
p = gcd(m,n)
# print(str('gcd=')+ str(p))
ans = primeFactor(p)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
import math
m,n = map(int,input().split())
ans = 1

# GCD(Grate Common Divisier) を求める
def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)

gcd_cnt = gcd(m,n)
# print(gcd_cnt)

# GCDの約数を素因数分解する
flg = 0
i = 2
while i <= gcd_cnt:
    # print(str(i)+str(',')+str(gcd_cnt))
    if gcd_cnt % i == 0:
        flg = 1
        gcd_cnt = gcd_cnt // i
    else:
        if flg == 1:
            ans +=1
            flg = 0
        i+=1 
if flg == 1:
    ans += 1

# if m % 2 == 0 and n % 2 == 0:
#     div.append(2)

# for i in range(1,m+1):
#     # print(i)
#     if m % i == 0 and n % i == 0:
#         ans += 1
#         # m = m / i
#         # n = n / i
#         div.append(i)
#         # for j in range(2,len(div)):
#         #     if i % div[j] == 0:
#         #         flg = 1
#         #         break
#         # if flg == 0:
#         #     div.append(i)
#         # else:
#         #     flg = 0
    
# print(" ".join(map(str,div)))
# div.sorted(reversed=True)

# for j in range(1,div[0]):
#     div[0] % j


# # print(len(div))
print(ans)


Fixed submission:
#coding: utf-8
from fractions import gcd
import math

# GCDの約数を素因数分解する
def primeFactor(n):
    flg = 0
    count = 0
    tmp = math.sqrt(n)
    i = 2

    if n == 1:
        return 1

    while i <= tmp:
        # print(str(i)+str(',')+str(gcd_cnt))
        if n % i == 0:
            if flg == 0:
                flg = 1
                count += 1
            n = n // i
        else:
            flg = 0
            i += 1
    # if flg == 1:
    #     count += 1
    # print(str('素数=')+str(count)+str(' n=')+str(n)+str(' i=')+str(i))
    if n > 1:
        count += 1
    # 1を足す
    count += 1
    return count


# # print(len(div))
m,n = map(int,input().split())
p = gcd(m,n)
# print(str('gcd=')+ str(p))
ans = primeFactor(p)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
m,n = map(int,input().split())
# div = [0]
div = [1]
flg = 0
ans = 0

# if m % 2 == 0 and n % 2 == 0:
#     div.append(2)

# while i < m:
#     if m % i == 0 and n % i == 0 and i % 2 == 1:
for i in range(1,m+1):
    # print(i)
    if m % i == 0 and n % i == 0:
        ans += 1
        m = m / i
        n = n / i
        # for j in range(2,len(div)):
        #     if i % div[j] == 0:
        #         flg = 1
        #         break
        # if flg == 0:
        #     div.append(i)
        # else:
        #     flg = 0
    
# 約数を求める
# J = 2
# while j > div[len(div)]:
#     div[]
    # print(student[i]-1)
    # toukou[student[i]-1] = i+1
# print(" ".join(map(str,div)))
# print(len(div))
print(ans)


Fixed submission:
#coding: utf-8
from fractions import gcd
import math

# GCDの約数を素因数分解する
def primeFactor(n):
    flg = 0
    count = 0
    tmp = math.sqrt(n)
    i = 2

    if n == 1:
        return 1

    while i <= tmp:
        # print(str(i)+str(',')+str(gcd_cnt))
        if n % i == 0:
            if flg == 0:
                flg = 1
                count += 1
            n = n // i
        else:
            flg = 0
            i += 1
    # if flg == 1:
    #     count += 1
    # print(str('素数=')+str(count)+str(' n=')+str(n)+str(' i=')+str(i))
    if n > 1:
        count += 1
    # 1を足す
    count += 1
    return count


# # print(len(div))
m,n = map(int,input().split())
p = gcd(m,n)
# print(str('gcd=')+ str(p))
ans = primeFactor(p)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
m,n = map(int,input().split())
# div = [0]
div = [1]
flg = 0

if m % 2 == 0 and n % 2 == 0:
    div.append(2)

# while i < m:
#     if m % i == 0 and n % i == 0 and i % 2 == 1:
for i in range(3,m,2):
    if m % i == 0 and n % i == 0 and i % 2 == 1:
        # ans += 1
        # m = m / i
        # n = n / i
        for j in range(2,len(div)):
            if i % div[j] == 0:
                flg = 1
                break
        if flg == 0:
            div.append(i)
        else:
            flg = 1
    

    # print(student[i]-1)
    # toukou[student[i]-1] = i+1
# print(" ".join(map(str,div)))
print(len(div))


Fixed submission:
#coding: utf-8
from fractions import gcd
import math

# GCDの約数を素因数分解する
def primeFactor(n):
    flg = 0
    count = 0
    tmp = math.sqrt(n)
    i = 2

    if n == 1:
        return 1

    while i <= tmp:
        # print(str(i)+str(',')+str(gcd_cnt))
        if n % i == 0:
            if flg == 0:
                flg = 1
                count += 1
            n = n // i
        else:
            flg = 0
            i += 1
    # if flg == 1:
    #     count += 1
    # print(str('素数=')+str(count)+str(' n=')+str(n)+str(' i=')+str(i))
    if n > 1:
        count += 1
    # 1を足す
    count += 1
    return count


# # print(len(div))
m,n = map(int,input().split())
p = gcd(m,n)
# print(str('gcd=')+ str(p))
ans = primeFactor(p)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
m,n = map(int,input().split())
# div = [0]
div = [1]
flg = 0

if m % 2 == 0 and n % 2 == 0:
    div.append(2)

# while i < 0:
    # if m 
for i in range(3,m,2):
    if m % i == 0 and n % i == 0 and i % 2 == 1:
        # ans += 1
        # m = m / i
        # n = n / i
        for j in range(1,len(div)):
            if i % div[j] == 0:
                flg = 1
                break
        if flg == 0:
            div.append(i)
        else:
            flg = 1
    

    # print(student[i]-1)
    # toukou[student[i]-1] = i+1
# print(" ".join(map(str,div)))
print(len(div))


Fixed submission:
#coding: utf-8
from fractions import gcd
import math

# GCDの約数を素因数分解する
def primeFactor(n):
    flg = 0
    count = 0
    tmp = math.sqrt(n)
    i = 2

    if n == 1:
        return 1

    while i <= tmp:
        # print(str(i)+str(',')+str(gcd_cnt))
        if n % i == 0:
            if flg == 0:
                flg = 1
                count += 1
            n = n // i
        else:
            flg = 0
            i += 1
    # if flg == 1:
    #     count += 1
    # print(str('素数=')+str(count)+str(' n=')+str(n)+str(' i=')+str(i))
    if n > 1:
        count += 1
    # 1を足す
    count += 1
    return count


# # print(len(div))
m,n = map(int,input().split())
p = gcd(m,n)
# print(str('gcd=')+ str(p))
ans = primeFactor(p)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
m,n = map(int,input().split())
# div = [0]
div = [1]
flg = 0

if m % 2 == 0 and n % 2 == 0:
    div.append(2)

# while i < 0:
    # if m 
for i in range(3,m):
    if m % i == 0 and n % i == 0 and i % 2 == 1:
        # ans += 1
        # m = m / i
        # n = n / i
        for j in range(1,len(div)):
            if i % div[j] == 0:
                flg = 1
                break
        if flg == 0:
            div.append(i)
        else:
            flg = 1
    

    # print(student[i]-1)
    # toukou[student[i]-1] = i+1
# print(" ".join(map(str,div)))
print(len(div))


Fixed submission:
#coding: utf-8
from fractions import gcd
import math

# GCDの約数を素因数分解する
def primeFactor(n):
    flg = 0
    count = 0
    tmp = math.sqrt(n)
    i = 2

    if n == 1:
        return 1

    while i <= tmp:
        # print(str(i)+str(',')+str(gcd_cnt))
        if n % i == 0:
            if flg == 0:
                flg = 1
                count += 1
            n = n // i
        else:
            flg = 0
            i += 1
    # if flg == 1:
    #     count += 1
    # print(str('素数=')+str(count)+str(' n=')+str(n)+str(' i=')+str(i))
    if n > 1:
        count += 1
    # 1を足す
    count += 1
    return count


# # print(len(div))
m,n = map(int,input().split())
p = gcd(m,n)
# print(str('gcd=')+ str(p))
ans = primeFactor(p)
print(ans)