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 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():
    NN=N=ii()
    ans = 0
    for i in range(2, int((N+1)**0.5)+3):
        c = i
        while N%c == 0:
            N //= c
            c *= i
            ans += 1
        while N%i==0:
            N//=i
    if NN==N>1:
        ans += 1
    print(ans)





main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import copy
import collections

# 素因数分解の結果をlistで返す
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
    n = int(input())
    n_prime = prime_factorize(n)
    unique_n_prime = []
    unique_n_prime = [x for x in n_prime if x not in unique_n_prime and not unique_n_prime.append(x)]

    ans = 0
    ans += len(unique_n_prime)

    unique_c = collections.Counter(unique_n_prime)

    c = collections.Counter(n_prime)
    c = c - unique_c

    while len(c) > 0:
        c = c - unique_c
        ans += len(c)
        c = c - unique_c

    print(ans)



    # for i in range(len(n_prime)):
    #     if (not n_prime[0] in used) and n % n_prime[0] == 0:
    #         n /= n_prime[0]
    #         used.append(n_prime.pop(0))
    #         break
    


if __name__ == '__main__':
    main()

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

    from collections import deque
    tyofuku = []

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

    mult = 1
    for i in tyofuku:
        mult *= i

    for i in range(1, mult + 1):
        if i not in target and mult % i == 0:
            target.add(i)

    print(len(target))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def get_sieve_of_eratosthenes_new(n):
    import math
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

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 get_count(beki) :
    count = 0
    for i in range(1,beki+1) :
        tmp = beki - i
        if (0 <= tmp) :
            count += 1
            beki = tmp
        else :
            return count
    
    return 1

def main() :
    N = int(input())
    count = 0

    factorized = factorization(N)
    # print(factorized)
    for fact in factorized :
        fact_c = fact[1]
        count += get_count(fact_c)


    # primes = get_sieve_of_eratosthenes_new(N)
    # for prime in primes :
    #     if (N < prime) :
    #         # 判定する素数よりもNが小さければ今後割り切れることはない
    #         break
        
    #     beki = 1
    #     while (True) :
    #         z = prime
    #         if (beki > 1) :
    #             z = pow(prime,beki)
    #         if (N % z == 0) :
    #             count += 1
    #             N = N // z
    #             beki += 1
    #             if (N < prime) :
                    
    #                 break
    #         else :
    #             # わりきれなくなったら終了
    #             break

    print(count)
main()

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
def factorization(num):
    factor = []
    flag = True
    is_Prime= True
    while num > 1 and flag:
        flag = False
        for i in range(int(math.sqrt(num))+2):
            k = i + 2
            if num % k == 0:
                factor.append(k)
                num = int(num / k)
                is_Prime = False
                flag = True
                break
    if is_Prime:
        factor.append(num)
    return factor
a = factorization(n)
from collections import Counter
co = Counter(a)
result = 0
for k, num in co.items():
    c = 0
    for i in range(1, num+1):
        c += i
        result += 1
        if c > num:
            result -= 1
            break
print(result)

Submission status: Wrong Answer

Solution code:
import heapq
import math

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

def is_perfect_power(n):
    size = int(math.log2(n) + 1)
    for b in range(2, size):
        a = int(math.pow(n, 1 / b))
        if a ** b == n or (a+1) ** b == n: return True
    return False

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

#約数を列挙する
ans = 0
for i in range(1,int(n**0.5)+1):
    if n%i==0 and (is_perfect_power(i) or isprime(i)):
        n//=i
        ans+=1
if ans==0:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
import math
from collections import defaultdict

res = 0
value = defaultdict(int)
def isprime(n):
    if n <= 1:
        return 0
    m = int(math.sqrt(n)) + 1
    for i in range(2, m):
        if n % i == 0:
            return 0
    return 1
if isprime(x):
    print(1)
else:
    def bprime(n):
        cnt = 2
        m =int(math.sqrt(n)) + 1
        while n != 1 and cnt < m:
            while n % cnt == 0:
                n //= cnt
                value[cnt] += 1
            cnt += 1
    def cal(n):
        if n <= 2:
            return 1
        j = 1
        cnt = 0
        while n >= j:
            n -= j
            j += 1
            cnt += 1
        return cnt
    bprime(x)
    for key in value.keys():
        res += cal(value[key])
    print(res)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
sqrt = int(math.sqrt(n))
numbers = []
used = [False] * (sqrt + 1)
for i in range(2, sqrt + 1):
    if used[i]:continue
    if n % i == 0:
        j = 1
        while i ** j <= sqrt:
            if used[i ** j]:continue
            numbers.append(i ** j)
            used[i ** j] = True
            j += 1

numbers.sort()
numbers.append(n)
ans = 0
for i in numbers:
    if i <= 1:
        break
    if n % i == 0:
        n /= i
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

##### 割り算の切り上げ #####
# tmp = -(-4 // 3)

##### dict の for文 #####
# for k, v in d.items():
#     print(k, v)

##### 進数の変換 #####
# bin_str = bin(i)[2:]
# oct_str = oct(i)[2:]
# hex_str = hex(i)[2:]

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N = inputInt()

	tmp = factorize(N)
	#print(tmp)
	ans = 0

	for i,val in enumerate(tmp):
		sosuu,kai = val

		if kai <= 2:
			ans += 1
			continue

		to = 0
		for j in range(1,kai):
			ans += 1
			to += j
			to += j
			if to > kai:
				break


	print(ans)

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# 2分検索のリバース
def bisect_left_reverse(a, x):
    if a[0] <= x:
        return 0
    if x < a[-1]:
        return len(a)
    # 二分探索
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] <= x:
            ok = mid
        else:
            ng = mid
    return ok

def bisect_right_reverse(a, x):
    if a[0] < x:
        return 0
    if x <= a[-1]:
        return len(a)
    # 二分探索
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] < x:
            ok = mid
        else:
            ng = mid
    return ok

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# 2分検索
# 存在しない場合: None 存在する場合: その値
def binary_search(list, item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if guess == item:
            return mid
        if guess > item:
            high = mid -1
        else:
            low = mid + 1
    return None

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# N 個のボールを K グループに分ける場合のパターン数
def sunuke(N, K, mod=10**9+7):
	if N < K or K-1 < 0:
		return 0
	else:
		return combination(N-1, K-1, mod)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# dfs のサンプル
def dfs(graph,parent,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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]:
    if n % i ==0:
      sosu_flag =False
      
    sosu.append(i)
    
if n == 1:
  print(0)
  sys.exit()

if sosu_flag:
  print(1)
  sys.exit()
  
count = 0
for v in sosu:
  j = 1
  while (n % (v**j) == 0) and n != 1:
    n //= (v**j)
    count += 1
    j += 1
    
  if n == 1:
    break

if org_n == 1:
  count = 0
    
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

factorization(N)

Submission status: Wrong Answer

Solution code:
N = int(input())  # 10**12
if N == 1:
    print(0)
    exit()
sqrt_N = int(10 ** 6 + 10)
ans = 0
for i in range(2, sqrt_N):
    if i > sqrt_N:
        break
    if i > N:
        break
    if N % i == 0:
        ans += 1
        N //= i
if ans == 0:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
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])
z = []
for i in arr:
    for j in range(1,i[1]+1):
        z.append(i[0]**j)
z = sorted(set(z))
c = 0
for i in z:
    if n%i == 0:
        c += 1
        n = int(n/i)
if n == 1:
    c = 0
print(c)

Submission status: Wrong Answer

Solution code:
import copy
from collections import defaultdict
N = int(input())
tmp = copy.copy(N)
d = defaultdict(int)
if N == 1:
    print(0)
    exit()
for i in range(2,int(N**0.5)+3):
    while N%i==0:
        N //= i
        d[i] += 1
if N%tmp==0:
    print(1)
    exit()
ans = 0
for i in d.values():
    tmp = 1
    while i - tmp >= 0:
        i -= tmp
        tmp += 1
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ar =  set()

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()
while N != 1:
    for i in range(2,N+1):
        if N%i == 0 and not i in ar:
            ar.add(i)
            break
    N = N//i
print(len(ar))

Submission status: Wrong Answer

Solution code:
N = int(input())

pf={}
m=N
ans = 0
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
    sum = 1
    k = 1
    while pf.get(i,0)>=sum:
      k = k + 1
      sum = sum + k
    ans = ans+k-1
    #print(ans)
if m>1:
  pf[m]=1
  ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
# nの約数列挙
def divisor(n):
    ass = []
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            ass.append(i)
            if i ** 2 == n:
                continue
            ass.append(n // i)
    ass.append(n)
    return ass  # sortされていない


N = int(input())
if N == 1:
    print(0)
    exit()
orig = N
num = sorted(divisor(N))
count = 0
for i in num:
    if N % i == 0:
        N = N // i
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
def prime_factorization(n):
  d = 2
  cnt = 0
  seen = []
  while d*d <= n:
    if n%d == 0:
      t = 1
      while d**t <= n:
        flg = True
        tmpn = n
        for _ in range(t):
          if tmpn%d==0:
            tmpn //= d
          else:
            flg = False
            break
        if flg and d**t not in seen:
          seen.append(d**t)
          cnt += 1
          n = tmpn
          t += 1
        else:
          break
    d += 1
 
  if n != 1 and n not in seen:
    cnt += 1
 
  return cnt
 
n = int(input())
print(prime_factorization(n))

Submission status: Wrong Answer

Solution code:
a = int(input())

m = list()
cnt = 0
c = a
j = 0
while c > 1: 
  b = int(c**(1/2))
  for i in range(2,b+1):
    if c % i == 0 and i not in m:
      cnt += 1
      c = c // i
      m.append(i)
      break
      
  if i == b:
    if c not in m:
      cnt += 1
    c = c // c
    
if cnt == 0 and a != 1:
  cnt = 1
print(cnt)

Submission status: Wrong Answer

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

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

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

    return arr

n = int(input())
ans = []
l = fact(n)
for i in l:
    a = i[0]
    b = i[1]
    up = 1
    if b > 2:
        for i in range(1,b+1):
            if up <= b:
                ans.append(a**i)
                up += i
            else:
                break
    else:
        ans.append(a)
        
ans = sorted(ans)
cnt = 0
for i in ans:
    if n == 1:
        break
    else:
        n //= i
        if n == 0:
            n * i
        else:
            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

a = int(input())

fact = factorization(a)

count = 0

for tup in fact:
    countTup = 0
    while True:
        countTup += 1
        if tup[1] < countTup:
            break
        tup[1] -= countTup
    count += countTup - 1

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())


def prime_factorize_n(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


a_list = prime_factorize_n(n)
# print(a_list)

tmp = 1
used_list = []
for i in range(len(a_list)):
    if a_list[i] not in used_list:
        used_list.append(a_list[i])

    else:
        tmp *= a_list[i]
        if tmp not in a_list:
            used_list.append(tmp)
            tmp = 1

# print(used_list)
print(len(used_list))

Submission status: Wrong Answer

Solution code:
m = 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(m)
b = len(a)
c = b

for j in range(b):
    d = a[j][1]
    if (d >= 3) and (d <= 5):
        c = c + 1
    elif (d >= 6) and (d <= 9):
        c = c + 2
    elif (d >= 10) and (d <= 14):
        c = c + 3
    elif (d >= 15) and (d <= 20):
        c = c + 4
    elif (d >= 21) and (d <= 27):
        c = c + 5
    elif (d >= 28) and (d <= 35):
        c = c + 6
    elif (d >= 36) and (d <= 44):
        c = c + 7
    elif (d >= 45) and (d <= 54):
        c = c + 8
    elif (d >= 55) and (d <= 65):
        c = c + 9

print(c)

Submission status: Wrong Answer

Solution code:
import collections

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


n = int(input())

itm = collections.Counter(prime_factorize(n))

# print(itm)

ans = 0

for i in itm.keys():
    num = 1
    while True:
        if itm[i] - num < 0:
            break
        else:
            ans+=1
            itm[i] -= num
            num += 1

# print(itm)

counter = 0

for i in itm.keys():
    if itm[i] != 0:
        counter += 1

if counter != 1:
    ans += 1 
        
    
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
count=0
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]
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
  
for i in make_divisors(n):
  if int(n)!=n or n==1:
    break
  if n%i==0 and len(factorization(i))==1:
    n=n/i
    count+=1
print(count-1)

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 n>math.sqrt(N):
    ans+=1
    
if ans==0:
    print(1)
else:
    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())
ans = 0
array = factorization(n)
#print(array)

array2 = [row[1] for row in array]

for i in array2:
    ans += math.floor(math.sqrt(2*i+9/4)-1/2)
    #print(math.floor(math.sqrt(2*i+9/4)-1/2))

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
aaa = 2
maxi = 2
def prime(aaa):
    if n != 1:
        i = 2
        while i*i <= aaa:
            if aaa % i == 0:
                return False
            i += 1
        return True
    else:
        return False
def divisors(a, i):
    global ans, aaa, maxi
    while i*i <= n:
        if a % i == 0:
            ans += 1
            num = a / i
            aaa = num
            if maxi <= i:
                maxi = i
            divisors(num, i+1)
            break
        i += 1
def divisors2(a, i):
    global ans
    while i <= a:
        if a >= 10**6:
            break
        elif a % i == 0:
            ans += 1
            num = a / i
            divisors2(num, i+1)
            break
        i += 1
if n == 1:
    print(0)
else:
    if prime(n):
        print(1)
    else:
        divisors(n, 2)
        divisors2(aaa, maxi + 1)
        print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
 
pn=[2];A=30000
for L in range(3,A):
    chk=True
    for L2 in pn:
        if L%L2 == 0:chk=False
    if chk==True:pn.append(L)
        
A246655 = []
for p in pn:
    pe = p
    while pe < A:
        A246655.append(pe)
        pe *= p
A246655 = sorted(A246655)
 
c=0
for i in range(len(A246655)):
    if N%A246655[i]==0:
        N = N//A246655[i]
        c+=1
print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = int(N ** (1/2) + 1)
ans = 0
nums = [N]
for i in range(2, n + 1):
  if N % i == 0:
    ans += 1
    print(i)
    nums.append(N/i)
    N /= i
for num in sorted(nums):
  if N % num == 0:
    ans += 1
    N /= i
  
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if n == 1:
  print(0)
  exit(0)
  
pows = []
upto = int(math.sqrt(n))
for i in range(2, upto+1):
  if n % i == 0:
    x = n//i
    cc = 0
    while n % i == 0:
      n //= i
      cc += 1
    pows.append(cc)
    
    if x == 1:
      continue
    
    cc = 0
    i = x
    while n % i == 0:
      n //= i
      cc += 1
    pows.append(cc)

    
if len(pows) == 0:
  print(1)
  exit(0)
  
ans = 0
for pp in pows:
  start = 1
  cc = 0
  while pp - start >= 0:
    cc += 1
    pp -= start
    start += 1
    
  ans += cc

print(ans)

Submission status: Wrong Answer

Solution code:
import math
import decimal
import numpy as np
N = decimal.Decimal(input())
count = 0
mem = {}
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

        if p not in mem:
            mem[p] = []
        e = 1
        while True:
            if p**e > N:
                break
            elif e not in mem[p] and np.mod(N, p**e) == 0:
                mem[p].append(e)
                z = p**e
                N = N / decimal.Decimal(z)
                N = N.quantize(decimal.Decimal('1'), rounding=decimal.ROUND_FLOOR)
                count += 1
                
            if N % p != 0:
                break

            e += 1
    print(count)