Problem:


Score : 400 points

Problem Statement

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

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

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

z divides N;

z is different from all integers chosen in previous operations.

Then, replace N with N/z.

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

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

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

Sample Input 1

24

Sample Output 1

3

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

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

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

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

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

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

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

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

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

Sample Input 4

1000000007

Sample Output 4

1

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

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

Sample Input 5

997764507000

Sample Output 5

7



Sample input:
24


Sample output:
3

Submission status: Wrong Answer

Solution code:
N = int(input())

import math


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

                while n % m0 == 0:
                        n = n // m0

        return (cnt)

cnt = 0

if N == 1:
        ans = 0
else:
        cnt = func(N, cnt)

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

Submission status: Wrong Answer

Solution code:
from itertools import product


def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table


def f(aa):
    ans = 1
    for a in aa:
        ans *= a
    return aa, ans


N = int(input())
pd = prime_decomposition(N)

cnt = 2
ans = 0


while pd:
    n = len(pd)
    arr = [
        [pd[i] for i, j in zip(range(n), mask) if j]
        for mask in product((0, 1), repeat=n)
    ][1:]
    narr = map(f, arr)

    tar = list(filter(lambda x: x[1] >= cnt, sorted(narr, key=lambda x: x[1])))

    if tar:
        cnt = tar[0][1] + 1
        ans += 1
        for e in tar[0][0]:
            pd.remove(e)
    else:
        break
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, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr == []:
        arr.append([n, 1])

    return arr

n = int(input())
n_list = factorization(n)
ans = 0
for i in range(len(n_list)):
    a = n_list[i][1]
    b = True
    cnt = 0
    cnt2= 1
    while b:
        a = a-cnt2
        cnt += 1
        if a < cnt+1:
            b = False
    ans += cnt
    
if n == 1:
  print(0)
print(ans)
print(n_list)

Submission status: Wrong Answer

Solution code:
N = int(input())

import math

def sieve_of_eratosthenes(n):
    candidate = [i for i in range(2, n+1)]
    prime = []
    limit = math.sqrt(n) + 1

    while True:
        p = min(candidate)
        if limit <= p:
            prime.extend(candidate)
            break
        prime.append(p)

        candidate = [i for i in candidate if i % p != 0]

    return prime


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

rn = math.ceil(math.sqrt(N))
L = sieve_of_eratosthenes(rn)

n = N
c = 0
used = []

for l in L:
    if n % l == 0:
        i = 1
        l2 = l
        while n % l2 == 0:
            c += 1
            i += 1
            used.append(l2)
            n = n // l2
            l2 = l ** i

if c == 0:
    print(1)
else:
    if n != 1:
        # x = sieve_of_eratosthenes(n)
        if n not in used:
            c += 1
    print(c)

Submission status: Wrong Answer

Solution code:
n=int(input())

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
if n==1:
    print(0)
    exit(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)

n = len(a)

arr1=[1,2]
arr2=[3,4,5]
arr3=[6,7,8,9]
arr4=[10,11,12,13]
arr5=[14,15,16,17,18]
arr6=[19,20,21,22,23,24]
arr7=[25,26,27,28,29,30,31]
arr8=[32,33,34,35,36,37,38,39]


cnt =0
for i in range(n):
    if a[i][1] in arr1:
        cnt+=1
    elif a[i][1] in arr2:
        cnt+=2
    elif a[i][1] in arr3:
        cnt+=3
    elif a[i][1] in arr4:
        cnt+=4
    elif a[i][1] in arr5:
        cnt+=5
    elif a[i][1] in arr6:
        cnt+=6
    elif a[i][1] in arr7:
        cnt+=7
    

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 pop(stack):
	return stack[0],stack[1:]

def push(stack,x):
	stack.append(x)
	s = set(stack)
	p = list(s)
	p.sort()
	return p

n = int(input())
#a = sympy.factorint(n)
a = factorization(n)
stack = []
temp = []
#print(a)
for i in a:
	stack.append(i[0])
	temp.append(i[0])

ans = 0
while 1 < n:
	v, stack = pop(stack)
	for i in temp:
		stack = push(stack,i*v)
	if n%v == 0:
		ans += 1
		n = n//v
		#print(n,v)
		if n <= v: break
	else:
		continue
print(ans)

Submission status: Wrong Answer

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

def pf(n):
	ret = False
	while n % 2 ==0:
		n //= 2
		ret = True
	f = 3
	while f * f <= n:
		if n %f == 0:
			if ret == True:
				ret = False
				break
			n //= f
			ret = True
		else:
			f += 2
	if n != 1:
		if ret == True:
			ret = False
		else:
			ret = True
	return ret

i = 2
while N > 1:
	if pf(i):
		if N % i == 0:
			ans += 1
			N //= i
	i += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math

n = int(input())

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

#prime = get_primenumber(n)
yaku = make_divisors(n)
#print(yaku)
ans = 0
for i in range(1,len(yaku)):

    t = math.sqrt(yaku[i])
    #print(yaku[i])
    if not is_prime(yaku[i]) and not t.is_integer():
        i=i+1
        continue
    n = n/yaku[i] 
    #print(n)
    ans+=1
    if n==1 or not n.is_integer():
        print(ans)
        sys.exit()

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
z = 1
Nz = N
c = 0
rN = math.sqrt(N)
while Nz > z:
  z = z+1
  if Nz % z == 0:
    Nz = Nz / z
    c = c+1
  if c == 0 and z > rN:
    c = 1
    break
print(c)

Submission status: Wrong Answer

Solution code:
# from math import factorial,sqrt,ceil #,gcd
# from itertools import permutations,combinations,combinations_with_replacement
# from collections import deque,Counter
# from bisect import bisect_left
from heapq import heapify,heappush,heappop
# from numba import njit
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from fractions import gcd

# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np    # numpy.lcm()
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb,perm #permはnPk
# import networkx as nx
# G = Graph()

# slist = "abcdefghijklmnopqrstuvwxyz"
N = int(input())

def primes(n):
    primes = []
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            primes.append(i) 
    return primes

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

ans = 0
Zque = primes(N)
Zset = set(Zque)
if len(Zque) == 0:
    print(1)
    exit()

Z = heappop(Zque)
while N >= Z:
    # print(N,Z)
    if N%Z == 0:
        ans += 1
        N = N//Z
    i = Z
    num = Z
    j = 2
    while num <= N:
        # print("num=",num,"N=",N,"j=",j)
        if not num in Zset:
            heappush(Zque,num)
            Zset.add(num)
        num = i**j
        j += 1
    if len(Zque)!=0:
        Z = heappop(Zque)
    else:
        break

print(ans)
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(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
    elif T[i][1]<55:
        a+=9
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
 
def primes(x):
   is_prime = [True] * (x+1)
   is_prime[0] = False
   is_prime[1] = False
   for i in range(2, int(x**0.5)+1):
      if not is_prime[i]:
         continue
      for j in range(i*2, x+1, i):
         is_prime[j] = False
   return [i for i in range(x+1) if is_prime[i]]
 
pl = primes(int(n**0.5)+1)
 
def factorization(x):
   arr = []
   tmp = x
   while x > 1:
      for i in pl:
         if x % i == 0:
            x /= i
            arr.append(i)
            break
      if x == tmp and len(arr) == 0:
         return [x]
   return arr
 
l = factorization(n)
used = [1]
cnt = 0
while len(l) > 0:
   y = 1
   while y in used:
      if len(l) == 0:
         break
      y *= l.pop(0)
   used.append(y)
   cnt += 1
if len(used) != len(set(used)):
   cnt -= 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
def sample_code():
    n = N
    
    #print('# 素因数')
    fct = factorize(n)
    print(fct)
    count=0
    count2=0
    for i in range(len(fct)):
        if fct[i]== 1:
            count+=0
        else:
            count+=fct[i][1]//2
            count2+=1
    if N==1:
        print("0")
    #elif len(fct)+count==0:
        #print("1")
    else:
        print(len(fct)+count)
    #print('# 約数')
    #for div in divisorize(fct):
        #print(div, num(div))


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]


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


def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a
if __name__ == '__main__':
    sample_code()

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
sum=1
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 and N%target==0:
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:

import sys
from copy import deepcopy
from collections import deque
from math import floor
from math import ceil
from itertools import combinations
from functools import reduce
from operator import mul
from itertools import chain

def main():
    n = int(input())
    on = n
    def is_prime(n):
        for i in range(2, n + 1):
            if i * i > n:
                break
            if n % i == 0:
                return False
        return n != 1
    if is_prime(n):
        print(1)
        sys.exit()

    nn = ceil(n**0.5)
    nn = max(6, nn)
    p = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(nn + 1)]
    p[0] = p[1] = False
    p[2] = p[3] = p[5] = True
    for i1 in range(3, floor(nn ** 0.5) + 1, 2):
        if p[i1]:
            for i2 in range(i1 ** 2, nn + 1, i1):
                p[i2] = False
        else:
            continue
    pl = [i for i, b in enumerate(p) if b == True]

    nums = deepcopy(pl)
    for pe in pl:
        cnt = 2
        while True:
            tnum = pow(pe, cnt)
            if tnum > n:
                break
            elif tnum != 0:
                if n % tnum == 0:
                    nums.append(tnum)
            cnt += 1

    nums.sort()
    numsd = deque(nums)
    ok = set()
    r = 0
    while True:
        if not numsd:
            break
        if n == 1:
            break
        nextn = numsd.popleft()
        if nextn > on or nextn > n:
            break
        elif n % nextn == 0:
            if nextn in ok:
                continue
            else:
                n = int(n // nextn)
                ok.add(nextn)
                r += 1
        if n == 1:
            break


    print(r)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list()
if n==1:
  print(0)
else:
  if n%2==0:
    l.append(2)
  if n%3==0:
    l.append(3)
  i=5
  while(i*i<=n):
    if n%i==0:
      l.append(i)
    elif n%(i+2)==0:
      l.append(i+2)
    i+=6
l.append(n)
k=0
for i in l:
  while(n%i==0 and n>0):
    n=n//i
    i=i*i
    k+=1
print(k)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
primelist=[2]
if N > 1000:
    num = int(math.sqrt(N))+1
else:
    num = int(N/2)+1
for i in range(3,num,2):
    if N % i == 0:
        for j in primelist:
            if i % j == 0:
                break
        else:
            primelist.append(i)
# print(primelist)
count = 0
for j in primelist:    
    i = j
    while N % i == 0:
        N = N / i
        i *= j
        count += 1
if count == 0 and N != 1:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

import math


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

                while n % m0 == 0:
                        n = n // m

        return (cnt)

cnt = 0

if N == 1:
        ans = 0
else:
        cnt = func(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())

dividables = []
count = 0

wasdivided = False

primelist = [2]
for x in range(2, N):
    for pr in primelist:
        if x%pr==0:
            wasdivided = True
        else:
            pass
    if wasdivided == False:
        primelist.append(x)
    else:
        wasdivided = False


#print(primelist)

def devidee():
    global N, count
    count += 1
    for prime in primelist:
        if N%prime == 0:
            N = (N / prime)
            dividables.append(prime)
            break
        else:
            continue

while N > 1:
    devidee()

print(len(dividables))

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
        if cnt == m:
            value[n] += 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:
# -*- coding: utf-8 -*-
import math

N = int(input())

z = 2
z_end = math.floor( math.sqrt(N) )
if ( z_end < z ):
  z_end = z

count = 0
#print(N, z, z_end)

while ( N > 1 ):
  for i in range(z, z_end+1):
    
    if( N % i == 0 ):
      N = int( N/i )
      z = i+1
      z_end = math.floor( math.sqrt(N) )
      if ( z_end < z ):
        z_end = z
      count += 1
      #print("N/i",N,i)
      break
    
    elif ( i == z_end ):
      #print("N/N",1,N)
      N = 1
      count += 1
      break
    
  if ( z>N ):
    N = 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:
        if n % (d**t) == 0:
          seen.append(d**t)
          n //= (d**t)
          cnt += 1
          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:
def get_primenumber(N):
    #素数リスト
    prime_list = [2]
    #3からNまでの数字を一つずつ取り出す
    for num in range(3,N+1,2):
      #取り出した数字が素数リストの要素で割れなければ素数リストに追加する
      if all( num % prime != 0 for prime in prime_list):
        prime_list.append(num)

    return prime_list
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]
so_li = get_primenumber(100)

n = int(input())
y_l = make_divisors(n)
y = y_l.pop(0)


used = []
for i in range(0, len(y_l)):
  if(n%y_l[i]==0):
    if(y_l[i] not in used):
      n = n/y_l[i]
    used.append(y_l[i])   
print(len(used))

Submission status: Wrong Answer

Solution code:
n = int(input())
import math
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
if is_prime(n):
    print("1")
    
else:
    used = []
    ans = 0
    for i in range(2,int(math.sqrt(n)) + 1):
        if is_prime(i):
            if n%i ==0:
                n = n/i
                for j in range(i,50):
                    used.append(i**j)
                ans += 1    
        elif i in used:
            if n%i ==0:
                n = n/i
                ans += 1
        
        if i > n:
            break
    print(ans)

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:
                #print(tmp)
                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())
current_num = 2
count = 0

import math
S=int(math.sqrt(N))
list1=[N]
def p_judge1(num) :
  q=int(math.sqrt(num))-1
  if num==1 :
    return False
  for i in range(2,q) :
    if num%i==0 :
      return False
  return True
while (S >= current_num):
  if N%current_num==0 and p_judge1(current_num):

    N=int(N/current_num)
    if N!=current_num :
      list1.append(N)
    count+=1
  current_num += 1


def p_judge(num) :
  q=int(math.sqrt(num))
  if num==1 :
    return False
  for i in range(2,q) :
    if num%i==0 :
      return False
  return True
list1=reversed(list1)
for item in list1 :
  if p_judge(item) and N%item==0 :
    N=int(N/item)
    count+=1

print(count)

Submission status: Wrong Answer

Solution code:
from math import sqrt

n = int(input())
div = []
for i in range(2, int(sqrt(n))+1):
    if n % i == 0:
        div.append(i)

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

prime = {}
for i in div:
    while n % i == 0:
        n /= i
        if i not in prime:
            prime[i] = 1
        else:
            prime[i] += 1
    
ans = 0
for i, num in enumerate(prime):
    ans += int( (-1+sqrt(1+8*prime[num])) / 2 )
   
    
print(ans)

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
a = prime_factorize(n)
b = list(set(a))
total = 0
for j in range(len(b)):
    c  = len([i for i, x in enumerate(a) if x == list(set(a))[j]])
    y = 1
    while c>0:
        c -= y
        y += 1
        if c>=0:
            total +=1

Submission status: Wrong Answer

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

factorization(24) 

import sys
N=int(input())
if(N==1):
  print(0)
  sys.exit()
div = make_divisors(N)
div.remove(1)
for k in div:
  jud=factorization(k) 
  if(len(jud)!=1):
    div.remove(k)
ans=0
for i in div:
  if(N%i==0):
    N=N/i
    ans+=1
  if(N==1):
    print(ans)
    sys.exit()
print(ans)

Submission status: Wrong Answer

Solution code:
pn=[2];A=50000
for L in range(3,A):
    chk=True
    for L2 in pn:
        if L%L2 == 0:chk=False
    if chk==True:pn.append(L)
      
ln=[]
for i in range(len(pn)):
  for j in range(8):
    ln.append(pn[i]**j)
mn=sorted(list(set(ln)))

n=int(input())

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

count=0
for k in range(1,len(mn)):
  if n%mn[k]==0:
    n=n//mn[k]
    count+=1
    if n==1:
      break
if count==0:
  print(1)
  exit()
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())


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

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

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

    return arr

ans = 0
flg=True
reg = factorization(N)
for b, a in reg:
    if a==b==1:
        print(0)
        flg=False
        break
    elif a<3:
        ans+=1
    elif a<6:
        ans+=2
    elif a<10:
        ans+=3
    elif a<15:
        ans+=4
    elif a<21:
        ans+=5
    elif a<28:
        ans+=6
if flg:
    print(ans)
        

# print(reg)

Submission status: Wrong Answer

Solution code:

N = int(input())

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

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

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] * 1000
s = 0
for i in range(1, 40+1):
    s += i
    su[s] = i
    
#print(su)

f = 0
for i in range(1000):
    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:
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
if count==0 and N!=1:
  print(1)
else:
  print(count)

Submission status: Wrong Answer

Solution code:
from collections import Counter
from itertools import combinations
import numpy as np

# 引用元
# https://note.nkmk.me/python-prime-factorization/
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.append(key)
    return ans

def choice_min_data(counter, min_num):
    temp = sum(counter.values())
    temp_min_num = 10**12
    co_index = None
    for index in range(1, temp+1):
        flag = False
        exp_list = get_list(counter, index)
        # print(exp_list)
        if not exp_list:
            break
        for ex in exp_list:
            ex_2 = ex ** index
            if temp_min_num > ex_2 > min_num:
                co_index = [ex, index]
                temp_min_num = ex_2
                flag = True
                break

        # 最小を新たに更新せず = 終了
        if co_index is not None and flag == False:
            break

    if co_index is None:
        return None, -1
    else:
        # print(co_index, temp_min_num)
        counter[co_index[0]] -= co_index[1]
        return counter, 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:

N = int(input())

def furui(n):
    if n < 2:
        return []
    plist = [1 for i in range(n)]
    plist[0] = plist[1] = 0
    for i in range(2, n):
        if plist[i]:
            for j in range(i*2, n, i):
                plist[j] = 0
    ret = []
    for i in range(n):
        if plist[i] != 0:
            ret.append(i)
    return ret


primes = furui(1000000)
count = 0

if N == 1:
    print(0)
else:
    for p in primes:
        used = set([])
        e = 1
        z = p ** e
        while N >= z:
            if e not in used and N % z == 0:
                N //= z
                count += 1
                used.add(e)
                e = 1
                # print(z, N)
            else:
                e += 1
            z = p ** e
    if count:
        print(count)
    else:
        print(1)  # prime

Submission status: Wrong Answer

Solution code:
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") # 無限
# 参考URL
# https://qiita.com/LorseKudos/items/9eb560494862c8b4eb56
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

input_n = int(input())

divisor_list = make_divisors(input_n)
divisor_list.remove(1)

count = 0

# print(divisor_list)
if 0 < len(divisor_list):
    for divisor in divisor_list[:]:
        # print("n:{} div:{}".format(n,divisor))
        if input_n%divisor==0:
            count += 1
            input_n /= divisor
print(count)