Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s=int(input())
def is_even(num):
    return num % 2 == 0
list=[]
list.append(s)

def calc(s):
	if is_even(int(s)):
		return (int((s)/2))
		list.append(s)
	else:
		return (int((s)*3+1))
		list.append(s)
	s=int(calc(s))
check=[1,2,4]
for (s) in (check):
	if not (s) in (check):
		calc(s)
else:
	print (int(s)+3)


Fixed submission:
a,b,c=list(map(int,(input()).split()))
print (int(((a)*(b))/2))
Buggy python submission (verdict: Runtime Error):
r
print(int(r)**2)

Fixed submission:
r = int(input())
print(r**2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
X = int(input())
T = int(input())
if N % X == 0:
    c = N / X
else:
    c = int(N / X) + 1 
print(c*T)


Fixed submission:
n, x, t = input().split()
N = int(n)
X = int(x)
T = int(t)
if N % X == 0:
    c = N / X
else:
    c = int(N / X) + 1 
C = int(c)
print(C*T)

Buggy python submission (verdict: Runtime Error):
print("a")
N = int(input("N = ?"))
X = int(input("X = ?"))
T = int(input("T = ?"))
if N % X = 0:
    c = N / X
else:
    c = int(N / X) + 1 
print(c)

Fixed submission:
n, x, t = input().split()
N = int(n)
X = int(x)
T = int(t)
if N % X == 0:
    c = N / X
else:
    c = int(N / X) + 1 
C = int(c)
print(C*T)
Buggy python submission (verdict: Runtime Error):
x,n = (int(x) for x in input().split())
p = [int(x) for x in input().split()]

result = 100

l = list(range(0,6))



if len(p) == 0:
    kotae = x
else:
    for i in range(len(p)):

        l[p[i]] = 200


    for i in reversed(range(len(l))):
     
  

        if l[i] != 200:

            if result >= abs(l[i] - x):
                result = abs(l[i] - x)
               
                kotae = l[i]
          
            



print(kotae)

Fixed submission:
x,n = (int(x) for x in input().split())
p = [int(x) for x in input().split()]

result = 100

l = list(range(0,102))



if len(p) == 0:
    kotae = x
else:
    for i in range(len(p)):

        l[p[i]] = ""



    for i in reversed(range(len(l))):
     
        if l[i] != "":

            if result >= abs(l[i] - x):
                result = abs(l[i] - x)
               
                kotae = l[i]          
            
print(kotae)

Buggy python submission (verdict: Runtime Error):
x,n = (int(x) for x in input().split())
p = [int(x) for x in input().split()]

result = 100

l = list(range(1,101))


if len(p) == 0:
    kotae = x
else:
    for i in range(len(p)):

        l[p[i]-1] = 0

    for i in reversed(range(len(l))):
        #print(l[i])
  

        if l[i] != 0:

            if result >= abs(l[i] - x):
                result = abs(l[i] - x)
               
                kotae = l[i]
          
            



print(kotae)

Fixed submission:
x,n = (int(x) for x in input().split())
p = [int(x) for x in input().split()]

result = 100

l = list(range(0,102))



if len(p) == 0:
    kotae = x
else:
    for i in range(len(p)):

        l[p[i]] = ""



    for i in reversed(range(len(l))):
     
        if l[i] != "":

            if result >= abs(l[i] - x):
                result = abs(l[i] - x)
               
                kotae = l[i]          
            
print(kotae)
Buggy python submission (verdict: Runtime Error):
import re

s = input()
t = input()

match_result = re.match(s+".,t)

if match_result:
    print("Yes")
else:
    print("No")

Fixed submission:
import re

s = input()
t = input()

match_result = re.match(s+".",t)

if match_result:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N,M = (int(x) for x in input().split())
list = [int(x) for x in input().split()]
tenbou = [input().split() for l in range(M)]
jj = [1] * N

#print(list)
#print(tenbou)

for i in range(N-1):
    x = int(tenbou[i][0]) - 1
    y = int(tenbou[i][1]) - 1
    if list[x] >= list[y]:
        jj[y] = 0
    elif list[y] > list[x]:
        jj[x] = 0


        
#print(jj)
print(jj.count(1))

Fixed submission:
N,M = (int(x) for x in input().split())
hight = [int(x) for x in input().split()]
tenbou = [input().split() for l in range(M)]
result = [1] * N


for i in range(M):
    x = int(tenbou[i][0]) - 1
    y = int(tenbou[i][1]) - 1
    if hight[x] > hight[y]:
        result[y] = 0
    elif hight[y] == hight[x]:
        result[x] = 0
        result[y] = 0
    elif hight[y] > hight[x]:
        result[x] = 0
#print(result)
print(result.count(1))
Buggy python submission (verdict: Runtime Error):
S = list(input())

if s[2] == s[3] and s[4] == s:
    print("Yes")
else:
    print("No")

Fixed submission:
S = list(input())

if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
ok = True

NM = [map(int, input().split())]
N, M = [list(i) for i in zip(*NM)]
sc = [map(int, input().split()) for _ in range(M[0])]
s, c = [list(i) for i in zip(*sc)]

l = [-1] * N[0]


for i in range(M[0]):
    if l[s[i]-1] == -1:
        l[s[i]-1] = c[i]
    elif l[s[i]-1] != c[i]:
        ok = False
        break
        
if l[0] == 0:
    ok = False
elif l[0] == -1:
    l[0] = 1
    
for i in range(1,N[0]):
    if l[i] == -1:
        l[i] = 0
    
ans = ""   
if ok:
    for i in range(len(l)):
        ans = ans + str(l[i])
    print(ans)
else:
    print("-1")

#print(M[0],N[0])
#print(s[0],c[0])

Fixed submission:
ok = True

NM = [map(int, input().split())]
N, M = [list(i) for i in zip(*NM)]

l = [-1] * N[0]

if M[0] != 0:
    sc = [map(int, input().split()) for _ in range(M[0])]
    s, c = [list(i) for i in zip(*sc)]

    for i in range(M[0]):
        if l[s[i]-1] == -1:
            l[s[i]-1] = c[i]
        elif l[s[i]-1] != c[i]:
            ok = False
            break
        
if l[0] == 0 and N[0] >= 2:
    ok = False
elif l[0] == -1:
    if N[0] >= 2:
        l[0] = 1
    else:
        l[0] = 0
    
for i in range(1,N[0]):
    if l[i] == -1:
        l[i] = 0
    
ans = ""   
if ok:
    for i in range(len(l)):
        ans = ans + str(l[i])
    print(ans)
else:
    print("-1")

#print(M[0],N[0])
#print(s[0],c[0])
Buggy python submission (verdict: Runtime Error):


c = raw_input()



ls = [chr(ord('a') + i) for i in range(26)]

for i in range(len(ls)):
    if ls[i] == c:
        print(ls[i + 1])
        break



Fixed submission:


c = input()



ls = [chr(ord('a') + i) for i in range(26)]

for i in range(len(ls)):
    if ls[i] == c:
        print(ls[i + 1])
        break

Buggy python submission (verdict: Runtime Error):
import string

c = raw_input()



ls = string.ascii_lowercase

for i in range(len(ls)):
    if ls[i] == c:
        print(ls[i + 1])
        break



Fixed submission:


c = input()



ls = [chr(ord('a') + i) for i in range(26)]

for i in range(len(ls)):
    if ls[i] == c:
        print(ls[i + 1])
        break
Buggy python submission (verdict: Runtime Error):
import math

a , b = (int(x) for x in input().split())

result = math.gcd(a, b)

print((a * b) // result)

Fixed submission:
import fractions

a , b = (int(x) for x in input().split())

result = fractions.gcd(a, b)

print((a * b) // result)

Buggy python submission (verdict: Runtime Error):
import math

a , b = (int(x) for x in input().split())

print((a * b) // math.gcd(a, b))

Fixed submission:
import fractions

a , b = (int(x) for x in input().split())

result = fractions.gcd(a, b)

print((a * b) // result)

Buggy python submission (verdict: Runtime Error):
import math

a , b = (int(x) for x in input().split())

print((a * b) // math.gcd(a, b))




Fixed submission:
import fractions

a , b = (int(x) for x in input().split())

result = fractions.gcd(a, b)

print((a * b) // result)
Buggy python submission (verdict: Runtime Error):
X=int(input())
Y=int(input())
Z=int(input())

if(X+Y+Z>=22):
    print("bust")
else:
    print("win")

Fixed submission:
a,b,c = map(int,input().split())

if a+b+c <= 21:
    print("win")
else:
    print("bust")

Buggy python submission (verdict: Runtime Error):
X=int(input())
Y=int(input())
Z=int(input())

if(X+Y+Z>=22):
    print("bust")
else:
    print("win")

Fixed submission:
a,b,c = map(int,input().split())

if a+b+c <= 21:
    print("win")
else:
    print("bust")
Buggy python submission (verdict: Time Limit Exceeded):
import re

n = int(input())

s = input()

l = []

for i in range(len(s)):
    l.append(s[i])


for h in range(len(l)-1):
 
    if l[h] == l[h+1]:
        l[h] = "red"

while "red" in l :
    l.remove("red")  #全ての"red"を削除します。


print(len(l))



Fixed submission:


n = int(input())

s = input()


count = 1



for h in range(len(s)-1):
 
    if s[h] != s[h+1]:
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
s = input()

list = ["Sunny","Cloudy","Rainy"]

result = list.index(s)%3

print(list[result + 1])

Fixed submission:
s = input()

list = ["","Sunny","Cloudy","Rainy"]

result = list.index(s)%3

print(list[result+1])
Buggy python submission (verdict: Runtime Error):
num = int(input())
x = input().split()
count = 0
TF = True
while TF: 
    
    for i in range(0,num):
        number = int(x[i])
        if(number%2==0):
            x[i] = number/2
            TF = True
        else:
            TF =False
    if TF:
        count += 1
print(count)

Fixed submission:


str = input()
print(str.count("1") )

Buggy python submission (verdict: Runtime Error):
num = int(input())
x = input().split()
count = 0
TF = True
while TF: 
    count += 1
    for i in range(0,num):
        number = int(x[i])
        if(number%2==0):
            number = number/2
            x[i] =  number
            TF = True
        else:
            TF =False
print(count)

Fixed submission:


str = input()
print(str.count("1") )
Buggy python submission (verdict: Runtime Error):
K,S = (int(x) for x in input().split())
count = 0

for x in range(K+1):
    if x > S:
        break
    for y in range(K+1):
        z = s - x - y
        if 0 <= z <= K:
            count += 1
        elif x + y > S:
            break


print(count)

Fixed submission:
K,S = (int(x) for x in input().split())
count = 0

for x in range(K+1):
    if x > S:
        break
    for y in range(K+1):
        z = S - x - y
        if 0 <= z <= K:
            count += 1
        elif x + y > S:
            break


print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K,S = (int(x) for x in input().split())
count = 0

for x in range(K+1):
    if x > S:
        break
    for y in range(K+1):
        if x + y > S:
            break
        for z in range(K+1):
            #print(x,y,z)
            if x + y + z == S:
                count += 1
                #print(x,y,z)


print(count)

Fixed submission:
K,S = (int(x) for x in input().split())
count = 0

for x in range(K+1):
    if x > S:
        break
    for y in range(K+1):
        z = S - x - y
        if 0 <= z <= K:
            count += 1
        elif x + y > S:
            break


print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K,S = (int(x) for x in input().split())
count = 0

for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            #print(x,y,z)
            if x + y + z == S:
                count += 1
                #print(x,y,z)


print(count)

Fixed submission:
K,S = (int(x) for x in input().split())
count = 0

for x in range(K+1):
    if x > S:
        break
    for y in range(K+1):
        z = S - x - y
        if 0 <= z <= K:
            count += 1
        elif x + y > S:
            break


print(count)
Buggy python submission (verdict: Runtime Error):
s = input()

sum = 0

l = ["+"] * (len(s) - 1)

n = 2 ** (len(s) - 1)

for i in range(n):
    l = ["+"] * (len(s) - 1)
    for j in range(len(l)):
        ls = list(s)
        if (i >> j) & 1:
            l[j] = ""
        for x in range(len(l)):
            
            ls.insert(2*x+1,l[x])
   
    

    maped_list = map(str, ls) 
    mojiretu = ''.join(maped_list)

    sum = sum + eval(mojiretu)

print(sum)
    



    
    
   





Fixed submission:
s = input()

sum = 0

if len(s) > 1:

    l = ["+"] * (len(s) - 1)

    n = 2 ** (len(s) - 1)

    for i in range(n):
        l = ["+"] * (len(s) - 1)
        for j in range(len(l)):
            ls = list(s)
            if (i >> j) & 1:
                l[j] = ""
            for x in range(len(l)):
                
                ls.insert(2*x+1,l[x])
    
        

        maped_list = map(str, ls) 
        mojiretu = ''.join(maped_list)

        sum = sum + eval(mojiretu)

    print(sum)
else:
    print(s)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n[-1]=='2' or n[-1]=='4' or n[-1]=='5' or n[-1]=='7' or n[-1]=='9':
  print('hon')
elif n[-1]=='3':
  print('bon')
else:
  print('pon')

Fixed submission:
n=input()
if n[-1]=='2' or n[-1]=='4' or n[-1]=='5' or n[-1]=='7' or n[-1]=='9':
  print('hon')
elif n[-1]=='3':
  print('bon')
else:
  print('pon')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(a * a - b)


Fixed submission:
a = int(input())
b = int(input())
print(a * a - b)

Buggy python submission (verdict: Runtime Error):

a, b = map(int, input().split())
A = 0

print(a * a - b)


Fixed submission:
a = int(input())
b = int(input())
print(a * a - b)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if (a+b>=24):
    print((a+b)-24)
else:
    print(a+b)

Fixed submission:
a, b = map(int, input().split())

A = a+b
B = A%24
print(B)
Buggy python submission (verdict: Runtime Error):
s = input()
a = s.fin("A")
z = s. find("Z")
print(z - a + 1)


Fixed submission:
s = input()
a_index = s.find("A")
z_index = s.rfind("Z")
print(z_index - a_index + 1)
Buggy python submission (verdict: Runtime Error):
a,b = list(map(int,input().split(" ")))

l = [input() for i in range(b)]

l.sort()
print("".join(l))

Fixed submission:
a,b = list(map(int,input().split(" ")))

l = [input() for i in range(a)]

l.sort()
print("".join(l))

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

a,b = list(map(int,input().split(" ")))

l = [input() for i in range(b)]

l = sorted(l)
new_l = ''.join(l)
print(new_l)

Fixed submission:
a,b = list(map(int,input().split(" ")))

l = [input() for i in range(a)]

l.sort()
print("".join(l))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n, k = map(int, input().split())
a = [int(i) for i in input().split()]
towns = [1]
prev = 1
count = 0
while len(towns) == len(set(towns)):
    next = a[prev - 1]
    towns.append(next)
    prev = next
    count += 1
    if count == k:
        print(next)
        sys.exit()
i = towns.index(next)
repeat = towns[i: -1]
unit = len(repeat)
rest = k - count + 1
print(repeat[(rest % unit) - 1])

Fixed submission:
import sys
from collections import defaultdict
n, k = map(int, input().split())
a = [int(i) for i in input().split()]
towns = [1]
town_dic = defaultdict(lambda : 0)
prev = 1
count = 0
while True:
    next = a[prev - 1]
    count += 1
    if count == k:
        print(next)
        sys.exit()
    if town_dic[next] == 1:
        break
    else:
        town_dic[next] += 1
    towns.append(next)
    prev = next
i = towns.index(next)
repeat = towns[i:]
unit = len(repeat)
rest = k - count + 1
print(repeat[(rest % unit) - 1])

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n, k = map(int, input().split())
a = [int(i) for i in input().split()]
towns = [1]
prev = 1
count = 0
while len(towns) == len(set(towns)):
    next = a[prev - 1]
    towns.append(next)
    prev = next
    count += 1
    if count == k:
        print(next)
        sys.exit()
i = towns.index(next)
repeat = towns[i: -1]
unit = len(repeat)
rest = k - len(towns) + 2
print(repeat[(rest % unit) - 1])

Fixed submission:
import sys
from collections import defaultdict
n, k = map(int, input().split())
a = [int(i) for i in input().split()]
towns = [1]
town_dic = defaultdict(lambda : 0)
prev = 1
count = 0
while True:
    next = a[prev - 1]
    count += 1
    if count == k:
        print(next)
        sys.exit()
    if town_dic[next] == 1:
        break
    else:
        town_dic[next] += 1
    towns.append(next)
    prev = next
i = towns.index(next)
repeat = towns[i:]
unit = len(repeat)
rest = k - count + 1
print(repeat[(rest % unit) - 1])
Buggy python submission (verdict: Runtime Error):
import numpy as np
a, b, n = map(int, input().split())
x = np.arange(1, b+1)
y = np.floor(a * x / b) - a * np.floor(x / b)
print(y)
print(int(y.max()))

Fixed submission:
import math
a, b, n = map(int, input().split())
x = min(b - 1, n)
print(math.floor(a * x / b) - a * math.floor(x / b))

Buggy python submission (verdict: Runtime Error):
import numpy as np
a, b, n = map(int, input().split())
x = np.arange(1 + (n // b), n + 1)
y = np.floor(a * x / b) - a * np.floor(x / b)
print(int(y.max()))

Fixed submission:
import math
a, b, n = map(int, input().split())
x = min(b - 1, n)
print(math.floor(a * x / b) - a * math.floor(x / b))

Buggy python submission (verdict: Runtime Error):
import numpy as np
a, b, n = map(int, input().split())
x = np.arange(1, n + 1)
y = np.floor(a * x / b) - a * np.floor(x / b)
print(int(y.max()))

Fixed submission:
import math
a, b, n = map(int, input().split())
x = min(b - 1, n)
print(math.floor(a * x / b) - a * math.floor(x / b))

Buggy python submission (verdict: Runtime Error):
import numpy as np
a, b, n = map(int, input().split())
x = np.arange(1, n + 1)
y = np.floor(a * n / b) - a * np.floor(n / b)
print(int(y.max()))

Fixed submission:
import math
a, b, n = map(int, input().split())
x = min(b - 1, n)
print(math.floor(a * x / b) - a * math.floor(x / b))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
import itertools

num = defaultdict(lambda : 0)
n = int(input())
a = [int(i) for i in input().split()]
for i in a:
    num[i] += 1
memo = {i: 0 for i in num.keys()}
total = 0

for i, j in num.items():
    x = len([k for k in itertools.combinations(range(j), 2)])
    memo[i] = x
    total += x
    
for i, j in enumerate(a):
    y = num[j]
    z = memo[j]
    
    if y == 1:
        print(total)
    else:
        print(total - z + len([k for k in itertools.combinations(range(y-1), 2)]))

Fixed submission:
from collections import defaultdict
num = defaultdict(lambda : 0)
n = int(input())
a = [int(i) for i in input().split()]
for i in a:
    num[i] += 1
memo = {i: 0 for i in num.keys()}
total = 0

for i, j in num.items():
    x = int(j * (j - 1) / 2 )
    memo[i] = x
    total += x

for i, j in enumerate(a):
    y = num[j]
    z = memo[j]

    if y == 1:
        print(total)
    else:
        print(total - z + int((y - 1) * (y - 2) / 2))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
import sys
s = []
c = []
d = [-1] * n
for _ in range(m):
    i, j = map(int, input().split())
    if i == 1 and j == 0:
        print(-1)
        sys.exit()
    if d[i-1] == -1 or d[i-1] == j:
        d[i-1] = j
    else:
        print(-1)
        sys.exit()
    s.append(i)
    c.append(j)

if max(s) > n:
    print(-1)
    sys.exit()
else:
    for i, j in enumerate(d):
        if j == -1:
            if i == 0:
                continue
            else:
                d[i] = 0
print(*d, sep='')

Fixed submission:
import sys
n, m = map(int, input().split())
d = [10] * n
if m == 0:
    if n == 1:
        print(0)
        sys.exit()
    else:
        print('1' + (n - 1) * '0')
        sys.exit()
for _ in range(m):
    s, c = map(int, input().split())
    s = s - 1
    if d[s] == 10:
        d[s] = c
    elif d[s] != c:
        print(-1)
        sys.exit()
if d[0] == 0:
    if n == 1:
        print(0)
        sys.exit()
    else:
        print(-1)
        sys.exit()
if d[0] == 10:
    d[0] = 1
for i in d:
    print(0, end='') if i == 10 else print(i, end='')
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = [int(i) for i in input().split()]
count = 0
min_value = p[0]
for i in enumerate(p):
    if i <= min_value:
        count += 1
        min_value = i
print(count)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]
count = 0
min_value = p[0]
for i in p:
    if i <= min_value:
        count += 1
        min_value = i
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(i) for i in input().split()]
count = 0
for i,j in enumerate(p):
    if j == min(p[:i+1]):
        count += 1
print(count)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]
count = 0
min_value = p[0]
for i in p:
    if i <= min_value:
        count += 1
        min_value = i
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(input())
a = [int(i) for i in input().split()]

b = 1
i = 0
pos = 0
while pos < n - 1:
    for j in a[pos:]:
        pos += 1
        if j == b:
            b += 1
            break
        else:
            i += 1
    if b == 1:
        print(-1)
        sys.exit()
print(i)

Fixed submission:
import sys
n = int(input())
a = [int(i) for i in input().split()]
if not 1 in a:
    print(-1)
    sys.exit()
target = 1
count = 0
for i in a:
    if i == target:
        target += 1
    else:
        count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(input())
a = [int(i) for i in input().split()]

b = 1
i = 0
pos = 0
while pos < n - 1:
    for j in a[pos:]:
        pos += 1
        if j == b:
            b += 1
            break
        else:
            i += 1
    if b == 1:
        print(-1)
        sys.exit()
print(i)

Fixed submission:
import sys
n = int(input())
a = [int(i) for i in input().split()]
if not 1 in a:
    print(-1)
    sys.exit()
target = 1
count = 0
for i in a:
    if i == target:
        target += 1
    else:
        count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(input())
a = [int(i) for i in input().split()]
if 1 not in a:
    print(-1)
    sys.exit()
    
b = 1
i = 0
pos = 0
while pos < n - 1:
    for j in a[pos:]:
        pos += 1
        if j == b:
            b += 1
            break
        else:
            i += 1
print(i)

Fixed submission:
import sys
n = int(input())
a = [int(i) for i in input().split()]
if not 1 in a:
    print(-1)
    sys.exit()
target = 1
count = 0
for i in a:
    if i == target:
        target += 1
    else:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if m2 = m1+1 and d2 = 1:
    print(1)
else
    print(0)

Fixed submission:
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if m2 == m1+1 and d2 == 1:
    print(1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import math
from fractions import gcd
a, b = map(int, input().split())
g = gcd(a, b)
sqrt = math.floor(g ** 0.5)
factors = [1]
z = g
for i in range(2, sqrt + 1):
    if not z % i:
        factors.append(i)
        while z % i == 0:
            z //= i
if z > 1:
    factors.append(i)
print(len(factors))

Fixed submission:
import math
from fractions import gcd
a, b = map(int, input().split())
g = gcd(a, b)
sqrt = math.floor(g ** 0.5)
factors = [1]
z = g
for i in range(2, sqrt + 1):
    if not z % i:
        factors.append(i)
        while z % i == 0:
            z //= i
if z > 1:
    factors.append(z)
print(len(factors))
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
print(np.arange(1, n).sum())

Fixed submission:
n = int(input())
ans = n * (n - 1) // 2
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = np.arange(1, n + 1)
b = np.hstack((np.arange(2, n + 1), 1))
print(np.sum(a % b))

Fixed submission:
n = int(input())
ans = n * (n - 1) // 2
print(ans)