Problem:


Score : 400 points

Problem Statement

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

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

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

z divides N;

z is different from all integers chosen in previous operations.

Then, replace N with N/z.

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

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

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

Sample Input 1

24

Sample Output 1

3

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

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

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

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

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

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

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

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

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

Sample Input 4

1000000007

Sample Output 4

1

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

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

Sample Input 5

997764507000

Sample Output 5

7



Sample input:
24


Sample output:
3

Submission status: Wrong Answer

Solution code:
#nの素数判定
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

import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n = I()
ans = 0
if is_prime(n):
    ans = 1
elif n == 1:
    ans = 0
else:
    l = [i for i in range(2, 100000)]
    # d = collections.deque(l)
    for i in l:
        if n % i == 0:
            ans += 1
            n = n//i
        if n == 1:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
k=2
p=0
while k<=n:
  if n%k==0:
    n=n/k
    p=p+1
  k=k+1
print(p)

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    sys.setrecursionlimit(10**9)
    input = sys.stdin.readline

    N = int(input())

    if N == 1:
        print(0)
        return

    def get_prime(n):
        import math
        p = []
        if n % 2 == 0:
            p.append(2)

        sq = math.ceil(math.sqrt(n))
        i = 3
        while i <= sq:
            if n % i == 0:
                p.append(i)
                if i*i != n:
                    p.append(n//i)
            i += 2
        p.append(n)
        return p
    
    p = get_prime(N)

    def prime_factorization(n, p):
        from collections import Counter
        d = Counter()
        for i in p:
            while n % i == 0:
                d[i] += 1
                n //= i
        return d

    d = prime_factorization(N, p)

    ans = 0
    his = {}
    for i in d:
        tmp = 1
        for j in range(d[i]):
            tmp *= i
            if N % tmp == 0 and not tmp in his:
                ans += 1
                N //= tmp
                his[tmp] = 1
            else:
                break
            if N == 1:
                break
        if N == 1:
            break

    print(ans)

main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n=int(input())
d=defaultdict(int)

def factorization(m):
    temp = m
    f=True
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            f=False
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            d[i]=cnt

    return f
if n==1:
    print(0)
elif factorization(n):
    print(1)
else :
    count=0
    for key in d.keys():
        l=d[key]
        i=1
        while l>=i:
            l-=i
            i+=1
            count+=1
    print(count)

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict
N = int(input())
d = defaultdict(int)
for i in range(2,int(pow(N,0.5))+3):
    while N%i==0:
        N //= i
        d[i] += 1
if not d and N >= 2:
    d[N]+=1
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:
N = int(input())
S = 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
A = factorization(N)

if N > 1:
    for i in range (len(A)):
        T = A[i][1]
        while(T>0):
            T = T//2
            S += 1
    

print(S)

Submission status: Wrong Answer

Solution code:
plist = [2, 4, 8, 16, 32, 64, 128, 256, 3, 9, 27, 81, 243, 729, 5, 25, 125, 625, 3125, 7, 49, 343, 2401]

for i in range(11, 1000000, 2):
    j = 0
    flag = False
    while plist[j] <= i ** 0.5:
        if i % plist[j] == 0:
            flag = True
            break
        j += 1
    if flag == False:
        plist.append(i)
        plist.append(i**2)
        plist.append(i**3)
plist.sort()

n = int(input())
count = 0

for i in plist:
    if n % i == 0:
        n /= i
        count += 1

if n > 1000000:
    count += 1

print(count)

Submission status: Wrong Answer

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

#n = int(input())
#l = list(map(int, input().split()))

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''
def yakusuu(n):
    yakusuu_list = []
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            yakusuu_list.append(i)
            if i != n // i:
                yakusuu_list.append(n//i)
    return yakusuu_list

def eratos(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]]


cnt=0
def ok(z,l,n,cnt):
    for j in range(len(l)):
        #print(z,l[j])
        if z%l[j]==0:
            if n%z==0:
                n//=z
                cnt+=1
                #print(n,z,cnt)
                return n,cnt
    return n,cnt

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

n=int(input())
l=eratos(int(n**0.5)+1)
#print(l)
ll=yakusuu(n)
ll.sort()
#print(ll)

if prime(n):
    print(1)
    sys.exit()

for i in range(len(ll)):
    if n==1:
        break

    if ll[i]%2==0:
        #print(ll[i],n//ll[i])
        if n%ll[i]==0:
            #print(n//ll[i])
            cnt=cnt+1
            n//=ll[i]
            #print(n,cnt,ll[i])        
    else:
        #print(ll[i])
        n,cnt=ok(ll[i],l,n,cnt)
print(cnt)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# vim: set fileencoding=utf-8

# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation


"""Module docstring
"""

import functools
import heapq
import itertools
import logging
import math
import os
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict, deque
from copy import deepcopy
from io import BytesIO, IOBase
from itertools import compress
from typing import Dict, List, Optional, Set, Tuple


def count(prime_divisors: Dict[int, int]) -> int:
    result = 0
    for e in prime_divisors.values():
        result += int((math.sqrt(1 + 8 * e) - 1) / 2)
    return result


def primes(n):
    """ Returns  a list of primes < n for n > 2 """
    sieve = bytearray([True]) * (n // 2)
    for i in range(3, int(n ** 0.5) + 1, 2):
        LOG.debug((i))
        if sieve[i // 2]:
            sieve[i * i // 2 :: i] = bytearray((n - i * i - 1) // (2 * i) + 1)
    return [2, *compress(range(3, n, 2), sieve[1:])]


def solve(nb: int) -> int:
    if nb == 1:
        return 0
    prime_divisors = defaultdict(int)
    while not nb % 2:
        prime_divisors[2] += 1
        nb //= 2
    cur = nb
    for i in range(3, math.ceil(math.sqrt(nb + 1)) + 20, 2):
        if cur == 1:
            break
        while not cur % i:
            prime_divisors[i] += 1
            cur //= i
    LOG.debug((prime_divisors))
    if not prime_divisors:
        return 1
    return count(prime_divisors)


def do_job(stdin, stdout):
    "Do the work"
    LOG.debug("Start working")
    N = int(stdin.readline().strip())
    # values = []
    # for _ in range(N):
    #     values.append(stdin.readline().split())
    result = solve(N)
    print(result, file=stdout)


def print_output(testcase: int, result, stdout) -> None:
    "Formats and print result"
    if result is None:
        result = "IMPOSSIBLE"
    print("Case #{}: {}".format(testcase + 1, result), file=stdout)
    # 6 digits float precision {:.6f} (6 is the default value)
    # print("Case #{}: {:f}".format(testcase + 1, result), file=stdout)


BUFSIZE = 8192


class FastIO(IOBase):
    # pylint: disable=super-init-not-called, expression-not-assigned
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    # pylint: disable=super-init-not-called
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def configure_log() -> None:
    "Configure the log output"
    log_formatter = logging.Formatter("L%(lineno)d - " "%(message)s")
    handler = logging.StreamHandler(IOWrapper(sys.stderr))
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)


LOG = None
# for interactive call: do not add multiple times the handler
if not LOG:
    LOG = logging.getLogger("template")
    configure_log()


def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    stdin = IOWrapper(sys.stdin)
    stdout = IOWrapper(sys.stdout)
    do_job(stdin, stdout)
    stdout.flush()
    for h in LOG.handlers:
        h.flush()
    return 0


if __name__ == "__main__":
    sys.exit(main())

Submission status: Wrong Answer

Solution code:
def prime(p):
    memo = []
    for i in range(2,(int(p**0.5)+1)):
        jousu = 1
        while p%(i**jousu)==0:
            p //= i**jousu
            memo.append(i**jousu)
            jousu += 1
    if p == n:
        memo.append(p)
    return memo
 
n=int(input())
 
memo = prime(n)

if len(memo) == 0:
  print(0)
else: 
  print(len(memo))

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

comb = factorization(n)
lst = []
for i in comb:
    for j in range(i[1]):
        lst.append(i[0]**(j+1))

lst.sort()
ans = 0
for i in lst:
    if n == 1:
        break
    elif n > 1:
        if n%i == 0:
            n = n/i
            print("n is ", n)
            ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

def gen_list_n_removed(l, n):
    return [i for i in l if i != n]

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



N = int(input())

num_list = set()

hoge = seachPrimeNum(1000000)

for i in range(1, 30):
    for j in hoge:
        res = j ** i
        if res > 10 ** 12:
            break
        num_list.add(j ** i)

num_list = sorted(num_list)

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

count = 0
while True:
    for i in num_list:
        if N % i == 0:
            N = N / i
            count += 1
            num_list = gen_list_n_removed(num_list, i)
            break
        if i == num_list[-1]:
            print(count)
            exit(0)

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):
    for i in range(2, int((n**0.5//1))+10):
        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

fact_N = factorization(N)
#fact_N = np.array(fact_N)
#num_sosuu = fact_N[:,1]

num_sosuu = []
for row in fact_N:
    num_sosuu.append(row[1])

#num_sosuu_max = num_sosuu.max()
num_sosuu_max = max(num_sosuu)

ans = 0
for i in range(len(num_sosuu)):
    num_i = num_sosuu[i]
#    for j in range(np.uint64(np.sqrt(2*num_sosuu_max))):
    for j in range(int((2*num_sosuu_max)**0.5)):
        if num_i >= j+1:
            ans += 1
            num_i -= j+1
        else:
            break

print(str(int(ans)))

Submission status: Wrong Answer

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

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

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

    return arr

factorization(24) 

n = int(input())
P = factorization(n)

Q = []
for p in P:
    
    temp = 1
    while p[1] > 1:
        t = p[0] ** temp
        Q.append(t)
        p[1] -= temp
        temp += 1

print(len(Q))

Submission status: Wrong Answer

Solution code:
def create_divisors(n):
  """
  自然数nの全ての約数を列挙したリストを作成する。

  Parameters
  ----------
  n : int
    自然数

  Returns
  -------
    divisors：list

  """
  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 factorization(n):
    """
    引数の値を素因数分解したリストを返す

    Parameters
    ----------
    n : int
        素因数分解したい自然数

    Returns
    -------
    retlist : list
        2以上の整数n => [[素因数, 指数], ...]の2次元リスト
    """
    retlist = []
    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
            retlist.append([i, cnt])

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

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

    return retlist
def isPrime(x):
  """
  xが素数か否か判定する。

  Parameters
  ----------
  x: int
      自然数

  Returns
  -------
      True:素数
      False:素数ではない
  """
  if x<2:
    return False
  for i in range(2,int(x**0.5)+1):
    if x%i==0:
      return False
  return True

n=int(input())
d=factorization(n)
# print(d)
p=[]
for i in range(len(d)):
  if isPrime(d[i][0]):
    p.append(d[i]) 

w=[int(i)  for i in range(1,100001)]
from itertools import accumulate
from bisect import bisect_left
s=list(accumulate(w))
ans=0
for i in range(len(p)):
  idx=bisect_left(s,p[i][1])
  ans+=idx+1
  if i!=0 and p[i][1]-s[i-1]>0 and p[i][1]>1:
    ans-=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = N

import math

def func(N,n,cnt):
        for i in range(3, int(math.sqrt(N)) + 2, 2):
                m0 = i
                m = m0
                while n % m == 0:
                        n = n // m
                        m = m * m0
                        cnt +=1
        return (cnt)

cnt = 0

if n == 1:
        ans = 0
else:
        m0 = 2
        m  = m0
        while n % m == 0:
                n = n // m
                m = m * m0
                cnt += 1
        cnt = func(N,n,cnt)

if n!=1 and cnt == 0: #素数の場合 (平方根＋1までには割り切れる数がない)
        ans = 1
else:
        ans = cnt
        
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = set()
i = 2
while i * i <= n:
    if (n % i) == 0:
        now = i
        count = 1
        while n >= now:
            if n % now == 0:
                a.add(now)
                n //= now
            count += 1
            now = i ** count
    i += 1
if n != 1:
    a.add(n)
print(len(a))

Submission status: Wrong Answer

Solution code:
import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]

N = int(sys.stdin.readline().strip())

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

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

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

    return arr

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

e = factorization(N)
#print(e)

ans = 0
for p, q in e:
    c = 0
    j = 1
    while c+j <= q:
        c += j
        j += 1

    ans += (j-1)
    #print(j-1)

print(ans)

Submission status: Wrong Answer

Solution code:
import math


n = int(input())
cnt_list = [1,3,6,10,15,21,28,36]

def get_list(i):
    loop_cnt = min([int(math.sqrt(i)) + 10, i])
    ret_list = []
    j = 2
    cnt = 0
    while j <= loop_cnt:
        if i % j == 0:
            i /= j
            cnt += 1
        else:
            if cnt > 0:
                for k in range(8):
                    if cnt < cnt_list[k]:
                        break
                for _ in range(k):
                    ret_list.append(j)
                cnt = 0
            j += 1
    if i != 1:
        ret_list.append(i)
    return ret_list

print(len(get_list(n)))

Submission status: Wrong Answer

Solution code:
# 引用元
# https://note.nkmk.me/python-prime-factorization/

from collections import Counter
from itertools import combinations
import numpy as np

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 get_list(counter, index):
    ans = []
    for key, val in sorted(counter.items()):
        if val > index:
            ans += [key] * index
        else:
            ans += [key] * val
    return ans

def choice_min_data(counter, min_num):
    temp = sum(counter.values())
    temp_min_num = 10**12
    co_li = None
    for index in range(1, temp+1):
        flag = False
        to_comb_list = get_list(counter, index)
        for co in combinations(to_comb_list, index):
            check_val = np.prod(co)
            if temp_min_num > check_val > min_num:
                co_li = co
                temp_min_num = check_val
                flag = True
                break

        # 最小更新せず = 終了
        if temp_min_num != 10**12 and flag == False:
            break
    if temp_min_num == 10**12:
        return None, -1
    else:
        # print(co_li, temp_min_num)
        return counter - Counter(co_li), temp_min_num

def main():
    # ルール
    # 素数p, 整数e: z == p ** e
    # N / z = int(x)
    # zは被らない
    # N を N/zに置き換える
    N = int(input())

    if N <= 1:
        print(0)
        return

    counter = Counter(prime_factorize(N))
    # print(counter)
    ans = 0
    min_num = 0
    while counter is not None:
        counter, min_num = choice_min_data(counter, min_num)
        if min_num == -1:
            break
        ans += 1
    
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import collections

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


P = collections.Counter(prime_factorize(n))

def counter(n):
  if n==1:
    return 1
  
  counter = 0
  for i in range(1, n):
    if n-i<0:
      break
    else:
      n-=1
      counter+=1
      i+=1
  
  return counter

ans = 0

for p in P.values():
  ans += counter(p)
  
print(ans)

Submission status: Wrong Answer

Solution code:

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(int(input())))
c = prime_factorize(int(input()))
# print(c)
a,z = 0,0
for i in c:
    if z == i :
        z = 0
    else :
        z = i
        a += 1
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())


def Pf(n):
    k = n
    l = {}
    if n == 1:
        return 0
    else:
        i = 2
        tnp = 0
        while n > 1 and i < int(k**0.5)+1:
            if n % i == 0:
                tnp += 1
                n //= i
            else:
                l[i] = tnp
                tnp = 0
                i += 1
        l[i] = tnp
        return l


def f(x):  # 何個取り出せるか
    if x == 0:
        return 0
    elif 1 <= x <= 2:
        return 1
    elif 3 <= x <= 5:
        return 2
    elif 6 <= x <= 9:
        return 3
    elif 10 <= x <= 14:
        return 4
    elif 15 <= x <= 20:
        return 5
    elif 21 <= x <= 27:
        return 6
    elif 28 <= x <= 35:
        return 7
    else:
        return 8


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

info = Pf(n).values()
# print(Pf(n))
# print(info)
ans = 0
for i in info:
    ans += f(i)

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
i = 1
for i in range(2, int(N ** 0.5 + 1)):
    div, rem = divmod(N, i)
    if not rem:
        count += 1
        N = div
print(count + (N > i))

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


def is_prime(n):
    for d in range(2, math.floor(math.sqrt(n)) + 1):
        if n % d == 0:
            return False
    return True


N = int(input())
if N == 1:
    print(0)
elif is_prime(N):
    print(1)
else:
    res = 0
    for _, count in factorization(N):
        if count <= 2:
            res += 1
        else:
            i = 1
            while count > 0:
                count -= i
                res += 1
                i += 1
    print(res)

Submission status: Wrong Answer

Solution code:
def seachPrimeNum(N):
    max = int(N ** (1/2))
    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

a = seachPrimeNum(10 ** 6)
n=(int)(input())
ans = 0
if n < 2:
  print(ans)
else:
  ans = 0
  count = 0
  while(count < 1230):
    temp = 0
    while(n % a[count] == 0):
      n = n // a[count]
      temp += 1
    if temp >= 10:
      ans += 4
    elif temp >= 6:
      ans += 3
    elif temp >= 3:
      ans += 2
    elif temp >= 1:
      ans += 1
    
    count += 1
    temp = 0
    if n < 2:
      print(ans)
      break
  if count == 1230:
      print(1)

Submission status: Wrong Answer

Solution code:
import math
import collections
 
N = int(input())
prime_number = False
ans = 0
 
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    #リストが空ならそれは素数
    if not factor:
      global prime_number
      prime_number = True
      return
    else:
        factor.append(n)
        return factor

list_num = trial_division(N)
 
if prime_number:
  ans = 1
else:
  if 1 in list_num:
    prime_list = list_num[:-1]
    counter = collections.Counter(prime_list)
    for key,val in counter.items():
      temp = val
      for i in range(1,val+1):
        if temp-i > 0:
          temp -= i
          ans += 1
        elif temp-i == 0:
          temp -= i
          ans += 1
          break
        else:
          break
    
print(ans)

Submission status: Wrong Answer

Solution code:
import math
from sys import exit

n=int(input())
primes = {}
i = 2
ans = 0
square = math.floor(math.sqrt(n))

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

while True:
    if n % i == 0:
        if i not in primes.keys():
            primes[i] = 1
        else:
            primes[i] += 1
        n = n // i
    elif n == 1 or i <= square:
        break
    else:
        if i == 2:
            i += 1
        else:
            i += 2
        continue

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

for k,v in primes.items():
    base = v * 2
    root = math.floor(math.sqrt(base))
    if root * (root + 1) > base:
        root -= 1
    ans += root

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
num=[]
for i in range(2,int(N**.5)+1):
    if N%i==0:
        num.append(i)
        N/=i
print(1 if N>1 and len(num)==0 else len(num))

Submission status: Wrong Answer

Solution code:
import math
import sys
n=int(input())
ans=0
x=1
if n==1:
  print(0)
  sys.exit()
def waru(n,x):
  for i in range(x+1,int(math.sqrt(n))+1):
    if n%i==0:
      return int(n/i),i
  return 1,n

while(True):
  n_old=n
  n,x=waru(n,x)
  if n_old==n**2:
    ans-=1
  ans+=1
  if n==1:
    print(ans)
    sys.exit()

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
count = 0
flg = True

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

for i in range(2, math.ceil(math.sqrt(n)) + 1):

    if n % i == 0:
        n = n // i
        flg = False
        count += 1

if flg == True:
    print(1)
    exit()

print(count)

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
    tmp = []
    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:
                        k = k-1
                        ans += k
                        tmp.append([i,j-k/2*(2+(k-1))])
                        break
    if n == 1000000000000:
        print(9)
    else:
        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)
count = 0

#print(primes)
for z in primes:
    if z > n:
        break
    
    #ori_z = z
    e = 1
    ze = z**e
    while n % ze == 0:
        if not(ze in used):
            count += 1
            n //= ze
            used.add(ze)
        e += 1
        ze = z**e

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))+1):
        if n % i == 0:
            return False
    return True

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

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
def check_prime_number(number):
    check_range = int(math.sqrt(number))  # √n
    for i in range(2,check_range+1):  
        if number % i == 0:
            return False
    return True


if check_prime_number(N):
    if N != 1: #print("1")
        print(1)
    else:
        print(0)
else:
    myans = 0
    mycnt = 2
    while mycnt <= N:
        if N%mycnt == 0:
            N = N/mycnt
            #mycnt += 1
            myans += 1
    #print(N)
        mycnt += 1
    print(myans)