Problem: Given is a positive integer N. Consider repeatedly applying the operation below on N:    * First, choose a positive integer z satisfying all of the conditions below:     * z can be represented as z=p^e, where p is a prime number and e is a positive integer;     * z divides N;     * z is different from all integers chosen in previous operations.   * Then, replace N with N/z.  Find the maximum number of times the operation can be applied.

Submission attempts (in order):
sieve = [True] * (10**6+1)
prime = []
for i in range(2, 10**6):
  if sieve[i]:
    prime.append(i)
    if i < 10**3:
      for j in range(i**2, 10**6, i):
        sieve[j] = False
n = int(input())
if n == 1:
  print(0)
else:
  e = []
  for p in prime:
    if n % p == 0:
      idx = 0
      while n % p == 0:
        n = n // p
        idx += 1
      e.append(idx)
    if n == 1:
        break
  if len(e) > 0:
    total = 0
    for idx in e:
      cnt = 1
      while idx => cnt*(cnt+1)//2:
        cnt += 1
      cnt -= 1
      total += cnt 
    if n == 1:
      print(total)
    else:
      print(total + 1)
  else:
    print(1)


sieve = [True] * 10**6
prime = []
for i in range(2, 10**6):
  if sieve[i]:
    prime.append(i)
    if i < 10**3:
      for j in range(i**2, 10**6, i):
        sieve[j] = False
n = int(input())
if n == 1:
  print(0)
else:
  e = []
  for p in prime:
    if n % p == 0:
      idx = 0
      while n % p == 0:
        n = n // p
        idx += 1
      e.append(idx)
    if n == 1:
        break
  if len(e) > 0:
    total = 0
    for idx in e:
      cnt = 1
      while idx => cnt*(cnt+1)//2:
        cnt += 1
      cnt -= 1
      total += cnt 
    if n == 1:
      print(total)
    else:
      print(total + 1)
  else:
    print(1)


sieve = [True] * 10**12
prime = []
for i in range(2, 10**6):
  if sieve[i]:
    prime.append(i)
    for j in range(i**2, 10**12, i):
      sieve[j] = False
n = int(input())
if n == 1:
  print(0)
else:
  e = []
  for p in prime:
    if n % p == 0:
      idx = 0
      while n % p == 0:
        n = n // p
        idx += 1
      e.append(idx)
      if n == 1:
        break
  if len(e) > 0:
    total = 0
    for idx in e:
      cnt = 1
      while idx => cnt*(cnt+1)//2:
        cnt += 1
      total += cnt - 1
    if n == 1:
      print(total)
    else:
      print(total + 1)
  else:
    print(1)
  
      
  

sieve = [True] * 10**6
prime = []
for i in range(2, 10**6):
  if sieve[i]:
    prime.append(i)
    if i < 10**3:
      for j in range(i**2, 10**6, i):
        sieve[j] = False
n = int(input())
if n == 1:
  print(0)
else:
  e = []
  for p in prime:
    if n % p == 0:
      idx = 0
      while n % p == 0:
        n = n // p
        idx += 1
      e.append(idx)
      if n == 1:
        break
  if len(e) > 0:
    total = 0
    for idx in e:
      cnt = 1
      while idx => cnt*(cnt+1)//2:
        cnt += 1
      cnt -= 1
      total += cnt 
    if n == 1:
      print(total)
    else:
      print(total + 1)
  else:
    print(1)


sieve = [True] * 10**6
prime = []
for i in range(2, 10**6):
  if sieve[i]:
    prime.append(i)
    if i < 10**3:
      for j in range(i**2, 10**6, i):
        sieve[j] = False
n = int(input())
if n == 1:
  print(0)
else:
  e = []
  for p in prime:
    if n % p == 0:
      idx = 0
      while n % p == 0:
        n = n // p
        idx += 1
      e.append(idx)
      if n == 1:
        break
  if len(e) > 0:
    total = 0
    for idx in e:
      cnt = 1
      while idx => cnt*(cnt+1)//2:
        cnt += 1
      total += cnt - 1
    if n == 1:
      print(total)
    else:
      print(total + 1)
  else:
    print(1)

sieve = [True] * 10**6
prime = []
for i in range(2, 10**6):
  if sieve[i]:
    prime.append(i)
    if i < 10**3:
      for j in range(i**2, 10**6, i):
        sieve[j] = False
n = int(input())
if n == 1:
  print(0)
else:
  e = []
  for p in prime:
    if n % p == 0:
      idx = 0
      while n % p == 0:
        n = n // p
        idx += 1
      e.append(idx)
    if n == 1:
        break
  if len(e) > 0:
    total = 0
    for idx in e:
      cnt = 1
      while idx >= cnt*(cnt+1)//2:
        cnt += 1
      cnt -= 1
      total += cnt 
    if n == 1:
      print(total)
    else:
      print(total + 1)
  else:
    print(1)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted