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:
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())
x = factorization(n)
x.sort(key=lambda x: x[-1])
a = [0]
b = 0
for i in range(3,9):
    b += i
    a.append(b)
ans = 0
c = 1
for i in range(len(x)):
    if x[i][1] >= a[c]:
        c += 1
    ans += c
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
p=2

while p<=10**6 and n!=1:
  dv=0
  wa=1
  num=1
  while n%p==0:
    n/=p
    n=int(n)
    dv+=1
  if dv>0:
    while dv>=wa:
      num+=1
      wa+=num
    num-=1
    ans+=num
  p+=1
  
if n!=1:
  print("1")
  exit()
  
print(str(ans))

Submission status: Wrong Answer

Solution code:
def factorize(n):
    b = 2
    fct = []
    while b * b <= n**1/2:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
n = int(input())
fact = factorize(n)
m = []
c = 0
z = 1
for f in fact:
  z *= f
  if z in m:
    continue
  else:
    n /= z
    m.append(z)
    c += 1
    z = 1
    if n ==1:
      break
print(c)

Submission status: Wrong Answer

Solution code:
import math


N = int(input())


def isprime(n):
    if n == 1:
        return False
    if n % 2 == 0 and n > 2:
        return False
    for i in range(3, int(math.sqrt(n)) + 1, 2):
        if n % i == 0:
            return False
    return True


z = 2
count = 0

used = set([])

if isprime(N):
    z = N

while True:
    if z not in used:
        if N % z == 0:
            p = z
            e = 1
            while N % (p ** e) == 0:
                zd = p ** e
                N //= zd
                used.add(zd)
                count += 1
                e += 1
    z += 1
    if N < z:
        break

print(count)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
H = N
count = 0
coun = 0
flag = False
lis = list()
for i in range(2,int(math.sqrt(N))+1):
  if N % i == 0:
    flag = True
    break
for i in range(2,int(math.sqrt(N))+1):
  if N%i == 0:
    count = 0
    while N%i == 0:
      N = N//i
      count += 1
    lis.append(count)
M = len(lis)
for i in range(M):
  su = 1
  for j in range(lis[i]):
    if lis[i] - su >= 0:
      lis[i] -= su
      su += 1
      coun += 1
if flag == True or H == 1:
  print(coun)
else:
  print(1)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
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

L = factorization(n)
#print(L)
ans = 0
#print(len(L))
for i in range(len(L)):
    b = L[i][1]
    s = 0
    for j in range(1,b+1):
        s += j
        if s == b:
            ans += j
            break
        elif s > b:
            ans += j-1
if n == 1:
    ans = 0
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:
def soinsu(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())
a=soinsu(n)
print(a)
c=[]
if n>=2:
    for i in range(max(a)):
        c.append(0)
for i in a:
    c[i-1]+=1
print(c)
z=0
for i in c:
    d=1
    e=1
    while e<=i:
        z+=1
        d+=1
        e=d*(d+1)/2
print(z)

Submission status: Wrong Answer

Solution code:
def f(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())
ct=0
ct2=0
ct3=1
a=f(n)
for i in range(len(a)):
    c=a[i][1]
    while 1:
        ct2+=ct3
        if ct2>=c:
            ct+=ct3
            break
        ct3+=1
if len(a)>1:
    ct-=1
if n==1:
    ct=0
print(ct)

Submission status: Wrong Answer

Solution code:
from collections import deque
N = int(input())
# 以下の条件を全て満たすzを選ぶ
# ある素数pと正の整数eを用いてz=p**eと表すことができる
# Nがzで割り切れる
# 以前の操作で使ったものは使えない

# これを、N=N/zで繰り返し行い、何回行えるかを出力する

used_nums = deque([1])


def prime_numbers(n):
    if n < 2:
        return []

    m = (n + 1) // 2
    p = [True] * m
    for i in range(1, int((n ** 0.5 - 1) / 2) + 1):
        if p[i]:
            for j in range(2 * i * (i + 1), m, 2 * i + 1):
                p[j] = False
    # 素数のみ返す
    a = [2 * i + 1 for i in range(m) if p[i]]
    a[0] = 2
    return a


P = set(prime_numbers(10**6))
# これが素数
P = [n for n in P if (N % n) == 0]
# Nを割り切れるもののみのこす
# print(P)
ans = 0
for num in P:
    start_x = 1
    while True:
        if N % num != 0:
            break
        if N <= num**start_x:
            break
        if N % (num**start_x) == 0:
            N = N / (num**start_x)
            ans += 1
            used_nums.append(num**start_x)
        start_x += 1
# print(N)
# print(used_nums)
if N not in used_nums:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt, ceil

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
search_list = list(range(2, int(sqrt(N))+1))
if N > 1:
    search_list.append(N)

for i in search_list:
    if N%i == 0:
        fact = factorization(i)
        if len(fact) == 1:
            N = N // i
            if N >= 1:
                ans += 1
            else:
                break

print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
def factorization(n):
    arr=[]
    temp=n
    for i in range(2,int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp//=i
            arr.append([i,cnt])
    if temp!=1:
        arr.append([temp,1])
    if arr==[]:
        arr.append([n,1])
    return arr
ww=factorization(a)
ans=0
if a==1:
    ans=0
else:
    for j in range(len(ww)):
        if 2>=ww[j][1]>=1:
            ans+=1
        if 5>=ww[j][1]>=3:
            ans+=2
        if 9>=ww[j][1]>=6:
            ans+=3 
        if 14>=ww[j][1]>=10:
            ans+=4
        if 20>=ww[j][1]>=15:
            ans+=5
        if 27>=ww[j][1]>=21:
            ans+=6

print(ans)

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 and n != 1:
        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 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)

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

Submission status: Wrong Answer

Solution code:
def factorize(n):
    b = 2
    fct = []
    while b * b <= n**1/2:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
n = int(input())
fact = factorize(n)
m = []
c = 0
z = 1
print(fact)
for f in fact:
  z *= f
  if z in m:
    continue
  else:
    n /= z
    m.append(z)
    c += 1
    z = 1
    if n ==1:
      break
print(c)

Submission status: Wrong Answer

Solution code:
#デフォルト
import itertools
from collections import defaultdict
import collections
from decimal import *
import math
import sys
sys.setrecursionlimit(200000)
mod = 1000000007

n = int(input())

def 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

MAX = 100010
is_prime = [True] * MAX
is_prime[0] = False
is_prime[1] = False
for i in range(2, MAX):
    if is_prime[i]:
        j = i * 2
        while j < MAX:
            is_prime[j] = True
            j += i
tf = {}
if (Prime(n)):
    print("1")
else:
    ans = 0
    for i in range(2, 100010):
        if is_prime[i]:
            if n % (i) == 0:
                ans += 1
                n = n // (i)

        if n == 1:
            break

    print(ans)

Submission status: Wrong Answer

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

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

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

    return arr

listA=factorization(N) 
nagasa=len(listA)
nn=0
kk=1
count=0
while nn<nagasa:
  while kk*(kk+1)/2 <=listA[nn][1]:
    count=count+1
    kk=kk+1
  kk=1
  nn=nn+1

print(count)

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, int(math.sqrt(n)) + 1):
    if n % i == 0:
        n = int(n / i)
        flg = False
        count += 1
    if n == 1:
        break

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

print(count)

Submission status: Wrong Answer

Solution code:

n = int(raw_input())
 
def f(c):

	cumul = 0
	step = 1
	cc = 0
	while(cumul < c):
		cc +=1
		cumul += step
		step += 1
	if cumul > c: cc -=1
	return cc

d = 2
count = 0
on = n


for d in range(2, int(n ** 0.5) + 2):
	if n%d==0:
		c = 0
		while(n%d == 0): 
			c += 1
			n /= d
		count += f(c)
	if n == 1:
		break
if n != 1:
	print 1
else:
	print count

Submission status: Wrong Answer

Solution code:
N = int(input())

pn=[2];A=10000
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())

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



fac = factorization(n)
ans = 0
if n == 1:
    print(0)
else:
    for i in fac:
        tem = 1
        while tem*(tem+1)/2 < i[1]:
            tem += 1
        ans += tem

    print(ans)

Submission status: Wrong Answer

Solution code:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def primeFactors(n):
    facs = defaultdict(int)
    # Print the number of two's that divide n
    while n % 2 == 0:
        facs[2]+=1
        n = n / 2

    # n must be odd at this point
    # so a skip of 2 ( i = i + 2) can be used
    for i in range(3, int(sqrt(n)) + 1, 2):

        # while i divides n , print i ad divide n
        while n % i == 0:
            facs[i]+=1
            n = n / i

            # Condition if n is a prime
    # number greater than 2
    if n > 2:
        facs[n]+=1

    return facs

n = INT()

factors = primeFactors(n)

canBe = []

for el in factors:
    for po in range(1, 60):
        if(factors[el]<=0):
            break
        canBe.append(int(el**po))
        factors[el]-=1


canBe.sort()
i = 0
ans = 0

while (True):
    if (i >= len(canBe) or canBe[i] > n):
        break

    n /= canBe[i]
    ans += 1
    i += 1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
i = 1
ch = n
while i*i <= ch:
    i += 1
    if n%i == 0:
        count += 1
        n /= i
if ch == 1:
    print(0)
elif count == 0:
    print(1)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
import sys

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

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prl = lambda x: print(*x ,sep='\n')

a = [i*(i+1) for i in range(60)]
n = ni()
l = factorization(n)
res = 0
for i in range(len(l)):
    j =  l[i][1]
    if l[i][0] == 1:
        continue
    for k,k_ in enumerate(a):
        if j < k_:
            res += k
            break
print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())
primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes = list(primes)

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
divisors = lower_divisors + upper_divisors[::-1]

candidates = set(primes) & set(divisors)
c_list = list(candidates)
for c in c_list:
  temp = c**2
  while temp < n:
    c_list.append(temp)
    temp = temp*c
c_list.sort()
count = 0
for c in c_list:
  if n%c == 0:
    count += 1
    n = n//c
  
  
print(count)

Submission status: Wrong Answer

Solution code:
import math
data = input()
target = int(data)

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

list = primes(1000000)
result =[]
for i in list:
    check = target
    k = 0
    while True:
        if check % i != 0:
            break
        else:
            check = check/i
            k +=1
    result.append(k)

ans = 0
for j in result:
    y = 0
    z = j
    while z > y:
        y += 1
        z -= y
        ans +=1
if ans == 0 and target != 1:
    ans =1        
print(ans)

Submission status: Wrong Answer

Solution code:
import math
def c(x):
    global yaku
    now=x
    for i in range(2,int(math.sqrt(now))+1):
        while now%i==0:
            if i in sosu.keys():
                v=sosu[i]
                sosu[i]=v+1
            else:
                sosu[i]=1
            now=now//i
            yaku+=1
def d(x):
    global ans
    q=x
    cur=1
    while(q>0):
        q=q-cur
        if q>=0:
            ans+=1
        cur+=1
    
n=int(input())
sosu={}
yaku=1
c(n)
if n==1:
    print(0)
else:
    if(yaku==1):
        print(1)
    else:
        ans=0
        #print(sosu)
        for i in sosu.keys():
            d(sosu[i])
        print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *
#import numpy as np
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
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=II()


ans = factorization(N)

cnt = 0

for an in ans:
    if an[0] != 1:
        k = an[1]
        i = 1

        if k == 1:
            cnt += 1
        if k == 2:
            cnt += 1
        if k == 3:
            cnt += 2
        if k == 4:
            cnt += 1
        if k == 6:
            cnt += 3
        if k == 10:
            cnt += 4
        if k == 15:
            cnt += 5
        if k == 21:
            cnt += 6
        if k == 28:
            cnt += 7
        if k == 36:
            cnt += 8


print(cnt)

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

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

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
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 == 1:
                cnt += 1
            break

print(ans+cnt//2)

Submission status: Wrong Answer

Solution code:
N = int(input())

def primef(n):
  i = 2
  p_nums = []
  while i * i <= n:
    j = i
    while n % j == 0:
      if n % j == 0 :
        n /= j
        p_nums.append(j)
      j *= j
    i += 1
  if n > 1 and int(n) not in p_nums:
    p_nums.append(int(n))
  return len(p_nums)

ans = primef(N)

print(ans)

Submission status: Wrong Answer

Solution code:
def fast_power(base, power):
    result = 1
    while power > 0:
        # If power is even
        if power % 2 == 0:
            # Divide the power by 2
            power = power // 2
            # Multiply base to itself
            base = base * base
        else:
            # Decrement the power by 1 and make it even
            power = power - 1
            # Take care of the extra value that we took out
            # We will store it directly in result
            result = result * base

            # Now power is even, so we can follow our previous procedure
            power = power // 2
            base = base * base

    return result
dicts = {}
n = int(input())
ans = 0 
base = 2
power = 1 
import math
checkprime = 0
root = int(math.sqrt(n)) + 2
for i in range(2, root):
    if n % i == 0 :
        checkprime = 1 
        base = i 
        break 
if n == 1 :
    print(0)
elif n == 2:
    print(1)
elif n == 3:
    print(2)
elif n == 4:
    print(1)
elif n == 5:
    print(1)
elif checkprime == 0 :
    print(1)
else:
    while n != 1:
        firsttime =0 
        while base:
            if firsttime == 0 :
                firsttime = 1 
                if n % base != 0 :
                    break
            div = fast_power(base, power)
            if div > n :
                break
            if div in dicts:
                power += 1 
                continue
            if n % div == 0 :
                ans += 1 
                n  = n // div 
                power += 1 
        
        base += 1 
        power = 1

    print(ans)

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 N == 1:
  ans = 0
elif 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:
from collections import deque
N = int(input())
# 以下の条件を全て満たすzを選ぶ
# ある素数pと正の整数eを用いてz=p**eと表すことができる
# Nがzで割り切れる
# 以前の操作で使ったものは使えない

# これを、N=N/zで繰り返し行い、何回行えるかを出力する

used_nums = deque([1])


def prime_numbers(n):
    if n < 2:
        return []

    m = (n + 1) // 2
    p = [True] * m
    for i in range(1, int((n ** 0.5 - 1) / 2) + 1):
        if p[i]:
            for j in range(2 * i * (i + 1), m, 2 * i + 1):
                p[j] = False
    # 素数のみ返す
    a = [2 * i + 1 for i in range(m) if p[i]]
    a[0] = 2
    return a


P = set(prime_numbers(10**6))
# これが素数
P = [n for n in P if (N % n) == 0]
# Nを割り切れるもののみのこす
# print(P)
ans = 0
if N == 1:
    print(ans)
else:
    for num in P:
        start_x = 1
        while True:
            if N % num != 0:
                break
            if N <= num**start_x:
                break
            if N % (num**start_x) == 0:
                N = N / (num**start_x)
                ans += 1
                used_nums.append(num**start_x)
            start_x += 1
    # print(N)
    # print(used_nums)
    if N not in used_nums:
        ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
H = N
count = 0
coun = 0
flag = False
lis = list()
for i in range(2,int(math.sqrt(N))+1):
  if N % i == 0:
    flag = True
    break
for i in range(2,int(math.sqrt(N))+1):
  if N%i == 0:
    count = 0
    while N%i == 0:
      N = N//i
      count += 1
    lis.append(count)
M = len(lis)
for i in range(M):
  su = 1
  for j in range(lis[i]):
    if lis[i] - su >= 0:
      lis[i] -= su
      su += 1
      coun += 1
if flag == True or H == 1:
  print(coun)
else:
  print(N)

Submission status: Wrong Answer

Solution code:
import math
import collections

n = int(input())
s = 0
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


l = collections.Counter(prime_factorize(n))
l2 = list(dict.values(l))
for i in range(len(l2)):
    s += int((math.sqrt(1 + 9 * l2[i])-1)/2)

print(s)

Submission status: Wrong Answer

Solution code:
def check_sosu(n):
    if n < 2:
        return 0
    j = 2
    while j * j <= n:
        if n % j == 0:
            return 0
        j += 1
    return 1


sosu = [1 for _ in range(10**6+5)]
sosu[0] = 0
sosu[1] = 0
for i in range(2, len(sosu)):
    if sosu[i]:
        j = i+i
        while j < len(sosu):
            sosu[j] = 0
            j += i

z_list = [0 for _ in range(10**6+5)]
for i in range(2, len(sosu)):
    if sosu[i]:
        j = i
        while j < len(sosu):
            z_list[j] = 1
            j *= i

# print(z_list[:20])

n = int(input())
o_n = n
cnt = 0
for i in range(len(z_list)):
    if z_list[i]:
        if n % i == 0:
            cnt += 1
            n //= i

if n >= 10**6+5:
    i = 2
    tmp = 1
    while i*i <= n:
        if n % i == 0:
            k = n//i
            tmp = check_sosu(k)
            break
        i += 1
    cnt += tmp

# if cnt == 0:
#     i = 2
#     cnt = 1
#     if o_n == 1:
#         cnt = 0
#     while i*i <= o_n:
#         if o_n % i == 0:
#             cnt = 0
#             break
#         i += 1

print(cnt)

Submission status: Wrong Answer

Solution code:

import collections
from collections import defaultdict

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
count = 0
n = int(input())
d = defaultdict(int)
ans = prime_factorize(n)
for i in ans:
    d[i] += 1
for i in d.values():
        if i < 3:
            count +=1
        elif i < 6:
            count +=2
        elif i < 10:
            count +=3
        elif i < 15:
            count +=4
        elif i < 21:
            count +=5
        else:
            count +=6
print(count)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
n = N
ans = 0
for i in range(2, int(np.sqrt(10**12))+10):
  if N < i:
    break
  if N % i == 0:
    N = N // i
    ans += 1

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

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict


N = int(input())
n = N
#素因数分解
factor = defaultdict(lambda: 0)
tmp = int(math.sqrt(N))+1
for num in range(2,tmp):
    while N % num == 0:
        N //= num
        factor[num] += 1
if not factor:
    factor[N] += 1


ans = 0
for num in factor:
    i = 1
    while True:
        factor[num] -= i
        if factor[num]<0:
            break
        ans += 1
        i+=1

print(ans)

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

def main():
    c = prime_factorize(N)
    if c == []:
        print(0)
        return
    else:
        coll = collections.Counter(c).values()
        ans = 0
        for i in coll:
            tmp = 0
            while i > 0:
                ans += 1
                tmp += 1
                i -= tmp
        print(ans)
        return

if __name__ == "__main__":
    main()