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

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *





































def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007




def main():
	N = inputInt()

	tmp = factorize(N)
	
	ans = 0

	for i,val in enumerate(tmp):
		sosuu,kai = val

		tmtmtm = 1
		con = 2
		while True:
			if kai < tmtmtm:
				break
			ans += 1
			tmtmtm += con
			con += 1

	print(ans)

def factorize(n):
    fct = []  
    b, e = 2, 0  
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct





def bisect_left_reverse(a, x):
    if a[0] <= x:
        return 0
    if x < a[-1]:
        return len(a)
    
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] <= x:
            ok = mid
        else:
            ng = mid
    return ok

def bisect_right_reverse(a, x):
    if a[0] < x:
        return 0
    if x <= a[-1]:
        return len(a)
    
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] < x:
            ok = mid
        else:
            ng = mid
    return ok





def binary_search(list, item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if guess == item:
            return mid
        if guess > item:
            high = mid -1
        else:
            low = mid + 1
    return None




def sunuke(N, K, mod=10**9+7):
	if N < K or K-1 < 0:
		return 0
	else:
		return combination(N-1, K-1, mod)




def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res


def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y




def H(n, r, mod=10**9+7):
	
	
    return combination(n+r-1, r, mod)


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        
        
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv



def dfs(graph,parent,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)



if __name__ == "__main__":
	main()

Solution (Python):
def divisor(x):
    ret = []
    for i in range(1, int(x ** 0.5) + 1):
        if x % i == 0:
            ret.append(i)
            ret.append(x // i)
    return sorted(list(set(ret)))

def prime_factor(n):
    ass = []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            ass.append(i)
            n = n // i
    if n != 1:
        ass.append(n)
    return len(set(ass))==1

n = int(input())

div = divisor(n)[1:]

l=[]
for i in div:
    if prime_factor(i):
        l.append(i)

ans = 0
for i in l:
    if n % i == 0:
        ans += 1
        n //= i
 
print(ans)

Solution (Python):
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(cnt)

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

    return arr
  
lst = factorization(n)
ans = 0
if not lst:
  print(ans)
else:
  mx = max(lst)
  for _ in lst:
    for i in range(1, mx+1):
      if _ - i >= 0:
      	_ -= i
      	ans += 1
      else:
      	break
  print(ans)

Solution (Python):


import sys
import math

debug = False

def log(text):
    if debug:
        print(text)

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


def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        
        
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]
    

    n = int(lines[0])

    return (n, )


def solve(n):

    if n == 1:
        return 0

    factors = factorization(n) 

    result = 0
    for f in factors:
        p = f[0]
        e = f[1]

        m = 0 
        for i in range(1, 1000):

            s = i * (i + 1) // 2
            if s > e:
                m = i - 1
                break

        if debug:
            log("p=%d, e=%d, m=%d" % (p, e, m))

        result = result + m
       

    return result

def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':
  
    main()

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *





































def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007




def main():
	N = inputInt()

	tmp = factorize(N)
	
	ans = 0

	for i,val in enumerate(tmp):
		sosuu,kai = val

		tmtmtm = 1
		con = 2
		while True:
			if kai < tmtmtm:
				break
			ans += 1
			tmtmtm += con
			con += 1

	print(ans)

def factorize(n):
    fct = []  
    b, e = 2, 0  
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct





def bisect_left_reverse(a, x):
    if a[0] <= x:
        return 0
    if x < a[-1]:
        return len(a)
    
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] <= x:
            ok = mid
        else:
            ng = mid
    return ok

def bisect_right_reverse(a, x):
    if a[0] < x:
        return 0
    if x <= a[-1]:
        return len(a)
    
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] < x:
            ok = mid
        else:
            ng = mid
    return ok





def binary_search(list, item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if guess == item:
            return mid
        if guess > item:
            high = mid -1
        else:
            low = mid + 1
    return None




def sunuke(N, K, mod=10**9+7):
	if N < K or K-1 < 0:
		return 0
	else:
		return combination(N-1, K-1, mod)




def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res


def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y




def H(n, r, mod=10**9+7):
	
	
    return combination(n+r-1, r, mod)


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        
        
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv



def dfs(graph,parent,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)



if __name__ == "__main__":
	main()

Solution (Python):
n=int(input())
ans=0

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

temp=factorization(n) 

if n==1:
  print(0)
else:
  i=0
  j=0
  while i<len(temp):
    if temp[i][1]>=j+1:
      temp[i][1]=temp[i][1]-(j+1)
      j=j+1
      ans=ans+1
    else:
      i=i+1
      j=0
  print(ans)

Solution (Python):
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)
    sys.exit()

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

Solution (Python):
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

m = int(input())
if m == 1:
  print(0)
  exit()
a = factorization(m)
b = []
ans = 0
for i in a:
    j = 1
    while j *(j+1) //2 <= i[1]:
        j += 1
    ans += j-1
print(ans)

Solution (Python):
history = set([])

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])

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

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

    return arr

def func(n):
    if n == 1:
        return 
    l = make_divisors(n)
    for i in sorted(l[1:]):
        if i in history:
            continue
        if len(factorization(i)) > 1:
            continue
        history.add(i)
        _ = n // i
        func(_)
        break
    return

N = int(input())
if N == 0:
    print(0)
elif N == 1:
    print(0)
else:
    func(N)
    print(len(history))

Solution (Python):


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())
if n == 1:
    print(0)
else:
    x_list = factorization(n)
    ans = 0
    for x in x_list:
        n = 2
        while True:
            if x[1] < (n * n + n) // 2:
                ans += n - 1
                break 
            n += 1

    print(ans)

Solution (Python):
import collections
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

N = int(input())
if N == 1:
  print(0)
else:
  c = collections.Counter(prime_factorize(N))
  ans = 0
  for num in c.values():
    tmp = 0
    for i in range(1,num+1):
      if tmp + i <= num:
        tmp +=i
        ans += 1
      else:
        break
  print (ans)

Solution (Python):
def solv_quadratic_equation(a, b, c):
    """ 2次方程式を解く  """
    D = (b**2 - 4*a*c) ** (1/2)
    x_1 = (-b + D) / (2 * a)
    x_2 = (-b - D) / (2 * a)


    return x_1, x_2





n=int(input())
N=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)

aa=set(a)
g=0
for i in aa:
    x1,x2=solv_quadratic_equation(1,1,-2*a.count(i))
    g=int(max(x1,x2))+g



print(g)

Solution (Python):
def resolve():
    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

    arr = factorization(N)
    ans = 0
    
    for i in range(len(arr)):
        for j in range(1,100):
            if arr[i][0] == 1:
                break
            elif arr[i][1] == 1:
                ans += 1
                break
            elif arr[i][1] == sum(range(0,j+1)):
                ans += j
                break
            elif arr[i][1] < sum(range(0,j+1)):
                ans += j-1
                break
    
    print(ans)
resolve()

Solution (Python):
import collections
N = int(input())

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

prime_factors = collections.Counter(prime_factorize(N))

counter = 0
for p in prime_factors:
    e = 1
    while prime_factors[p] >= e:
        N //= p ** e
        prime_factors[p] -= e
        e += 1
        counter += 1

print(counter)

Solution (Python):

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])


    cnt = 0
    N = n
    prime_arr = []
    array = []

    if len(arr) > 1:
        for i in range(len(arr)):
            array.append(arr[i][0])

        for i in range(len(arr)):
            for j in range(arr[i][1]):
                prime_arr.append(array[i]**(j+1))
        prime_arr.sort()

        for i in range(len(prime_arr)):
            if (N/prime_arr[i] >= 1 and N%prime_arr[i] == 0):
                N /= prime_arr[i]
                cnt += 1
        print(cnt)
    elif len(arr) == 1:
        if arr[0][0] == 1:
            print(0)
        else:
            num = arr[0][1]
            for i in range(num):
                prime_arr.append(arr[0][0]**(i+1))
            prime_arr.sort()

            for i in range(len(prime_arr)):
                if (N/prime_arr[i] >= 1):
                    N /= prime_arr[i]
                    cnt += 1
            print(cnt)

    return arr
    

if __name__=="__main__":
    n = int(input())
    factorization(n)

Solution (Python):
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

f = factorization(int(input()))
c=0
for _,i in f:
    if _ == 1:
        print(0)
        exit()
    a=1
    while a*-~a//2 <= i:
        a+=1
    c+=~-a
print(c)

Solution (Python):
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())
ans = 0
fn = factorization(N)
for i in range(len(fn)):
  if 0 < fn[i][1] <= 2:
    ans += 1
  elif 2 < fn[i][1] < 6:
    ans += 2
  elif 5 < fn[i][1] < 10:
    ans += 3
  elif 10 <= fn[i][1] < 15:
    ans += 4
  elif 15 <= fn[i][1] < 21:
    ans += 5
  elif 21 <= fn[i][1] < 28:
    ans += 6
  elif 28 <= fn[i][1] < 36:
    ans += 7
  elif 36 <= fn[i][1] < 45:
    ans += 8
  elif 45 <= fn[i][1] < 55:
    ans += 9

if N == 1:
  print(0)
else:
  print(ans)

Solution (Python):
import bisect
N = int(input())

base = pow(N, 1/2)
dic = {}
i = 2
li = []
now = 0
count = 0

for j in range(1, 51):
    now += j
    li.append(now)

while N != 1 and i <= base:
    
    if N % i == 0:
        dic[i] = 0
        while N % i == 0:
            N /= i
            dic[i] += 1
    i += 1
if N != 1:
    dic[N] = 1

if len(dic.keys()) == 0:
    if N == 1:
        print(0)
    else:
        print(1)
else:
    
    for d in dic.values():
        
        count += bisect.bisect_right(li, d)
    print(count)

Solution (Python):


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())
if n==1:
    print(0)
    exit()
a=factorization(n) 

count=0
for i in range(len(a)):
    j=1
    while 1:
        a[i][1]=a[i][1]-j

        count+=1
        if a[i][1]<0:
            a[i][1]=a[i][1]+j
            count-=1
            break
        elif a[i][1]==0:
            break
        j+=1
print(count)

Solution (Python):
N=int(input())

def fctr1(n): 
    f=[]
    c=0
    r=int(n**0.5)
    for i in range(2,r+2):
        while n%i==0:
            c+=1
            n=n//i
        if c!=0:
            f.append([i,c])
            c=0
    if n!=1:
        f.append([n,1])
    return f
L=fctr1(N)
ans=0
for i in range(len(L)):
  if L[i][1]==1:
    ans+=1
  else:
    ans+=(-1+(1+8*L[i][1])**0.5)//2
print(int(ans))

Solution (Python):
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


def calcN(num):
    if num >= 45:
        return 9
    elif num >= 36:
        return 8
    elif num >= 28:
        return 7
    elif num >= 21:
        return 6
    elif num >= 15:
        return 5
    elif num >= 10:
        return 4
    elif num >= 6:
        return 3
    elif num >= 3:
        return 2
    elif num >= 1:
        return 1
    

A = int(input())
if A == 1:
    print(0)
else:
    insuu =  factorization(A)
    ret = 0
    for i in insuu:
        ret += calcN(i[1])
    print(ret)

Solution (Python):
n = int(input())

def prime(n_):
    if n_ == 1:
        return []
    num = int(pow(n_, 0.5)) + 1
    pr = [True] * (num + 1)
    pr[0], pr[1] = False, False
    for i in range(2, int(pow(num, 0.5) + 1)):
        if not pr[i]:
            continue
        for j in range(i * 2, num + 1, i):
            pr[j] = False
    return [i for i in range(num + 1) if pr[i]]

def factorization(num):
    pr = prime(num)
    data = []
    temp = num
    for i in pr:
        if temp % i == 0:
            count = 0
            while temp % i == 0:
                count += 1
                temp //= i
            data.append([i, count])
    if temp != 1:
        data.append([temp, 1])
    if data == []:
        data.append([n, 1])
    return data

def main():
    ans = 0
    pr = factorization(n)
    for i, j in pr:
        count = 1
        sub = j
        while sub >= count:
            ans += 1
            sub -= count
            count += 1
    if n == 1:
        ans = 0
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())

n = 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)

pset = list(set(a))




M = len(pset)
number = 0

for i in range(M):
    p = pset[i]
    c = a.count(p)
    if c >= 1 and c<3:
        number += 1
    elif c >= 3 and c<6:
        number += 2
    elif c >= 6 and c<10:
        number += 3
    elif c >= 10 and c<15:
        number += 4
    elif c >= 15 and c<21:
        number += 5
    elif c >= 21 and c<28:
        number += 6
    elif c >= 28 and c<36:
        number += 7
    elif c >= 36 and c<45:
        number += 8
    elif c >= 45 and c<55:
        number += 9
    else:
        number += 10

print(number)

Solution (Python):

import math

n = int(input())


faccs = {}


def isPrime(n) : 
  
    if (n <= 1) : 
        return False
    if (n <= 3) :
        return True

    if (n % 2 == 0 or n % 3 == 0) : 
        return False
  
    i = 5
    while(i * i <= n) : 
        if (n % i == 0 or n % (i + 2) == 0) : 
            return False
        i = i + 6
  
    return True

if isPrime(n):
    print(1)
else:
    while n % 2 == 0:
        if 2 in faccs:
            faccs[2] += 1
        else:
            faccs[2] = 1
        n = n / 2

    for i in range(3,int(math.sqrt(n))+1,2): 
          

        while n % i== 0:
            if i in faccs:
                faccs[i] += 1
            else:
                faccs[i] = 1
            n = n / i 

    if n > 2:
        faccs[math.floor(n)] = 1 

    count = 0

    for i in faccs.values():
        if i > 0:
            temp = 1
            while (i-temp)>=0:
                i -= temp
                temp +=1
                count += 1
    print(count)

Solution (Python):
import math
N=int(input())
def hantei(u):
  if u==1:
    return 1
  for i in range(1,u+1):
    if (1/2)*i**2+(1/2)*i>u:
      return int(i-1)
    else:
      continue
   
a=[0]*int(math.sqrt(N))
for i in range(2,int(math.sqrt(N))+1):
  while N%i==0:
    N=N//i
    a[i-1]=a[i-1]+1
c=0
if N!=1:
  c+=1
for t in range(len(a)):
  if a[t]!=0:
    c+=hantei(a[t])
print(c)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    usedz=[]
    cnt=0
    def prime_factorize1(N):
        """
        Nをくって、Nの素因数を格納したリストresを返す。
        リストの要素をすべて掛ければNになる"""
        l = []
        x = N
        y = 2
        while y*y <= x:
            while x % y == 0:
                l.append(y)
                x //= y
            y += 1
        if x > 1:
            l.append(x)
        prev=1
        newl=[]
        for x in range(len(l)):
            if l[x]!=prev:
              newl.append(l[x])
              prev=l[x]
            else:
                newl.append(newl[x-1]*l[x])
        newl.sort()
        for x in newl:
            if x not in usedz:
                usedz.append(x)
                return x
        return -1

    while True:
        z = prime_factorize1(n)
        if z==-1:
            break
        else:
            n=n//z
            cnt+=1
    print(cnt)

resolve()

Solution (Python):

from bisect import bisect_right
import math
import numpy as np

def primes(n):
    yield 2
    import numpy as np
    nn = int(math.sqrt(n)+1)
    a = np.arange(1, nn+1)
    b = a * a.reshape((nn, 1))
    b = b[1:,1:]
    c = b.reshape((nn-1)*(nn-1), )
    notprimes = set(c)
    for p in range(3, n+1, 2):
        if p not in notprimes:
            yield p

def bunkai(N):
    result = dict()
    for p in primes(int(math.sqrt(N))+1):
        if N == 1:
            return result
        count = 0
        while N % p == 0:
            count += 1
            N /= p
        if count != 0:
            result[p] = count
    
    if N != 1:
        result[N] = 1
    
    return result


def main():
    N = int(input())

    s = np.arange(math.log(N,2)+1, dtype=np.int32)
    S = (s * (s + 1) ) // 2
    p_list = bunkai(N)

    ans = 0
    for c in p_list.values():
        i = bisect_right(S, c) - 1
        
        ans += i
    
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import collections
N=int(input())
def prime_factorize(n):
    a = []
    b=[]
    c=[]
    d=[]
    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)
    for z in a:
        if not z in b:
            b.append(z)
    for z in b:
        c.append(a.count(z))
    for z in range(len(c)):
        for y in range(1,c[z]+1):
            d.append(b[z]**y)
    d=sorted(d)
    number=N
    answer=0
    for z in d:
        if number%z==0:
            number=int(number/z)
            answer+=1
    return answer
if N==1:
    print(0)
else:
    print(prime_factorize(N))

Solution (Python):
import math
import collections
 
N = int(input())
prime_number = False
ans = 0
 
def trial_division(n):
    
    factor = []
    
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    
    if not factor:
      global prime_number
      prime_number = True
      return
    else:
        factor.append(n)
        return factor

list_num = trial_division(N)

if N == 1:
  ans = 0
elif prime_number:
  ans = 1
else:
  if 1 in list_num:
    prime_list = list_num[:-1]
  else:
    prime_list = list_num
  counter = collections.Counter(prime_list)
  for key,val in counter.items():
    temp = val
    for i in range(1,val+1):
      if temp-i > 0:
        temp -= i
        ans += 1
      elif temp-i == 0:
        temp -= i
        ans += 1
        break
      else:
        break
    
print(ans)

Solution (Python):
import collections


def f(x):  
    if x == 0:
        return 0
    elif 1 <= x <= 2:
        return 1
    elif 3 <= x <= 5:
        return 2
    elif 6 <= x <= 9:
        return 3
    elif 10 <= x <= 14:
        return 4
    elif 15 <= x <= 20:
        return 5
    elif 21 <= x <= 27:
        return 6
    elif 28 <= x <= 35:
        return 7
    elif 36 <= x <= 44:
        return 8
    else:
        return 9



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


n = int(input())

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

c = collections.Counter(prime_factorize(n))
cl = c.values()

ans = 0
for i in cl:
    ans += f(i)

if ans == 0:
    print(1)
else:
    print(ans)