Problem:


Score : 400 points

Problem Statement

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

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

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

z divides N;

z is different from all integers chosen in previous operations.

Then, replace N with N/z.

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

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

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

Sample Input 1

24

Sample Output 1

3

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

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

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

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

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

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

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

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

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

Sample Input 4

1000000007

Sample Output 4

1

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

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

Sample Input 5

997764507000

Sample Output 5

7



Sample input:
24


Sample output:
3

Submission status: Wrong Answer

Solution code:
#デフォルト
import 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
if (Prime(n)):
    print("1")
else:
    ans = 0
    for i in range(2, 10 ** 4  * 3):
        if Prime(i):
            for j in range(1, 10 ** 2 * 3):
                sub = i**j
                if n % (sub) == 0:
                    ans += 1
                    n = n // (sub)
                if n == 1:
                    break
        if n == 1:
            break

    print(ans)

Submission status: Wrong Answer

Solution code:
from functools import reduce
from decimal import *
from operator import mul

def main():
    n = int(input())
    p = prime_factorize(n)
    ans = []
    i = 1
    for v in p:
        i *= v
        if i not in ans and n % i == 0:
            ans.append(i)
            i = 1
    sa = list(sorted(ans))

    count = 0
    for v in sa:
        n = int(n/v)
        count += 1
        if n <= 1:
            break
    print(count)

def input_list():
    return list(map(int, input().split()))

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#import math
N = int(input())
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
x = factorize(N)
counter = 0
for item in x:
  if item[1]==1:
    counter += 1
    break
  else:
    temp = item[1]
    i = 1
    while temp > 0:
      temp -= i
      i += 1
      if temp >= 0:
        counter += 1
print(counter)

Submission status: Wrong Answer

Solution code:
def p(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=p(n)
d={}
for i in a:
  d[i]=d.get(i,0)+1
b=list(d.values())
ans=0
d=[1]*50
for i in range(1,50):
    d[i]=d[i-1]+i
for i in b:
    c=1
    while d[c]<i:
        c+=1
    ans+=c    
print(ans)

Submission status: Wrong Answer

Solution code:
#import math
#=input()
n=int(input())
#a,b=map(float,input().split())
#=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]
import collections
def pf(x):
    a = []
    while x % 2 == 0:
        a.append(2)
        x //= 2
    f = 3
    while f ** 2 <= x:
        if x % f == 0:
            a.append(f)
            x //= f
        else:
            f += 2
    if x != 1:
        a.append(x)
    return a
c = collections.Counter(pf(n))
if n == 1:
    counts = [1]
else:
    values, counts = zip(*c.most_common())
ans = 0
for i in range(len(counts)):
    q = counts[i]
    for j in range(100):
        if (j * (j + 1)) > (2 * q):
            j -= 1
            break
    ans += j
print(ans)

Submission status: Wrong Answer

Solution code:
import math
M = int(input())
N = M
sq = int(math.sqrt(N+0.01))
sum = 0
count = 0
while(N%2 == 0):
    count += 1
    N /= 2
if(count !=0):
    sum += (math.sqrt(8*count+1.0000001)-1)//2
count = 0
while(N%3 == 0):
    count += 1
    N /= 3
if(count !=0):
    sum += (math.sqrt(8*count+1.0000001)-1)//2
for i in range(5, sq+7, 6):
    if(N%i != 0 and N%(i+2) != 0):
        continue
    count = 0
    while(N%i == 0):
        count += 1
        N /= i
    if(count !=0):
        sum += (math.sqrt(8*count+1.0000001)-1)//2
    count = 0
    while(N%(i+2) == 0):
        count += 1
        N /= (i+2)
    if(count !=0):
        sum += (math.sqrt(8*count+1.0000001)-1)//2
    if(N == 1):
        print(int(sum))
        exit()
if(N == M):
    print("1")
    exit()
print(int(sum))

Submission status: Wrong Answer

Solution code:
N = int(input())
ANS = 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

L = factorization(N)

for i in range(len(L)):
    for j in range(50):
        if j * (j+1) > L[i][1]:
            ANS += j
            break
if len(L) == 1 and L[0][0] == 1:
    ANS = 0

print(ANS)

Submission status: Wrong Answer

Solution code:
def main():
    m = 10 ** 12
    limit = int(m ** 0.5 // 1)

    N = int(input())
    tmp_n = N
    ans = 0
    for i in range(2,limit):
        if tmp_n == 0:
            break
        if tmp_n % i == 0:
            tmp_n /= i
            ans += 1
    if ans == 0 and N != 1:
        ans += 1
    print(ans)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

import math


n = math.sqrt(N) + 1

cm = []
idx = 2
while True:
    if N % idx == 0:
        N //= idx
        cm.append(idx)
    else:
        idx += 1
     
    if N == 1:
        break
        
    if (idx > n+1) and len(cm) == 0:
        print(1)
        exit()
        
    if idx > n+1:
        break

#print(cm)

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

    
print(count)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
primelist = []
count = 0
for i in range(2, int(math.sqrt(N))+1):
    if N % i == 0:
        N = N / i
        count += 1
if count == 0 and N != 1:
    count += 1
print(count)

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())
ans = 0
for i in factorization(n):
    ans = ans + i[1]//2 + i[1]%2
print(ans)

Submission status: Wrong Answer

Solution code:
import math

def isPrime(num):
    if num < 2: return False
    elif num == 2: return True
    elif num % 2 == 0: return False

    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False

    return True

def callIsPrime(input_num=1000):
    numbers = []
    for i in range(1, input_num):
        if isPrime(i):
            numbers.append(i)

    return numbers
n=int(input())
pr=callIsPrime(math.floor(n**0.5))
pr.append(n)
e=1
cnt=0
while n!=1:
    flag=0
    for i in pr:
        z=i**e
        
        if n%z==0:
            cnt+=1
            n//=z
            flag+=1
            #print(z)
    if flag==0:
        break
    else:
        e+=1
#print(n)
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
def eratos(n):
    isprime = [True for i in range(n+1)]
    isprime[0] = False
    isprime[1] = False
    for i in range(2, int(math.sqrt(n))+13):
        if isprime[i]:
            j = i + i
        while j <= n:
            isprime[j] = False
            j = j + i
    return isprime
N = int(input())
ans = 0
is_prime = eratos(10**6+13)
for i in range(2, 10**6+14):
    if not is_prime[i]:
        continue
    x = i
    while N % x == 0:
        ans += 1
        N //= x
        x *= i
        # print(N)
if ans == 0 and N != 1:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:


import sys
from collections import defaultdict

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7
# ----------


N = int(input())

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

e = defaultdict(int)
for i in range(2, int(N ** 0.5) + 1):
    while N % i == 0:
        e[i] += 1
        N //= i

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

ans = 0
for k, v in e.items():
    if v % 2 == 0:
        ans += v //2
    else:
        ans += v //2 + 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
p=2
c=0
curr=0
while n%p==0:
    curr+=1
    n//=p
i=0
for i in range (1,curr):
    curr-=i
    if curr>=0:
        c+=1
    else:
        break
for i in range (3,int(math.sqrt(n))+1,2):
    p=i
    curr=0
    while n%p==0:
        curr+=1
        n//=p
    for i in range (1,curr):
        curr-=i
        if curr>=0:
            c+=1
        else:
            break
if n>2:
    c+=1
print(c)

Submission status: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    if n == 1:
        arr.append([0])
    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([cnt])

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

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

    return arr

n = int(input())
arr = factorization(n)
cnt = 0
for j in arr:
    i = j[0]
    if i == 0:
        cnt = 0
        break
    if i == 1 or i == 2:
        cnt = cnt + 1
    elif i == 3 or i == 4 or i == 5:
        cnt = cnt + 2
    elif i == 6 or i == 7 or i == 8 or i == 9:
        cnt = cnt + 3
    elif i == 10 or i == 11 or i ==12 or i ==13 or i == 14:
        cnt = cnt + 4
    elif i >= 15 and i <= 20:
        cnt = cnt + 5
    elif i >= 21 and i <= 27:
        cnt = cnt + 6
    else:
        cnt = cnt + 7
        
print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
orgn=n
counter=0
for i in range(2,int((n+1)**0.5)):
    if n % i == 0:
        counter += 1
        n //= i
        wari=i**2
        while n % wari == 0:
            counter +=1
            n //= wari
            wari *= i
        
        while n % i ==0:
            n //= i

if n == orgn:
    if n == 1:
        print(0)
    else:
        print(1)
else:
    print(counter)

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 check(S):
  for i in range(S):
    if S != 1 and S != 2:
      if (i**2+i) > S:
        return i
    else:
      return 1

if N != 1:
  result = factorization(N) 
  print(result)

  a = 0
  for r in result:
    b = check(r[1])
    a += b
  print(a)

else:
  print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

divs = make_divisors(N)

check = 1
ans = 0
for div in divs[1:]:
    check *= div
    if check <= N:
        ans += 1
    else:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
def soinsu(a):
    b=[]
    while a%2==0:
        b.append(2)
        a//=2
    f=3
    while f*f<=a:
        if a%f==0:
            b.append(f)
            a//=f
        else:
            f+=2
    if a!=1:
        b.append(f)
    return b
    
n=int(input())
a=soinsu(n)
c=[]
if n>=2:
    for i in range(max(a)):
        c.append(0)
for i in a:
    c[i-1]+=1
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:
import math
N = int(input())
ruteN = math.ceil(math.sqrt(N))
prime=[1]*(ruteN+3)
prime[0]=0
primes=[]
count=0
for i in range(2,ruteN+3,1):
    if prime[i]==1:
        primes.append(i)
        count+=1
        for j in range(i*2,ruteN+3,i):
            prime[j]=0

ans =0
for i in range(0,count,1):
    tmp = primes[i]
    while tmp <= N:
        if N%tmp==0:
            ans += 1
            N = N//tmp
        else:
            while N % primes[i] ==0:
                N=N//primes[i]
            break
        tmp = tmp*primes[i]

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

Submission status: Wrong Answer

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

"""
z = p^e where p is a prime number and e = positive int
z divides N
"""

def get_primes(up_to=1000):
    primes = []

    A = [True] * (up_to + 2)

    for i in range(2, int(up_to**0.5)+1):
        if A[i]:
            j = i*2
            while j < up_to:
                A[j] = False
                j += i
    
    i = 2

    while i < up_to:
        if A[i]:
            primes.append(i)
        i += 1

    return primes

from math import sqrt

n = int(input())
primes = get_primes(int(sqrt(n))+2)
count = 0

#print(primes)
for z in primes:
    if z > n:
        break
    
    #ori_z = z
    exp = 1
    while n % z**exp == 0:
        count += 1
        n //= z**exp
        exp += 1

def is_prime(n):
    if n < 2:
        return False
    elif n == 2 or  n == 3:
        return True
        
    for i in range(2, int(sqrt(n))+1):
        if n % i == 0:
            return False
    return True

if is_prime(n):
    print(count +1)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
def is_prime(n):
    for p in PRIME:
        if n in DONE and not n % p:
            return False
    return True


N = int(input())

DONE = []
PRIME = []

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

for i in range(2, int(N**0.5) + 1):
    if N == 1 or N in PRIME or N in DONE:
        break

    if is_prime(i) and not N % i:
        z = i
        DONE.append(z)
        PRIME.append(z)
        N /= z
        z *= i
        while not N % z:
            DONE.append(z)
            N /= z
            z *= i
else:
    DONE.append(N)

print(len(DONE))

Submission status: Wrong Answer

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

def judge(n):
  l = 1
  while n > 0:
    n -= l
    l += 1
  if n == 0:
    return l-1
  else:
    return l-2

count = 0
for i in arr:
  count += judge(i)
print(count)

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 prime_len(n):
    a = set()
    while n % 2 == 0:
        a.add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.add(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.add(n)
    return len(a)


n = int(input())
c = 0
for z in make_divisors(n):
    if prime_len(z) == 1:
        tmp = n // z
        if tmp < 1:
            break
        n = tmp
        c += 1
print(c)

Submission status: Wrong Answer

Solution code:
from math import floor,sqrt
N=int(input())

p = [1]*floor(sqrt(10**6))
p[0]=p[1]=0
prime=[]
for i in range(2,len(p)):
    if p[i]==0:
        continue
    prime.append(i)
    for j in range(i*2,len(p),i):
        p[j]=0

ans=0
for x in prime:
    if N%x!=0:
        continue
    cnt=0
    while N%x==0:
        cnt+=1
        N//=x
    ans+=floor((-1+sqrt(1+8*cnt))/2)
print(ans+int(N!=1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(n)):
        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
    cnt = 0
    for l in arr:
      i = l[1]
      div = 0
      while 1:
        div += 1
        i -= div
        print(div)
        if i >= 0:
          cnt += 1
        else:
          break
    
    return cnt

print(factorization(N))

Submission status: Wrong Answer

Solution code:
# 2130~
N=int(input())
# まず素因数分解する．素因数の指数に対して-1,-2,-3と指定していき，素因数の指数が0より小さくなった時点で中止する
# それぞれの素因数についてその数を数え上げて足し算をすれば，それが最大の操作回数である
# まず素因数を求める
A = {}
while N%2 == 0:
    if not 2 in A:
        A[2]=1
    else:
        A[2]+=1
    N /= 2

f=3
while f*f <= N:
    if N % f == 0:
        if not f in A:
            A[f] = 1
        else:
            A[f] += 1
        N /= f
    else:
        f += 2

if N != 1:
    A[N] = 1

ans = 0
for k,v in A.items():
    ind = 1
    while not v<ind:
        v -= ind
        ans += 1
        ind += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import deque
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)
    a.sort()
    return a

q = deque()
for x in prime_factorize(N):
  q.append(x)

#print(q)
count = 0
done = []
while N != 1:
  break_flag = False
  if len(q) == 0:
    break
  x = q.popleft()
  #print(N, q, x)
  if x == 1:
    continue
  
  if x in done:
    mul = x
    while mul in done:
      if len(q) == 0:
        break_flag = True
        break
      pop = q.popleft()
      #print(x, pop)
      if x != pop:
        q.append(pop)
        break_flag = True
        break
      mul *= pop
    x = mul
    if break_flag:
      continue
  
  if N % x == 0:
    N = N // x
    count += 1
    done.append(x)

print(count)
#print(done)

Submission status: Wrong Answer

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

import math

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

cnt = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
sys.setrecursionlimit(10**6)

n=int(input())

m=int(np.sqrt(n))+1

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

ans=0
for i in range(2,m+1):
    cnt=0
    for j in range(40):
        if n%i==0:
#            print("i=",i,"n=",n)
            n=n/i
            cnt+=1
        else:
            break
    if 1<=cnt<3:
        ans+=1
    if 3<=cnt<6:
        ans+=2
    if 6<=cnt<10:
        ans+=3
    if 10<=cnt<15:
        ans+=4
    if 15<=cnt<21:
        ans+=5
    if 21<=cnt<28:
        ans+=6
    if 28<=cnt<36:
        ans+=7
    if 36<=cnt<45:
        ans+=8

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

for i in range(2, 10**6+1):
    if N % i != 0: continue
    ans += 1
    cnta = 0
    cntb = 2
    while N % i == 0:
        N //= i
        cnta += 1
        if cnta > cntb:
            cnta -= cntb
            cntb += 1
            ans += 1
    if N == 1:
        break

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

Submission status: Wrong Answer

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
   
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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=factorization(n)
le=len(a)
cnt=0
b=0
for i in range(le):
	b=1
	while a[i][1]>=b: 
		a[i][1]-=b
		b+=1
		cnt+=1

print(cnt)

Submission status: Wrong Answer

Solution code:
from math import sqrt
from decimal import Decimal
def factorint(n):
    d = {}
    for i in range(2, int(sqrt(n))+1):
        c = 0
        q, r = divmod(n, i)
        while not r:
            c += 1
            n = q
            q, r = divmod(n, i)
        if c:
            d[i] = c
    if n != 1:
        d[n] = 1
    return d

n = int(input())
if n == 1:
    print(0)
else:
    d = factorint(n)
    s = 0
    for k in d.keys():
        v = d[k]
        t = int(Decimal(8*v-1).sqrt()/2)
        s += t
        d[k] -= t*(t+1)//2
    s += len([v for v in d.values() if v != 0]) // 2
    print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
def pri_me(x):
    if x == 2:
        return True
    for i in range(3,int(x**0.5)+1):
        if x%i==0:
            return False
    return True
#print(pri_me(n))
if n==1:
    print(0)
    exit()
if pri_me(n):
    print(1)
    exit()
N = n
ans = 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

for i in range(2,int(N**0.5)+4):
    if n%i==0 and len(set(prime_factorize(i)))==1: 
        n=n//i
        ans += 1
        #print(n,i)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
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
N=int(input())
if N==1:
    print(0)
    exit()
if is_prime(N):
    print(1)
    exit()
N_SQ=math.sqrt(N)
if N==N_SQ**2:#整数なら
    N_SQ=int(N_SQ)
    if is_prime(N_SQ):
        print(1)
        exit()
    else:
        ans=1#N_SQを入れる
        target=N_SQ
        for i in range(2,N_SQ//2+1):
            if target%i==0:
                ans+=1
                target/=i
                if target==1:break
else:
    target=N
    ans=0
    for i in range(2,int(N_SQ)+1):
        if target%i==0:
            ans+=1
            target/=i
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    if n == 1:
        print(0)
        exit()

    mid = int(n ** (0.5))
    cnt = 0
    for i in range(2, mid + 1):
        if n % i == 0:
            cnt += 1
            n //= i

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from math import sqrt as s
n=int(input())
d={}
l=(1,3,6,10,15,21,28,36)
ans=0
div=2
while n>1:
  comp=int(s(n))
  if n%div:
    if div>comp:
      d[n]=1
      break
    div+=1
  elif div in d:
    d[div]+=1
    n//=div
    div=2
  else:
    d[div]=1
    n//=div
    div=2
for i in d.values():
  j=0
  for k in l:
    if i>=k:
      j+=1
    else:
      break
  ans+=j
print(ans)

Submission status: Wrong Answer

Solution code:
import math

def isPrime(num):
    if num < 2: return False
    elif num == 2: return True
    elif num % 2 == 0: return False

    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False

    return True

def callIsPrime(input_num=1000):
    numbers = []
    for i in range(1, input_num):
        if isPrime(i):
            numbers.append(i)

    return numbers
n=int(input())
pr=callIsPrime(math.floor(n**0.5))
pr.append(n)
e=1
cnt=0
while n!=1:
    flag=0
    for i in pr:
        z=i**e
        
        if n%z==0:
            cnt+=1
            n//=z
            flag+=1
            print(z)
    if flag==0:
        break
    else:
        e+=1
print(n)
print(cnt)

Submission status: Wrong Answer

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

"nの素因数分解"
def prime_factor(n):
    ass = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            ass.append(i)
            n = n//i
    if n != 1:
        ass.append(n)
    return ass

N = int(input())
A = divisor(N)
A.sort()

count = 0
for a in A:
  if a == 1:
    continue
  if N % a != 0:
    continue
  N //= a
  count += 1

print(count)

Submission status: Wrong Answer

Solution code:
class Sieve: 
    
    def __init__(self, n=1):
        self.f = [0 for _ in range(n+1)]
        self.f[0] = -1
        self.f[1] = -1
        self.primes = []
        for i in range(2, n+1):
            if self.f[i]:
                continue
            self.primes.append(i)
            self.f[i] = i
            for j in range(i*i, n+1, i):
                if not self.f[j]:
                    self.f[j] = i
    
    def isPrime(self, x):
        return self.f[x] == x
    
    def factorList(self, x):
        res = []
        while x != 1:
            res.append(self.f[x])
            x //= self.f[x]
        return res
    
    def factor(self, x):
        fl = self.factorList(x)
        if not len(fl):
            return []
        res = [[fl[0], 0]]
        for p in fl:
            if res[-1][0] == p:
                res[-1][1] += 1
            else:
                res.append([p, 1])
        return res



n = int(input())

s = Sieve(10**6+10)

prime_list = []
for i in range(2, 10**6+10):
    if s.isPrime(i):
        prime_list.append(i)

e = 1
pos = 0
ans = 0
while pos < len(prime_list) and n >= prime_list[pos]:
    p = prime_list[pos]
    if n%(p**e) == 0:
        ans += 1
        n //= p**e
        e += 1
    else:
        while n%p == 0:
            n //= p
        pos += 1
        e = 1

if ans == 0 and n > 1:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
i=1
k=1
while N % (2**i) == 0:
  ans+=1
  N=N//(2**i)
  i+=1
f=3
while f <= N:
  if N % (f**k) == 0:
    ans+=1
    N=N//(f**k)
    k+=1
  else:
    f += 2
    k=1
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n=int(input())
sqn=int(math.sqrt(n))
soinsu=[]
#soinsu[i]はi+2で何回割れるか示す.
#soinsu[-1]はnが素数ならば1合成数ならば0.
goseisu=0
for i in range(2,sqn+1):
    count=0
    while True:
        if n%i==0:#iで割れるなら
            n=n//i
            count+=1
            goseisu=1
        else:
            soinsu.append(count)
            break
if goseisu==0:#素数ならば
    soinsu.append(1)
else:#合成数ならば
    soinsu.append(0)
        
ans=0
for i in range(len(soinsu)):
    ans+=int((-1+math.sqrt(1+8*soinsu[i]))/2)



print(ans)

Submission status: Wrong Answer

Solution code:
from functools import reduce
from decimal import *
from operator import mul

def main():
    n = int(input())
    p = prime_factorize(n)
    ans = []
    i = 1
    for v in p:
        i *= v
        if i not in ans and n % i == 0:
            ans.append(i)
            i = 1
    sa = list(sorted(ans))

    count = 0
    for v in sa:
        n = int(n/v)
        count += 1
        if n == 1:
            break
    print(count)

def input_list():
    return list(map(int, input().split()))

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    if n == 1:
        arr.append([0])
    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([cnt])

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

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

    return arr

n = int(input())
arr = factorization(n)
cnt = 0
for j in arr:
    i = j[0]
    if i == 0:
        cnt = 0
        break
    if i == 1 or i == 2:
        cnt = cnt + 1
    elif i == 3 or i == 4 or i == 5:
        cnt = cnt + 2
    elif i == 6 or i == 7 or i == 8 or i == 9:
        cnt = cnt + 3
    elif i == 10 or i == 11 or i ==12 or i ==13 or i == 14:
        cnt = cnt + 4
    else:
        cnt = cnt + 5
        
print(cnt)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math

a=int(stdin.readline())
PP=0
K=0

if a==1:
    print(0)
    K=1
L=list()

for b in range(2,int(math.floor(math.sqrt(a)))+1):
    count=0
    if a%b==0:
        while a%b==0:
            count+=1
            a=a/b
    if count>0:
       L.append(count)

if len(L)==0 and K==0:
    print(1)
    PP=1
sum=0

for k in range(0,len(L)):
    p=L[k]
    sum+=int(math.floor((-1+math.sqrt(1+8*p))/2))

if PP==0 and K==0:
   print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n>1:
  powers = {n}
else:
  powers = set()
for i in range(2,int(n**0.5)):
  for j in range(1,41):
    if i**j>(n**0.5)+1:
      break
    else:
      powers.add(i**j)
power = list(powers)
power.sort()
counter = 0
for s in power:
  if n%s==0:
    n = n/s
    counter += 1
  if n<s:
    break
print(counter)