Problem:


Score : 400 points

Problem Statement

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.

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

Print the maximum number of times the operation can be applied.

Sample Input 1

24

Sample Output 1

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=12.)

Choose z=3 (=3^1). (Now we have N=4.)

Choose z=4 (=2^2). (Now we have N=1.)

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=32.)

Choose z=4 (=2^2). (Now we have N=8.)

Choose z=8 (=2^3). (Now we have N=1.)

Sample Input 4

1000000007

Sample Output 4

1

We can apply the operation once by, for example, making the following choice:

z=1000000007 (=1000000007^1). (Now we have N=1.)

Sample Input 5

997764507000

Sample Output 5

7



Sample input:
24


Sample output:
3

Submission status: Wrong Answer

Solution code:

N = int(input())

import math
n = math.floor(math.sqrt(N)) + 1

cm = []
for i in range(2, n+1):
    if (N % i != 0):
        continue
    
    ex = 0
    while (N % i == 0):
        ex += 1
        N //= i
        
    cm.append([i, ex])
    
if len(cm) == 0:
    print(1)
    exit()
        
#print(cm)

su = [0] * 1000
s = 0
for i in range(1, 40+1):
    s += i
    su[s] = i

f = 0
for i in range(1000):
    if su[i] == 0:
        su[i] = f
    else:
        f = su[i]

count = 0
for i in cm:
    #print(i)
    #print(i[1])
    count += su[i[1]]

print(count)

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

ans=0
arr=[]

tmp=1

for i in range(int(math.sqrt(N))+5):
    tmp=1
    while N % (i+2) == 0:
        for j in range(tmp):
            if N % (i+2) == 0:
                N=int(N/(i+2))
                flg=True
            else:
                N=int(N/(i+2))
                flg=False
        if flg:
            ans+=1
        #print("tmp:"+str(tmp))
        #print("N:"+str(N))
        #print("ans:"+str(ans))
        tmp+=1


if N > 1 and ans==0:
    ans=1

print(ans)

Submission status: Wrong Answer

Solution code:
import math

def is_prime(n):
    if n == 1: return 0
    c = 0
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            n /= k
            c += 1
    if c == 0:
        c += 1
    return c

n = int(input())
print(is_prime(n))

Submission status: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
 
    if temp!=1:
        arr.append([temp, 1])
 
    if arr==[]:
        arr.append([n, 1])
 
    return arr
 
t=int(input())
if t==1:
  print(0)
  exit()
 
fac=factorization(t)
 
def pcount(a):
  p=1
  cout=0
  while a>0:
    a=a-p
    p+=1
    if a<0:break
    cout+=1
  return cout
#print(fac)
tt=0
 
for po in fac:
  
  cc=pcount(po[1])
  print(cc)
  tt+=cc
 
print(tt)

Submission status: Wrong Answer

Solution code:
a = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
    
li = factorization(a)
ct = 0

ran = range(1,1000)
for i,j in li:
    ctb = 0
    for k in ran:
        if ctb >= j:
            break
        ctb += k
    ct += ctb

print(ct)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import collections

# 素因数分解の結果をlistで返す
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
    n = int(input())
    n_prime = prime_factorize(n)
    unique_n_prime = []
    unique_n_prime = [x for x in n_prime if x not in unique_n_prime and not unique_n_prime.append(x)]

    ans = 0
    ans += len(unique_n_prime)

    unique_c = collections.Counter(unique_n_prime)

    c = collections.Counter(n_prime)
    c = c - unique_c

    while len(c) > 0:
        c = c - unique_c
        ans += len(c)
        c = c - unique_c

    print(ans)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def factorization(n):
    arr = {}
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            #arr.append([i, cnt])
            arr[i] = cnt

    if temp!=1:
        #arr.append([temp, 1])
        arr[temp] = 1

    if len(arr)==0:
        #arr.append([n, 1])
        arr[n] = 1

    return arr

N = int(input())
divi = make_divisors(N)
imp_factor = [
    factorization(i) for i in divi
]
imp_factor = [i for i in imp_factor if len(i) == 1]
imp_factor.pop(0)

known = dict()
ret = 0
while True:
    if len(imp_factor) == 0:
        break
    cnt = 0
    while True:
        if len(imp_factor) == 0:
            break
        factor_d = imp_factor.pop(0)
        factor = list(factor_d.keys())[0]
        factor_v = factor_d[factor]
        if factor**factor_v not in known:
            known[factor**factor_v] = 1
            ret += 1
            break
    for i in range(len(imp_factor)):
        if list(imp_factor[i].keys())[0] == factor:
            imp_factor[i][factor] -= 1

print(ret)
pass

Submission status: Wrong Answer

Solution code:
N = int(input())

N_temp = N
Ans = 0

if N == 1:
  print(0)
elif N < 4:
  print(1)
else:
  for base_i in range(N // 2 - 2):
    base = base_i + 2
    if N_temp % base != 0:
      continue
    exp_temp = 0
    N_exp_temp = N_temp
    while N_exp_temp % base == 0:
      exp_temp = exp_temp + 1
      N_exp_temp = N_exp_temp // base
      
    i = 0
    sum_temp = 1
    while sum_temp <= exp_temp:
      i = i + 1
      sum_temp = sum_temp + i + 1

    Ans = Ans + i
    N_temp = N_temp // base ** exp_temp
    base = base + 1

    if N_temp == 1:
      break

print(Ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

"""
z = p^e where p is a prime number and e = positive int
z divides N
"""

def get_primes(up_to=1000):
    primes = []

    A = [True] * (up_to + 2)

    for i in range(2, int(up_to**0.5)+1):
        if A[i]:
            j = i*2
            while j < up_to:
                A[j] = False
                j += i
    
    i = 2

    while i < up_to:
        if A[i]:
            primes.append(i)
        i += 1

    return primes

from math import sqrt

n = int(input())
used = set()
primes = get_primes(int(sqrt(n))+2)
ze = []
for z in primes:
    i = 1
    zval = z**i
    while zval <= n:
        ze.append(zval)
        i += 1
        zval = z**i

ze.sort()

count = 0

for z in ze:
    if z > n:
        break

    if n % z == 0 and not(z in used):
        used.add(z)
        count += 1
        n /= z

def is_prime(n):
    if n < 2:
        return False
    elif n == 2 or  n == 3:
        return True

    for i in range(2, int(sqrt(n))+2):
        if n % i == 0:
            return False
    return True

#print(primes)
if is_prime(n) and not(n in used):
    print(count +1)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

a = factorization(n)

cnt = 0
for i in range(len(a)):
    tmp = a[i][1]
    for j in range(1,100):
        tmp -= j
        if tmp >= 0:
            cnt += 1
        else:
            break

print(cnt)

Submission status: Wrong Answer

Solution code:
#-------------------------------------------------------------------
import sys
def p(*_a):
  _s=" ".join(map(str,_a))
  #print(_s)
  sys.stderr.write(_s+"\n")
#-------------------------------------------------------------------
import math

def factorize(n):
  ret, a = [], n
  for i in range(2, int(n**0.5)+1):
    if a%i>0: continue
    c=0
    while a%i==0:
      a//=i
      c+=1
    else:
      ret.append((i,c))
  if a!=1: ret.append((a,1))
  return ret

#nの素数判定
def is_prime(n):
	if n == 1:
		return False
	for i in range(2,int(n**0.5)+1):
		if n % i == 0: return False
	return True


n = int(input())
N = factorize(n)
#p(N)

i = 2
ans=0
while n >= i:
  if is_prime(n):
    n /= n
    ans += 1
    #p("ans=",ans)
  elif n % i ==0:
    for k,_ in N:
      a = math.log(i, k)
      #p("n,i,k,a,int(a)=",n,i,k,int(a),a)
      if int(a)==a:
        n /= k
        ans += 1
        #p("ans=",ans)

  i += 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
current_num = 2
count = 0

import math
S=int(math.sqrt(N))
list1=[N]
while (S >= current_num):
  if N%current_num==0 :
    print(current_num)
    N=int(N/current_num)
    if N!=current_num :
      list1.append(N)
    count+=1
  current_num += 1


def p_judge(num) :
  q=int(math.sqrt(num))
  if num==1 :
    return False
  for i in range(2,q) :
    if num%i==0 :
      return False
  return True
list1=reversed(list1)
for item in list1 :
  if p_judge(item) and N%item==0 :
    N=int(N/item)
    count+=1

print(count)

Submission status: Wrong Answer

Solution code:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N=int(input())
zlist = make_divisors(N)
done=[]
cnt=0
for n in range(len(zlist)):
        for z in zlist:
            if(z not in done and N%z==0 and z!=1):
                done.append(z)
                N=int(N/z)
                zlist = make_divisors(N)
                cnt+=1
                break
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

def factorization(n):
    arr = 0
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
      if temp%i==0:
        cnt=0
        while temp%(i**(cnt+1))==0:
          temp //= (i**(cnt+1))
          cnt+=1
        arr+=cnt
        
    if arr==0:
      print(1)
    else:
      print(arr)

factorization(N)

Submission status: Wrong Answer

Solution code:
n = int(input())
divs = []
for i in range(1, int(n ** 0.5) + 1):
  if n % i == 0:
    divs.append(i)
    if i != n // i:
      divs.append(n // i)
a = sorted(divs)
ea = a[1:]
count = 0
for i in range(len(ea)):
  t = n / ea[i]
  if t.is_integer() == False:
    continue
  else:
    n /= ea[i]
    n = int(n)
    count += 1
  if n == 1:
    break
print(count)

Submission status: Wrong Answer

Solution code:
def check_sosu(n):
    if n < 2:
        return 0
    j = 2
    while j * j <= n:
        if n % j == 0:
            return 0
        j += 1
    return 1


sosu = [1 for _ in range(10**6+5)]
sosu[0] = 0
sosu[1] = 0
for i in range(2, len(sosu)):
    if sosu[i]:
        j = i+i
        while j < len(sosu):
            sosu[j] = 0
            j += i

z_list = [0 for _ in range(10**6+5)]
for i in range(2, len(sosu)):
    if sosu[i]:
        j = i
        while j < len(sosu):
            z_list[j] = 1
            j *= i


n = int(input())
o_n = n
cnt = 0

for i in range(len(z_list)):
    if z_list[i]:
        if n % i == 0:
            cnt += 1
            n //= i

if n >= 10**6+5:
    i = 2
    tmp = check_sosu(n)
    cnt += tmp


print(cnt)

Submission status: Wrong Answer

Solution code:
import bisect
import math
from typing import Dict, List, NoReturn


def factorize(n: int) -> Dict[int, int]:
    result: Dict[int, int] = {}
    n_org: int = n

    for d in range(2, int(math.sqrt(n_org)) + 1):
        div_count: int = 0
        flag: bool = False
        while n % d == 0:
            flag = True
            n /= d
            div_count += 1

        if flag:
            result[d] = div_count

        if n == 1:
            break

        if d == int(math.sqrt(n)):
            result[n_org] = 1

    return result


def reverse_sum(n: int) -> int:
    sum_of_k: List[int] = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120,
                           136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378,
                           406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820]

    return bisect.bisect_right(sum_of_k, n)


def main() -> NoReturn:
    n: int = int(input())

    factors: Dict[int, int] = factorize(n)

    answer: int = 0

    for value in factors.values():
        answer += reverse_sum(value)

    print(answer)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""
import math

#def main(N):
def main():
    N = int(input())
    # Nが1のときは答えは0
    if N == 1:
        return 0
    else:
        N_remein = N
        # Nを素因数分解する。
        p_list = []
        p_factor_list = []
        p = 2
        while N_remein >= 2:
        #for p in range(2, math.ceil(math.sqrt(N))+1):
            if N_remein%p == 0:
                counter = 0
                #p_pow_counter = 1
                while True:
                    #p_pow_counter *= p
                    if N_remein%p == 0:
                        N_remein = N_remein//p
                        counter+=1
                    else:
                        p_list.append(p)
                        p_factor_list.append(counter)
                        break
            if p > math.ceil(math.sqrt(N_remein)):
                break
            p += 1
        #print(p_list)
        #print(p_factor_list)
        # Nが素数の場合は、答えは1。
        if not p_factor_list:
            return 1
        else:
            answer = 0
            # 各素因数の指数に対して、、
            # 1,2,3,...と正整数を順番に引いていき、
            # 引けた回数を合計する。
            for factor in p_factor_list:
                counter = 1
                while (counter*(counter+1))//2 <= factor:
                    counter += 1
                answer += (counter-1) 
            #return answer, p_list, p_factor_list
            return answer

if __name__ == "__main__":
    print(main())
    #for i in range(1, 100):
    #    print(i, main(i))

Submission status: Wrong Answer

Solution code:
import sys
n=int(input())

if n == 1:
    print(0)
    sys.exit()

orgn=n
counter=0
for i in range(2,int((n**0.5) + 1) ):
    if n % i == 0:
        counter += 1
        n //= i
        wari=i**2
        while n % wari == 0:
            counter +=1
            n //= wari
            wari *= i
        
        while n % i ==0:
            n //= i

if n == orgn:
    print(1)

if n >= int(n ** 0.5):
        counter+=1
print(counter)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

"""
z = p^e where p is a prime number and e = positive int
z divides N
"""

def get_primes(up_to=1000):
    primes = []

    A = [True] * (up_to + 2)

    for i in range(2, int(up_to**0.5)+1):
        if A[i]:
            j = i*2
            while j < up_to:
                A[j] = False
                j += i
    
    i = 2

    while i < up_to:
        if A[i]:
            primes.append(i)
        i += 1

    return primes

from math import sqrt

n = int(input())
used = set()
primes = get_primes(int(sqrt(n))+2)
ze = []
for z in primes:
    i = 1
    zval = z**i
    while zval <= n:
        ze.append(zval)
        i += 1
        zval = z**i

ze.sort()

count = 0

for z in ze:
    if z > n:
        break

    if n % z == 0 and not(z in used):
        used.add(z)
        count += 1
        n /= z

def is_prime(n):
    if n < 2:
        return False
    elif n == 2 or  n == 3:
        return True

    for i in range(2, int(sqrt(n))+2):
        if n % i == 0:
            return False
    return True

print(primes)
if is_prime(n) and not(n in used):
    print(count +1)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

import heapq 
from collections import defaultdict
import numpy as np
import math

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum




if is_prime(N):
    ans = 1
elif N == 1:
    ans = 0
else:
    if N > 10**6:
        heap = seachPrimeNum(int(math.sqrt(N))+1)
    else:
        heap = seachPrimeNum(N)
    # print(heap)
    # print(heap)
    heapq.heapify(heap)
    ans = 0
    dict_prime = defaultdict(int)

    while(heap):

        # print(N)
        # cnt += 1
        # if cnt > 10:break
        # print(N)
        sub = heapq.heappop(heap)
        # print(sub)
        # print(cand)
        # print(heap)
        # print(cand)
        # print(heapq)
        if N < sub:
            # print(N,sub)
            # print("a")
            break
        if N % sub == 0:
            N = N // sub
            ans += 1
            if sub not in dict_prime:
                dict_prime[sub] = sub
                dict_prime[sub*sub] = sub
            else:
                dict_prime[sub*dict_prime[sub]] = dict_prime[sub]
                # print("a")
            heapq.heappush(heap, sub*dict_prime[sub])


print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
max_n = math.sqrt(N)

if N == 1:
    print(0)
    exit()
count = 0
for i in range(2, int(max_n)+2):
    if N % i == 0:
        count += 1
        N /= i
print(1 if count == 0 else count)

Submission status: Wrong Answer

Solution code:
def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n // i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
  

N = int(input())
if N == 1:
    print(0)
else:
    used = set()
    ans = 0
    while N > 1:
        L = make_divisors(N)
        for l in L:
            if l not in used:
                N //= l
                used.add(l)
                break
        else:
            break
    print(len(used) - 1)

Submission status: Wrong Answer

Solution code:
def prime(n):
  if n<=1:
    return False
  for i in range(2, int(n**0.5)):
    if n%i==0:
      return False
  return True

N = int(input())
calc_N = N
count = 0
if N<2:
  print(N-1)
else:
  for i in range(N):
    if calc_N < i:
      break
    if prime(i) and calc_N%i==0:
      count += 1
      calc_N /= i
  print(count)

Submission status: Wrong Answer

Solution code:
import math
import collections


def trial_division(n):
    factor = []
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            if num != 1:
                factor.append(num)
    if not factor:
        return -1
    else:
        factor.append(n)
        return factor


n = int(input())
l = trial_division(n)
if n == 1:
    print(0)
    exit(0)
if l == -1:
    print(n)
    exit(0)
if l[len(l) - 1] == 1:
    l = l[:-1]
c = collections.Counter(l)


ans = 0
for k, v in c.items():
    s = 1
    for i in range(1, v):
        if i * (i + 1) <= v * 2:
            s = max(s, i)
    ans += s
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)
div = []
for i in primes:
    N = n
    for j in range(100):
        if N%i==0:
            N=N//i
        else:
            if j == 0:
                break
            div.append(j)
            break

if div == [None]:
    print(1)
    exit()
ans = 0
for i in div:
    c = 0
    for j in range(1,100):
        if i > c+j:
            c+=j
        else:
            ans += j
            break
print(ans)

Submission status: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

import math

def kaisa(x):
  first = math.floor(math.sqrt(x*2))
  if x*2 >= first*(first+1):
    return first
  else:
    return first-1

n = int(input())
soinsu = factorization(n) 

res = 0
for i in soinsu:
  #print(int(i[1]))
  #print(type(int(i[1])))
  res = res + kaisa(int(i[1]))
print(res)

Submission status: Wrong Answer

Solution code:
import math


def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


def primes(n):
    ps = {}
    x = n
    for i in range(2, n):
        if x == 1:
            break
        cnt = 0
        while x % i == 0:
            x = x // i
            cnt += 1
        if cnt > 0:
            ps[i] = cnt
        # print(n,i,cnt)

    return ps


def factorization(n):
    arr = {}
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr[i] = cnt

    return arr


def main():
    import decimal
    n = int(input())
    if n == 1:
        print(0)
        exit()

    if is_prime(n):
        print(1)
        exit()

    ps = factorization(n)
    # print(ps)
    ans = sum([int(decimal.Decimal((-1 + (1 + 8 * v) ** 0.5) / 2)) for v in ps.values()])

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

count = 0
for i in make_divisors(N)[1:]:
  if N%i == 0:
    N = N/i
    count +=1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = []
def divisors(n):
    nums = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            nums.append(i)
            if i != n // i:
                nums.append(n//i)
    return sorted(nums)

from decimal import Decimal

if n == 1:
    print(0)
    exit()

while n > 1:
    d = divisors(n)
    for _d in d[1:]:
        # print(_d, n)
        if n % _d == 0 and _d not in ans:
            _n = n / _d
            n = int(_n)
            ans.append(_d)
            if n == 1 or n == _d:
                print(len(ans))
                exit()

# print(len(ans))

Submission status: Wrong Answer

Solution code:
def f(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

n=int(input())
ct=0
a=f(n)
for i in range(len(a)):
    ct2=0
    ct3=1
    c=a[i][1]
    while 1:
        ct2+=ct3
        if ct2>=c:
            ct+=ct3
            break
        ct3+=1
if len(a)>1:
    ct-=1
if n==1:
    ct=0
print(ct)

Submission status: Wrong Answer

Solution code:
import math, sys
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

def sieve_of_eratosthenes(n): 
    candidate = [i for i in range(2, n+1)] 
    prime = []
    limit = math.sqrt(n) + 1 

    while True:
        p = min(candidate) 
        if limit <= p:
            prime.extend(candidate) 
            break
        prime.append(p) 

        candidate = [i for i in candidate if i % p != 0]
        
    return prime

N = int(input())
if is_prime(N):
    print(1)
    sys.exit()
if N == 1:
    print(0)
    sys.exit()
x = sieve_of_eratosthenes(N)
sorce = []  #Nを割るための要素
for i in range(len(x)):
    j = 1
    while x[i] ** j <= N and N % (x[i] ** j) == 0:
        sorce.append(x[i] ** j)
        j += 1
SORCE = sorted(sorce)
count = 0
for t in SORCE:
    N /= t
    count += 1
    if N == 1:
        print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
counter = 0
i = 2
while i <= n:
  if n%i == 0:
    counter += 1
    n = n//i
  i += 1
print(counter)

Submission status: Wrong Answer

Solution code:
from decimal import *
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
n = int(input())
li = []
for i in factorization(n):
    ran = range(i[1]+1)
    sum = 0
    s = 0
    n = 1
    for j in ran:
        sum += 1
        if sum > s:
            li.append(i[0]**(j))
            s = n + s
            n += 1
ans = 1
count = 0
for i in sorted(set(li)):
    ans = int(Decimal(str(ans)) * Decimal(str(i)))
    count += 1
    if ans == n:
        break
print(count-1)

Submission status: Wrong Answer

Solution code:
L=int(input())
L_ = L
devider = 2
good = True
ans = 0
while devider**2 <= L_:
    devider_ = devider
    good = True
    while good:
        if L_ % devider_ == 0:
            L_ = L_ //devider_
            devider_ *= devider
            ans += 1
        else:
            good = False
    if devider == 2:
        devider += 1
    else:
        devider += 2
if devider <= L_:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
def factorize(n):
    b = 2
    fct = []
    while b * b <= n**1/2:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
  
n = int(input())
fact = factorize(n)
set_fact = set(fact)
ans = 0
for f in set_fact:
  c = fact.count(f)
  c = int(c)
  if c == 1:
    ans+= 1
  else:
    ans += 1
    ans += int(math.log2(c-1))
print(ans)

Submission status: Wrong Answer

Solution code:
#デフォルト
import itertools
from collections import defaultdict
import collections
from decimal import *
import math
import sys
sys.setrecursionlimit(200000)
mod = 1000000007

n = int(input())

def Prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

MAX = 100010 * 5
is_prime = [False] * MAX
is_prime[0] = False
is_prime[1] = False
for i in range(2, MAX):
    if Prime(i):
        j = i * i
        is_prime[i] = True
        while j < MAX:
            is_prime[j] = True
            j *= i
if (Prime(n)):
    print("1")
else:
    ans = 0
    for i in range(2, MAX):
        if is_prime[i]:
            if n % i == 0:
                ans += 1
                n = n / i

        if n == 1:
            break

    print(ans)