Problem p02900 (python)

Fixed submission:
from math import gcd
A, B = map(int,input().split())
max_cmn_div = gcd(A, B)

# 約数列挙関数
def make_divisor(n):
    divisor = []
    for i in range(1, int(n**(1/2))+1):
        if n % i == 0:
            divisor.append(i)
            if i != n//i:
                divisor.append(n//i)
    return divisor

def check_prime(n):
    for i in range(2, int(n**(1/2))+1):
        if n % i == 0:
            return 0
    return 1

cmn_div = make_divisor(max_cmn_div)
ans = 0
for i in cmn_div:
    if check_prime(i):
        ans += 1
print(ans)

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

def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            divisors.add(n//i)
    return divisors

lst_A = make_divisors(A)
lst_B = make_divisors(B)
cmn_lst = lst_A & lst_B
m = max(cmn_lst)

hurui = [1] * (m+1)
hurui[0] = 0
for j in range(2, m//2+1):
    for k in range(j, m+1, j):
        if k == j:
            continue
        hurui[k] += 1

cand = set()
for p, v in enumerate(hurui):
    if v == 1:
        cand.add(p)
print(len(cand & cmn_lst))

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

def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            divisors.add(n//i)
    return divisors

lst_A = make_divisors(A)
lst_B = make_divisors(B)
cmn_lst = lst_A & lst_B
cmn = list(cmn_lst)
m = max(cmn)

hurui = [1] * (m+1)
hurui[0] = 0
for j in range(2, m//2+1):
    for k in range(j, m+1, j):
        if k == j:
            continue
        hurui[k] += 1

cand = set()
for i, v in enumerate(hurui):
    if v == 1:
        cand.add(i)
print(len(cand & cmn_lst))

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

def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            divisors.add(n//i)
    return divisors

lst_A = make_divisors(A)
lst_B = make_divisors(B)
cmn_lst = lst_A & lst_B
m = max(cmn_lst)

hurui = [1] * (m+1)
hurui[0] = 0
for j in range(2, m//2+1):
    for k in range(j, m+1, j):
        if k == j:
            continue
        hurui[k] += 1

cand = set()
for i, v in enumerate(hurui):
    if v == 1:
        cand.add(i)
print(len(cand & cmn_lst))

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

def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            if i != n // i:
                divisors.add(n//i)
    return divisors

lst_A = make_divisors(A)
lst_B = make_divisors(B)
cmn_lst = lst_A & lst_B
m = max(cmn_lst)

hurui = [1] * (m+1)
hurui[0] = 0
for j in range(2, m//2+1):
    for k in range(j, m+1, j):
        if k == j:
            continue
        hurui[k] += 1

cand = set()
for i, v in enumerate(hurui):
    if v == 1:
        cand.add(i)
print(len(cand & cmn_lst))

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

def make_divisors(m, n):
    divisors = []
    for i in range(1, int(min(m, n)**0.5)+1):
        if n % i == 0 and m % i == 0:
            divisors.append(i)
            if i != n // i and i != m // i:
                if n // i == m // i:
                    divisors.append(n//i)
    divisors.sort()
    return divisors

lst = make_divisors(A, B)
m = max(lst)

hurui = [1] * (m+1)
hurui[0] = 0
for j in range(2, m//2+1):
    for k in range(j, m+1, j):
        if k == j:
            continue
        hurui[k] += 1

cand = []
for i, v in enumerate(hurui):
    if v == 1:
        cand.append(i)
print(len(set(cand) & set(lst)))

Buggy submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
gcd_list=[]
so_list=[]
for num in range(1,math.gcd(A,B)+1):
    if A%num==0 and B%num==0:
        gcd_list.append(num)
for i in gcd_list:
    flag=0
    if len(so_list)==0:
        so_list.append(i)
    else:
        for num in so_list:
            if num==1:
                continue
            if i%num==0:
                flag=1
                break
        if flag==0:
            so_list.append(i)
print(len(so_list))

Buggy submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
gcd_list=[]
so_list=[]
for num in range(2,math.gcd(A,B)+1):
    if A%num==0 and B%num==0:
        gcd_list.append(num)
for i in gcd_list:
    flag=0
    if len(so_list)==0:
        so_list.append(i)
    else:
        for num in so_list:
            if i%num==0:
                flag=1
                break
        if flag==0:
            so_list.append(i)
print(len(so_list)+1)