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: Accepted

Solution code:
N = int(input())
if N==1:
    print(0)
    exit()

from collections import Counter
def factorize(n):
    d = Counter()
    m = 2
    while m*m <= n:
        while n%m == 0:
            n //= m
            d[m] += 1
        m += 1
    if n > 1:
        d[n] += 1
    return d

fac = factorize(N)
if len(fac)==1 and N in fac:
    print(1)
    exit()

ans = 0
for v in fac.values():
    n = 1
    while v >= n:
        v -= n
        ans += 1
        n += 1
print(ans)

Submission status: Accepted

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
fact = factorization( n )

cnt = 0
for f in fact:
  if f[0] == 1:
    continue
  fa = f[ 1 ]
  fa -= 1
  i = 2
  while fa >= 0:
    cnt += 1
    fa -= i
    i += 1
print( cnt )

Submission status: Accepted

Solution code:
from collections import Counter

def p(x):
    a=[]
    while x%2==0:
        a.append(2)
        x//=2
    f=3
    while f*f<=x:
        if x%f==0:
            a.append(f)
            x//=f
        else:
            f+=2
    if x!=1:
        a.append(x)
    return a

N=int(input())
c=Counter(p(N))
ans=0
for k,v in c.items():
    i=1
    j=1
    while i<=v:
        ans+=1
        j+=1
        i+=j
print(ans)

Submission status: Accepted

Solution code:
import math
def f(n):
    if n==1:
        return [[1,0]]
    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=f(int(input()))
s=0
for i in n:
    p=i[1]
    s+=int((-1+math.sqrt(1+8*p))/2)
print(s)

Submission status: Accepted

Solution code:
n = int(input())

def factorization(n):
    # https://qiita.com/snow67675476/items/e87ddb9285e27ea555f8
    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 s2n(s):
    m = 0
    for i in range(1, 9):
        if i * (i+1) // 2 <= s:
            m = i
        else:
            break
    return m

if n == 1:
    print(0)
else:
    ans = 0
    for [p, esum] in factorization(n):
        ans += s2n(esum)
    print(ans)

Submission status: Accepted

Solution code:
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
import math
N = int(input())
A = prime_factorize(N)
B = list(set(A))
kosuu = [0]*len(B)
ans = 0
for i in range(len(B)):
    kosuu[i] = A.count(B[i])
for i in range(len(kosuu)):
    for j in range(1, int(math.sqrt(N))):
        kosuu[i] -= j
        if kosuu[i] >= 0:
            ans += 1
        else:
            break
print(ans)

Submission status: Accepted

Solution code:
import collections
import bisect

n = 10 ** 6 + 10
fl = [1] * n
fl[0] = 0
fl[1] = 0
lprime = []
for i in range(n):
    if fl[i] == 1:
        lprime.append(i)
        ti = i * 2
        while ti < n:
            fl[ti] = 0
            ti += i


def prime_factorize(n):
    global lprime
    a = []
    for p in lprime:
        if p * p > n:
            break
        while n % p == 0:
            a.append(p)
            n //= p
    if n != 1:
        a.append(n)
    return a


N = int(input())
tres = prime_factorize(N)
ctres = collections.Counter(tres)
sl = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66]
res = 0
for c in ctres.values():
    res += bisect.bisect_right(sl, c)
print(res)

Submission status: Accepted

Solution code:
def prime_factor(x):
    
    prime_factor=[]
    
    for i in range(2,int(x**0.5)+1):
        if x==1: break

        count = 0
        while x%i == 0:
            x //= i
            count += 1
        if count>0:
            prime_factor.append((i,count))
    
    if x>1: prime_factor.append((x,1))
    
    return prime_factor

def count(x):
    ret = 1
    for i in range(1,x):
        if i*(i+1)//2 <= x:
            ret = i
        else:
            break
    return ret

n = int(input())
ans = 0
for p,esum in prime_factor(n):
    ans += count(esum)
print(ans)

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations, combinations_with_replacement
from heapq import heappop, heappush
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def div3(x): 
    div = defaultdict(int)
    check = 2
    while(x!=1 and check <= int(x**0.5)+2):
        while x%check == 0:
            div[check] += 1
            x /= check
        check += 1
    if x != 1:
      div[x] += 1
    return div

def main():
    n = inp()
    dp = [i for i in range(51)]
    for i in range(50):
        dp[i+1] += dp[i]
    div = div3(n)
    ans = 0
    for e in div:
        ans += bisect.bisect_right(dp,div[e]) - 1
    print(ans)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
primes = []
t = 2
n_ = n
while t*t <= n_ and t*t < n:
    if n % t == 0:
        cnt = 1
        while n % (t ** (cnt+1)) == 0:
            cnt += 1
        primes.append([t,cnt])
        n //= (t**cnt)
    t += 1
if n != 1:
    primes.append([n,1])

def largest_tri(m):
    cnt = 0
    for i in range(1,m+3):
        cnt += i
        if cnt > m:
            return i - 1

ret = 0
for p in primes:
    ret += largest_tri(p[1])
print(ret)

Submission status: Accepted

Solution code:
from bisect import bisect_left
from collections import defaultdict

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


def prime_factor(n):
    # (素因数, 数)のリストで出てくる
    d = defaultdict(int)
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            d[i] += 1
            n //= i
    if n != 1:
        d[n] += 1
    return list(d.items())


soinsu = prime_factor(n)
kouho = [i * (i + 1) // 2 for i in range(10000)]
ans = 0
for key, val in soinsu:
    pos = bisect_left(kouho, val + 1)
    ans += pos - 1
print(ans)

Submission status: Accepted

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

  return arr

arr = factorization(int(input()))

ans = 0
for p in arr:
  i = 1
  while p[1] >= i:
    ans += 1
    p[1] -= i
    i += 1
    
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    divisors.sort()
    return divisors
def is_prime(n):
    if n == 1:
        return False
    for k in range(2, int(n**0.5) + 1):
        if n % k == 0:
            return False
    return True

def insu(num):
    from collections import defaultdict
    div_prime = [d for d in make_divisors(num) if is_prime(d)]
    res = defaultdict(int)
    for d in div_prime:
        while num % d == 0:
            num //= d
            res[d] += 1
    return res
ins = insu(N)
ans = 0
for v in ins.values():
    counter = 1
    while v >= counter:
        v -= counter
        counter += 1
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import math
from collections import defaultdict
from bisect import bisect_right

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


n = int(input())
r = trial_division(n)
check = [i for i in range(1, 101)]
for i in range(len(check)-1):
    check[i+1] += check[i]

ans = 0
for k, v in r.items():
    if k == 1:
        continue

    ans += bisect_right(check, v)

print(ans)

Submission status: Accepted

Solution code:
from math import sqrt,gcd,ceil 
def ii():return int(input())
def mi():return map(float,input().split())
def li():return list(mi())
def si():return input()

n=ii()
ans=0
for i in range(2,int(sqrt(n))+1):
    f=0
    while(n%i==0):
        n//=i
        f+=1
    c=1
    c1=1
    while(c<=f):
        ans+=1
        c1+=1
        c+=c1
if(n>1):
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
from itertools import accumulate
import bisect

N = int(input())
l = list(accumulate(range(1, 20)))
ans = 0

def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

p = prime_decomposition(N)
dic = {}
for v in p:
    if not v in dic:
        dic[v] = 0
    dic[v] += 1

for v in dic.values():
    i = bisect.bisect_right(l, v)
    ans += i

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
primes = {}
for i in range(2, int(n**0.5)+1):
    if n%i==0:
        cnt = 0
        while n%i==0:
            n //= i
            cnt += 1
        primes[i] = cnt
    if n==1:
        break
else:
    if n!=1:
        primes[n] = 1
ans = 0
for i in primes.values():
    for j in range(1, 100000):
        if j*(j+1)//2<=i:
            ans += 1
        else:
            break
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter


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


pf = prime_factorize(int(input()))
c = Counter(pf)
#print(c)
ans = 0
for a, b in c.items():
    tmp = 1
    while True:
        b -= tmp
        if b < 0:
            break
        tmp += 1
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()
# template

def make_devisor(n: int):
    x = n
    ret = []
    for i in range(2, int(math.sqrt(n)) + 1):
        cnt = 0
        while x % i == 0:
            cnt += 1
            x //= i
        if cnt != 0:
            ret.append(cnt)
    if x != 1:
        ret.append(1)
    return ret

def main():
    n = ii()
    a = make_devisor(n)
    # print(a)
    ans = 0
    for x in a:
        t = -1
        while (t + 2) * (t + 1) // 2 <= x:
            t += 1
        ans += t
    print(ans)
    return

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
# from collections import Counter,deque,defaultdict
import itertools
# import math
# import networkx as nx
from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop
n=n0()

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

if n>=2:
    list1=factorization(n)

    list2=[x[1] for x in list1]

    m=max(list2)
    list3=list(itertools.accumulate([i for i in range(1,m+1)]))

    ans=0
    for i in list2:
        a=bisect_right(list3,i)
        ans+=a
    print(ans)
else:
    print(0)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

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 = ii()

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

f = factorization(N)
ans = 0
for i, j in f:
    cnt = 1
    while True:
        j -= cnt
        ans += 1
        if j <= cnt:
            break
        cnt += 1
print(ans)

Submission status: Accepted

Solution code:
#!python3

LI = lambda: list(map(int, input().split()))

# input
N = int(input())


def prime_factor(x):
    m = {}
    i = 2
    while i ** 2 <= x:
        while x % i == 0:
            if i in m:
                m[i] += 1
            else:
                m[i] = 1
            x //= i
        i += 1
    if x != 1:
        m[x] = 1
    return m


def main():
    m = prime_factor(N)
    ans = 0
    for v in m.values():
        n = 1
        while n ** 2 + n <= 2 * v:
            n += 1
        ans += n - 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from functools import lru_cache


def PrimeFactorization(m):
    pf = {}
    for i in range(2, int(m ** 0.5) + 1):
        while m % i == 0:
            pf[i] = pf.get(i, 0) + 1
            m //= i
    if m > 1:
        pf[m] = 1
    return pf


@lru_cache(maxsize=100000)
def f(x):
    return int((-1 + (1 + 8 * x) ** 0.5) // 2 + 0.001)


def resolve():
    n = int(input())
    d = PrimeFactorization(n)
    ans = 0
    for v in d.values():
        ans += f(v)
    print(ans)


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
n = int(input())

d = []

x = 2
while n > 1 and x <= 1000000:
    t = 0
    while n % x == 0:
        t += 1
        n //= x
    if t > 0:
        d.append(t)
    x += 1
if n > 1:
    d.append(1)

def f(t):
    l, r = 0, t + 3
    while r - l > 1:
        c = (r + l) // 2
        if c * (c + 1) // 2 > t:
            r = c
        else:
            l = c
    return l
print(sum(f(ti) for ti in d))

Submission status: Accepted

Solution code:
from collections import Counter
import sys

def prime_factorize(n):
    ans = []
    while not n%2:
        ans.append(2)
        n //= 2
    mod = 3
    while mod**2 <= n:
        if n%mod == 0:
            ans.append(mod)
            n //= mod
        else:
            mod += 2
    if n != 1:
        ans.append(n)
    counter = Counter(ans)
    return counter


def main():
    input = sys.stdin.readline
    n = int(input())
    primes = prime_factorize(n)
    ans = 0
    for v in primes.values():
        value = v
        if value <= 2:
            ans += 1
            continue
        ans += 1
        value -= 2
        k = 3
        while value > 0:
            value -= k
            k += 1
            ans += 1
            
          
    print(ans)
    
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque
from collections import defaultdict

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

    if temp!=1:
        arr[temp] = 1

    if arr==[]:
        arr[n] = 1

    return arr

def main():
    n = int(sys.stdin.readline())
    base = factorization(n)
    ans = 0
    for x in list(base.keys()):
        i = 1
        while(base[x] >= i):
            base[x] -= i
            ans += 1
            i += 1
    print(ans)
    return 0

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N=int(input())
if N==1:
    print(0)
    exit()
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
nprime=factorization(N)
ans=0
for t in nprime:
    now=1
    count=0
    while t[1]>=now:
        t[1]-=now
        now+=1
        count+=1
    ans+=count
print(ans)

Submission status: Accepted

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

N=int(input())
fact=factorization(N)
if fact[0][0]==1:
    fact=fact[1:]
ans=0
for i in range(len(fact)):
    n= 1
    while n*(n+1)//2<=fact[i][1]:
        n+=1
    ans+=n-1

print(ans)

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

N = I()

import math

d = {}
for i in range(2,math.floor(math.sqrt(N))+1):
    if N % i == 0:
        r = 0
        while N % i == 0:
            N //= i
            r += 1
        d[i] = r
if N != 1:
    d[N] = 1

ans = 0
for i in d.keys():
    r = d[i]
    b = 1
    a = 0
    while r > 0:
        r -= b
        if r >= 0:
            b += 1
            a += 1
        else:
            break
    ans += a

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

primes = [0]
while N % 2 == 0:
    primes[0] += 1
    N //= 2

if N != 1:
    for i in range(3, 1000000, 2):
        if N % i == 0:
            primes.append(0)
            while N % i == 0:
                primes[-1] += 1
                N //= i
            if N == 1:
                break
    else:
        primes.append(1)

ans = 0
for e in primes:
    i = 0
    while True:
        i += 1
        e -= i
        if e >= 0:
            ans += 1
        else:
            break

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
def resolve():
    N,=pin()
    if N==1:
        print(0)
        return

        
    n=int(N**0.5)+1
    divs=dict()
    temp=N
    for i in range(2,n+4):
        while (1):
            if temp%i !=0:
                break
            divs.setdefault(i,0)
            divs[i]+=1
            temp/=i
    if temp>1:
        divs.setdefault(temp,1)
    #print(divs)
    check=1
    ans=0
    for p,q in divs.items():
        check*=p**q
        temp2=0
        for i in range(1,50):
            temp2+=i
            if temp2>q:
                break
            ans+=1
            
            
        #print(ans)
    print(ans)
    assert N== check
    
#%%submit!
resolve()

Submission status: Accepted

Solution code:
import collections

def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N = Z()

    def bunkai(num):
        i = 2
        ret = []
        a = num
        while i*i <= num:
            c = 0
            while a%i == 0:
                a //= i
                c += 1
            if c > 0: ret.append([i, c])
            i += 1
        if a != 1: ret.append([a, 1])
        return ret

    pl = bunkai(N)
    output = 0
    for i in range(len(pl)):
        _, c = pl[i]
        j = 1
        while c >= j:
            c -= j
            j += 1
            output += 1
    print(output)

    return

if __name__ == '__main__':
    main()

Submission status: Accepted

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

n = int(input())
a = factorization(n)
c = 0
if n == 1:
  print(0)
  exit()
for d in a:
  s = d[1]
  if s > 44:
    c += 9
  elif s > 35:
    c += 8
  elif s > 27:
    c += 7
  elif s > 20:
    c += 6
  elif s > 14:
    c += 5
  elif s > 9:
    c += 4
  elif s > 5:
    c += 3
  elif s > 2:
    c += 2
  elif s > 0:
    c += 1
print(c)

Submission status: Accepted

Solution code:
from copy import deepcopy
m = 43
table = [[] for i in range(43)]
table[0].append(set([0]))
table[1].append(set([1]))
for i in range(2,m):
    table[i].append(set([i]))
    for j in range(1, i):
        k = i-j
        for t in table[j]:
            if k in t:
                continue
            tmp = deepcopy(t)
            tmp.add(k)
            table[i].append(tmp)
    l = max(len(a) for a in table[i])
    tmp = []
    for a in table[i]:
        if len(a) == l:
            tmp.append(a)
    table[i] = tmp
table = [max(len(j) for j in i) for i in table]

n = int(input())
def factorization(n):
    ret = {}
    for i in range(2, int(n**0.5)+1):
        while n % i == 0:
            ret[i] = ret.get(i, 0) + 1
            n //= i
    if n != 1:
        ret[n] = ret.get(n, 0) + 1
    return ret

d = factorization(n)
ans = 0
for k,v in d.items():
    ans += table[v]
print(ans)

Submission status: Accepted

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

H=[]
for j in range(10):
    H+=[j]*(j+1)

N=int(input())
S=0

if N!=1:
    L=factorization(N)
    S=0
    for (x,a) in L:
        S+=H[a]

print(S)

Submission status: Accepted

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

primes = collections.Counter(prime_factorize(N))

answer = 0

for key in primes:
    number = primes[key]
    minus_number = 1
    while True:
        number -= minus_number
        if number < 0:
            break
        minus_number += 1
    answer += (minus_number - 1)

print(answer)

Submission status: Accepted

Solution code:
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
import collections
c = collections.Counter(prime_factorize(n))
ans=0
for x in list(c.values()):
  now=1
  i=1
  while now<x+1:
    now+=(i+1)
    i+=1
  ans+=(i-1)
print(ans)

Submission status: Accepted

Solution code:
import bisect
n = int(input())
#nを受け取り、nを素因数分解した形で返す
if n == 1:
    print(0)
    exit()
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
acc = [0 for i in range(1000)]
acc[1] = 1
for i in range(2,1000):
    acc[i] = acc[i-1] + i
array = factorization(n)
ans = 0
for num, count in array:
    index = bisect.bisect_right(acc, count)
    ans += (index - 1)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

d = {}
for i in range(2,int(n**0.5)+1):
    if n%i == 0:
        d[i] = 0
        while n%i == 0:
            d[i] += 1
            n //= i
if n > 1:
    d[n] = 1

ans = 0
for i in d.values():
    x = i
    for j in range(1,10000):
        if x >= j:
            x -= j
            ans += 1
        else:
            break
print(ans)

Submission status: Accepted

Solution code:
import sys
readline=sys.stdin.readline
 
N = int(readline())
if N == 1:
  print(0)
  exit(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
  
# 同じ素数の組から、1つ、2つと選び方を変えて選ぶ

arr = factorization(N)
ans = 0
for a in arr:
  facts = a[1]
  i = 1
  while i <= facts:
    ans += 1
    facts -= i
    i += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
n = int(input())
d = defaultdict(int)
k = 2
while n > 1 and k * k <= n:
    if n % k == 0:
        d[k] += 1
        n //= k
    else:
        k += 1
if n > 1:
    d[n] += 1
ans = 0
for k,v in d.items():
    a = 1
    while v >= a:
        v -= a
        a += 1
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from math import sqrt
  
def primeFactors(n): 
    factor = dict()
    # Print the number of two's that divide n 
    while n % 2 == 0: 
        if 2 not in factor:
            factor[2] = 1
        else:
            factor[2] += 1
        n = n / 2
          
    # n must be odd at this point 
    # so a skip of 2 ( i = i + 2) can be used 
    for i in range(3,int(sqrt(n))+1,2): 
        # while i divides n , print i ad divide n 
        while n % i== 0: 
            if i not in factor:
                factor[i] = 1
            else:
                factor[i] += 1
            n = n / i 
              
    if n > 2: 
        factor[n] = 1

    return factor

x = int(input())
res = 0
pf = primeFactors(x)
for i in pf:
    res += int(0.5*(sqrt(8*pf[i] + 1) - 1))

print(res)

Submission status: Accepted

Solution code:
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

def main():
    N = int(input())
    P = prime_factorize(N)
    C = collections.Counter(P)
    # print(C)

    ans = 0
    for k, v in C.items():
        x = 1
        while v - x >= 0:
            v -= x
            x += 1
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()