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:
from collections import Counter
import bisect

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())
L = Counter(prime_factorize(n))
A = [0]*50
for i in range(50):
    cnt = 1
    while i >= (cnt+1)*(cnt+2)//2:
        cnt += 1
    A[i] = cnt
ans = 0
for c in L.values():
    ans += A[c]
print(ans)

Submission status: Accepted

Solution code:
import math

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

primes = factorization(n)
cnt = 0

for i in primes:
    if primes == [[1, 1]]:
        break
    cnt += math.floor(math.sqrt(2*i[1]+1/4)-1/2)

print(cnt)

Submission status: Accepted

Solution code:
def is_prime(n):
  i=2
  r=[]
  while i*i<=n:
    if n%i==0:
      c=0
      while n%i==0:
        c+=1
        n//=i
      r.append((i,c))
    i+=1
  if n> 1:
    r.append((n,1))
  return r

def main():
  n=int(input())
  r=0
  for p,e in is_prime(n):
    i=1
    while e>=i:
      r+=1
      e-=i
      i+=1
  return r
print(main())

#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

# def is_prime(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

# from itertools import groupby
# n=int(input())
# p=is_prime(n)

# ans = 0

# for v, g in groupby(p):
#   n=len(list(g))
#   for i in range(1,100000):
#     n-=i
#     if n>=0:
#       ans+=1
#     else:
#       break
# print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

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

second_prime_max = int(N ** 0.5)

check = 2

while check <= second_prime_max:
    if N % check == 0:
        N //= check
        prime_count = 1
        while N % check == 0:
            N //= check
            prime_count += 1
        z_count = 0
        while z_count < prime_count:
            z_count += 1
            ans += 1
            prime_count -= z_count
        second_prime_max = int(N ** 0.5)
    check += 1

if N != 1:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
n=int(input())

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
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

a = factorization(n)

# print(a)
n = len(a)

cnt =0
for i in range(n):
    k = a[i][1]

    fr=1
    cnt+=1
    for j in range(2,k+1):
        fr+=j
        if k-fr>=0:
            cnt+=1

print(cnt)

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def factorization(n):
    # 参考: https://qiita.com/snow67675476/items/e87ddb9285e27ea555f8
    dic = defaultdict(int)
    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
            dic[i] = cnt
            
    if temp!=1:
        dic[temp] = 1


    return dic

def main():
    n = int(input())
    prime_dic = factorization(n)
    ans = 0
    for p in prime_dic:
        j = 1
        while prime_dic[p] >= j:
            ans += 1
            prime_dic[p] -= j
            j += 1            
    
    print(ans)
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())


def factorization(n):
    retval = []
    tmp = n
    for p in range(2, int(n**.5)+1):
        if tmp % p == 0:
            cnt = 0
            while tmp % p == 0:
                cnt += 1
                tmp //= p
            retval.append([p, cnt])
    if tmp != 1:
        retval.append([tmp, 1])
    return retval


fact = factorization(n)
m = len(fact)
ans = 0
for i in range(1, 1000):
    for j in range(m):
        if i <= fact[j][1]:
            fact[j][1] -= i
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
#D
import math
N = int(input())
Nsyo = N
count = 0
div = 2
divcount = 0
divlist = []
while N > 1 and div <= math.sqrt(Nsyo)+1:
    if N%div == 0:
        while N%div == 0:
            N = N/div
            divcount = divcount+1
        divlist.append(divcount)
        divcount = 0
    else:
        pass
    div = div + 1
div = 1
divcount = 0
for i in divlist:
    while i >= div:
        i = i-div
        divcount = divcount + 1
        div = div + 1
        
    count = count +divcount
    divcount = 0
    div = 1
if N > math.sqrt(Nsyo):
    count = count + 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())


def factorization(n):
    retval = []
    tmp = n
    for i in range(2, int(-(-n**.5//1))+1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            retval.append([i, cnt])
    if tmp != 1:
        retval.append([tmp, 1])
    return retval


fact = factorization(n)
m = len(fact)
ans = 0
for i in range(1, 1000):
    update = 0
    for j in range(m):
        if i <= fact[j][1]:
            fact[j][1] -= i
            ans += 1
            update = 1
    if not update:
        break
print(ans)

Submission status: Accepted

Solution code:
n = int(input())


def factorization(n):
    retval = []
    tmp = n
    for i in range(2, int(-(-n**.5//1))+1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            retval.append([i, cnt])
    if tmp != 1:
        retval.append([tmp, 1])
    return retval


fact = factorization(n)
m = len(fact)
ans = 0
for i in range(1, 1000):
    for j in range(m):
        if i <= fact[j][1]:
            fact[j][1] -= i
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
def prime(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())
a = prime(N)
a.sort()
import copy
b = copy.copy(a)
b = list(set(b))
b.sort()

ret = 0
for i in b:
    cnt = 0
    idx=0
    while True:
        idx += 1
        cnt = cnt + idx
        if a.count(i) >= cnt:
            ret += 1
        else:
            break

print(ret)

Submission status: Accepted

Solution code:
def fac(n):
    dic = {}
    cur = n
    for i in range(2,(int(n**0.5)+2)):
        if cur % i == 0:
            count = 0
            while cur % i == 0:
                count += 1
                cur //= i
            dic[i] = count
            if cur == 1:
                break
    if cur != 1:
        dic[cur] = 1
    return dic

N = int(input())
lists = fac(N)
ans = 0
for i in lists.values():
    count = 1
    while i >= count:#count=1+2+3+...nといってもしiがcount未満の値になったら終了
        i -= count
        count += 1
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

def prime_factor(n):
    prime_list = []
    
    for i in range(2,int(n**0.5)+1):
        repeat = 0
        while n % i == 0:
            n /= i
            repeat += 1
        if repeat > 0:
            prime_list.append([i,repeat])
        if n == 1:
            break
    if n > 1:
        prime_list.append([n,1])
    return prime_list

p = prime_factor(n)

count = 0
for prime in p:
    power = prime[1]
    time = 1
    while power > 0 and power >= time:
        power -= time
        time += 1
        count+=1
print(count)

Submission status: Accepted

Solution code:
n=int(input())
a=0
for i in range(2,10**6):
    b=0
    while n%i==0:
        n//=i
        b+=1
    c=d=0    
    while c+d<b:
        c+=1
        d+=c
    a+=c    
print(a+(n>1))

Submission status: Accepted

Solution code:
import math

n = int(input())
count = 0
p = n

for z in range(2, int(math.sqrt(n)) + 1):
    e = 1
    while n % z ** e == 0:
        n //= z ** e
        count += 1
        e += 1
    if n % z == 0: #これを行わなければ，素因数同士でかける場合も含んでしまう．
        while n % z == 0:
            n //= z

if n != 1:
    count += 1
if count == 0 and p != 1:
    count = 1

print(count)

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


N = int(input())

primes = prime_factorize(N)

num = 0
hist = [1]
c = 1

tmp = 1
for p in primes:
    # 前回と異なる場合
    if tmp != p:
        c = 1
    tmp = p
    c *= p
    if c not in hist:
        hist.append(c)
        num += 1
        c = 1
print(num)

Submission status: Accepted

Solution code:
def prime_factorize(n):
    '''引数nの因数分解結果のlistを返す。'''
    arr = []
    while n % 2 == 0:
        arr.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            arr.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        arr.append(n)
    return arr

def main():
    n = int(input())
    f = set(prime_factorize(n))
    s = set()
    for p in f:
        e = 1
        z = p ** e
        while z <= n:
            if n % z == 0:
                if z not in s:
                    n //= z
                    s.add(z)
            e += 1
            z = p ** e
    print(len(s))
        
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[i] = cnt

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

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

    return arr



N = int(input())
fac_dic = factorization(N) 
count = 0


for k,v in fac_dic.items():
  tmp = 1
  while(v >= tmp):
    v = v - tmp
    tmp += 1
    count += 1
  


print(count)

Submission status: Accepted

Solution code:
# 素数と個数を求める
def factorize(n):
    res = []
    for i in range(2,n):
        if i*i > n: break
        if n%i: continue
        res += [[i,0]]
        while n%i == 0:
            n //= i
            res[-1][1] += 1
    if n != 1: res += [[n,1]]
    return res

n = int(input())
P = factorize(n)
ans = 0
for p, c in P:
    for i in range(1, c+1):
        pi = p**i
        if n%pi: continue
        n //= pi
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
# print('n',n)

# 素数と個数を求める
def factorize(n):
    res = []
    for i in range(2,n):
        if i*i > n: break
        if n%i: continue
        res += [[i,0]]
        while n%i == 0:
            n //= i
            res[-1][1] += 1
    if n != 1: res += [[n,1]]
    return res

P = factorize(n)
# print(P)

ans = 0
for pc in P:
    for c in range(1, pc[1]+1):
        pp = pc[0]**c
        if n%pp: continue
        n //= pp
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

# 素因数分解
# √n+1までを対象に因数分解
# 素数のみを対象に処理しなくても2で引っかかる場合は4、6などは対象にならない。
prime = []
for i in range(2, int(n**0.5)+1): 
  cnt = 0
  while n%i == 0:
    n //= i # 割り切れる場合に最後の処理で余りが1になり、ループを抜ける
    cnt += 1
  prime.append(cnt) # 因数分解した回数を保持
  if n == 1:
    break

# 対象が素数であった場合は１を結果として保持
if n > 1:
  prime.append(1)
  
ans = 0
for x in prime:
  for i in range(1, x+1):
    if x >= i: # 素数の数をカウント
      ans += 1
      x -= i
    else:
      break
print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())
if n == 1:
    print(0)
    exit(0)
max = int(math.sqrt(n) + 0.1)
ans = 0
for i in range(2, max):
    count = 0
    while n % i == 0:
        count += 1
        n = n // i
    if count > 0:
        for j in range(1, 64):
            if count >= j:
                ans += 1
            else:
                break
            count -= j
    if n == 1:
        print(ans)
        exit(0)
print(ans + 1)

Submission status: Accepted

Solution code:
def prime_factorization(n):
    #素因数分解の結果を辞書に保存して返す
    #1の時は空の辞書を返す
    num = int(n ** 0.5)
    rec = dict()
    for prime in range(2, num + 2):
        if n % prime == 0:
            cnt = 0
            while True:
                if n % prime != 0:break
                cnt += 1
                n = n // prime
            rec[prime] = cnt

    if n != 1:rec[n] = 1
    return rec

n = int(input())
rec = prime_factorization(n)
ans = 0
for key, cnt in rec.items():
    temp = 1
    while True:
        if cnt < temp:break
        ans += 1
        cnt -= temp
        temp += 1
print(ans)

Submission status: Accepted

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

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

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 main():
  n = original_n = int(input().strip())
  factored = factorization(n)
  result = 0

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

  for i, count in factored:
    diff = 1
    while count > 0:
      count -= diff
      if count >= 0:
        result += 1
        diff += 1

  print(result)

main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

from functools import reduce

import math


from collections import defaultdict
from math import sqrt

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

def prime_factors(n):
    primes = defaultdict(int)
    i = 2
    mx = sqrt(n)
    while n != 1:
        if n % i == 0:
            n = n // i
            primes[i] += 1
        elif i >= mx:
            if is_prime(n):
                primes[i] += 1
            break
        else:
            i += 1
    return primes

def solve_n(x):
    return (-1 + sqrt(1 + 4 * 2* x)) / 2

def solve(N: int):
    fs = prime_factors(N)
    count = 0
    for key, value in fs.items():
        val = solve_n(value)
        count += math.floor(val)

    print(count)
    return



# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
N = int(input())
t = 0
p = N
tmp = int(math.sqrt(N)) + 1
for num in range(2,tmp):
    d = 1
    while N % num**d ==0:
        N //= num**d
        t += 1
        d += 1
    if(N % num == 0):
        while N % num == 0:
            N //= num
if (N != 1):
    t+=1
if(t==0 and p != 1):
    t = 1
print(t)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

from functools import reduce

import math


from collections import defaultdict
from math import sqrt

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

def prime_factors(n):
    primes = defaultdict(int)
    i = 2
    mx = sqrt(n)
    while n != 1:
        if n % i == 0:
            n = n // i
            primes[i] += 1
        elif i >= mx:
            if len(primes) == 0:
                primes[i] += 1
            elif is_prime(n):
                primes[i] += 1
            break
        else:
            i += 1
    return primes

def solve_n(x):
    return (-1 + sqrt(1 + 4 * 2* x)) / 2

def solve(N: int):
    fs = prime_factors(N)
    count = 0
    for key, value in fs.items():
        val = solve_n(value)
        count += math.floor(val)

    print(count)
    return



# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import decimal
import math

N = int(input())
i = 2
counter = {}
while i * i < N:
  cnt = 0
  while N % i == 0:
    cnt += 1
    N //= i
  counter[i] = cnt
  i += 1

if N != 1:
  counter.setdefault(N, 0)
  counter[N] += 1
#print (counter)

ans = 0

for i, v in counter.items():
  p = 1
  while True:
    if v - p >= 0:
      #print (i**p)
      v -= p
      ans += 1
      p += 1
    else:
      break

print (ans)

Submission status: Accepted

Solution code:
n = int(input())


def solve(n):
    res = 0
    for d in range(2, n):
        if d * d > n:
            break

        degree = 0
        while n % d == 0:
            n /= d
            degree += 1

        i = 1
        while degree >= i:
            degree -= i
            i += 1
            res += 1

    if n > 1:
        res += 1
    return res


print(solve(n))

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())
if N == 1:
    print(0)
else:
    result = 0
    for i in range(len(factorization(N))):
        tempnumber = factorization(N)[i][1]
        plusnumber = 1
        while tempnumber > 0:
            result += 1
            plusnumber += 1
            tempnumber -= plusnumber
    print(result)

Submission status: Accepted

Solution code:
n=int(input())
a=p=1
while p<1e6:
 c=t=0;p+=1
 while n%p<1:n/=p;x=c==t;t+=x;c+=1-t*x;a+=x
print(a-(n<2))

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())
fac = factorization(N)
cnt = 0

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

for i in range(len(fac)):
    e = 1
    while fac[i][1]-e >= 0:
        fac[i][1] -= e
        e += 1
        cnt += 1 
print(cnt)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

#素因数分解を行う関数O(root(N))
#int -> list
def factorize(x):
      res = []
      for i in range(2, int(x**0.5)+1):
          if x%i != 0:
              continue
          cnt = 0
          while x%i == 0:
              x //= i
              cnt += 1 
          res.append((i, cnt))
      if x != 1:
          res.append((x, 1))
      return res
 
def f(x):
    l = 0     
    r = 1000
    while r-l>1:
        c = (r+l)//2
        if x >= c*(c+1)//2:
            l = c
        else:
            r = c
    return l 
def main():
    n = int(readline())    
    fact = factorize(n)     
    ans = 0
    for i, j in fact:
        ans += f(j)
    print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def factorize(n):
    """
    素因数はたかだか n**0.5 以下
    :return: e.g. factorize(24) -> {2: 3, 3: 1} (24 = 2**3 * 3**1)
    """
    res = {}
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            res[i] = 0
            while temp % i ==0:
                res[i] += 1
                temp //= i

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

    if len(res) == 0:
        res[n] = 1

    return res

def factorize_exp(n):
    """
    Return only exponents of factorization.
    :return: e.g. factorize(24) -> [3, 1] (24 = 2**3 * 3**1)
    """
    res = []
    temp = n

    if n == 1:
        # 1 は素数ではない
        return res

    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
            res.append(cnt)
    if temp != 1:
        res.append(1)

    if len(res) == 0:
        res.append(1)

    return res


n = int(input())
factors = factorize_exp(n)
cnt = 0

for i in factors:
    rem = i
    j = 1
    while rem >= j:
        rem -= j
        cnt += 1
        j += 1

print(cnt)

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
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)

Submission status: Accepted

Solution code:
#문제를 풀때 너무 조급하기도 해서 행간을 읽지 못했다.
#TIME : 
import sys
from math import sqrt
input = sys.stdin.readline

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))

n = inp()

def factoriation(n):
    arr = []
    temp = n
    for i in range(2,int(sqrt(n))+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 = factoriation(n)
res = 0
if n==1:
    print(0)
    exit()
for i in range(len(fact)):
    for j in range(1,fact[i][1]+1):
        if n%(fact[i][0]**j) == 0:
            res+=1
            n = n/(fact[i][0]**j)
print(res)

Submission status: Accepted

Solution code:
def prime(n):
    p = dict([])
    i = 2
    while i*i <= n:
        while n % i == 0:
            n /= i
            if i in p:
                p[i] += 1
            else:
                p[i] = 1
        i += 1
    if n > 1:
        p[int(n)] = 1
    return p


n = int(input())

import math
ans = 0
for a in prime(n).values():
    ans += math.floor(math.sqrt(8*a+1) - 1)//2

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
def primeFactorize(n):
    fac = []
    if n < 2: return fac
    while n%2 == 0:
        n //= 2
        fac.append(2)
    for i in range(3,int(n**0.5)+1,2):
        while n%i == 0:
            n //= i
            fac.append(i)
    if n != 1: fac.append(n)
    return fac

n = int(input())
ans = 0
cnt = Counter(primeFactorize(n))
for v in cnt.values():
    c = 1
    while c <= v:
        ans += 1
        v -= c
        c += 1
print(ans)
# print(primeFactorize(n))
# print(cnt)

Submission status: Accepted

Solution code:

n = int(input())

import math

# input->3以上の奇数のみ
def first_div(n):
    for i in range(3, math.ceil(math.sqrt(n)) + 1, 2):
        if n % i == 0:
            return i
    return n

def next_div(start, stop):
    for i in range(start, math.ceil(math.sqrt(n)) + 1, 2):
        if n % i == 0:
            return i
    return n   

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


ans = 0
currentBase = 2
while n > 1:
    if n % currentBase == 0:
        currentDiv = currentBase
        while True:
            ans += 1
            n = n//currentDiv
            currentDiv = currentDiv * currentBase
            if n%currentDiv != 0 or n <= 1:
                while n%currentBase == 0:
                    n = n//currentBase
                break
    if currentBase == 2:
        currentBase = 3
    else:
        currentBase = next_div(currentBase+2, n)


print(ans)

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())
rlt = 0
c = collections.Counter(prime_factorize(N))

for i in c:
  k = 0
  j = 1
  while k <= c[i]:
    k += j
    j += 1
  rlt += (j-2)
  
print(rlt)

Submission status: Accepted

Solution code:
from collections import defaultdict

n = int(input())

num = 2
d = defaultdict(int)
while num * num <= n:
    while n % num == 0:
        n //= num
        d[num] += 1

    num += 1

if n != 1:
    d[n] += 1

ans = 0
for v in d.values():
    mn = 1
    while v >= mn:
        v -= mn
        ans += 1
        mn += 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 i in range(len(fact)):
    for j in range(1,fact[i][1]+1):
        if n==1:
            print(cnt)
            exit()
        if n%(fact[i][0]**j)==0:
            cnt += 1
            n = n/(fact[i][0]**j)
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
primetable = []

i = 2
while i* i <= N:
  if(N % i == 0):
    j = 0
    while N % i == 0:
      N/= i
      j+= 1
    primetable.append((i, j))
  i+= 1
if(N != 1):
  primetable.append((int(N), 1))
  
Ans = 0  
for i in primetable:
  ans = 0
  n = 1
  while 1/ 2* n* (n+ 1)<= i[1]:
    ans = n
    n+= 1
  Ans+= ans  
  
print(Ans)

Submission status: Accepted

Solution code:
N = int(input())

cnt = 0
result = 0

num = [1,3,6,10,15,21,28,36,45,55,66]

def prime_factorize(n):
    """[summary]
    素因数分解の関数、整数を入力して配列を返す
    計算量はO(√N)
    Arguments:
        n {[int]} -- 素進数分解するための整数

    Returns:
        list -- 素因数分解した後の数字の配列
    """    
    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 factorization(n):
    """[summary]
    素因数分解して、素数の種類とその素数の個数を二次元配列に入れる
    Arguments:
        n {int} -- 素因数分解する整数

    Returns:
        [arr] -- [[素数, 個数], [素数, 個数], ... ]
    """    
    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


L = factorization(N)

if N == 1:
    print(0)
else:
    for p,e in L:
        cnt = 1
        for i in range(2,100):
            cnt += i
            if e < cnt:
                result += i-1
                break
                
    print(result)

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())
l = prime_factorize(N)
m = collections.Counter([])
m[1]=1
x=1
cnt=0
y=list()
for i in range(len(l)):
    if x!=1 and x%l[i]!=0:
        x=1
    x*=l[i]
    #print(x)
    if m[x]==0:
        y.append(x)
        m[x]=1
        cnt+=1
        x=1
#print(l)
#print(m)
#print(x,y)
print(cnt)

Submission status: Accepted

Solution code:
from math import sqrt
from collections import defaultdict

n = int(input())

d = defaultdict(int)
for i in range(2, int(sqrt(n)) + 10):
    while n % i == 0:
        d[i] += 1
        n //= i

if n != 1:
    d[n] += 1

ans = 0
for v in d.values():
    mn = 1
    while v >= mn:
        v -= mn
        ans += 1
        mn += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
pf = {}
answer = 0

for i in range(2,int(N**0.5)+1):
    while N % i ==0:
        pf[i] = pf.get(i, 0) + 1
        N //= i
    
    if N < i:
        break
if N > 1:
    answer += 1
    
for j, k in pf.items():
    sq = 1
    for l in range(k):
        answer += 1
        k -= sq
        sq += 1
        if k == 0:
            break
        elif k < 0:
            answer -= 1
            break

print(answer)