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
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
l = prime_factorize(n)
c = Counter(l)
l3 = []
for i in c.most_common():
    l3.append(i[1])
l2 = [i * (i + 1) // 2 for i in range(1, 10)]
ans = 0
for i in l3:
    for j in range(len(l2)):
        if l2[j] > i:
            ans += j
            break
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())
a=factorization(n)
ans=0
if a[0][0]==1:
  print(0)
else:
  for i in a:
    now=(2*i[1])**0.5
    now=int(now//1)
    while now*(now+1)<=2*i[1]:
      now+=1
    ans+=now-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])

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

    return arr

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

facts = factorization(n)
cnt = 0
for fact in facts:
    for i in range(1, 100000):
        if (fact[1] - i) < 0:
            break
        fact[1] -= i
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n=int(input())

def factorization(n):
    global a
    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

soinsu = factorization(n)
a = len(soinsu)
#print(soinsu)
#print(a)
ans = 0

for i in range(a):
    x = soinsu[i][1]
    for j in range(1,10**18):
        if x >= j:
            x = x-j
            ans += 1
        else:
            break

if n== 1:
    ans = 0


print (ans)

Submission status: Accepted

Solution code:
def prime_factors(n):
    i = 2
    factors = {}
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            if i not in factors:
                factors[i] = 0
            factors[i] += 1
    if n > 1:
        if n not in factors:
            factors[n] = 0
        factors[n] += 1
    return factors


def count(factor_count):
    result = 0
    for i in range(1, 10000000000):
        if factor_count < i :
            break
        result += 1
        factor_count -= i
    return result


def solve(n):
    ans = 0
    pfactors = prime_factors(n)
    for factor in pfactors:
        ans += count(pfactors[factor])
    return ans


n = int(input())
print(solve(n))

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())

def factorization(n):
    if n == 1:
        return []

    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)

comp = []

for i in range(40):
    comp.append((i + 1) * (i + 2) / 2)

cn = np.array(comp)

Sum = 0

for arr in Arr:
    Sum += np.count_nonzero(arr[1] >= cn)
    
print(Sum)

Submission status: Accepted

Solution code:
n = int(input())
#a,b = input().split()
#a = list(int(i) for i in input().split())

"""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

s = factorization(n)
lis_num = len(s)
ans = 0
cout = 1

if n == 1:
	print(ans)
else:
	for i in range(lis_num):
		while s[i][1]-cout >=0:
			s[i][1]-=cout
			cout+=1
			ans+=1
		cout = 1
	print(ans)

Submission status: Accepted

Solution code:
import math
l=[]
def primeFactors(n): 
    while n % 2 == 0: 
        l.append(2)
        n = n / 2         
    for i in range(3,int(math.sqrt(n))+1,2): 
        while n % i== 0: 
            l.append(i)
            n = n / i 
             
    if n > 2: 
        l.append(n)

no=int(input())
d={}
primeFactors(no)
def count(n) : 
    return (-1 + math.sqrt(1 + 8 * n)) // 2; 

for i in range(len(l)):
	if l[i] in d:
		d[l[i]]+=1
	else:
		d[l[i]]=1
c=0
#print(d)
for u,v in d.items():
	c+=count(v)

print(int(c))

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())
a = factorization(n)
if a[0][0] == 1:
    print(0)
else:
    b = []
    c = [0,1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190]
    for i in range(len(a)):
        b.append(a[i][1])
    ans = 0
    for i in range(len(b)):
        for j in range(len(c)):
            if b[i] == c[j]:
                ans +=j
                break
            elif b[i] < c[j]:
                ans += j-1
                break
                
    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())
c = collections.Counter(prime_factorize(n))
#print(c)
# Counter({2: 3, 3: 1, 5: 1, 7: 1})
ans = 0
for x in c.values():
    for i in range(1,100):
        
        if(x-i >= 0):
            ans += 1
            x -= i
print(ans)

Submission status: Accepted

Solution code:
import collections
# Nの入力
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

c = collections.Counter(prime_factorize(N))
result = 0
for i in list(c.values()):
    j = 1
    if i == 1:
        result += 1
    else:
        while i >= j:
            i = i - j
            result += 1
            j += 1
print(result)

Submission status: Accepted

Solution code:
import math
import sys
import collections

n = int(input())

if n == 1:
    print(0)
    sys.exit()
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)
c = collections.Counter(a)
list = c.values()
ANS = 0
for l in list:
    i = 1
    cnt = 1
    while l >= cnt:
        ANS += 1
        i += 1
        cnt += i
print(ANS)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

sys.setrecursionlimit(10**7)

ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

n = ni()

def prime_factorization(n):
    i = 2
    res = []
    while i * i <= n:
        if n % i != 0:
            i += 1
            continue
        ex = 0
        while n % i == 0:
            ex += 1
            n //= i
        res.append((i, ex))
    if n != 1:
        res.append((n, 1))
    return res

ans = 0
fac = prime_factorization(n)
for a, ex in fac:
    i = 1
    while ex - i >= 0:
        ans += 1
        ex -= i
        i += 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(cnt)

    if temp!=1:
        arr.append(1)

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

    return arr
ans=0
n=int(input())
L=factorization(n)
if n>1:
    for l in L:
        tmp=l
        for i in range(1,l+1):
            tmp-=i
            if tmp>=0:
                ans+=1
            if tmp<=0:
                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
  
n = int(input())
A = prime_factorize(n)
C = Counter(A)

S = []
s = 0
for i in range(1,50):
  s += i  
  S.append(s)
  
def count(n):
  for i in range(50-1):
    if n < S[i]:
      return i    

ans = 0
for k,v in C.items():
  ans += count(v)
  
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
dict = {}
N = int(input())
def search(n):
    if n == 1:
        return
    else:
        s = int(np.sqrt(n)//1)
        for i in range(2, s+1):
            if n % i == 0:
                global dict
                dict[i] = dict.get(i, 0) + 1
                search(int(n/i))
                break
        else:
            dict[n] = dict.get(n, 0) + 1
search(N)
ans = 0
for i in dict.keys():
    n = dict[i]
    j = 1
    while n > 0:
        n -= j
        j += 1
        if n >= 0:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:

aaa = [0,1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,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())
l = factorization(N) 

ans = 0

for arr in l:
  if arr[0] != 1:
    a = arr[1]
    b = aaa[a]
    ans += b
  
print(ans)

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

dic = {}
for v in factorization(N):
    dic[v[0]] = v[1]
#print(dic)


lst = []
for i in dic:
    for j in range(1, dic[i]+1):
        lst.append(i**j)
lst.sort()


cnt = 0
for i in lst:
    if  N % i == 0 and N // i > 0:
        N = N / i
        cnt += 1
print(cnt)

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
ans = 0
N = int(input())
f = factorization(N)
for pair in f:
  p = pair[0]
  e = pair[1]
  i = 1
  while(e-i>=0):
    e = e - i
    i = i  + 1
    ans = ans + 1
if N == 1:
  ans = 0
print(ans)

Submission status: Accepted

Solution code:
import sys
import collections

def main():

    input = sys.stdin.readline

    N = int(input())

    c = collections.Counter(prime_factorize(N))

    ans = 0

    for value in c.values():
        j = 1
        for i in range(2,1000000):
            j += i

            if value < j:
                ans += (i - 1)
                break


    print(ans)

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
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
  
l = prime_factorize(N)
ans = 0
for k,v in Counter(l).items():
  i = 1
  while v>=i:
    v-=i
    ans += 1
    i += 1
    
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

a = []
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
        a.append([i, cnt])

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

ans = 0
for i in range(len(a)):
    e = 1
    while 1:
        if N % a[i][0]**e == 0:
            N /= a[i][0]**e
            a[i][1] -= e
            e+=1
            ans += 1
        else:
            break
        if a[i][1] < e:
            break

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
from itertools import accumulate
B=[i for i in range(101)]
B=list(accumulate(B))

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

d=Counter(prime_factorize(N))
k=d.keys()
ans=0
for i in k:
  a=1
  while d[i]>=B[a]:
    ans+=1
    a+=1
print(ans)

Submission status: Accepted

Solution code:
from bisect import bisect_left

def prime_factorize(n):
    res = []
    for i in range(2, int(n**(1/2))+1):
        if n % i != 0: continue
        num = 0
        while n % i == 0:
            num += 1
            n /= i
        res.append((i, num))
    if n != 1:
        res.append((n, 1))
    
    return res

n = int(input())

prime = prime_factorize(n)

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

ans = 0
for k, v in prime:
    i = bisect_left(c, v)
    if c[i] == v: i += 1
    ans += i

print(ans)

Submission status: Accepted

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

import time

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq


n = readInt()

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 ahaha(x):
	n = (-1+int((1+8*x)**0.5))//2
	return n

f = factorization(n)

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

ans=0

for i in f:
	ans+=ahaha(i[1])

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import Counter

prime_factor = []
N = int(input())
for i in range(2,int(N**0.5)+1):
    while N % i == 0:
        prime_factor.append(i)
        N /= i
if N > 1:
    prime_factor.append(N)

c = Counter(prime_factor)

cnt = 0
for k, v in c.items():
    diff = 1
    while v > 0:
        v -= diff
        if v >= 0:
            cnt += 1
        diff += 1

print(cnt)

Submission status: Accepted

Solution code:
# ABC169 D Div Game

n = int(input())

def factorization(n):
    arr = []
    if n == 1:
        return 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_list = factorization(n)
ans = 0

for i in range(len(f_list)):
    _tmp = f_list[i][1]
    j = 1
    while _tmp >= 0:
        _tmp -= j
        j += 1
    ans += j-2

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 collections
n=int(input())
p=collections.Counter(prime_factorize(n))
p=p.values()

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

print(ans)

Submission status: Accepted

Solution code:
import sys
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
            count = 0
            while temp%i==0:
                cnt+=1
                temp //= i
                if cnt == count+1:
                    count += 1
                    cnt = 0
            arr.append([i, count])

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

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

    return arr

arr = factorization(N)
if N == 1:
    print(0)
    sys.exit()
else:
    print(sum([arr[i][1] for i in range(len(arr))]))

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

if n == 1:
    print(0)
    quit()
f = factorization(n)
ans = 0
c = len(f)
for i in range(c):
    s = 0
    g = f[i][1]
    if g == 2:
        ans += 1
    else:
        for j in range(g):
            s += j + 1
            f[i][1] -= j+1
            if s > g:
                break
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
r = 0
i = 2
while i * i <= n:
  j = k = 1
  while n % i == 0:
    n //= i
    j -= 1
    if j == 0:
      r += 1
      j = k = k + 1   
  i += 1
print(r + (n > 1))

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

def main():
    import numpy as np
    import sys
    n = int(input())
    arr = factorization(n)
    ans = 0
    for fact,num in arr:
        if fact == 1:
            print(0)
            exit(0)
        ans += int((np.sqrt(1+8*num) - 1)/2)  
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
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
c = collections.Counter(prime_factorize(n))
v = list(c.values())
ans = 0
for i in v:
    j = 1
    p = 0
    count = 0
    while True:
        p += j
        j += 1
        if i<p:
            break
        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())
a=factorization(n)
ans=0
for i in range(len(a)):
  tmp=0
  for j in range(1,50):
    tmp+=j
    if a[i][1] >= tmp:
      ans += 1
if n==1:
  print(0)
else:
  print(ans)

Submission status: Accepted

Solution code:
N = int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 2
    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 prime_factor(n):
    res = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            res.append(i)
            n = n//i
    if n != 1:
        res.append(n)
    return res

ans = 0
divisors = make_divisors(N)

if len(divisors) == 0 and N != 1:
    print(1)
    exit()

for i in divisors:
    primes = set(prime_factor(i))
    if len(primes) == 1 and N % i == 0:
        ans += 1
        N /= i
        N = int(N)

print(ans)

Submission status: Accepted

Solution code:
m = int(input())

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

l = []

for i in range(1, 40):
    p = i * (i+1) / 2
    l.append(p)

def check(n):
    num = 0
    i = 0
    while n >= l[i]:
        num += 1
        i += 1
    return num


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

primers = factorization(m)

ans = 0

for i in primers:
    ans += check(i[1])

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
if n == 1:
  print(0)
else:
  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)):
    cnt = arr[i][1]
    j = 1
    while cnt >= 0:
      cnt -= j
      j += 1
    ans += (j - 2)
  print(ans)

Submission status: Accepted

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


soinsuu = factorization(n)

ans = 0
kouho = []
for aa in soinsuu:
    for i in range(aa[1]):
        kouho.append(aa[0]**(i+1))

dame = [1]
while True:
    flag = False
    kouho.sort()
    for i in range(len(kouho)):
        if kouho[i] in dame:
            continue
        else:
            flag = True
            waruyatu = copy.deepcopy(kouho[i])
            dame.append(waruyatu)
            for j in range(len(kouho)):
                if kouho[j]%waruyatu == 0:
                    kouho[j] = kouho[j]//waruyatu
            ans += 1
            break
    if not flag:
        break

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

bunkai=factorize(N)
blist=list(set(bunkai))

ans=0
for i in blist:
    tmp=bunkai.count(i)
    for p in range(1,50):
        if tmp>=p:
            ans+=1
            tmp-=p
        else:
            break
print(ans)

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

arr = factorization(N)

count = 0
for i in arr:
    for j in range(1,10**5):
        if j*(j+1)/2 <= i[1] < (j+1)*(j+2)/2:
            count += j
            break

print(count)

Submission status: Accepted

Solution code:
def factorization(n):
    """
    nを素因数分解
    2以上の整数n => [[素因数, 指数], ...]の2次元リスト
    """
    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_li = factorization(N)
ans = 0
for t in fact_li:
    if t[0] == 1:
        continue
    tmp = t[1]
    for i in range(1, tmp + 1):
        if tmp >= i:
            ans += 1
            tmp -= i
        else:
            break

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

ans = 0
c = factorization(N)  
#print(c)
for i in range(len(c)):
  A = c[i][1]
  if(c[i][0] == 1):
    n = 0
  else:
    n = int((-1+math.sqrt(1+8*A))/2 + 0.01) 
  ans += n
  
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def prime_factorize(n):
    res = []
    for i in range(2, int(n**0.5)+1):
        if n % i != 0:continue
        ex = 0
        while n % i == 0:
            ex += 1
            n = n//i
        res.append((i, ex))
    if n != 1:res.append((n, 1))
    return res
def main():
    N = int(input())
    p = prime_factorize(N)
    ans = 0
    for v, ex in p:
        current = 1
        while ex > 0:
            ex -= current
            if ex >= 0:
                ans += 1
                current += 1
            else:
                break
    print(ans)
if __name__ == "__main__":
    main()