Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

def test(a,b):
  num = 2
  x = gcd(a,b)
  s = []
  while x != 1:
    if(x % num == 0):
      x = x / num
      s.append(num)
    else:
      num += 1

  return set(s)

def main():

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

  num = []

  num = list(test(a, b))
  num.append(1)
  print(len(num))

if __name__ == '__main__':
  main()


Fixed submission:
from fractions import gcd
import math

def test(a,b):
  x = gcd(a,b)
  s = []
  for i in range(2, int(math.sqrt(x)) + 1):
    while x % i == 0:
      s.append(i)
      x //= i

  s.append(x)
  s.append(1)

  return list(set(s))

def main():

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

  num = []

  num = test(a, b)
  print(len(num))

if __name__ == '__main__':
  main()

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

def test(a,b):
  num = 2
  x = gcd(a,b)
  s = []
  while x != 1:
    if(x % num == 0):
      x = x / num
      s.append(num)
    else:
      num += 1

  return set(s)

def main():

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

  num = []

  num = list(test(a, b))
  num.append(1)
  print(len(num))

if __name__ == '__main__':
  main()


Fixed submission:
from fractions import gcd
import math

def test(a,b):
  x = gcd(a,b)
  s = []
  for i in range(2, int(math.sqrt(x)) + 1):
    while x % i == 0:
      s.append(i)
      x //= i

  s.append(x)
  s.append(1)

  return list(set(s))

def main():

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

  num = []

  num = test(a, b)
  print(len(num))

if __name__ == '__main__':
  main()

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

def test(a,b):
  num = 2
  x = math.gcd(a,b)
  s = []
  while x != 1:
    if(x % num == 0):
      x = x / num
      s.append(num)
    else:
      num += 1

  return set(s)

def main():

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

  num = []

  num = list(test(a, b))
  num.append(1)
  print(len(num))

if __name__ == '__main__':
  main()


Fixed submission:
from fractions import gcd
import math

def test(a,b):
  x = gcd(a,b)
  s = []
  for i in range(2, int(math.sqrt(x)) + 1):
    while x % i == 0:
      s.append(i)
      x //= i

  s.append(x)
  s.append(1)

  return list(set(s))

def main():

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

  num = []

  num = test(a, b)
  print(len(num))

if __name__ == '__main__':
  main()

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

def test(a,b):
  num = 2
  x = math.gcd(a,b)
  s = []
  while x != 1:
    if(x % num == 0):
      x = x / num
      s.append(num)
    else:
      num += 1

  return set(s)

def main():

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

  num = []

  num = list(test(a, b))
  num.append(1)
  print(len(num))

if __name__ == '__main__':
  main()


Fixed submission:
from fractions import gcd
import math

def test(a,b):
  x = gcd(a,b)
  s = []
  for i in range(2, int(math.sqrt(x)) + 1):
    while x % i == 0:
      s.append(i)
      x //= i

  s.append(x)
  s.append(1)

  return list(set(s))

def main():

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

  num = []

  num = test(a, b)
  print(len(num))

if __name__ == '__main__':
  main()

Buggy python submission (verdict: Time Limit Exceeded):
def test(x):
  num = 2
  s = []
  while x != 1:
    if(x % num == 0):
      x = x / num
      s.append(num)
    else:
      num += 1

  return set(s)

def main():
  import math

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

  num = []

  num = list(test(a) & test(b))
  num.append(1)
  print(len(num))

if __name__ == '__main__':
  main()


Fixed submission:
from fractions import gcd
import math

def test(a,b):
  x = gcd(a,b)
  s = []
  for i in range(2, int(math.sqrt(x)) + 1):
    while x % i == 0:
      s.append(i)
      x //= i

  s.append(x)
  s.append(1)

  return list(set(s))

def main():

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

  num = []

  num = test(a, b)
  print(len(num))

if __name__ == '__main__':
  main()

Buggy python submission (verdict: Time Limit Exceeded):
def test(x):
  num = 2
  s = []
  while x != 1:
    if(x % num == 0):
      x = x / num
      s.append(num)
    else:
      num += 1

  return set(s)

def main():
  import math

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

  num = []

  num = list(test(a) & test(b))
  num.append(1)
  print(len(num))

if __name__ == '__main__':
  main()


Fixed submission:
from fractions import gcd
import math

def test(a,b):
  x = gcd(a,b)
  s = []
  for i in range(2, int(math.sqrt(x)) + 1):
    while x % i == 0:
      s.append(i)
      x //= i

  s.append(x)
  s.append(1)

  return list(set(s))

def main():

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

  num = []

  num = test(a, b)
  print(len(num))

if __name__ == '__main__':
  main()