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:
a=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

factorization(a)

Submission status: Wrong Answer

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


def primes(n):
    ps = {}
    for i in range(2, int(n ** 0.5) + 2):
        if n == 1:
            break
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                n = n // i
                cnt += 1

            ps[i] = cnt

    return ps


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

    if is_prime(n):
        print(1)
        exit()

    ps = primes(n)

    ans = sum([int((-1 + (1 + 8 * v) ** 0.5) / 2) for v in ps.values()])
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    import copy
    n = int(input())
    if n==1:
        print(0)
        return
    k = copy.deepcopy(int(n**0.5)+2)
    ans = 0
    for i in range(2,k):
        if n%i==0:
            m = 1
            ans += 1
            n = n//i
            cnt = 0
            while n%i==0:
                n = n//i
                cnt += 1
                if cnt > m:
                    m = m+1
                    cnt = 0
                    ans += 1
        if n==1:
            break
    if ans==0:
        print(1)
        return
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    cand = [2]+list(range(3, int(-(-n**0.5//1))+1, 2))
    for i in cand:
        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

max_N=1000
s = [i for i in range(1, max_N)]
sums = [sum(s[:i]) for i in range(1,max_N)]
def comb(a):
    for i in range(max_N):
        if a<sums[i]:
            return i

N = int(input())
fac = factorization(N) 
res = 0
for a in [el[1] for el in fac]:
    res += comb(a)
print(res)

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
if n == 1:
    print(0)
else:
    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))

    ans = 0
    if len(c) == 1:
        if list(c.values())[0] == 1 or list(c.values())[0] == 2:
            ans += 1
        else:
            for k in range(1,100):
                if k/2*(2+(k-1)) >= list(c.values())[0]:
                    ans += k
                    break
    else:
        i = 0
        j = 0
        for l in range(len(c)):
            i == list(c.keys())[l]
            j = list(c.values())[l]
            if j == 1 or j == 2:
                ans += 1
            else:
                for k in range(1,100):
                    if k/2*(2+(k-1)) >= j:
                        ans += k
                        break

    print(ans)

Submission status: Wrong Answer

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

p = [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,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]

n = int(input())
if n == 0:
    print(0)
else:
    ans = 0
    for j in factorization(n):
        ans += p[j[1]-1]

    print(ans)

Submission status: Wrong Answer

Solution code:
# Contest No.: ABC169
# Problem No.: D
# Solver:      JEMINI
# Date:        20200531

import sys
import heapq

def main():
    temp = [True] * (10 ** 6 + 10)
    temp[0] = False
    temp[1] = False
    for i in range(2, 10 ** 6 + 10):
        if temp[i]:
            cnt = 2 * i
            while cnt < 10 ** 6 + 10:
                temp[cnt] = False
                cnt += i
    prime = []
    for i in range(10 ** 6 + 10):
        if temp[i]:
            prime.append(i)

    n = int(input())
    ans = 0
    tempN = n
    for i in prime:
        if i > n:
            break
        if tempN % i:
            continue
        div = 0
        while True:
            cnt = 1
            while tempN % (i ** (2 * cnt)) == 0:
                cnt += 1
            if tempN % (i ** cnt):
                break
            div += cnt
            tempN = tempN // (i ** cnt)
        #print(div)
        if div > 2:
            div = int((div * 2) ** 0.5)
        else:
            div = 1
        #print(i, div, tempN)
        ans += div
    if tempN != 1:
        ans += 1
    print(ans)
    return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun May 31 21:31:49 2020

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

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

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

    return arr

if __name__ == "__main__":
    N = int(input())
    if N == 1:
        print(0)
    else:
        b = factorization(N)
        a = []
        c = 1
        for i in range(0, len(b)):
            c *= b[i]
            if c in a:
                continue
            elif N % c != 0:
                continue
            else:
                N = N // c
                a.append(c)
                c = 1
        print(len(a))

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def prime_set(limit=10**5):
    """
    2020/04/10
    https://atcoder.jp/contests/abc084/tasks/abc084_d
    """

    ret = [2]
    for x in range(3, limit+1, 2):
        is_prime = True
        sqrtx = int(pow(x, 0.5))

        for p in ret:
            if p > sqrtx:
                break

            if x % p == 0:
                is_prime = False
                break

        if is_prime:
            ret.append(x)

    return ret


def main():
    N = int(input())
    N_ = N

    primes = prime_set(int(N**0.5)+1)

    # primes = prime_set(10**6)  # 1.3 sec
    # print(len(primes))  # 78498

    soinsu = {}
    for p in primes:
        if N == 1:
            break

        if N % p == 0:
            soinsu[p] = 1
            N = N // p
            while True:
                if N % p == 0:
                    soinsu[p] += 1
                    N = N // p
                else:
                    break
    
    if len(soinsu.keys()) == 0 and N_ != 1:
        soinsu[N_] = 1
    # print(soinsu)

    counts = {}
    for cnt in soinsu.values():
        if cnt not in counts:
            counts[cnt] = 1
        else:
            counts[cnt] += 1

    ans = 0
    for k, v in counts.items():
        for n in range(int((2*k+0.25)**0.5) + 1, -1, -1):
            if n*(n+1) <= 2*k < (n+1)*(n+2):
                ans += n*v
                break
    
    return ans


print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import bisect
ans = 0
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
lis = factorization(N)
suum = [0]*(10**5)
for k in range(1,10**5):
    suum[k] = suum[k-1]+k
for j in range(len(lis)):
    index = bisect.bisect_left(suum,lis[j][1])
    ans += index
    if lis[j][1] == 2:
        ans -= 1
if N != 1:
    print(ans)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import numpy as np
import math
N = int(input())
n = N
ans = 0


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


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


d = set()


for x in primes(int(n**0.5)+1):
    tmp = x
    while(tmp <= N):
        d.add(tmp)
        tmp *= x

d = list(d)
d.sort()
for i in d:
    if N % i == 0:
        N = N // i
        ans += 1

if N**2 > n and is_prime(N):
    ans += 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

yakusu = factorization(n)

ans = 0

for i in range(len(yakusu)):
    l = yakusu[i]
    a,b = l[0],l[1]
    j = 1
    k = 1
    if a != 1:
        while b>=j:
            ans += 1
            j += k
            k += 1
print(ans)

Submission status: Wrong Answer

Solution code:
#d
import math
from collections import deque


n = int(input())
a = []
ans = 0
d = 2
for i in range(2,int(math.sqrt(n)+1)):
    
    if n%i==0:
        a.append(i)
ans = len(a)
if ans == 0 and n >1:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
k=n
dic={}
import math
for i in range(2,math.floor(math.sqrt(n))+1):
  for j in range(10**10):
    if n%i==0:
      if i in dic:
        dic[i]+=1
      else:
        dic[i]=1
      n=n//i
    else:
      break

count=0
if k!=1:
  if not dic:
    count+=1
  if n!=1:
    count+=1
while dic:
  keep=1
  x=dic.popitem()
  num=x[1]
  for i in range(1000):
    if num>=keep:
      num-=keep
      count+=1
      keep+=1
    else:
      break
print(count)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())  # 10**12
if N == 1:
    print(0)
    exit()
sqrt_N = int(math.sqrt(N))

sosuu = [2]
ans = 0
i = 2
n = 1
while 1:
    i_n = i ** n
    d,m = divmod(N, i_n)
    # print(d,m)
    if m == 0:
        N = d
        n += 1
        ans += 1
    else:
        break
A = sqrt_N + 2
for i in range(3, A, 2): # 2 以外の素数は奇数なので
    is_prime = True
    sqrt_i = math.sqrt(i)
    for L2 in sosuu:
        if i % L2 == 0:  # すべての既存素数で割り切れなかったら素数
            is_prime = False
            break
        if L2 > sqrt_i:
            break
    if is_prime:
        sosuu.append(i)
        n = 1
        while 1:
            i_n = i ** n
            d,m = divmod(N, i_n)
            # print(d,m)
            if m == 0:
                N = d
                n += 1
                ans += 1
            else:
                break

if ans == 0:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
def solve() :
    n = int(input())
    m = int(math.sqrt(n))+1
    is_prime = [True]*m
    ans = 0
    used = set()
    if n == 1 :
        return 0
    for i in range(2, m) :
        if is_prime[i] :
            j=i 
            while n%j == 0 :
                n//=j 
                used.add(j)
                j*=i
                ans += 1
            j=i+i 
            while j<m :
                is_prime[j] = False
                j += i 
    if n != 1 and n not in used:
        ans += 1
    return ans

print(solve())

Submission status: Wrong Answer

Solution code:
from math import sqrt
n = int(input())
count = 0 
if n%2 == 0 :
    p =1
    while(n%(2*p) ==0 ) :
        
        count +=1
        n = n//(2*p)
        p *=2
for i in range(3, int(sqrt(n)) +1 ,2 ) :
    if n%i == 0  :
        j =1
        while n%(i*j) == 0 :
            count +=1
            n = n//(i*j)
            j *=i
if n!= 1 and count == 0 :
    count = 1
print(count)

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

A=factorization(N)
P=[row[1] for row in A]

ans=0

for i in range(len(P)):
    c=1
    while P[i]>=c:
        P[i]-=c
        c+=1
        ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
C = {}
for i in range(2, max(3, int(N**(0.5))+1)):
    while(N % i == 0):
        N = N//i
        if i not in C:
            C[i] = 1
        else:
            C[i] += 1

if len(C) == 0:
    print(1)
    sys.exit()

ans = 0
for i in C.values():
    s = 1
    while(True):
        i -= s
        if i < 0:
            break
        ans += 1
        s += 1
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
    tmp = tmpA%i
    resArray.append(0)
    while tmp == 0:
        print(i)
        tmpA = tmpA/i
        resArray[-1] += 1
        tmp = tmpA%i
if tmpA != 1:
    print(1)
    exit()
res = 0
for i in resArray:
    if i != 0:
        for j in range(i + 1):
            if j*(j+1)/2 > i:
                res += j - 1
                break
print(res)

Submission status: Wrong Answer

Solution code:
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
#sys.stdin = open("input.txt", "r")
#sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)
is_prime=[1 for i in range(10**6+1)]
is_prime[0]=0
is_prime[1]=0
for i in range(2,10**6+1):
    if(is_prime[i]):
        for j in range(2*i,10**6+1,i):
            is_prime[j]=0
n=l()[0]
ans=0
x=n
for i in range(2,int(n**0.5)+1):
    if(x%i==0 and is_prime[i]):
        p=i
        while(x%p==0):
            # print(i,x)
            ans+=1
            x//=p
            p*=i
if(ans==0 and n>10**6):
    ans=1
elif(x!=1 and x!=n):
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
k=n
dic={}
import math
for i in range(2,math.floor(math.sqrt(n))+1):
  for j in range(10**10):
    if n%i==0:
      if i in dic:
        dic[i]+=1
      else:
        dic[i]=1
      n=n//i
    else:
      break

count=0
if k!=1:
  if not dic:
    count+=1
  if n!=1:
    count+=1
print(dic)
while dic:
  keep=1
  x=dic.popitem()
  num=x[1]
  for i in range(1000):
    if num>=keep:
      num-=keep
      count+=1
      keep+=1
    else:
      break
print(count)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import sys


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


n = int(input())
if is_prime(n) is True:
    print('1')
    sys.exit()
temp = []
i = 2
# print('Start')
while True:
    if n == 1:
        print(len(temp))
        break
    if n % i == 0 and i not in temp:
        temp.append(i)
        n = n//i
        i = 2
        # print(temp, n)
    i += 1
    if n in temp:
        print(len(temp))
        break

Submission status: Wrong Answer

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

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

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

    return arr
def main():
    N = int(input())
    z_list=[]
    arr = fanction(N)
    k=0
    for i in range(len(arr)):
        #print(1)
        z= arr[i][0]
        N=N/z
        z_list.append(z)
        arr[i][1]=arr[i][1]-1
        k+=1
        if arr[i][1]>1:
            for n in range(2,arr[i][1]+1):
                z2 = z**n
                if not(z2 in z_list):
                    #print(2,n)
                    N=N/z
                    z_list.append(z2)
                    arr[i][1]=arr[i][1]-n
                    k+=1
                if  arr[i][1]<n:
                    break
        else:
            continue
    print(k)
    
main()

Submission status: Wrong Answer

Solution code:
import bisect
ans = 0
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
lis = factorization(N)
suum = [0]*(10**5)
for k in range(1,10**5):
    suum[k] = suum[k-1]+k
for j in range(len(lis)):
    index = bisect.bisect_left(suum,lis[j][1])
    ans += index
    if lis[j][1] == 2:
        ans -= 1
if ans != 1:
    print(ans)
else:
    print(0)

Submission status: Wrong Answer

Solution code:

n=int(input())

count=0
for i in range(2,1000000000):
    if n%i==0:
        n=n/i
        count+=1
    if n<i:
        break


print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
def make_divisors(a, i):
    global ans
    while i*i <= n:
        if a % i == 0:
            ans += 1
            make_divisors(a / i, i+1)
            break
        i += 1
make_divisors(n, 2)
import math
if ans == 0 and n != 1:
    i = 2
    while i*i <= n:
        if n % i == 0:
            break
        i += 1
    else:
        ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
trs = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171,
      190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435,
      465, 496, 528, 561, 595, 630, 666, 703, 741, 780]

n = int(input())

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

D = {}

i = 2
while i * i < n:
    # print(i, n)
    if n % i == 0:
        n = n // i
        if i in D:
            D[i] += 1
        else:
            D[i] = 1
    else:
        i += 1

if n in D:
    D[n] += 1
else:
    D[n] = 1

# print(D)

ans = 0
for one in D:
    for ntr, tr in enumerate(trs):
        if tr > D[one]:
            # print(D[one], tr)
            ans += ntr
            break

print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def prime_set(limit=10**5):
    """
    2020/04/10
    https://atcoder.jp/contests/abc084/tasks/abc084_d
    """

    ret = [2]
    for x in range(3, limit+1, 2):
        is_prime = True
        sqrtx = int(pow(x, 0.5))

        for p in ret:
            if p > sqrtx:
                break

            if x % p == 0:
                is_prime = False
                break

        if is_prime:
            ret.append(x)

    return ret


def main():
    N = int(input())
    N_ = N

    primes = prime_set(int(N**0.5)+1)

    # primes = prime_set(10**6)  # 1.3 sec
    # print(len(primes))  # 78498

    soinsu = {}
    for p in primes:
        if N == 1:
            break

        if N % p == 0:
            soinsu[p] = 1
            N = N // p
            while True:
                if N % p == 0:
                    soinsu[p] += 1
                    N = N // p
                else:
                    break
    
    if len(soinsu.keys()) == 0:
        soinsu[N_] = 1
    # print(soinsu)

    counts = {}
    for cnt in soinsu.values():
        if cnt not in counts:
            counts[cnt] = 1
        else:
            counts[cnt] += 1

    ans = 0
    for k, v in counts.items():
        for n in range(int((2*k+0.25)**0.5) + 1, -1, -1):
            if n*(n+1) <= 2*k < (n+1)*(n+2):
                ans += n*v
                break
    
    return ans


print(main())

Submission status: Wrong Answer

Solution code:
def task(n):
    primes = {}
    i = 2
    while i < 1000001 and i <= n:
        if n % i == 0:
            n = n // i
            if not i in primes:
                primes[i] = 0
            primes[i] += 1
        else:
            i += 1

    ans = 0
    for prime in primes:
        e = 1
        count = primes[prime]
        while count >= e:
            count -= e
            e += 1
            ans += 1

    if ans == 0:
        ans = 1

    print(ans)


n = int(input())
task(n)

Submission status: Wrong Answer

Solution code:
import math

n=int(input())
sqn=int(math.sqrt(n))
soinsu=[]#soinsu[i]はi+2で何回割れるか示す
for i in range(2,sqn+1):
    count=0
    while True:
        if n%i==0:#iで割れるなら
            n=n//i
            count+=1
        else:
            soinsu.append(count)
            break
        
ans=0
for i in range(len(soinsu)):
    ans+=int((-1+math.sqrt(1+8*soinsu[i]))/2)

print(ans)

Submission status: Wrong Answer

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

p = [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,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10]

n = int(input())
if n == 0:
    print(0)
else:
    ans = 0
    for j in factorization(n):
        ans += p[j[1]-1]

    print(ans)

Submission status: Wrong Answer

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

s=factorization(a) 
ans=0
for i in s:
    if i[0]>1:
        ans+=(i[1]-1)//2+1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

p = [0]*10**6
for i in range(2, 10**6):
    if p[i] == 0:
        p[i] = 1
        j = 2
        while i*j < 10**6:
            p[i*j] = -1
            j += 1

L = []
ans = 0
for i in range(10**6):
    if p[i] < 1:
        continue
    j = 1
    while N%pow(i, j) == 0:
        L.append(pow(i, j))
        N //= pow(i, j)
        j += 1
        ans += 1

if N > 10**6:
    i = 2
    f = True
    while i <= N**0.5:
        if N%i == 0:
            f = False
            break
        i += 1
    if f:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
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

b = factorization(int(input()))
count = 0
for i in b:
    j = 1
    while(1):
        i -= j
        if i<0:
            break
        else:
            count += 1
            j += 1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

    divisors.sort()
    return divisors

lst = list(make_divisors(N))
#print(lst)
#print(len(lst))
cnt = 0

for i in range(1,len(lst)):
    if N > 1:
        N = N//lst[i]
        cnt+=1
        #print(N)
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'


def main():
    N=ii()
    NN = N
    ans = 0
    for i in chain(range(2, int(N**0.5)+3)):
        c = i
        while N%c == 0:
            N //= c
            c *= i
            ans += 1
    ans += (NN==N>1)
    print(ans)





main()

Submission status: Wrong Answer

Solution code:
import math
import bisect

N = int(input())

def printCount(N):
    if N <= 1:
        print(0)
        return

    num = N
    primeDivisions = []

    limit = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780]

    primeCounts = []
    for factor in range(2, int(math.sqrt(N)) + 1):
        if num % factor != 0:
            continue
        count = 0
        while num % factor == 0:
            count += 1
            num //= factor
        primeCounts.append(count)

    if len(primeCounts) == 0:
        print(1)
    else:
        result = 0
        for count in primeCounts:
            index = bisect.bisect_right(limit, count)
            result += index
        print(result)

printCount(N)

Submission status: Wrong Answer

Solution code:
n = int(input())
powers = set()
for i in range(2,int(n**0.5)):
  for j in range(1,41):
    if i**j>n**0.5:
      break
    else:
      powers.add(i**j)
power = list(powers)
power.sort()
counter = 0
for s in power:
  if n%s==0:
    n = n/s
    counter += 1
  if n<s:
    break
print(counter)

Submission status: Wrong Answer

Solution code:
n=int(input())
start=n
ans=0
for i in range(2,int(n**0.5+1)):
    if(n%i==0):
        for j in range(1,100000):
            if(n%(i**j)==0):
                ans+=1
                n/=i**j
            else:
                break
    if(n==1):
        break
if(n==start and start!=1):
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
from math import *

n=int(input())
val=n
ans=0
for i in range(2,1000001):
	if val==1:
		break
	if val%i==0 and (val//i)>i:
		val=val//i
		ans+=1
		# print(val)

if val!=1 and val%n==0:
	val=val//n
	ans+=1
if val==1:
	print(ans)
else:
	print(ans+1)

Submission status: Wrong Answer

Solution code:
N=int(input())

num=[]

for i in range(2,N):
    N_cp=N
    if N_cp%i==0:
        num.append(i)
        while N_cp%i!=0:
            N=N//i
    if len(num)>100:
        break

times=0
pass_time=0
for i in range(len(num)):
    if N%num[i]==0:
        N=N//num[i]
        times+=1
        pass_time+=1
    if pass_time>40:
        break

print(times)