Problem:


Score : 400 points

Problem Statement

Given is a positive integer N. Consider repeatedly applying the operation below on N:

First, choose a positive integer z satisfying all of the conditions below:

z can be represented as z=p^e, where p is a prime number and e is a positive integer;

z divides N;

z is different from all integers chosen in previous operations.

Then, replace N with N/z.

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

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

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

Sample Input 1

24

Sample Output 1

3

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

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

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

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

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

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

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

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

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

Sample Input 4

1000000007

Sample Output 4

1

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

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

Sample Input 5

997764507000

Sample Output 5

7



Sample input:
24


Sample output:
3

Submission status: Wrong Answer

Solution code:
def f(exponent):
	#reurns how many times a prime raised to exponent can be used
	step = 1
	cumul = 0
	count = 0
	while( cumul <= exponent):
		cumul += step
		count +=1
		step +=1
	return count - (1 if cumul > exponent else 0)

def answer(n):
	if n == 1: return 0
	res = 0
	on = n
	for d in range(2, int(on ** 0.5) + 1):
		if n % d == 0:
			e = 0
			while(n%d == 0): 
				e +=1
				n/=d
			res+= f(e)
		
	return res if n == 1 else 1

print answer(int(raw_input()))

Submission status: Wrong Answer

Solution code:
def f(exponent):
	#reurns how many times a prime raised to exponent can be used
	step = 1
	cumul = 0
	count = 0
	while( cumul <= exponent):
		cumul += step
		count +=1
		step +=1
	return count - (1 if cumul > exponent else 0)

def answer(n):
	if n == 1: return 0
	res = 0
	on = n
	d = 2
	while(d * d <= on and n > 1):
		if n % d == 0:
			e = 0
			while(n%d == 0): e +=1
			res+= f(e)
		d +=1
	return res if n == 1 else 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0

def pf(n):
    ret = []
    c = 0
    while n % 2 ==0:
        n //= 2
        c += 1
    if c > 0: ret.append(c)

    c = 0
    f = 3
    while f * f <= n:
        if n % f == 0:
            c += 1
            n //= f
        else:
            if c > 0: ret.append(c)
            c = 0
            f += 2
    if n != 1:
        ret.append(1)
    return ret

for c in pf(N):
    t = 1
    while c > 0:
        if t * 2 < c or t == c:
            c -= t
            ans += 1
        t += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 1
i = 2
while True:
  if i*i >= n:
    break
    
  if n % i == 0:
    ans+=1
    n //= i

  i += 1
print(ans)

Submission status: Wrong Answer

Solution code:
from math import ceil
n = int(input())
pf = []
t = n
if n == 1:
    print(0)
    exit()
for i in range(2, ceil(n ** 0.5) + 1):
    c = 0
    while t % i == 0:
        c += 1
        t //= i
    if c > 0: pf.append(c)
if pf == []: pf.append(1)

ans = 0
for i in pf:
    tmp = i
    j = 1
    while j <= tmp:
        tmp -= j
        ans += 1
        j += 1
print(ans)

Submission status: Wrong Answer

Solution code:
from math import floor
n = int(input())
pf = []
t = n
if n == 1:
    print(0)
    exit()
for i in range(2, floor(n ** 0.5) + 1):
    c = 0
    while t % i == 0:
        c += 1
        t //= i
    if c > 0: pf.append(c)
if pf == []: pf.append(1)

ans = 0
for i in pf:
    tmp = i
    j = 1
    while j <= tmp:
        tmp -= j
        ans += 1
        j += 1
print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math
def I(): return int(stdin.readline().rstrip())

n = I()
m = n
l = []
for i in range(2,int(math.sqrt(n))+1):
    if n==1 or n<i:
        break
    if n%i==0:
        c = 0
        while n%i==0:
            n//=i
            c += 1
        for j in range(1,c+1):
            l.append(i**j)
    i += 1
if n!=1:
    l.append(n)

l.sort()
print(l)
ans = 0
for i in l:
    if m==1 or m<i:
        break
    else:
        if not m%i:
            m/=i
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
rN = int(math.sqrt(N)) + 1
ans = 0
if N == 1:
    print(ans)
    exit()
for i in range(2,rN):
    if(N > 1):
        if(N % i == 0):
            N /= i
            ans += 1
    else:
        break
if ans == 0:
    ans = 1

print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from itertools import accumulate


def main():
    n = int(input())
    prime_counter = defaultdict(int)
    acc = tuple(accumulate(range(1, 42)))  # 10^12 < 2^39

    f = 2
    while n % f == 0:
        n //= f
        prime_counter[f] += 1
    f = 3
    while f * f <= n:
        if n % f == 0:
            n //= f
            prime_counter[f] += 1
        else:
            f += 2
    if n != 1:
        prime_counter[f] += 1

    ans = 0
    for c in prime_counter.values():
        for i, x in enumerate(acc):
            if c < x:
                tmp = i
                break
        ans += tmp
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from itertools import accumulate


def main():
    n = int(input())
    prime_counter = defaultdict(int)
    acc = tuple(accumulate(range(1, 42)))  # 10^12 < 2^39

    f = 2
    while f * f <= n:
        if n % f == 0:
            n //= f
            prime_counter[f] += 1
        else:
            f += 1
    if n != 1:
        prime_counter[f] += 1

    ans = 0
    for c in prime_counter.values():
        for i, x in enumerate(acc):
            if c < x:
                tmp = i
                break
        ans += tmp
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from itertools import accumulate


def main():
    n = int(input())
    prime_counter = [0] * int(n ** 0.5 + 2)
    acc = tuple(accumulate(range(1, 42)))  # 10^12 < 2^39

    f = 2
    while f * f <= n:
        if n % f == 0:
            n //= f
            prime_counter[f] += 1
        else:
            f += 1
    if n != 1:
        prime_counter[f] += 1

    ans = 0
    for c in prime_counter:
        for i, x in enumerate(acc):
            if c < x:
                tmp = i
                break
        ans += tmp
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math
def I(): return int(stdin.readline().rstrip())

n = I()
m = n
l = []
for i in range(2,int(math.sqrt(n))+1):
    if n==1 or n<i:
        break
    if n%i==0:
        c = 0
        while n%i==0:
            n/=i
            c += 1
        for j in range(1,c+1):
            l.append(i**j)
    i += 1

l.sort()
ans = 0
for i in l:
    if m==1:
        break
    else:
        if not m%i:
            m/=i
            ans += 1

if ans == 0 and 2<=n:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0

def pf(n):
    ret = []
    c = 0
    while n % 2 ==0:
        n //= 2
        c += 1
    ret.append(c)
    c = 0
    f = 3
    while f * f <= n:
        if n % f == 0:
            c += 1
            n //= f
        else:
            ret.append(c)
            c = 0
            f += 2
    if n != 1:
        ret.append(1)
    return ret

for c in pf(N):
    t = 1
    while c > 0:
        if t * 2 < c or t == c:
            c -= t
            ans += 1
        t += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())


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

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

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

    # return arr
    cnt = 0
    for l in arr:
        i = l[1]
        if i != 1:
            div = 0
            while 1:
                div += 1
                i -= div
                if i >= 0:
                    cnt += 1
                else:
                    break

    return cnt


print(factorization(N))

Submission status: Wrong Answer

Solution code:
N = int(input())


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(n)):
        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
    cnt = 0
    for l in arr:
        i = l[1]
        if i != 1:
            div = 0
            while 1:
                div += 1
                i -= div
                if i >= 0:
                    cnt += 1
                else:
                    break

    return cnt


print(factorization(N))

Submission status: Wrong Answer

Solution code:
import itertools
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
x=prime_factorize(N)
l=list(set(prime_factorize(N)))
s=[]
for i in range(len(l)):
    s.append([])
for i in l:
    a=l.index(i)
    b=i
    for j in range(x.count(i)):
        s[a].append(i)
        i*=b
t=list(itertools.chain.from_iterable(s))
ans=0
while len(t)>0:
    p=t.pop(t.index(min(t)))
    sp=s[l.index(p)]
    sp.pop(0)
    if len(sp)>0:
        l[l.index(p)]=sp[0]
        ssp=sp[-1]
        if ssp in sp:
            sp.pop(sp.index(ssp))
        if ssp in t:
            t.pop(t.index(ssp))
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0

def pf(n):
    ret = []
    c = 0
    while n % 2 ==0:
        n //= 2
        c += 1
    ret.append((2, c))
    c = 0
    f = 3
    while f * f <= n:
        if n % f == 0:
            c += 1
            n //= f
        else:
            ret.append((f, c))
            c = 0
            f += 2
    if n != 1:
        ret.append((n, 1))
    return ret

for p in pf(N):
    i, c = p
    t = 1
    while c >= t:
        c -= t
        t += 1
        ans += 1
print(ans)

Submission status: Wrong Answer

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

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

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

    return arr
    
a=factorization(int(input()))

b=[1,3,6,10,15,21,28,36,43]

ans=0
print(a)
if len(a)==1 and a[0][0]==1:
    print(0)
    exit()

for i in a:
    for j in range(len(b)):
        if i[1]<b[j]:
            ans+=j
            break
print(ans)

Submission status: Wrong Answer

Solution code:
from functools import reduce
from math import gcd
from random import randint


def brent(N):
    if N % 2 == 0:
        return 2
    y, c, m = randint(1, N-1), randint(1, N-1), randint(1, N-1)
    g, r, q = 1, 1, 1
    while g == 1:
        x = y
        for i in range(r):
            y = ((y*y) % N+c) % N
        k = 0
        while (k < r and g == 1):
            ys = y
            for i in range(min(m, r-k)):
                y = ((y*y) % N+c) % N
                q = q*(abs(x-y)) % N
            g = gcd(q, N)
            k = k + m
        r = r*2
    if g == N:
        while True:
            ys = ((ys*ys) % N+c) % N
            g = gcd(abs(x-ys), N)
            if g > 1:
                break
    return g


def factorize(n1):
    if n1 == 0:
        return []
    if n1 == 1:
        return [1]
    n = n1
    b = []
    p = 0
    mx = 1000000
    while n % 2 == 0:
        b.append(2)
        n //= 2
    while n % 3 == 0:
        b.append(3)
        n //= 3
    i = 5
    inc = 2
    while i <= mx:
        while n % i == 0:
            b.append(i)
            n //= i
        i += inc
        inc = 6-inc
    while n > mx:
        p1 = n
        while p1 != p:
            p = p1
            p1 = brent(p)
        b.append(p1)
        n //= p1
    if n != 1:
        b.append(n)
    return sorted(b)


n = int(input())
if n == 1:
    print(0)
    quit()
li = factorize(n)


def sums(factors):
    dicc = {}
    for factor in set(factors):
        n = factors.count(factor)
        dicc[factor] = [1]
        n -= 1
        while n > dicc[factor][-1]:
            dicc[factor].append(dicc[factor][-1] + 1)
            n -= dicc[factor][-1]
    return dicc


print(li)
print(sums(li))
count = 0
for i in sums(li).values():
    count += len(i)
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
primes = dict()
p = 2

while p * p < n:
  if n % p == 0:
    primes[p] = 0
    while n % p == 0:
      n //= p
      primes[p] += 1
  p += 1
if p * p == n:
  primes[p] = 2
elif n >= p:
  primes[n] = 1

count = 0
for e in primes.values():
  c = 1
  while e >= c:
    e -= c
    c += 1
  count += c
  
print(count)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
 
nums = [i for i in range(2, 1000)]
nums.append(n)
 
ans = 0
x = 0
 
if n != 1:
    while True:
        for i in nums:
            ix = len(nums)
            if 0 == n % i:
                ans += 1
                nums.remove(i)
                n = n // i
                break
        if ix == len(nums):
            break

 
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
import math

def soi(num_ref):
    arr = []
    num = num_ref
    for i in range(2, int(math.sqrt(num))+1):
        if num%i == 0:
            cnt = 0
            while num%i == 0:
                cnt += 1
                num //= i
            arr.append([i, cnt])
    if arr == []:
        arr.append([num_ref, 1])
    return arr

N = int(input())
if N == 1:
    print(0)
    exit()
arr = soi(N)
cnt = 0
for i in arr:
    minus = 1
    tmp = i[1]
    while(tmp - minus >= 0):
        tmp -= minus
        minus += 1
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
import math

def soi(num_ref):
    arr = []
    num = num_ref
    for i in range(2, int(math.sqrt(num))+1):
        if num%i == 0:
            cnt = 0
            while num%i == 0:
                cnt += 1
                num /= i
            arr.append([i, cnt])
    if arr == []:
        arr.append([num_ref, 1])
    return arr

N = int(input())
if N == 1:
    print(0)
    exit()
arr = soi(N)
cnt = 0
for i in arr:
    minus = 1
    tmp = i[1]
    while(tmp - minus >= 0):
        tmp -= minus
        minus += 1
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt=0
factor=[]
for i in range(2, int(n**.5)+1):
    j=1
    while n%i==0:
        n//=i
        factor.append(i)
if n>1:
    cnt+=1

# 1->1, 3->2, 6->3, 10->4 ...を返す
def f(x):
    i=1
    print(x)
    cnt=0
    while x>=i:
       x-=i
       i+=1
       cnt+=1
    return cnt

from itertools import groupby
for k,v in groupby(factor):
    cnt+=f(len(list(v)))
print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt=0
factor=[]
for i in range(2, int(n**.5)+1):
    j=1
    while n%i==0:
        n//=i
        factor.append(i)
if n>1:
    cnt+=1
from itertools import groupby
for k,v in groupby(factor):
    cnt+=int((len(list(v))+1)**.5)
print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt=0
factor=[]
for i in range(2, int(n**.5)+1):
    j=1
    while n%i==0:
        n//=i
        factor.append(i)

from itertools import groupby
for k,v in groupby(factor):
    cnt+=int((len(list(v))+1)**.5)
print(cnt)

Submission status: Wrong Answer

Solution code:
from typing import Any, Union


def find_factors(number):
    """
    Print prime factors.
    :param number: <int> number
    :return: <None>
    """
    global count
    count = count + 1
    is_prime = True
    for i in range(2, int(number ** 0.5 + 2),):

        if number %(i)== 0:

            is_prime = False

            find_factors(int(number / (i*i)))

            break


    if (is_prime and number!=1):

        return


    if (number==1 or number==0) :
        count=count-1
    return





try:
    number = int(input())
    count = 0
    if number <= 0:
        raise Exception
    find_factors(number)
    print(count)
except Exception as e:
    exit()

Submission status: Wrong Answer

Solution code:
from typing import Any, Union


def find_factors(number):
    """
    Print prime factors.
    :param number: <int> number
    :return: <None>
    """
    global count
    count = count + 1
    is_prime = True
    for i in range(2, int(number ** 0.5 + 2),):

        if number %(i)== 0:

            is_prime = False
            
            find_factors(int(number / (i*i)))

            break


    if (is_prime and number!=1):

        print(str(number), end=" ")


    if (number==1 or number==0) :
        count=count-1
    return





try:
    number = int(input())
    count = 0
    if number <= 0:
        raise Exception
    find_factors(number)
    print(count)
except Exception as e:
    exit()

Submission status: Wrong Answer

Solution code:
from typing import Any, Union


def find_factors(number):
    """
    Print prime factors.
    :param number: <int> number
    :return: <None>
    """
    global count
    count = count + 1
    is_prime = True
    for i in range(2, int(number ** 0.5 + 2),):

        if number %(i)== 0:

            is_prime = False
            print(str(i), end=" ")
            find_factors(int(number / (i*i)))

            break


    if (is_prime and number!=1):

        print(str(number), end=" ")


    if (number==1 or number==0) :
        count=count-1
    return





try:
    number = int(input())
    count = 0
    if number <= 0:
        raise Exception
    find_factors(number)
    print("count",count)
except Exception as e:
    exit()

Submission status: Wrong Answer

Solution code:
n = int(input())
org=n
cnt=0
for i in range(2, int(n**.5)+1):
    j=1
    while n%(i**j)==0:
        n//=(i**j)
        cnt+=1
        j+=1
#        print(f'n={n} i={i} j={j} i**j={i**j}')
cnt+=int(n==org)
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
n = I()
n_z = n # n/z
prime_e = [] # 素数**自然数のリスト
p = 2 # 最初の素数
e = 1
 
def fermat_test(q):
    if q == 2: return True
    elif q < 2 or q & 1 == 0: return False   # q & 1 == 0 偶数の場合のFalseを返す意。 
 
 
if n == 1:
    print(0)
    sys.exit()
 
 
while p * p <= n: # 素数pの2乗がnより大きいと1回も割れない。
    if n_z % p == 0:
        z = p ** e
        while n_z % z == 0:
            if z not in prime_e:
                n_z = int(n_z / z)
                prime_e.append(z)
            e += 1
            z = p ** e
    p += 1
    e = 1
    while fermat_test(p) == False:
        p += 1
print(len(prime_e))

Submission status: Wrong Answer

Solution code:
import collections
n=int(input())
ans=0
d=1
m=0
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))
for i in range(len(list(c.values()))):
    while d*(d+1)/2<list(c.values())[i]+1:
        if m<=d:
            m=d
            d+=1
            print(m)
    if d*(d+1)/2>=list(c.values())[i]+1:
        ans+=m
        d=1
        m=0
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
n = I()
n_z = n # n/z
prime_e = [] # 素数**自然数のリスト
p = 2 # 最初の素数
e = 1

while p * p <= n: # 素数pの2乗がnより大きいと1回も割れない。
    if n_z % p == 0:
        z = p ** e
        while n_z % z == 0:
            n_z = int(n_z / z)
            prime_e.append(z)
            e += 1
            z = p ** e           
    p += 1
    e = 1

print(len(prime_e))#, prime_e)

Submission status: Wrong Answer

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 func(a,b):
    cnt = 0
    while(a%b == 0):
        a = a/b
        b = b * b
        cnt = cnt+1
    return cnt

input = input()
c = collections.Counter(prime_factorize(int(input)))
L = list(c.values())
K = list(c.keys())
ans = 0
for i in range(len(L)):
    ans = ans + func(int(input),int(K[i]))

print(ans)

Submission status: Wrong Answer

Solution code:
import math
import decimal


def main():

    N = int(input())
    ans = 0
    A = int(math.ceil(N**0.5)+1)
    explist = []
    flag = False
    if N >= 3:
        for L in range(2, A):
            if N < L:
                break
            d = L
            cnt = 0
            while(True):
                if N % d == 0:
                    N /= d
                    cnt += 1
                    flag = True
                else:
                    break
            explist.append([d, cnt])
        for i in explist:
            c = i[1]
            for j in range(1, A):
                if c >= j:
                    ans += 1
                    c -= j
                else:
                    break
        if flag:
            print(ans)
            return
        else:
            print(1)
            return
    elif N == 2:
        print(1)
        return
    else:
        print(0)
        return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np
import math

def fuctrization(n):
    arr = []
    tmp = n
    for i in range(2,math.ceil(n**(1/2))+1):
        if tmp%i==0:
            j = 0
            while tmp%i==0:
                j += 1
                tmp //= i
            arr.append([i,j])
    if tmp != 1:
        arr.append([tmp,1])
    if arr:
        pass
    else:
        arr.append([n,1])
            
    return arr
            
        
        
n = int(input())
if n == 1:
    print(0)
else:
    arr = fuctrization(n)
    nn = 0
    for i in range(len(arr)):
        k = arr[i][1]
        nnn = 1
        while k-nnn>0:
            k -= nnn
            nnn += 1
            if k-nnn == 0:
                pass
            elif nnn != 1:
                nnn -= 1
        nn += nnn
    print(nn)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
n = I()
n_z = n # n/z
prime_e = [] # 素数**自然数のリスト
p = 2 # 最初の素数
e = 1

def fermat_test(q):
    q = abs(q)
    if q == 2: return True
    elif q < 2 or q & 1 == 0:    # q & 1 == 0 偶数の場合の意。 
    # x(int) & y(int)と表記すると2進数表記にしたときに、各桁のどこかが一致する場合は1、どこも一致しない場合は0を返す。
    # 例えば10→2進数:1010と1→2進数:1を比較するとドコモ一致しないので、0が帰ってくる。
    # 2進数表記の偶数は一番下の桁が0のため、2進数表記の1は一致しないため、0が返ってくる。
        return False

while p * p <= n: # 素数pの2乗がnより大きいと1回も割れない。
    if n_z % p == 0:
        z = p ** e
        while n_z % z == 0:
            n_z = int(n_z / z)
            prime_e.append(z)
            e += 1
            z = p ** e           
    p += 1
    e = 1
    while fermat_test(p) == False:
        p += 1
print(len(prime_e))#, prime_e)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
num = 0
sqrt_n = math.sqrt(n)
for i in range(2, int(sqrt_n)):
    p = 1
    p2 = 1
    while not n % i:
        n /= i
        p += 1
        if p > sum(range(1, p2+1)):
            num += 1
            p2 += 1
if n > sqrt_n:
    num = 1
print(num)

Submission status: Wrong Answer

Solution code:
import math
import decimal


def main():

    N = int(input())
    ans = 0
    A = int(math.ceil(N**0.5)+1)
    explist = []
    flag = False
    if N >= 3:
        for L in range(2, A):
            if N < L:
                break
            d = L
            cnt = 0
            while(True):
                if N % d == 0:
                    N /= d
                    cnt += 1
                    flag = True
                else:
                    break
            explist.append([d, cnt])
        for i in explist:
            c = i[1]
            for j in range(1, A):
                if c >= j:
                    ans += 1
                    c -= j
                else:
                    break
        if flag:
            print(ans)
            return
        else:
            print(1)
    elif N == 2:
        print(1)
        return
    else:
        print(0)
        return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
num = 0
sqrt_n = math.sqrt(n)
for i in range(2, int(sqrt_n)):
    p = 1
    while not n % i**p:
        n /= i**p
        p += 1
        num += 1
if n > sqrt_n:
    num = 1
print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [0 for i in range(int(N**0.5)+1)]
c = 0
i = 2
m = 0
while i < N**0.5:
    if N % i == 0:
        a[i] += 1
        N = N / i
        m = i
        i -= 1
    i += 1
    if N == 1:
        break 
for j in range(2, m+1):
    if a[j] != 0:
        d = 0
        while a[j] > d:
            a[j] -= d+1
            d += 1
        c += d
if N <= 1:
    print(0)
else:
    print(c+1)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
num = 0
sqrt_n = int(math.sqrt(n))
for i in range(2, sqrt_n):
    p = 1
    while not n % i**p:
        n /= i**p
        p += 1
        num += 1
if n > sqrt_n:
    num = 1
print(num)

Submission status: Wrong Answer

Solution code:
import math
import decimal


def main():

    N = int(input())
    ans = 0
    A = int(math.ceil(N**0.5)+1)
    explist = []
    if N >= 3:
        for L in range(2, A):
            if N < L:
                break
            d = L
            cnt = 0
            while(True):
                if N % d == 0:
                    N /= d
                    cnt += 1
                else:
                    break
            explist.append([d, cnt])
        for i in explist:
            c = i[1]
            for j in range(1, A):
                if c >= j:
                    ans += 1
                    c -= j
                else:
                    break
        print(ans)
        return
    elif N == 2:
        print(1)
        return
    else:
        print(0)
        return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [0 for i in range(int(N**0.5)+1)]
c = 0
i = 2
m = 0
while i < N**0.5:
    if N % i == 0:
        a[i] += 1
        N = N / i
        m = i
        i -= 1
    i += 1
    if N == 1:
        break 
for j in range(2, m+1):
    if a[j] != 0:
        d = 0
        while a[j] >d:
            a[j] -= d+1
            d += 1
        c += d
if N <= 1:
    print(0)
else:
    print(c+1, end='')

Submission status: Wrong Answer

Solution code:
import numpy as np
import math

def fuctrization(n):
    arr = []
    tmp = n
    for i in range(2,math.ceil(n**(1/2))+1):
        if tmp%i==0:
            j = 0
            while tmp%i==0:
                j += 1
                tmp /= i
            arr.append([i,j])
    if arr:
        pass
    else:
        arr.append([n,1])
            
    return arr
            
        
        
n = int(input())
arr = fuctrization(n)
nn = 0
for i in range(len(arr)):
    k = arr[i][1]
    nnn = 1
    while k-nnn>0:
        k -= nnn
        nnn += 1
    if k-nnn == 0:
        pass
    elif nnn != 1:
        nnn -= 1
    nn += nnn
if n==1:
    nn = 0    
print(nn)

Submission status: Wrong Answer

Solution code:
import sys
from copy import deepcopy
from collections import deque
from math import floor
from math import ceil

def main():
    n = int(input())
    on = n
    def is_prime(n):
        for i in range(2, n + 1):
            if i * i > n:
                break
            if n % i == 0:
                return False
        return n != 1
    if is_prime(n):
        print(1)
        sys.exit()

    nn = ceil(n**0.5)
    nn = max(6, nn)
    p = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(nn + 1)]
    p[0] = p[1] = False
    p[2] = p[3] = p[5] = True
    for i1 in range(3, floor(nn ** 0.5) + 1, 2):
        if p[i1]:
            for i2 in range(i1 ** 2, nn + 1, i1):
                p[i2] = False
        else:
            continue
    pl = [i for i, b in enumerate(p) if b == True]

    nums = deepcopy(pl)
    for pe in pl:
        cnt = 2
        while True:
            tnum = pow(pe, cnt)
            if tnum > n:
                break
            elif tnum != 0:
                if n % tnum == 0:
                    nums.append(tnum)
            cnt += 1

    nums.sort()
    numsd = deque(nums)
    ok = set()
    r = 0
    while True:
        if not numsd:
            break
        if n == 1:
            break
        nextn = numsd.popleft()
        if nextn > on or nextn > n:
            break
        elif n % nextn == 0:
            if nextn in ok:
                continue
            else:
                n = int(n // nextn)
                ok.add(nextn)
                r += 1
                if n == 1:
                    break
    print(r)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import collections
n=int(input())
ans=0
d=1
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))
for i in range(len(list(c.values()))):
    while d*(d+1)/2<list(c.values())[i]-1:
        d+=1
    if d*(d+1)/2>=list(c.values())[i]-1:
        ans+=d
        d=1
print(ans)