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:
import numpy as np
import decimal
N = decimal.Decimal(input())
count = 0
def is_prime(p):
    dest = int(np.sqrt(p))
    for i in range(2, dest):
        if np.mod(p, i) == 0:
            return False
    return True

if is_prime(N):
    print(1)
else:
    for p in range(2, int(np.sqrt(N))):
        if np.mod(N, p) != 0:
            continue
        
        if not is_prime(p):
            continue

        e = 1
        while True:
            if p**e > N:
                break
            elif np.mod(N, p**e) == 0:
                N = N / decimal.Decimal(p**e)
                count += 1
                
            if np.mod(N, p) != 0:
                break

            e += 1
        if p >= int(np.sqrt(N)):
            break
    
    print(count)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
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):
    ass = []
    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
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass
primelist=set(primes(10**6))

N=int(input())
if N==1:
    print(0)
    exit()
if is_prime(N):
    print(1)
    exit()
N_SQ=math.sqrt(N)
if N_SQ**2==N:
    if is_prime(N_SQ):
        print(1)
        exit()
target=N
ans=0
last=0
for i in range(2,int(N_SQ)+1):
    if target%i==0:
        for j in primelist:
            if j**math.log(i, j) == i:
                ans+=1
                target/=i
                last=i
                break
# if target!=1 and target!=last:
#     ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

def factorization(n):
    d = {}
    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
            d[i] = cnt

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

    if d.keys()==[]:
        d[n] = 1

    return d

def get_a(n):
    N = n
    if n == 1:
        return [1]
    elif n==2:
        return [2]
    else:
        a = [1]

    while 1:
        n_temp = n - a[-1]
        #print(n_temp, a)
        if n_temp<=0:
            a.pop()
            a[-1] = N - sum(a[:-1])
            break
        else:
            n = n_temp
        a.append(a[-1]+1)
    #print(n_temp, a)
    return a

ans = 0
fact_dict = factorization(n)
#print(fact_dict)

for key, val in fact_dict.items():
    #print(key, val, get_a(val))
    ans += len(get_a(val))

if ans>0:
    print(ans)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
if N == 1:
    print(0)
    exit()
div = {}
for i in range(2, int(math.sqrt(N))+1):
    while N % i == 0:
        N = N // i
        if i in div:
            div[i] += 1
        else:
            div[i] = 1
    if N == 1:
        break
if N != 1:
    div[N] = 1
ans = 0
cnt = []
for v in div.values():
    i = 1
    while v >= i:
        v -= i
        i += 1
        ans += 1
    if v != 0:
        cnt.append(v)
list.sort(cnt, reverse=True)
while len(cnt) >= 2:
    if cnt[0] > cnt[-1]:
        cnt[0] -= cnt[-1]
        ans += cnt[-1]
        cnt = cnt[:-1]
    elif cnt[0] == cnt[-1]:
        ans += cnt[0]
        cnt = cnt[1:-1]
    else:
        cnt[-1] -= cnt[0]
        ans += cnt[0]
        cnt = cnt[1:]
ans_ = 0
cnt = list(div.values())
while len(cnt) >= 2:
    if cnt[0] > cnt[-1]:
        cnt[0] -= cnt[-1]
        ans_ += cnt[-1]
        cnt = cnt[:-1]
    elif cnt[0] == cnt[-1]:
        ans_ += cnt[0]
        cnt = cnt[1:-1]
    else:
        cnt[-1] -= cnt[0]
        ans_ += cnt[0]
        cnt = cnt[1:]
if len(cnt) == 1:
    i = 1
    while cnt[0] >= i:
        cnt[0] -= i
        i += 1
        ans_ += 1
print(max(ans, 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

arr2=factorization(n)
ans=0
for i in range(len(arr2)):
    count=1
    count2=1
    while arr2[i][1]>=count2:
        ans+=1
        count+=1
        count2+=count

print(ans)

Submission status: Wrong Answer

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

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

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

    return arr
N = int(input())
cnt = 0
insulist = factorization(N)
for i in range(len(insulist)):
  for j in range(1, insulist[i][1] + 1):
    if N % (insulist[i][0] ** j) == 0:
      N //= insulist[i][0] ** j
      cnt += 1
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 arr==[]:
        arr.append([n, 1])

    return arr

n=int(input())
if n==1:
    print(0)
ans=0
t=factorization(n)

fg=[]
for i in range(1,16):
    fg.append(i*(i+1)//2)

tmp=[]
for i in range(len(t)):
    cnt=0
    for j in range(len(fg)):
        if t[i][1]>=fg[j]:
            cnt=(j+1)
    ans+=cnt
    g=max(0,cnt-1)
    if t[i][1]-fg[g]>0:
        tmp.append([t[i][0],t[i][1]-fg[cnt-1]])


print(ans+len(tmp)//2)

Submission status: Wrong Answer

Solution code:
import itertools

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 for x in range(cnt)])

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

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

    return arr

ret = factorization(N)
L = list(itertools.chain.from_iterable(ret))
if 1 in L:
    while 1 in L:
        L.remove(1)
if 0 in L:
    L.remove(0)

cnt = 0
mem = []
e = 0
while True:
    e += 1
    flg = 0
    for l in set(L):
        if N <= l**e:
            flg += 1

    if len(L) == 0:
        break
    for p in set(L):
        z = p**e
        q,mod = divmod(N,z)
        if mod == 0 and (z not in mem):
            N = q
            for x in range(e):
                L.remove(p)
            mem.append(z)
            print(z,N,mod,L)
            cnt += 1
            break

    if flg == len(set(L)):
        break

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

    return arr

def divide(n):

    if n == 0:

        return [ ]

    

    l = [ [ n ] ]

    for i in range(n - 1, 0, -1):

        for a in divide(n - i):

            if a[0] <= i:

                l.append([ i ] + a)

    return l

N = int(input())
f = factorization(N)
v = []
m = 1
buf = 0
for i in range(len(f)) :
    v.append(f[i][1])
#print(v)
for i in range(len(v)) :
    d = divide(v[i])
    #print(d)
    s = 0
    m = 0
    for j in range(len(d)) :
        if len(d[j]) >= m and (len(d[j]) == len(set(d[j]))) :
            #print(len(d[j]))
            m = len(d[j])
    buf += m

print(buf)

Submission status: Wrong Answer

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

for i in range(2,int(N**(1/5))+1):
    e=1
    while N%(i**e)==0:
        N=N//(i**e)
        ans+=1
        e+=1
    if N<i:
        break
if M==1:
    ans=0
elif ans==0:
    x = int(N**(1/5))
    y = int(N**(1/4))
    z = int(N**(1/3))
    a = int(N**(1/2))
    if x**5==M:
        ans = 2
    elif y**4==M:
        ans = 2
    elif z**3==M:
        ans = 2
    elif a**2==M:
        ans = 1
    else:
        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)

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

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

    return arr

def main():
    n = int(input())
    if n == 1:
        print(0)
        return 0
    from collections import deque
    q = deque(factorization(n))
    buf = set()
    cnt = 0
    p = 1
    while q:
        p *= q.popleft()
        if p not in buf:
            cnt += 1
            buf.add(p)
            p = 1

    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
def calc_factors(N):
    n = int(N**.5)
    arr = []
    tmp = N
    for i in range(2,n+1):
        if tmp % i == 0:
            while tmp % i == 0:
                arr.append(i)
                tmp = int(tmp/i)
    if tmp != 1: arr.append(tmp) 
    return arr
arr = calc_factors(N)

def facter(c):
    i=1
    s=c 
    while s>0:
        s-=i
        if s > 0:i+=1
        else: break
    return i

res = 0
for i in set(arr):
    c = arr.count(i)
    res += facter(c)
print(res)

Submission status: Wrong Answer

Solution code:
import numpy as np
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
#from scipy.sparse import csr_matrix
import itertools
import copy

n = int(input())

def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum


def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

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

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

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

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

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

    return arr

nums = factorization(n)

ans = 0
cnt = 0
tmp = {}
#print(nums)
for i in range(len(nums)):
    num = nums[i][1]

    for j in range(1,10*8):
        num -= j
        ans += 1
        if (num < j+1):
            if num>0:
                if len(tmp) == 0:
                    tmp[nums[i][0]] = num
                    tmp2 = copy.copy(tmp)
                else:
                    tmp = copy.copy(tmp2)
                    for a in tmp.values():
                        print(a)
                        if a > 0:
                            a -= 1
                            ans += 1
                            #print(tmp)
                            if num - 1 > 0:
                                tmp2[nums[i][0]] = num -1
            break

#print(tmp)

tmp = sorted(tmp.items(), key=lambda x:x[1])

print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque
import sys

N = int(input())
if N == 1:
    print(0)
    sys.exit()

def prime_factorize(n):
    a = deque()
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

N_alt = prime_factorize(N)
e = 1
cnt = 0
ans = 0
num = N_alt[0]
while len(N_alt) != 0:
    if num == N_alt[0]:
        N_alt.popleft()
        cnt += 1
        if  cnt == e:
            ans += 1
            e += 1
            cnt = 0
    else:
        num = N_alt[0]
        e = 1

print(ans)

Submission status: Wrong Answer

Solution code:
import heapq
import math

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

ans = 0
flag = True
for i in range(2,int(n**0.5)+1):
    if i>n:
        break
    if n%i==0:
        flag=False
        tmp = 0
        tmp2 = 0
        while n%i==0:
            n//=i
            tmp+=1
        count = 0
        for j in range(1,10**10):
            if tmp<j:
                break
            tmp-=j
            count+=1
        ans+=count

if flag:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))

import math

def factorization(n):
    # 素因数を格納するリスト
    factor = []
    # 2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    target = n
    for num in range(2, tmp):
        while target % num == 0:
            target //= num
            factor.append(num)

    # リストが空ならそれは素数
    if not factor and n != 1:
        factor.append(n)

    return factor


def main():
    n = input_int()

    a = factorization(n)

    target = set()

    tyofuku = []

    for _a in a:
        if _a in target:
            tyofuku.append(_a)
        else:
            target.add(_a)

    check = 1
    for i in tyofuku:
        check *= i
        if check not in target:
            target.add(check)
            check = 1

    print(len(target))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

ans=0
arr=[]

tmp=1

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

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

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
def fac(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

n=int(input())
li=fac(n)

ans=0
y=0
for x in range(1,50):
    y=y+x
    ans=ans+len([i for i in li if i >= y])
    if len([i for i in li if i >= y])==0:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
import math
import functools
import operator
N=int(input())
ans=1
z=N
count=N
countt=0
if N==1:
    z=0
    count=3
for i in range(2,count):
    if N%i==0:
        z/=i
        countt+=1
    if z==1:
        break
print(countt)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(1,n):
    if n%i == 0:
        n = n%i
        ans += 1
print(ans)

Submission status: Wrong Answer

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

"""
z = p^e where p is a prime number and e = positive int
z divides N
"""

def get_primes(up_to=1000):
    primes = []

    A = [True] * (up_to + 2)

    for i in range(2, int(up_to**0.5)+1):
        if A[i]:
            j = i*2
            while j < up_to:
                A[j] = False
                j += i
    
    i = 2

    while i < up_to:
        if A[i]:
            primes.append(i)
        i += 1

    return primes

from math import sqrt

n = int(input())
used = set()
primes = get_primes(int(sqrt(n))+2)
ze = []
for z in primes:
    i = 1
    zval = z**i
    while zval <= n:
        if not(zval in used):
            ze.append(zval)
            used.add(zval)
        i += 1
        zval = z**i

ze.sort()

count = 0

for z in ze:
    if z > n:
        break

    if n % z == 0:
        count += 1
        n //= z

def is_prime(n):
    if n < 2:
        return False
    elif n == 2 or  n == 3:
        return True

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

#print(primes)
if is_prime(n) and not(n in used):
    print(count +1)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
for i in range(2, int(N**0.5)+1):
    cnt = 0
    while N%i == 0:
        N /= i
        cnt += 1
    a = 0
    b = 0
    for j in range(1, cnt):
        a += j
        if a > cnt:
            break
        b += 1
        
    ans += b

print(1 if ans==0 else ans)

Submission status: Wrong Answer

Solution code:

N = int(input())

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

import math
n = math.floor(math.sqrt(N)) + 1

cm = []
for i in range(2, n+1):
    if (N % i != 0):
        continue
    
    ex = 0
    while (N % i == 0):
        ex += 1
        N //= i
        
    cm.append([i, ex])
    
if len(cm) == 0:
    print(1)
    exit()
        
#print(cm)

su = [0] * 2000
s = 0
for i in range(1, 50+1):
    s += i
    su[s] = i
    
#print(su)

f = 0
for i in range(2000):
    if su[i] == 0:
        su[i] = f
    else:
        f = su[i]
        
#print(su)

count = 0
for i in cm:
    #print(i)
    #print(i[1])
    count += su[i[1]]

print(count)

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 = int(input())
b = factorization(a)
countation = 0
for i in range(len(b)):
    t = b[i][1]
    k = 1
    n = 1
    while t >= n:
        countation += 1
        k = k + 1
        n = k*(k+1)/2
print(countation)

Submission status: Wrong Answer

Solution code:

n = int(raw_input())
 
def f(c):
	stack = []   
	cumul = 0
	step = 1
	while(cumul < c):
		stack.append(step)
		cumul += step
		step += 1
	while(cumul != c):
		cumul -= stack.pop()
		cand = c - (stack[-1] if stack else 0)
		if cand > (stack[-1] if stack else 0):
			stack.append(cand)
			cumul += cand

	return len(stack)

d = 2
count = 0
on = n
while(n!= 1 and d ** 2 <= on):
	if n%d==0:
		c = 0
		while(n%d == 0): 
			c += 1
			n /= d
		count += f(c)
	d+=1 # break
if n != 1:
	print 1
else:
	print count

Submission status: Wrong Answer

Solution code:
###############################################################################
#Imports
import collections
import itertools
from functools import lru_cache
import sys
import math
###############################################################################
#Constants
MOD = int(1e9)+7
###############################################################################
#Helper


def helper():
	pass
###############################################################################
#Solver


def solve():
	n = int(input())
	if n == 1:
		print(0)
		return
	x = n
	count = 0
	for i in range(2, int(math.sqrt(n))+5):
		if x == 1:
			break
		if x % i == 0:
			x = x // i
			count += 1
	if x == n:
		print(count + 1)
		return
	print(count)


###############################################################################
#Driver
t = 1
for _ in range(t):
	solve()
###############################################################################

Submission status: Wrong Answer

Solution code:

import sys
from collections import defaultdict

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7
# ----------

def P(n):
    if n == 2:
        return 1
    rest = n
    s = {1}
    for i in range(1, n):
        if rest == 0:
            break
        if rest - i in s:

            s.add(rest)
            break
        else:
            s.add(i)
            rest -= i
    return len(s)

N = int(input())

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

e = defaultdict(int)
for i in range(2, int(N ** 0.5) + 1):
    while N % i == 0:
        e[i] += 1
        N //= i

if len(e) == 0:
    print(1)
    exit()

ans = 0
for k, v in e.items():
    ans += P(v)
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
a=0
T=factorization(N)
l=len(T)
for i in range(l):
    if T[i][1]<3:
        a+=1

    elif T[i][1]<6:
        a+=2
    elif T[i][1]<10:
        a+=3
    elif T[i][1]<15:
        a+=4
    elif T[i][1]<21:
        a+=5
    elif T[i][1]<28:
        a+=6
    elif T[i][1]<36:
        a+=7
    elif T[i][1]<45:
        a+=8
print(a)

Submission status: Wrong Answer

Solution code:
import numpy as np
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
#from scipy.sparse import csr_matrix
import itertools
import copy

n = int(input())

def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum


def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

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

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

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

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

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

    return arr

nums = factorization(n)

ans = 0
cnt = 0
tmp = {}
#print(nums)
for i in range(len(nums)):
    num = nums[i][1]

    for j in range(1,10*8):
        num -= j
        ans += 1
        if (num < j+1):
            if num>0:
                if len(tmp) == 0:
                    tmp[nums[i][0]] = num
                    tmp2 = copy.copy(tmp)
                else:
                    tmp = copy.copy(tmp2)
                    for a in tmp.values():
                        print(a)
                        if a > 0:
                            a -= 1
                            ans += 1
                            #print(tmp)
                            if num - 1 > 0:
                                tmp2[nums[i][0]] = num -1
            break

#print(tmp)

tmp = sorted(tmp.items(), key=lambda x:x[1])

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors
f = list(set(prime_factors(n)))
f = f+list(map(lambda x: x**2,f))+list(map(lambda x: x**3,f))
f.sort()
print(f)
ans = 0
for i in f:
    if n % i == 0:
        n = n//i
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
temp = n

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

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

if a==[]:
  a.append([n, 1])
#素因数分解リスト終了

count = 0
for i in range(len(a)):
  j = 1
  while a[i][1] >= j:
    a[i][1] -= j
    count += 1
    j += 1

print(count)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
count=0
for k in range(2,int(math.sqrt(N)+1)) :
  if N%k == 0:
    N=N/k
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
import numpy as np

def seachPrimeNum2(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    primeNum2 = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    for i in range(1,10):
      for j in primeNum:
        primeNum2.append(j**i)
    return primeNum2
def seachPrimeNum3(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    primeNum2 = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    for i in range(1,6):
      for j in primeNum:
        primeNum2.append(j**i)
    return primeNum2
def seachPrimeNum4(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    primeNum2 = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    for i in range(1,3):
      for j in primeNum:
        primeNum2.append(j**i)
    return primeNum2
P = seachPrimeNum2(100)
P += seachPrimeNum3(1000)
P = set(P+seachPrimeNum4(1000000))
N = int(input())
ans = 0
for p in P:
  if N%p == 0:
    ans += 1
    N = N//p
  if N == 1:
    print(ans)
    exit()
if ans == 0:
  print(1)
  exit()
print(ans+1)

Submission status: Wrong Answer

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

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

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

x = make_divisors(n)[1:]
if len(x)==1:
  print(n)
  exit()

cnt = 0
numbers = []
for a in x:
  if a == "": continue
  if a in numbers:
    if n%a==0: 
      n //= a
      cnt += 1
  if is_prime(a):
    n //= a
    b = 2
    cnt += 1
    while n%(a**b)==0:
      numbers.append(a**b)
      b += 1
print(cnt)

Submission status: Wrong Answer

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

if N % 2 == 0:
    div = 2
    ans +=1
    n = 1
    while N % div == 0:
      ans += 1
      N = N/div
      n += 1
      div = div**n
if N % 3 == 0:
  wide = int(N/3) + 1
elif N % 3 == 1:
  wide = int((N + 2)/3)
else:
  wide = int((N +1)/3)
for i in range(3,wide,2):
  if N % i == 0:
    div = i
    n = 1
    while N % div == 0:
      ans += 1
      N = N/div
      n += 1
      div = div**n
if ans == 0 and N != 0:
  print(1)
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
import itertools
n=int(input())
c=0
A=[]
for i in range(2,int(n**0.5+1)):
  if n%i==0:
    a=0
    while(n%i==0):
      n//=i
      a+=1
    A.append(a)
l=len(A)
i=1
while(sum(A)>=l and l>0):
  for j in itertools.combinations_with_replacement(range(l), i):
    for k in j:
      if A[k]<1:
        break
    else:
      for k in j:
        if A[k]==0:
          break
        else:
          A[k]-=1
      else:
        c+=1
  B=[]
  for a in A:
    if a!=0:
      B.append(a)
  A=B
  l=len(A)
  i+=1
print(1 if c!=1 and c==0 else c)

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
from math import sqrt


def solve(*args: str) -> str:
    n = int(args[0])

    ret = 0
    i = 2
    sqrt_n = -int(-sqrt(n))
    P = [True]*(2*sqrt_n+1)
    P[0] = False
    P[1] = False

    for i in range(2, 2*sqrt_n+1):
        if P[i]:
            for j in range(i+i, 2*sqrt_n+1, i):
                P[j] = False

    Q = []
    for p, is_prime in enumerate(P):
        if is_prime and n % p == 0:
            t = p
            while t <= n:
                Q.append(t)
                t *= p
    if not Q and 1 < n:
        Q.append(n)

    Q.sort()
    for q in Q:
        if n % q == 0:
            n //= q
            ret += 1

    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))