Buggy python submission (verdict: Runtime Error):
# 所持している鍵の集合をbitで表現する
#　鍵の集合を表す2進数が少なくなる方向に遷移することはないから，for文for文でかける

N, M = map(int, input().split())
status_money = [float('inf')] * (1 << N)
key_money = []

# 初期状態からの遷移を記録
for _ in range(M) :
    a, b = map(int, input().split())
    key_money.append(a)
    C = 0
    for c in input().split() :
        C |= (1 << int(c) - 1)
    status_money[C] = min(status_money[C], a)
    
# ある状態とある状態の組合せを全部取る
for c in range(1 << N):
    # どんな鍵の組合せでも到達できない宝箱の組合せがあるかもしれない
    if status_money[c] == float('inf'):
        continue
    for d in range(1 << N):
        # c と d の論理和をとって新しく生成される状態 e を考える
        e = c | d
        # eにあらかじめ格納されている最小コストと，今生成したコストとのminをとる
        status_money[e] = min(status_money[c] + status_money[d], status_money[e])

# そもそも到達できない場合の処理を記述       
if status_money[-1] == float('inf'):
    print(-1)
else:
    print(status_money[-1])

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

def gcd(a, b):
	if b == 0: return(a)
	else : return gcd(b, a % b)
		
G = gcd(A, B)
ctr = 1
for i in range(2, int(math.sqrt(G)) + 1):
    if G == 1: 
        break
    if G % i == 0: 
        ctr += 1
    while G % i == 0:
        G /= i
        
if G == 1:        
    print(ctr)
else:
    print(ctr + 1)

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

def gcd(a, b):
	if b == 0: return(a)
	else : return gcd(b, a % b)
		
G = gcd(A, B)
ctr = 1
for i in range(2, G + 1):
    if G == 1: 
        break
    if G % i == 0: 
        ctr += 1
    while G % i == 0:
        G /= i
        
        
print(ctr)

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

def gcd(a, b):
	if b == 0: return(a)
	else : return gcd(b, a % b)
		
G = gcd(A, B)
ctr = 1
for i in range(2, int(math.sqrt(G)) + 1):
    if G == 1: 
        break
    if G % i == 0: 
        ctr += 1
    while G % i == 0:
        G /= i
        
if G == 1:        
    print(ctr)
else:
    print(ctr + 1)

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

def gcd(a, b):
	if b == 0:
		return(a)
	else :
		return gcd(b, a % b)
		
a = gcd(A, B)
ctr = 1
gusu = 0
lst = [2]

for i in range(3, a + 1):
	sosu = 1
	for j in range(2, int(math.sqrt(i) + 1)):
		if i % j == 0:
			sosu = 0
			break
	if sosu == 1:
		lst.append(i)

for i in lst:
	if not (gusu == 1 and i % 2 == 0):
		do = 0
		while a % i == 0:
			a /= i
			do = 1
			if a == 1:
				break
		if do:
			ctr += 1
		if do and i == 2:
			gusu = 1
		if a == 1:
			break
		
print(ctr)

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

def gcd(a, b):
	if b == 0: return(a)
	else : return gcd(b, a % b)
		
G = gcd(A, B)
ctr = 1
for i in range(2, int(math.sqrt(G)) + 1):
    if G == 1: 
        break
    if G % i == 0: 
        ctr += 1
    while G % i == 0:
        G /= i
        
if G == 1:        
    print(ctr)
else:
    print(ctr + 1)

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

def gcd(a, b):
	if b == 0:
		return(a)
	else :
		return gcd(b, a % b)
		
a = gcd(A, B)
ctr = 1
gusu = 0

for i in range(2, a + 1):
	if not (gusu == 1 and i % 2 == 0):
		do = 0
		while a % i == 0:
			a /= i
			do = 1
			if a == 1:
				break
		if do:
			ctr += 1
		if do and i == 2:
			gusu = 1
		if a == 1:
			break
		
print(ctr)

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

def gcd(a, b):
	if b == 0: return(a)
	else : return gcd(b, a % b)
		
G = gcd(A, B)
ctr = 1
for i in range(2, int(math.sqrt(G)) + 1):
    if G == 1: 
        break
    if G % i == 0: 
        ctr += 1
    while G % i == 0:
        G /= i
        
if G == 1:        
    print(ctr)
else:
    print(ctr + 1)

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

def gcd(a, b):
	if b == 0:
		return(a)
	else :
		return gcd(b, a % b)
		
a = gcd(A, B)
ctr = 1

for i in range(2, a + 1):
	do = 0
	while a % i == 0:
		a /= i
		do = 1
		if a == 1:
			break
	if do:
		ctr += 1
	if a == 1:
		break
		
print(ctr)

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

def gcd(a, b):
	if b == 0: return(a)
	else : return gcd(b, a % b)
		
G = gcd(A, B)
ctr = 1
for i in range(2, int(math.sqrt(G)) + 1):
    if G == 1: 
        break
    if G % i == 0: 
        ctr += 1
    while G % i == 0:
        G /= i
        
if G == 1:        
    print(ctr)
else:
    print(ctr + 1)