Buggy python submission (verdict: Time Limit Exceeded):
def factorize(n):
    p = n
    while True:
        if p % 2 == 0:
            p //= 2
            yield 2
        else:
            break

    for i in range(3,n+1,2):
        while True:
            if p % i == 0:
                p //= i
                yield i
            else:
                break

n = int(input())
l = factorize(n)

print(str(n)+":",*list(l))

Fixed submission:
import math

def factorize(p):
    l = []
    while p % 2 == 0:
        p //= 2
        l.append(2)

    r = 3
    while r < int(math.sqrt(p)+1):
        if p % r == 0:
            p //= r
            l.append(r)
        else:
            r += 2

    if p != 1:
        l.append(p)

    return l

n = int(input())
l = factorize(n)

print(str(n)+":",*l)

Buggy python submission (verdict: Runtime Error):
def factorize(n):
    p = n
    while True:
        if p % 2 == 0:
            p //= 2
            yield 2
        else:
            break

    r = 3
    while p != 1:
        if p % i == 0:
            p //= i
            yield i
        else:
            r += 2

n = int(input())
l = factorize(n)

print(str(n)+":",*list(l))

Fixed submission:
import math

def factorize(p):
    l = []
    while p % 2 == 0:
        p //= 2
        l.append(2)

    r = 3
    while r < int(math.sqrt(p)+1):
        if p % r == 0:
            p //= r
            l.append(r)
        else:
            r += 2

    if p != 1:
        l.append(p)

    return l

n = int(input())
l = factorize(n)

print(str(n)+":",*l)

Buggy python submission (verdict: Time Limit Exceeded):
def factorize(n):
    p = n
    while True:
        if p % 2 == 0:
            p //= 2
            yield 2
        else:
            break

    r = 3
    while p != 1:
        if p % r == 0:
            p //= r
            yield r
        else:
            r += 2

n = int(input())
l = factorize(n)

print(str(n)+":",*list(l))

Fixed submission:
import math

def factorize(p):
    l = []
    while p % 2 == 0:
        p //= 2
        l.append(2)

    r = 3
    while r < int(math.sqrt(p)+1):
        if p % r == 0:
            p //= r
            l.append(r)
        else:
            r += 2

    if p != 1:
        l.append(p)

    return l

n = int(input())
l = factorize(n)

print(str(n)+":",*l)

Buggy python submission (verdict: Time Limit Exceeded):
def factorize(n):
    p = n
    while True:
        if p % 2 == 0:
            p //= 2
            yield 2
        else:
            break

    r = 3
    while p >= r:
        if p % r == 0:
            p //= r
            yield r
        else:
            r += 2

n = int(input())
l = factorize(n)

print(str(n)+":",*list(l))

Fixed submission:
import math

def factorize(p):
    l = []
    while p % 2 == 0:
        p //= 2
        l.append(2)

    r = 3
    while r < int(math.sqrt(p)+1):
        if p % r == 0:
            p //= r
            l.append(r)
        else:
            r += 2

    if p != 1:
        l.append(p)

    return l

n = int(input())
l = factorize(n)

print(str(n)+":",*l)

Buggy python submission (verdict: Runtime Error):
import scala.io.StdIn.readInt
import scala.collection.mutable.ArrayBuffer

object Main {

  def factorize(p:Int,d:Int,l:List[Int]):List[Int] = {
    if(d >= Math.sqrt(p)+1) {
      if(p != 1) p::l else l
    } else {
      if(p%d == 0)
        factorize(p,d,d::l)
      else if(d==2)
        factorize(p,d+1,l)
      else
        factorize(p,d+2,l)
    }
  }

  def printList(l:List[Int]):Unit = l match {
    case List() => ()
    case h::tail =>
        print(" " + h)
        printList(tail)
  }

  def main(args: Array[String]) = {
    val n = readInt
    val list = factorize(n,2,List())
    print(n.toString + ":")
    printList(list)
    println()
  }
}

Fixed submission:
import math

def factorize(p):
    l = []
    while p % 2 == 0:
        p //= 2
        l.append(2)

    r = 3
    while r < int(math.sqrt(p)+1):
        if p % r == 0:
            p //= r
            l.append(r)
        else:
            r += 2

    if p != 1:
        l.append(p)

    return l

n = int(input())
l = factorize(n)

print(str(n)+":",*l)

Buggy python submission (verdict: Runtime Error):
while True:
    n,x = map(int,input().split())

    if n==0 and x==0: 
        break

    print( sum( len( range(max(i+1,x-i-n),min(n,(x-i+1)//2)) ) ) for i in range(1,min(n-1,x//3)) )

Fixed submission:
import math

def factorize(p):
    l = []
    while p % 2 == 0:
        p //= 2
        l.append(2)

    r = 3
    while r < int(math.sqrt(p)+1):
        if p % r == 0:
            p //= r
            l.append(r)
        else:
            r += 2

    if p != 1:
        l.append(p)

    return l

n = int(input())
l = factorize(n)

print(str(n)+":",*l)

Buggy python submission (verdict: Runtime Error):
while True:
    n,x = map(int,input().split())

    if n==0 and x==0:
        break

    print(sum( [ len(range(max(i+1,x-i-n),min(n,(x-i+1)//2))) for i in range(1,min(n-1,x//3)) ]))

Fixed submission:
import math

def factorize(p):
    l = []
    while p % 2 == 0:
        p //= 2
        l.append(2)

    r = 3
    while r < int(math.sqrt(p)+1):
        if p % r == 0:
            p //= r
            l.append(r)
        else:
            r += 2

    if p != 1:
        l.append(p)

    return l

n = int(input())
l = factorize(n)

print(str(n)+":",*l)

Buggy python submission (verdict: Runtime Error):
while True:
    n,x = map(int,input().split())

    if n==0 and x==0:
        break

    print(sum( [ len(range(max(i+1,x-i-n),min(n,(x-i+1)//2))) for i in range(1,min(n-1,x//3)) ]))

Fixed submission:
import math

def factorize(p):
    l = []
    while p % 2 == 0:
        p //= 2
        l.append(2)

    r = 3
    while r < int(math.sqrt(p)+1):
        if p % r == 0:
            p //= r
            l.append(r)
        else:
            r += 2

    if p != 1:
        l.append(p)

    return l

n = int(input())
l = factorize(n)

print(str(n)+":",*l)