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:
N=int(input())
if N==1:
    print(0)
else:
    nowN=N
    cnt=[]
    I=[]
    #print(NN)
    cn=0
    if nowN%2==0:
        while nowN%2==0:
            nowN/=2
            cn+=1
        cnt.append([2,cn])
        #print(nowN)
    n=3
    end=N/2
    while n < end:
        cn=0
        if nowN%n==0:
            while nowN%n==0:
                nowN/=n
                cn+=1
            cnt.append([n,cn])
            end=int(N/n)
        n+=2
        if nowN==1:
            break
    if nowN==N:
        print(1)
    else:    
        for cn in cnt:
            han=True
            nowcnt=cn[1]
            i=1
            while han:
                nowcnt-=i
                if nowcnt<=i:
                    I.append(i)
                    han=False
                else:
                    i+=1
        ans=0
        for i in I:
            ans+=i
        #print(cnt)
        print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter
def main():
    n = int(input())

    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

    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 prime_dec(n):
        i = 2
        table = []
        while i * i <= n:
            while n % i == 0:
                n /= i
                table.append(int(i))
            i += 1
        if n > 1:
            table.append(n)
        return table


    if is_prime(n):
        print(1)

    pd = prime_dec(n)
    pdc = Counter(pd)
    pdcl = [pdc[i] for i in pdc]
    r = 0
    for pse in pdcl:
        num = pse
        cnt = 1
        while num > 0:
            if cnt > num:
                break
            else:
                r += 1
                num -= cnt
                cnt += 1
    print(r)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())
if N==1:
    print(0)
else:
    nowN=N
    cnt=[]
    I=[]
    #print(NN)
    cn=0
    if nowN%2==0:
        while nowN%2==0:
            nowN/=2
            cn+=1
        cnt.append([2,cn])
        #print(nowN)
    n=3
    end=N/2
    while n < end:
        cn=0
        if nowN%n==0:
            while nowN%n==0:
                nowN/=n
                cn+=1
            cnt.append([n,cn])
        #print(n,nowN)
        n+=2
        end=int(N/n)
        if nowN==1:
            break
    if nowN==N:
        print(1)
    else:    
        for cn in cnt:
            han=True
            nowcnt=cn[1]
            i=1
            while han:
                nowcnt-=i
                if nowcnt<=i:
                    I.append(i)
                    han=False
                else:
                    i+=1
        ans=0
        for i in I:
            ans+=i
        #print(cnt)
        print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
pf = []
i = 2
if n == 1:
    print(0)
    exit()

while i ** 2 <= n:
    j = 0
    while n % i == 0:
        n = n // i
        j += 1
    if j > 0:
        pf.append(j)
    i += 1
if len(pf) == 0: 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:
n = int(input())
pf = []
i = 2
while i ** 2 < n:
    j = 0
    while n % i == 0:
        n = n // i
        j += 1
    if j > 0:
        pf.append(j)
    i += 1
if len(pf) == 0: 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:
import math
import decimal


def main():

    N = int(input())
    ans = 0
    pn = [2]
    A = int(math.ceil(N**0.5)+1)

    if N >= 3:
        for L in range(3, A):
            if L % 2 == 0:
                continue
            chk = True
            for L2 in pn:
                if L % L2 == 0:
                    chk = False
            if chk == True:
                for i in pn:
                    d = L
                    while(True):
                        if N % d == 0:
                            N /= d
                            ans += 1
                            d *= i
                        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:
import math
import decimal


def main():

    N = int(input())
    ans = 0
    pn = [2]
    A = int(math.ceil(N**0.5)+1)

    if N >= 3:
        for L in range(3, A):
            if L % 2 == 0:
                continue
            chk = True
            for L2 in pn:
                if L % L2 == 0:
                    chk = False
            if chk == True:
                for i in pn:
                    d = L
                    while(True):
                        if N % d == 0:
                            N /= d
                            ans += 1
                            d *= i
                        else:
                            break
    elif N == 2:
        print(1)
        return
    else:
        print(0)
        return

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
t = n
pf = []
i = 2
while n > 1 and i ** 2 < t:
    j = 0
    while n % i == 0:
        n = n // i
        j += 1
    if j > 0:
        pf.append(j)
    i += 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:
n = int(input())
pf = []
i = 2
while n > 1 and i ** 2 < n:
    j = 0
    while n % i == 0:
        n = n // i
        j += 1
    if j > 0:
        pf.append(j)
    i += 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:
#D
N=int(input())
N_C=N
P={}
for i in range(2,10**6+1):
    if N%i==0:
        P[i]=0
        while True:
            N=N/i
            P[i]+=1
            if N%i!=0:
                break
    if N==1:
        break
if N_C==1:
    print(0)
elif P=={}:
    print(1)
else:
    ans=0
    for key,v in P.items():
        z=key**v
        L=[0]+[True for i in range(v)]
        for i in range(1,v+1):
            if L[i]:
                if z%(key**i):
                    break
                z=z/(key**i)
                L[i]=False
                ans+=1
    print(ans)

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

ans=0
arr=[]

tmp=1

#print(int(math.sqrt(N))+5)

for i in range(int(math.sqrt(N))+5):
    tmp=1

    while N % ((i+2)**tmp) == 0:
        N=N / ((i+2)**tmp)
        #print((i+2)**tmp)
        ans+=1
        tmp+=1

    while N % (i+2) == 0:
        N = N // (i+2)

if N > 1 :
    ans+1

print(ans)

Submission status: Wrong Answer

Solution code:
#D
N=int(input())
N_C=N
P={}
for i in range(2,10**6+1):
    if N%i==0:
        P[i]=0
        while True:
            N=N/i
            P[i]+=1
            if N%i!=0:
                break
    if N==1:
        break
if N_C==1:
    print(0)
elif P=={}:
    print(N_C)
else:
    ans=0
    for key,v in P.items():
        z=key**v
        L=[0]+[True for i in range(v)]
        for i in range(1,v+1):
            if L[i]:
                if z%(key**i):
                    break
                z=z/(key**i)
                L[i]=False
                ans+=1
    print(ans)

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

ans=0
arr=[]

tmp=1

#print(int(math.sqrt(N))+5)

for i in range(int(math.sqrt(N))+5):
    tmp=1

    while N % ((i+2)**tmp) == 0:
        N=N / ((i+2)**tmp)
        print((i+2)**tmp)
        ans+=1
        tmp+=1

    while N % (i+2) == 0:
        N = N // (i+2)

if N > 1 :
    ans+1

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

ans=0
arr=[]

tmp=1

print(int(math.sqrt(N))+5)

for i in range(int(math.sqrt(N))+5):
    tmp=1

    while N % ((i+2)**tmp) == 0:
        N=N // ((i+2)**tmp)
        print((i+2)**tmp)
        ans+=1
        tmp+=1

    while N % (i+2) == 0:
        N = N // (i+2)

if N > 1 :
    ans+1

print(ans)

Submission status: Wrong Answer

Solution code:

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

    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 is_prime(n):
        print(1)
    else:
        ps = factorization(n)
        r = 0
        for pse in ps:
            num = pse[1]
            cnt = 1
            while num > 0:
                if cnt <= num:
                    r += 1
                    num -= cnt
                    cnt += 1
        print(r)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#D
N=int(input())

P={}
for i in range(2,10**6+1):
    if N%i==0:
        P[i]=0
        while True:
            N=N/i
            P[i]+=1
            if N%i!=0:
                break
    if N==1:
        break
if P==1:
    print(0)
elif P=={}:
    print(N)
else:
    ans=0
    for key,v in P.items():
        z=key**v
        L=[0]+[True for i in range(v)]
        for i in range(1,v+1):
            if L[i]:
                if z%(key**i):
                    break
                z=z/(key**i)
                L[i]=False
                ans+=1
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
import decimal


def main():

    N = int(input())
    ans = 0
    pn = [2]
    A = int(math.ceil(N**0.5)+1)

    if N >= 3:
        for L in range(3, A):
            chk = True
            for L2 in pn:
                if L % L2 == 0:
                    chk = False
            if chk == True:
                pn.append(L)
    elif N == 2:
        print(1)
        return
    else:
        print(0)
        return

    for i in pn:
        d = i
        while(True):
            if N % d == 0:
                N /= d
                ans += 1
                d *= d
            else:
                break

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
import decimal


def main():

    N = int(input())
    ans = 0
    pn = [2]
    A = int(math.ceil(N**0.5)+1)

    if N >= 3:
        for L in range(3, A):
            chk = True
            for L2 in pn:
                if L % L2 == 0:
                    chk = False
            if chk == True:
                pn.append(L)
    elif N == 2:
        print(1)
        return
    else:
        print(0)
        return

    for i in pn:
        cnt = 0
        d = i
        while(True):
            if N % d == 0:
                N /= d
                cnt += 1
                d *= d
            else:
                break

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
from collections import Counter
A= int(input())
resArray = []
tmpA = A
i = 1
while i * i < A:
    i += 1
    if tmpA == 1:
        break

    if i >2 and i %2 == 0:
        continue


    while tmpA % i == 0:
        tmpA = tmpA / i
        resArray.append(i)

if tmpA != 1:
    print(1)
    exit()

res = 0

cArray = Counter(resArray)

for i in cArray.values():
    if i > 0:
        
        tmp = 1
        while tmp*(tmp+1)//2 <= i:
            tmp += 1
        res += tmp -1
print(res)

Submission status: Wrong Answer

Solution code:
import math
from collections import Counter
A= int(input())
resArray = []
tmpA = A
for i in range(2, int(math.sqrt(A))):
    if tmpA == 1:
        break

    if i >2 and i %2 == 0:
        continue


    while tmpA % i == 0:
        tmpA = tmpA / i
        resArray.append(i)

if tmpA != 1:
    print(1)
    exit()

res = 0

cArray = Counter(resArray)

for i in cArray.values():
    if i > 0:
        
        tmp = 1
        while tmp*(tmp+1)//2 <= i:
            tmp += 1
        res += tmp -1
print(res)

Submission status: Wrong Answer

Solution code:
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()
N=int(input())
#N=10**18

lst=defaultdict(int)

for i in list(range(2,int(N**.5)+100))+[N]:
    while N>1 and N%i==0:
        N//=i
        lst[i]+=1
c=0
#print(lst)
for s in lst:
    l=lst[s]
    i=1
    while l>=i:
        l-=i
        c+=1
        i+=1
print(c)

Submission status: Wrong Answer

Solution code:
import math
A= int(input())
resArray = []
tmpA = A
for i in range(2, int(math.sqrt(A))):
    if tmpA == 1:
        break

    resArray.append(0)

    if i >2 and i %2 == 0:
        continue

    tmp = tmpA % i

    while tmp == 0:
        tmpA = tmpA / i
        resArray[-1] += 1
        tmp =  tmpA % i

if tmpA != 1:
    print(1)
    exit()

res = 0

for i in resArray:
    if i > 0:
        
        tmp = 1
        while tmp*(tmp+1)//2 <= i:
            tmp += 1
        res += tmp -1
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n==1:
  print(0)
else:
  cnt = 0
  flg = 0
  for i in range(10000001):
    if n<i:
      break
    if i==0 or i==1 or n%i!=0:
      continue
    j = i
    while(n%j==0):
      if flg==0:
        flg = 1
      n /= j
      j *= i
      cnt += 1
  if flg==0:
    print(1)
  else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())

if N==1:
    print(0)
else:
    nowN=N
    cnt=[]
    I=[]
    NN=int(N**(1/2)+1)
    for n in range(2,NN+1):
        cn=0
        if nowN%n==0:
            while nowN%n==0:
                nowN/=n
                cn+=1
            cnt.append([n,cn])
        if nowN==1:
            break
    if nowN==N:
        print(1)
    else:    
        for cn in cnt:
            han=True
            nowcnt=cn[1]
            i=1
            while han:
                nowcnt-=i
                if nowcnt<=i:
                    I.append(i)
                    han=False
                else:
                    i+=1
        ans=0
        for i in I:
            ans+=i
        #print(cnt)
        print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())

if N==1:
    print(0)
else:
    nowN=N
    cnt=[]
    I=[]
    NN=int(N**(1/2)+1)
    for n in range(2,NN+1):
        cn=0
        if nowN%n==0:
            while nowN%n==0:
                nowN/=n
                cn+=1
            cnt.append([n,cn])
        if nowN==1:
            break
    if nowN==N:
        print(1)
    else:    
        for cn in cnt:
            han=True
            nowcnt=cn[1]
            i=1
            while han:
                nowcnt-=i
                if nowcnt<=i:
                    I.append(i)
                    han=False
                else:
                    i+=1
        ans=0
        for i in I:
            ans+=i
        print(cnt)
        print(ans)

Submission status: Wrong Answer

Solution code:
import math
A= int(input())
resArray = []
tmpA = A
for i in range(2, int(math.sqrt(A))):
    if tmpA == 1:
        break

    resArray.append(0)

    if i >2 and i %2 == 0:
        continue

    tmp = tmpA % i

    while tmp == 0:
        tmpA = tmpA / i
        resArray[-1] += 1
        tmp =  tmpA % i

if tmpA != 1:
    print(1)
    exit()

res = 0
for i in resArray:
    if i > 0:
        tmp = 1
        while tmp <= i:
            i = i - tmp
            tmp += 1
            res += 1

print(res)

Submission status: Wrong Answer

Solution code:
import math
A= int(input())
resArray = []
tmpA = A
for i in range(2, int(math.sqrt(A))):
    if tmpA == 1:
        break
    tmp = tmpA%i
    resArray.append(0)
    while tmp == 0:
        tmpA = tmpA/i
        resArray[-1] += 1
        tmp = tmpA%i

if tmpA != 1:
    print(1)
    exit()

res = 0
for i in resArray:
    if i > 0:
        tmp = 1
        while tmp <= i:
            i = i - tmp
            tmp += 1
            res += 1
        
print(res)

Submission status: Wrong Answer

Solution code:
import math
import sys
 
n = int(input())
org_n = n
 
array = [True] * (math.ceil(math.sqrt(n))+1)
                  
for i in range(2,len(array)):
  if not array[i]:
    continue
    
  for j in range(i*2,len(array), i):
    array[j] = False
 
sosu = []
sosu_flag = True
for i in range(2,len(array)):
  if array[i]:
    sosu.append(i)
    if n % i == 0:
      sosu_flag = False
      
if sosu_flag:
  sosu.append(n)
    

dic = {}
for v in sosu:
  if n < v:
    break
    
  count = 0
  while n % v == 0:
    count += 1
    n //= v
    
  if count != 0:
    dic[v] = count

ans = 0
for v in dic.values():
  index = 1
  while True:
    if index > v:
      break
      
    v -= index
    ans += 1
    index += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math
import collections

n = int(input())

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

ans = 0

factor = []
tmp = int(math.sqrt(n)) + 1

for num in range(2,tmp):
    while n % num == 0:
        n //= num
        factor.append(num)

if not factor:
    factor.append(n)
        
s = collections.Counter(factor)


s = list(s.values())

for i in s:
    j = 1
    while True:
        i -= j
        if i < 0:
            break
        j += 1
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
count = 0

def prime_factors(number):
    listp = []
    int_sqrtn = int(math.sqrt(number))
    for prime in range(2, int_sqrtn+1):
        if number % prime == 0:
            listp.append(prime)
            number //= prime

    if number > int_sqrtn:
        listp.append(number)

    return listp

print(len(prime_factors(n)))

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = int(input())

n = N
counter = Counter()
for i in range(2, N):
    if n == 1:
        break
    if i ** 2 > N:
        break
    while n % i == 0:
        counter[i] += 1
        n = n // i
if n == N:
    counter[N] += 1

ans = 0
for key in counter.keys():
    e = 1
    while counter[key] >= e:
        ans += 1
        counter[key] -= e
        e += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math
import sys
 
n = int(input())
org_n = n
 
array = [True] * (math.ceil(math.sqrt(n))+1)
                  
for i in range(2,len(array)):
  if not array[i]:
    continue
    
  for j in range(i*2,len(array), i):
    array[j] = False
 
sosu = []
for i in range(2,len(array)):
  if array[i]:
    sosu.append(i)
    

dic = {}
for v in sosu:
  if n < v:
    break
    
  count = 0
  while n % v == 0:
    count += 1
    n //= v
    
  if count != 0:
    dic[v] = count

ans = 0
for v in dic.values():
  index = 1
  while True:
    if index > v:
      break
      
    v -= index
    ans += 1
    index += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math


import math
import numpy as np
from collections import deque
def sieve_of_erastosthenes(num):
    """
    エラストネスの篩
    :param num:
    :return:
    """
    input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)]
    input_list[0] = input_list[1] = False

    input_list[2] = input_list[3] = input_list[5] = True
    sqrt = math.sqrt(num)

    for serial in range(3, num, 2):

        if serial >= sqrt:
            return input_list

        for s in range(serial ** 2, num, serial):
            input_list[s] = False
    return input_list

N=int(input())

def factorization(n):
    """

    素因数分解
    :param n:
    :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[i]= cnt

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

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

    return arr

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

input_ = make_divisors(N)
cnt = 0
# for i in input_:
#     n = N
#     _cnt =1
#     stack = deque([i])
#     seen= [i]
#     while stack:
#         s =stack.pop()
#         hoge= stack[-1]
#         for s
#         if math.log(hoge,)  and not hoge in seen:
#             stack.append(n/i)
#         else:
#             stack.pop
# prime_list = np.array(range(1,N+1))[sieve_of_erastosthenes(N)]
prime_dict = factorization(N)
searched = []
count=0
for prime, val in prime_dict.items():
    for e in range(1 ,val+1):
        z = prime ** e
        if N%z == 0 and not z in searched:
            searched.append(z)
            N = N//z
            count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n==1:
  print(0)
else:
  cnt = 0
  flg = 0
  for i in range(1000000):
    if n<i:
      break
    if i==0 or i==1 or n%i!=0:
      continue
    j = i
    while(n%j==0):
      if flg==0:
        flg = 1
      n /= j
      j *= i
      cnt += 1
  if flg==0:
    print(1)
  else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())

if N==1:
    print(0)
else:
    nowN=N
    cnt=[]
    I=[]
    NN=int(N**(1/2))
    for n in range(2,NN):
        cn=0
        if nowN%n==0:
            while nowN%n==0:
                nowN/=n
                cn+=1
            cnt.append([n,cn])
        if nowN==1:
            break
    if nowN==N:
        print(1)
    else:    
        for cn in cnt:
            han=True
            nowcnt=cn[1]
            i=1
            while han:
                nowcnt-=i
                if nowcnt<=i:
                    I.append(i)
                    han=False
                else:
                    i+=1
        ans=0
        for i in I:
            ans+=i
        print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
nn=N
import math
sq=round(math.sqrt(N))+1

i=2
ans=0
count1=0
count2=1
while sq>=i:
    if nn%i==0:
        nn//=i
        count1+=1
        if count1==count2:
            ans+=1
            count2+=1
            count1=0
    else:
        i+=1
        count1=0
        count2=1

if ans==0 and N>=2:
    ans+=1

if nn>sq:
    ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
#
import math

n=int(input())
N=n
if n==1:
    print(0)
    exit()
ans=0
z=[]
for i in range(2,int(math.sqrt(N))+1):
    if n%i==0:
        x=i#xは素数
        s=0
        while n>=1:
            if n%x==0:
                #print(n,x**s,ans)
                n=n//x
                s+=1
                
            else:
                #print(n,x**s,ans)
                z.append(s)
                break
    if n==1:
        break

#print(z)
if len(z)==0:
    print(1)
    exit()
for i in range(len(z)):
    j=1
    while z[i]>0:
        ans+=1
        z[i]-=j
        j+=1
        if z[i]<j:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

    return a

result = factorization(N)

count = 0
for p,i in result:
    if p == 1:
        continue
    s = 0
    for k in range(1, i+1):
        if p ** k > N:
            break
        elif s + k > i+1:
            break
        else:
            N /= p ** k
            count += 1
            s += k
print(count)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *
#import numpy as np
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

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

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

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

    return arr


N=II()


ans = factorization(N)

cnt = 0

for an in ans:
    if an[0] != 1:
        k = an[1]
        i = 1
        flg = True
        while flg:
            if k - i >= 0:
                k-=1
                cnt+=1
                i+=1
            else:
                flg = False
        


print(cnt)

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 not arr:
        arr.append([n, 1])

    return arr


n = int(input())
cnt = 0
z_list = []
f = factorization(n)
if n > 0:
    for fact in f:
        for j in range(1, fact[1] + 1):
            z = fact[0] ** j
            if z < 2:
                print(0)
                exit()
            if str(z) not in z_list:
                if n % z == 0:
                    n = n // z
                    cnt += 1
                    z_list += str(z)
print(cnt)

Submission status: Wrong Answer

Solution code:
from sys import stdin
from math import sqrt
input = stdin.readline
N = int(input())

n = N

ans = 0

for i in range(2, int(sqrt(n)) + 1):
    tmp = i

    while n % tmp == 0:
        n //= tmp
        ans += 1
        tmp *= i

for i in range(2, int(sqrt(n)) + 1):
    if n % i == 0:
        print(ans)
        exit()

if n != 1 and n > sqrt(N):
    ans += 1


print(ans)

Submission status: Wrong Answer

Solution code:
import math

def factorization(n):
    r = []
    temp = n
    for i in range(2,int(math.sqrt(n))+1):
        m = 0
        while temp % i == 0:
            temp /= i
            m += 1
        if m > 0:
            r.append((i,m))
    if temp != 1:
        r.append((temp,1))
    if len(r) == 0:
        r.append((n,1))
    return r

n = int(input())
p = factorization(n)
ans = 0
if p[0][0] == 1:
    ans = 0
else:
    for x in p:
        i = 1
        s = x[1]
        while s > 0:
            s -= i
            i += 1
        ans += (i-1)
print(ans)

Submission status: Wrong Answer

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

n = N
i = 2
while (i*i <= n):
    tmp = 0
    k = 1

    while (N%i == 0):
        tmp += 1
        N //= i
    # print(tmp)
    while tmp > 0:
        if tmp - k >= 0:
            count += 1
        tmp -= k
        k += 1
    
    if N == 1:
        break
    elif i*i == N:
        count += 1
    i += 1

print(count)

Submission status: Wrong Answer

Solution code:
#
import math

n=int(input())
N=n
if n==1:
    print(0)
    exit()
ans=0
z=[]
for i in range(2,int(math.sqrt(N))+1):
    if n%i==0:
        if i in z:
            n=n//i
            continue
        
        x=i#xは素数
        s=1
        while n>=1:
            if n%(x**s)==0:
                #print(n,x**s,ans)
                n=n//x**s
                z.append(x**s)
                s+=1
                ans+=1
                
            else:
                #print(n,x**s,ans)
                break
    if n==1:
        break

#print(z)
if ans==0:
    print(1)
else:
    if n>math.sqrt(N):
        ans+=1
    print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt
import itertools

def factorization(n):
    factors = []
    temp = n
    for i in range(2, int(sqrt(n))+1):
        if temp % i == 0:
            count = 0
            while temp % i == 0:
                count += 1
                temp //= i
            factors.append((i, count))
    if not factors:
        factors.append((n, 1))

    return factors


N = int(input())
factors = factorization(N)
count = 0
for a, b in factors:
    c = 0
    for i in itertools.count(1):
        c += i
        if c > b:
            break
        else:
            count += 1

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