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:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z
        A.append(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while 2*f <= n:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)

            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f

    #残ったnが以前に選んだもので割り切れないとき
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z

        A.append(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n+1:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)
            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f

    #残ったnが以前に選んだもので割り切れないとき
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z

        A.append(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= N:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)
            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f

    #残ったnが以前に選んだもので割り切れないとき
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z

        A.append(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)
            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f

    #残ったnが以前に選んだもので割り切れないとき
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z
        print(n,z)
        A.append(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)
            print(n,z,f)
            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f
    print(list(A))
    #残ったnが以前に選んだもので割り切れないとき
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = set()
    #2の倍数で割っていく
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z
        
        A.add(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%z == 0:
            cnt += 1
            n //= z
            A.add(z)
        
            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f

    #残ったnが素数かつ以前に選んでいないとき
    if n != 1 and not(n in A):
        A.add(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = set()
    #2の倍数で割っていく
    z = 2
    while n%2==0 and (n>=z):
        cnt += 1
        n //= z

        A.add(z)
        #割るたびに2倍
        z *= 2
    #割る始めの数をfとして保持
    f = 3
    z = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%z == 0:
            cnt += 1
            n //= z
            A.add(z)
            
            #割るたびにf倍
            z = z*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            z = f

    #残ったnが素数かつ以前に選んでいないとき
    if n != 1 and not(n in A):
        A.add(z)
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def Prime_factorize(n):
    cnt = 0
    #2の倍数で割っていく
    two_div = 2
    while n%2==0 and (n>=two_div):
        cnt += 1
        n //= two_div
        #割るたびに2倍
        two_div *= 2
    #割る始めの数をfとして保持
    f = 3
    f_div = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%f_div == 0:
            cnt += 1
            n //= f_div
            #割るたびにf倍
            f_div = f_div*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            f_div = f
    #残ったnが素数かつ以前に選んでいないとき
    if n != 1 and (n ==f_div):
        cnt += 1
    #素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def Prime_factorize(n):
    cnt = 0
    #2の倍数で割っていく
    two_div = 2
    while n%2==0 and (n>=two_div):
        cnt += 1
        n //= two_div
        #割るたびに2倍
        two_div *= 2
    #割る始めの数をfとして保持
    f = 3
    f_div = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%f_div == 0:
            cnt += 1
            n //= f_div
            #割るたびにf倍
            f_div = f_div*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            f_div = f
    #残ったnが素数かつ以前に選んでいないとき
    if n != 1 and (n ==f_div+2):
        cnt += 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def Prime_factorize(n):
    cnt = 0
    #2の倍数で割っていく
    two_div = 2
    while n%2==0 and (n>=two_div):
        cnt += 1
        n //= two_div
        #割るたびに2倍
        print(two_div,n)
        two_div *= 2
    #割る始めの数をfとして保持
    f = 3
    f_div = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%f_div == 0:
            cnt += 1
            n //= f_div
            print(f_div,n)
            #割るたびにf倍
            f_div = f_div*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            f_div = f
    #残ったnが素数かつ以前に選んでいないとき
    if n != 1 and (n ==f_div+2):
        cnt += 1
        print(n)
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def Prime_factorize(n):
    cnt = 0
    #2の倍数で割っていく
    two_div = 2
    while n%2==0 and (n>=two_div):
        cnt += 1
        n //= two_div
        #割るたびに2倍
        two_div *= 2
    #割る始めの数をfとして保持
    f = 3
    f_div = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%f_div == 0:
            cnt += 1
            n //= f_div
            #割るたびにf倍
            f_div = f_div*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            f_div = f
    #残ったnが素数のとき
    if n != 1:
        cnt += 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def Prime_factorize(n):
    cnt = 0
    #2の倍数で割っていく
    two_div = 2
    while n%2==0 and (n>=two_div):
        cnt += 1
        n //= two_div
        #割るたびに2倍
        two_div *= 2
    #割る始めの数をfとして保持
    print(n)
    f = 3
    f_div = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%f_div == 0:
            cnt += 1
            n //= f_div
            #割るたびにf倍
            f_div = f_div*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            f_div = f
    #残ったnが素数のとき
    if n != 1:
        cnt += 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def Prime_factorize(n):
    cnt = 0
    #2の倍数で割っていく
    two_div = 2
    while n%2==0:
        cnt += 1
        n //= two_div
        #割るたびに2倍
        two_div *= 2
    #割る始めの数をfとして保持
    f = 3
    f_div = 3
    #sqrt(n)以内に全ての素因数は含まれる
    while f*f <= n:
        if n%f_div == 0:
            cnt += 1
            n //= f_div
            #割るたびにf倍
            f_div = f_div*f
        #fで割り切れなかったら(f+2)してf_divもリセット
        else:
            f += 2
            f_div = f
    #nが素数のとき
    if cnt == 0:
        cnt = 1
    return cnt
ans = Prime_factorize(N)
print(ans)

Submission status: Wrong Answer

Solution code:
def divisors(n):
   d=[]
   for i in range(1,int(n**0.5)+1):
       if n%i==0:
           d.append(i)
           if i!=n//i:
               d.append(n//i)
   d.sort()
   return d
n=int(input())
a=divisors(n)
count=-1
for i in a:
    if n%i==0:
        n=n//i
        count+=1
    else:
        continue
print(count)

Submission status: Wrong Answer

Solution code:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


N = int(input())
div_list = make_divisors(N)
# print(div_list)
ans = 0
for div in div_list:
    if div == 1 or N % div != 0:
        continue
    if N == 1:
        break
    ans += 1
    N //= div
print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

M = 10 ** 6

ans = 0
check = [True for _ in range(M + 1)]

for p in range(2, M + 1):
    if check[p] == True:
        for j in range(2, M // p + 1):
            check[p * j] = False

        e = 1
        while N % (p ** e) == 0:
            N = N // (p ** e)
            e += 1
            ans += 1

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

M = int(math.sqrt(N))

ans = 0
check = [True for _ in range(M + 1)]

for p in range(2, M + 1):
    if check[p] == True:
        for j in range(2, M // p + 1):
            check[p * j] = False

        e = 1
        while N % (p ** e) == 0:
            N = N // (p ** e)
            e += 1
            ans += 1

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

M = int(math.sqrt(N))

ans = 0
check = [True for _ in range(M + 1)]

for p in range(2, M + 1):
    if check[p] == True:
        for j in range(2, M // p + 1):
            check[p * j] = False

        e = 1
        while N % (p ** e) == 0:
            print(N, end=' ')
            print(p ** e)
            N = N // (p ** e)
            e += 1
            ans += 1

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

M = int(math.sqrt(N))

ans = 0
check = [True for _ in range(M + 1)]

for p in range(2, M + 1):
    if check[p] == True:
        for j in range(2, M // p + 1):
            check[p * j] = False

        e = 1
        while N % (p ** e) == 0:
            N //= (p ** e)
            e += 1
            ans += 1

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

def p_num(m):
  ret = 0
  for j in range(1,10**12):
    ret += j
    if ret <= m < ret+(j+1):
      ans = j
      break
  return ans

p = factorization(N)

cnt = 0
for k in range(len(p)):
  cnt += p_num(p[k][1])
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
max_D = int(2 + math.sqrt(N))
count = []
for i in range(2, max_D):
   if N % i == 0:
      count.append(0)
      while N % i == 0:
         N = N // i
         count[-1] += 1
         if N < i:
            break
l = len(count)
ans = 0
for i in range(l):
   E = 2*count[i]
   j = 0
   while j * (j + 1) <= E:
      j += 1
   ans += j - 1
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

#素因数分解
def prime_factorize(n):
    if n == 1:
        return [1]
    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 = inp()
c = Counter(prime_factorize(n))
res = 0
# print(c)
for v in c.values():
    cnt = 0
    for now in range(1,150000):
        cnt += now
        if cnt > v:
            res += now-1
            break
print(res)

Submission status: Wrong Answer

Solution code:
from collections import Counter
import math
N = int(input())
Nso = []
Nruto = math.sqrt(N)
Nruto = math.floor(Nruto)
for i in range(2, Nruto+1):
    while N % i == 0:
        N = N//i
        Nso.append(i)
    if N == 1:
        break
    Nruto = math.sqrt(N)
    Nruto = math.floor(Nruto)
Nso.append(N)
if 1 in Nso:
    Nso.remove(1)
Nso = Counter(Nso)
ans = 0
for v in Nso.values():
    kouho = math.ceil(math.sqrt(v))
    for i in range(kouho, 0, -1):
        if (1+i)*i <= 2*v:
            ans += i
            break
print(ans)

Submission status: Wrong Answer

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

l = make_divisors(n)
cnt = 0
for i in l[1:]:
    if n%i != 0: continue
    n //= i
    cnt += 1
print(cnt)

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

n=int(input())
if n==1:
    print(1)
    sys.exit()
l=factorization(n)
ans =0
for x in l:
    a=x[0] #素数
    b=x[1] #素数の個数
    k=0
    t=0
    while(True):
        t += 1
        k += t
        if k==b:
            ans += t
            break
        elif k > b:
            ans += t-1
            break
print(ans)

Submission status: Wrong Answer

Solution code:
import math
import sys
n=int(input())
m=int(math.sqrt(n))+1
q=n
l=[]
for i in range(2,m+1):
    num=0
    if q%i==0:
        while(q%i==0):
            num +=1
            q //= i
    l.append([i,num])
    if i==m:
        if n%i!=0:
            print(1)
            sys.exit()
    if q==1:
        break
ans =0
for x in l:
    a=x[0] #素数
    b=x[1] #素数の個数
    k=0
    t=0
    while(True):
        t += 1
        k += t
        if k==b:
            ans += t
            break
        elif k > b:
            ans += t-1
            break

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
n1 = n
pn = []
cnt = 2
ans = 0
while cnt <= int(n ** 0.5):
    while n1 % cnt == 0:
        n1 = n1 // cnt
        pn.append(cnt)
    cnt += 1
pns = list(set(pn))
ansa = []
for i in pns:
    ansa.append(pn.count(i))
for i in ansa:
    x = 1
    while i > 0:
        i -= x
        if i < 0:
            break
        x += 1
        ans += 1
print(1 if ans == 0 and n != 1 else ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
n1 = n
cnt = 2
ans = 0
while cnt <= int(n ** 0.5):
    cnt1 = 1
    while n1 % cnt ** cnt1 == 0:
        n1 = n1 // cnt ** cnt1
        cnt1 += 1
        ans += 1
    cnt += 1
print(1 if n != 1 and ans == 0 else ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
n1 = n
cnt = 2
ans = 0
while cnt <= int(n ** 0.5):
    cnt1 = 1
    while n1 % cnt ** cnt1 == 0:
        n1 = n1 // cnt ** cnt1
        cnt1 += 1
        ans += 1
    cnt += 1
print(max(ans, 1))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3


def main():
    from collections import deque

    def prime_factorization_list(n: int):
        """
        入力された整数nを素因数分解し，素因数が列挙されたリストで返却
        Parameters
        ----------
        n : int
            素因数分解したい整数
        Returns
        -------
        prime_factorization_lst : lst
            [素因数]の形で素因数が列挙された素因数分解結果
        """
        fct = []  # prime factor
        b = 2     # base factor
        while b * b <= n:
            while n % b == 0:
                n //= b
                fct.append(b)
            b += 1
        if n > 1:
            fct.append(n)
        return fct

    N = int(input())

    q = deque(prime_factorization_list(N))
    memo = []
    while q:
        p = q.popleft()
        res = p
        while res in memo and q:
            can = q.popleft()
            if can == p:
                res *= can
            else:
                memo.append(res)
                res = can
                break
        if res not in memo:
            memo.append(res)
    print(len(memo))
    # print(memo)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3


def main():
    from collections import deque

    def prime_factorization_list(n: int):
        """
        入力された整数nを素因数分解し，素因数が列挙されたリストで返却
        Parameters
        ----------
        n : int
            素因数分解したい整数
        Returns
        -------
        prime_factorization_lst : lst
            [素因数]の形で素因数が列挙された素因数分解結果
        """
        fct = []  # prime factor
        b = 2     # base factor
        while b * b <= n:
            while n % b == 0:
                n //= b
                fct.append(b)
            b += 1
        if n > 1:
            fct.append(n)
        return fct

    N = int(input())

    q = deque(prime_factorization_list(N))
    memo = []
    ans = 0
    while q:
        res = q.popleft()
        while res in memo and q:
            res *= q.popleft()
        ans += 0 if res in memo else 1
        memo.append(res)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3


def main():
    from collections import deque

    def prime_factorization_list(n: int):
        """
        入力された整数nを素因数分解し，素因数が列挙されたリストで返却
        Parameters
        ----------
        n : int
            素因数分解したい整数
        Returns
        -------
        prime_factorization_lst : lst
            [素因数]の形で素因数が列挙された素因数分解結果
        """
        fct = []  # prime factor
        b = 2     # base factor
        while b * b <= n:
            while n % b == 0:
                n //= b
                fct.append(b)
            b += 1
        if n > 1:
            fct.append(n)
        return fct

    N = int(input())

    q = deque(prime_factorization_list(N))
    memo = []
    ans = 0
    while q:
        res = q.popleft()
        while res in memo:
            if q:
                res *= q.popleft()
            else:
                ans -= 1
                break
        memo.append(res)
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
ans,n = 0,N
for i in range(2,int(math.sqrt(N))+1):
  ii=i
  while n%ii==0:
    ans+=1
    n//=ii
    ii*=i
  while n%i==0:
    n//=i
  if i>n:
    break
if N!=1:
  ans=max(ans,1)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
ans,n = 0,N
for i in range(2,int(math.sqrt(N))+1):
  ii=i
  while n%ii==0:
    ans+=1
    n//=ii
    ii*=i
  while n%i==0:
    n//=i
if N!=1:
  ans=max(ans,1)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
ans,n = 0,N
for i in range(2,int(math.sqrt(N))+1):
  ii=i
  while n%ii==0:
    ans+=1
    n//=ii
    ii*=i
  while n%i==0:
    n=n//i
  if i>n:
    break
if N!=1:
  ans=max(ans,1)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
ans,n = 0,N
for i in range(2,int(math.sqrt(N))+1):
  ii=i
  if n%ii==0:
    ans+=1
    n=n//ii
    ii*=i
  if i>n:
    break
if n==N and N!=1:
  ans=1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
ans,n = 0,N
for i in range(2,math.ceil(math.sqrt(N))+1):
  ii=i
  if n%ii==0:
    ans+=1
    n=n//ii
    ii*=i
print(max(ans,1) if N!=1 else 0)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
ans,n = 0,N
for i in range(2,int(math.sqrt(N))+1):
  ii=i
  if n%ii==0:
    ans+=1
    n=n//ii
    ii*=i
if N==n:
  ans=1
elif N==1:
  ans=0
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def fac(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
def main():
  N = int(input())
  l = fac(N)
  counter = 0
  if len(l) == 1 and l[0][1] == 1:
    print(1)
    exit()
  for x in l:
#    print(x)
    temp = 0
    for k in range(1, 141423):
      temp += 1
      z = x[0] ** temp
#      print("z:" + str(z))
      if N/z < 1:
        break
#      print("OK")
      N = N/z
      if float(N).is_integer() == False:
        N = N * z
        break
#      print("z:" + str(z) + ", N:" + str(N))
      counter += 1
    if N <= 1:
      break
  print(counter)
if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
def fac(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
def main():
  N = int(input())
  l = fac(N)
  counter = 0
  if len(l) == 1 and l[0][1] == 1:
    print(0)
    exit()
  for x in l:
#    print(x)
    temp = 0
    for k in range(1, 141423):
      temp += 1
      z = x[0] ** temp
#      print("z:" + str(z))
      if N/z < 1:
        break
#      print("OK")
      N = N/z
      if float(N).is_integer() == False:
        N = N * z
        break
#      print("z:" + str(z) + ", N:" + str(N))
      counter += 1
    if N <= 1:
      break
  print(counter)
if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
def fac(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
def main():
  N = int(input())
  l = fac(N)
  counter = 0
  if len(l) == 1 and l[0][1] == 1:
    print(0)
    exit()
  for x in l:
    temp = 0
    for k in range(1, 141423):
      temp += 1
      z = x[0] ** temp
      if N/z < 1:
        break
      N = N/z
      counter += 1
    if N <= 1:
      break
  print(counter)
if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
def factorization(n):
    if n==1:
        return [[1,1]]
    temp=n
    ans=[]
    for i in range(2, int(n**0.5+1.01)):
        if temp % i ==0:
            ct=0
            while temp % i == 0:
                temp //= i
                ct += 1
            ans.append([i, ct])
    if temp != 1:
        ans.append([temp, 1])
    return ans

N=int(input())
L=factorization(N)
ans=0
for l in L:
    ct=0
    fac=1
    while fac<=l[1]:
        ct+=1
        fac+=ct+1
    ans+=ct
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
N_ori = N
cnt = 0
for p in range(2,int(math.sqrt(N_ori))+1):
    waru = p
    while(N%waru==0):
        N //= waru
        cnt += 1
        waru *= p

if(N == N_ori and N != 1):
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
N_ori = N
cnt = 0
for p in range(2,int(math.sqrt(N_ori))+10):
    waru = p
    while(N%waru==0):
        N //= waru
        cnt += 1
        waru *= p

if(N == N_ori and N != 1):
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
N_ori = N
p = 2
cnt = 0
for p in range(2,int(math.sqrt(N))+1):
    i=1
    cnt_tmp=0
    while(N%p==0):
        N //= p
        cnt_tmp += 1
    while(cnt_tmp>=i):
        cnt_tmp -= i
        i += 1
        cnt += 1
if(N == N_ori and N != 1):
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
N_ori = N
p = 2
cnt = 0
for p in range(2,int(math.sqrt(N))):
    i=1
    cnt_tmp=0
    while(N%p==0):
        N //= p
        cnt_tmp += 1
    while(cnt_tmp>=i):
        cnt_tmp -= i
        i += 1
        cnt += 1
if(N == N_ori and N != 1):
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
from functools import lru_cache
N = int(input())

@lru_cache(maxsize=None)
def isprime(x):
    i = 2
    while i * i <= x:
        if x % i == 0:
            return False
        i += 1
    return True

prime_cache = [2, 3]

def primeiter():
    global prime_cache
    for p in prime_cache:
        yield p
    x = prime_cache[-1] + 1
    while True:
        if isprime(x):
            prime_cache.append(x)
            yield x
        x += 1

done = set()
while N > 1:
    ds = [N]
    d = 2
    while d * d <= N:
        if N % d == 0:
            if not d in done:
                ds.append(d)
            d2 = N // d
            if d2 != d and not d2 in done:
                ds.append(d2)
        d += 1
    ds.sort()
    for d in ds:
        if isprime(d):
            N //= d
            done.add(d)
            break
        else:
            for p in primeiter():
                if d < p:
                    break
                while p < d:
                    p *= p
                if p == d:
                    N //= d
                    done.add(d)
                    break
    else:
        break
print(len(done))

Submission status: Wrong Answer

Solution code:
from functools import lru_cache
N = int(input())

@lru_cache(maxsize=None)
def isprime(x):
    i = 2
    while i * i <= x:
        if x % i == 0:
            return False
        i += 1
    return True

prime_cache = [2, 3]

def primeiter():
    global prime_cache
    for p in prime_cache:
        yield p
    x = prime_cache[-1] + 1
    while True:
        if isprime(x):
            prime_cache.append(x)
            yield x
        x += 1

done = set()
while N > 1:
    ds = [N]
    d = 2
    while d * d <= N:
        if N % d == 0:
            if not d in done:
                ds.append(d)
            d2 = N // d
            if d2 != d and not d2 in done:
                ds.append(d2)
        d += 1
    ds.sort()
    for d in ds:
        if isprime(d):
            N //= d
            done.add(d)
            break
        else:
            for p in primeiter():
                if d < p * p:
                    break
                while p < d:
                    p *= p
                if p == d:
                    N //= d
                    done.add(d)
                    break
    else:
        break
print(len(done))