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 sys
import math


def is_prime(N):
    if N == 1:
        return False
    i = 2
    while i * i <= N:
        if N % i == 0:
            return False
        i += 1
    return True

def prime(N):
    prime = []
    is_prime = [True for i in range(N+1)]  # 全て素数であると初期化
    is_prime[0] = is_prime[1] = False # 0,1は素数ではない
    for i in range(2, N+1):
        if is_prime[i]:
            # iは素数である
            prime.append(i)
            for j in range(2 * i, N+1, i):
                # iの倍数は素数でない
                is_prime[j] = False
    # N以下の素数を表示
    return prime

def main():
    N = int(input())
    if N == 1:
        print(0)
        sys.exit()
    if is_prime(N):
        print(1)
        sys.exit()
    else:
        n = int(math.sqrt(N)) + 1
        prime_list = prime(n)
        ans = []
        for i in range(len(prime_list)):
            now = prime_list[i]
            j = 1
            while now ** j <= n :
                ans.append(now ** j)
                j += 1
        ans.sort()
        count = 0
        for i in range(len(ans)):
            now = ans[i]
            if N < now:
                break
            if N % now == 0:
                count += 1
                N //= now
        print(count)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
import math
from collections import defaultdict

res = 0
value = defaultdict(int)
def isprime(n):
    if n <= 1:
        return 0
    m = int(math.sqrt(n)) + 1
    for i in range(2, m):
        if n % i == 0:
            return 0
    return 1
if isprime(x):
    print(1)
else:
    def bprime(n):
        m = 10 ** 6
        for cnt in range(2, m):
            while n % cnt == 0:
                n //= cnt
                value[cnt] += 1
            cnt += 1
    def cal(n):
        if n <= 2:
            return 1
        j = 1
        cnt = 0
        while n >= j:
            n -= j
            j += 1
            cnt += 1
        return cnt
    bprime(x)
    for key in value.keys():
        res += cal(value[key])
    print(res)

Submission status: Wrong Answer

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

cnt=0
a=make_divisors(n)

for i in range(1,len(a)):
    if n%a[i]==0:
        cnt+=1
        n=n/a[i]
print(cnt)

Submission status: Wrong Answer

Solution code:
def main():
  n = int(input())
  if n == 1:
    return 0
  index = []
  no = []
  i = 1
  result = 1
  while n > 1 and i ** 2 < n:
    i += 1
    if n % i == 0:
      n /= i
      cnt = 1
      while n % i == 0:
        n /= i
        cnt += 1
      index.append(cnt)
  for j in index:
    result += (j + 1) // 2
  return result

print(main())

Submission status: Wrong Answer

Solution code:
x = int(input())
import math
from collections import defaultdict

res = 0
value = defaultdict(int)
def isprime(n):
    if n <= 1:
        return 0
    m = int(math.sqrt(n)) + 1
    for i in range(2, m):
        if n % i == 0:
            return 0
    return 1
if isprime(x):
    print(1)
else:
    def bprime(n):
        m = int(math.sqrt(n)) + 1
        for cnt in range(2, m):
            while n % cnt == 0:
                n //= cnt
                value[cnt] += 1
            cnt += 1
    def cal(n):
        if n <= 2:
            return 1
        j = 1
        cnt = 0
        while n >= j:
            n -= j
            j += 1
            cnt += 1
        return cnt
    bprime(x)
    for key in value.keys():
        res += cal(value[key])
    print(res)

Submission status: Wrong Answer

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

    return arr

N = int(input())
ans = 0
for i, j in factorization(N):
  c = 1
  while True:
    if j >= c:
      ans += 1
      c += 1
      j -= 1
    else:
      break
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print(0)

else:
    ans = 0
    for i in range(2, int(N**0.5)+1):
        cnt = 0
        while N%i == 0:
            N /= i
            cnt += 1
            a = 0
            b = 0
            for j in range(1, cnt+1):
                a += j
                if a > cnt:
                    break
                    b += 1    
                ans += b

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

Submission status: Wrong Answer

Solution code:
n = int(input())


import collections

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

#n = 997764507000
A = prime_factorize(n)
C = collections.Counter(A)


count = 0
print(C.values())
for v in C.values():
    i = 1
    while v >= i*(i+1)/2:
        i += 1
    count += i-1
print(count)

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    cnt = 0
    while n % 2 == 0:
        cnt += 1
        n //= 2
    a.append(cnt)
    f = 3
    cnt = 0
    while f * f <= n:

        if n % f == 0:
            cnt += 1
            n //= f
        else:
            f += 2
            a.append(cnt)
            cnt = 0

    if n != 1:
        a.append(1)
    return a

n = int(input())
ans = 0
lis = prime_factorize(n)
#print(lis)
if len(lis) == 0:
    print(0)
    exit()

for i in range(len(lis)):
    val = 1
    while val <= lis[i]:
        lis[i] -= val
        val += 1
        ans += 1
    val = 1
print(ans)

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    cnt = 0
    while n % 2 == 0:
        cnt += 1
        n //= 2
    a.append(cnt)
    f = 3
    cnt = 0
    while f * f <= n:

        if n % f == 0:
            cnt += 1
            n //= f
        else:
            f += 2
            a.append(cnt)
            cnt = 0

    if n != 1:
        a.append(1)
    return a

n = int(input())
ans = 0
lis = prime_factorize(n)
#print(lis)
if len(lis) == 0:
    print(0)
    exit()

for i in range(len(lis)):
    val = 1
    while val <= lis[i]:
        lis[i] -= val
        val += 1
        ans += 1
    val = 0
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())


if n == 1:
    print(0)
else:
    prime = []
    saidai = math.sqrt(n)
    i = 2
    while i <= saidai:
        if n % i == 0:
            n //= i
            prime.append(i)
        else:
            i +=1
    if len(prime) == 0:
        print(1)
    else:
        count = 1
        ans = 0
        i = 0
        prime.append(0)
        while i < len(prime)-1:
            if count == 1:
                ans += 1
                if prime[i] == prime[i+1]:
                    count += 1
                i += 1
            else:
                hantei = True
                atai = prime[i]
                j = 1
                while hantei:
                    if i + j > len(prime)-1:
                        hantei = False
                        i = i+j
                        count = 1
                    elif atai != prime[i+j]:
                        hantei = False
                        i = i + j
                        count = 1
                    else:
                        if j + 1 == count:
                            hantei = False
                            ans += 1
                            i = i + j + 1
                            if atai == prime[i]:
                                count += 1
                            else:
                                count = 1
                        else:
                            j += 1
        print(ans)

Submission status: Wrong Answer

Solution code:
import math
#試し割法
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
            if num not in factor:
                factor.append(num)
    #リストが空ならそれは素数
    if not factor:
        return 'prime number'
    else:
        factor.append(n)
        return factor
    
n=int(input())
if n==1:
	ans=0
elif trial_division(n)== 'prime number':
    ans=1
else:
    z=2
    ans=0
    while z <= n/2:
        if trial_division(z)== 'prime number' and n%z ==0:
            n = n/z
            z += 1
            ans += 1
        elif len(trial_division(z))==2 and n%z ==0:
            n = n/z
            z += 1
            ans += 1
        
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 1:
    print(0)
else:
    ans = 0
    for i in range(2, int(N**0.5)+1):
        cnt = 0
        while N%i == 0:
            N /= i
            cnt += 1
            a = 0
            b = 0
            for j in range(1, cnt+1):
                a += j
                if a > cnt:
                    break
                    b += 1    
                    ans += b

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

Submission status: Wrong Answer

Solution code:
import collections as cc
I = lambda : list(map(int,input().split()))
ans=0
n,=I()
k=2
ff=cc.defaultdict(int)
while 1:
	f=0
	for i in range(k,int(n**0.5)+1):
		if n%i==0:
			ff[i]=n
			n//=i
			f=1
			k+=1
			ans+=1
			break

	if not f :
		if not ff[n]:
			ans+=1
		break
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
M=N
ans=0
U=1

for i in range(2,150):
    e=1
    while N%(i**e)==0:
        N=N//(i**e)
        ans+=1
        e+=1
    if N<i:
        break
for i in range(151,int(M**(1/4))+1):
    e=1
    while N%(i**e)==0:
        N=N//(i**e)
        ans+=1
        e+=1
        U=0
    if N<i:
        break
if M==1:
    ans=0
elif N != 0 and U==1:
    x = int(N**(1/5))
    y = int(N**(1/4))
    z = int(N**(1/3))
    a = int(N**(1/2))
    if x**5==N:
        ans += 2
    elif y**4==N:
        ans += 2
    elif z**3==N:
        ans += 2
    elif a**2==N:
        ans += 1
    else:
        ans+=1
print(ans)

Submission status: Wrong Answer

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

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:
                temp //= i
                cnt += 1
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    return arr

N = int(input())
if N == 1:
    print(0)
else:
    pri_list = factorization(N)
    a = 0
    b = 0
    for pri in pri_list:
        a += pri[1] // 2
        b += pri[1] % 2
    print(a+b)
#     prist = []
#     f = 0
#     for pri in pri_list:
#         prist.append(pri[0])
#         f += pri[1]
#     if f == 1:
#         print(1)
#     else:
#         flag = 0
#         i = 0
#         jou = {i:i for i in prist}
#         while flag != 1:
#             for j in range(len(prist)):
#                 if N % prist[j] == 0:
#                     N /= prist[j]
#                     i += 1
#                     pri = prist[j]
#                     prist[j] *= jou[prist[j]]
#                     jou[prist[j]] = jou[pri]
#                     prist.sort()
#                     break
#             if j == len(prist) - 1:
#                 flag = 1
#         print(i)

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
import collections

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().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

N = I()
result = prime_factorize(N)
c = collections.Counter(result)

ans = 0
for i,q in c.items():
    pre = 1
    
    while pre <= q:
        q = q - 1
        ans += 1
        pre += 1
print(ans)

Submission status: Wrong Answer

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

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

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

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

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

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

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

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

print(ans)
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

res = 0
ps = []
p = 2
while p < N:
  is_p = True
  for a in ps:
    if p%a == 0:
      is_p = False
      break
  if is_p:
    ps.append(p)
    n = 1
    while True:
      if N % p**(n*(n+1)/2) == 0:
        n += 1
      else:
        res += n-1
        N = N // p**((n-1)*n/2)
        break
  p += 1

print(res)

Submission status: Wrong Answer

Solution code:
import math as mp
N = int(input())
count=0
for i in range(2, int(mp.sqrt(N)+2)):
    q, mod = divmod(N,i)
    if mod ==0:
        count = count+1
        N = q

if count == 0 and N == 1:
    print(0)
elif count==0:
    print(1)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
import collections as cc
I = lambda : list(map(int,input().split()))
ans=0
n,=I()
k=2
ff=cc.defaultdict(int)
while 1:
	f=0
	for i in range(k,int(n**0.5)+1):
		if n%i==0:
			ff[i]=n
			n//=i
			f=1
			k+=1
			ans+=1
			break
	if n<=1:
		break
	if not f :
		if not ff[n]:
			ans+=1
		break
print(ans)

Submission status: Wrong Answer

Solution code:
import math
def is_prime(x):
    if x < 2: return False
    if x == 2 or x == 3 or x == 5: return True 
    if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False

    prime = 7
    step = 4
    while prime <= math.sqrt(x):
        if x % prime == 0: return False

        prime += step
        step = 6 - step

    return True

def prime_factorization(n):
  d = 2
  cnt = 0
  seen = []
  while d*d <= n:
    if n%d == 0:
      t = 1
      while d**t <= n:
        if n % (d**t) == 0:
          seen.append(d**t)
          n //= (d**t)
          cnt += 1
          t += 1
        else:
          break
    d += 1
 
  if n != 1 and n not in seen and is_prime(n):
    cnt += 1

  return cnt
 
n = int(input())
print(prime_factorization(n))

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]

divisors = set(make_divisors(N)[1:])
count = 0
for i in divisors:
  if N%i == 0:
    N = int(N/i)
    count +=1
print(count)

Submission status: Wrong Answer

Solution code:
import collections
import sys

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

N = int(input())

Z = prime_factorize(N)

if not Z:
    print(0)
    sys.exit(0)

P = collections.Counter(Z)

print(P)

x = 0

for i in P.values():
    #print(i)
    y = 0
    z = 0
    for j in range(1, i+1):
        y = y + j
        z += 1
        print(i, y, z)
        if y >= i:
            if y > i:
                z -= 1
            break
    
    x = x + z

print(x)

Submission status: Wrong Answer

Solution code:
import math
def is_prime(x):
    if x < 2: return False
    if x == 2 or x == 3 or x == 5: return True 
    if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False

    prime = 7
    step = 4
    while prime <= math.sqrt(x):
        if x % prime == 0: return False

        prime += step
        step = 6 - step

    return True

def prime_factorization(n):
  d = 2
  cnt = 0
  seen = []
  while d*d <= n:
    if n%d == 0:
      t = 1
      while d**t <= n:
        if n % (d**t) == 0:
          seen.append(d**t)
          n //= (d**t)
          cnt += 1
          t += 1
        else:
          break
    d += 1
 
  if n != 1 and n not in seen and is_prime(n):
    cnt += 1

  print(seen)
  return cnt
 
n = int(input())
print(prime_factorization(n))

Submission status: Wrong Answer

Solution code:
import math
import sys
n=int(input())
ans=0
x=2
if n==1:
  print(0)
  sys.exit()
def waru(n,x):
  for i in range(x,int(math.sqrt(n))+1):
    if n%i==0:
      return int(n/i),i
  return 1,n
xx=0
while(True):
  n_old=n
  x_old=x
  n,x=waru(n,x)
  if x==x_old:
    xx+=1
  else:
    xx+=1
    for i in range(1,xx):
      xx=xx-i
      if xx>=0:
        ans+=1
      else:
        xx=0
        break

  if n==1:
    xx+=1
    for i in range(1,xx+1):
      xx=xx-i
      if xx>=0:
        ans+=1
      else:
        xx=0
        break
    print(ans)
    sys.exit()

Submission status: Wrong Answer

Solution code:
N = int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

from collections import deque
que = deque()

que = prime_factorize(N)
que = deque(que)

if len(que) == 0:
    print(0)
    exit()
elif len(que) == 1:
    print(1)
    exit()

B = []
def X(x):
    for i in range(len(x)):
        if len(que) == 0:
            print(len(B))
            exit()
        else:
#            print(i, B)
            P = que.popleft()
        if P in B:
            if len(x)>0:
                B.append(P * que.popleft())
            else:
                print(len(B))
                exit()
        else:
            B.append(P)

print(X(que))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

    return 0

N = int(input())
dic = {}
if N == 1:
  print(0)
  exit()
while True:
  if N == 1:
    val = list(dic.values())
    print(sum(val))
    break
  res = is_prime(N)
  if res != 0:
    cnt = 1
    while res in dic:
      cnt += 1
      res = res**cnt
    dic[res] = 1
    N = N/res
  if res == 0:
    val = list(dic.values())
    if sum(val) != 0:
      print(sum(val)+1)
      break
    else:
      print(1)
      break

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


N = int(input())
l = prime_factorize(N)
m = set(l)
l2 = list(m)
ans = 0

for i in range(len(l2)):
    x = l.count(l2[i])
    if x == 1:
        ans += 1
        continue
    while x > 1:
        x  = x/2
        ans += 1
print(ans)

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 = []

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

if not DONE:
    DONE.append(N)

print(len(DONE))

Submission status: Wrong Answer

Solution code:
def isprime(a):
    k=1
    for i in range(2,int(a**(1/2))):
        if(a%i==0):
            k=0
            break
    return k
n  = int(input())
if(isprime(n)==1):print(1)
else:
    p=[]
    for i in range(2,int(n**(1/2))):
        if(n%i==0 and isprime(i)==1):
            p.append(i)
    
    #print(p)       
    c=0
    
    for i in range(len(p)):
        for j in range(1,int(n)):
            if(n%(p[i]**j)==0):
                c+=1
                n = n/(p[i]**j)
                #print(p[i]**j)
            else:break
        
    print(c)

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

import sys     
N = int(input())
if N == 1:
    print(0)
    sys.exit()
# if isPrime(N)==True:
#     print(0)
fact = factorization(N)
fact_num = []
fact_num2 = []

    
for i in range(len(fact)):
    fact_num.append(fact[i][0])
    fact_num2.append(fact[i][1])

cnt=0

for j in range(1000000):
    for i in range(len(fact)):
        if N%fact_num[i]==0 and N%(fact_num[i]*(j+1))==0:
            N = N/(fact_num[i]*(j+1))
            cnt+=1

print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
import collections

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().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

N = I()
result = prime_factorize(N)
c = collections.Counter(result)
ans = 0
for i,q in c.items():
    pre = 1
    while pre <= i:
        i = i - 1
        ans += 1
        pre += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math


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 using_sqrt(limit):
    n = []
    for k in range(2, limit + 1):
        factor = 0

        # 2以外の偶数は素数ではないので無視する
        if k % 2 == 0 and k != 2:
            continue

        # 繰り返しの上限を対象の平方根にする
        for divisor in range(2, math.floor(math.sqrt(k)) + 1):
            if k % divisor == 0:
                factor += 1

        if factor == 0:
            n.append(k)

    return n


def isPrime(limit):
    n = []
    for k in range(limit, limit + 1):
        factor = 0

        # 2以外の偶数は素数ではないので無視する
        if k % 2 == 0 and k != 2:
            continue

        # 繰り返しの上限を対象の平方根にする
        for divisor in range(2, math.floor(math.sqrt(k)) + 1):
            if k % divisor == 0:
                factor += 1

        if factor == 0:
            return True
    return False


n = int(input())
prime = using_sqrt(10**5)
prev = []

if n > 1 and isPrime(n):
    print(1)
    exit()


def check(n, prev):
    divs = make_divisors(int(n))
    flag = False
    for i in divs[1:]:
        for p in prime:
            e = math.log(i, p)
            if e.is_integer() and i not in prev:
                prev.append(i)
                flag = True
                check(n/i, prev)
                break
        if flag:
            break


check(n, prev)
print(len(prev))

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

n = int(input())
ans = 1
ans_l = prime_factorize(n)
import collections
c = collections.Counter(ans_l).values()
ans=0
for x in c:
    i=0
    for j in range(1,100):
        print(x)
        if x<j:
            break
        x=x-j
        i=i+1
    ans=ans+i
#for x in ans_l:
#    ans = ans*x
print(c)
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
i = 2
count = 0

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

a = factorization(n) 
a_l = len(a)
#print(a)
ans = 0

for i in range(a_l):
  w = a[i][1]
  w_n = 1
  c_n = 0
  while True:
    if w < w_n:
      break
    else:
      w = w-w_n
      w_n = w_n + 1
      c_n = c_n + 1
  ans = ans + c_n
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

A = factorization(N)

def func(x):
    import math
    return int((-1+math.sqrt(1+8*x))/2)

ans = 0
for i in range (len(A)):
    ans = ans + func(A[i][1])
    
print(ans)

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]
n = int(input())
ans = 0
for i in make_divisors(n):
    if(n % i == 0):
        ans+=1;
        n = n/i 
    if(n == 1):
        break
print(ans-1)

Submission status: Wrong Answer

Solution code:
N = int(input())
N_prime = []

n = N
i = 2
while True:
    if i == N or i > (N**0.5):
        N_prime.append(int(n))
        break
    if n%i == 0:
        N_prime.append(i)
        n = n/i
        if n == 1:
            break
    else:
        i += 1
ct = []
temp_i = 0
for i in N_prime:
    if i in ct:
        if temp_i == i:
            temp_i *= i
            ct.append(temp_i)
        else:
            temp_i = i    
    else:
        ct.append(i)

print(len(ct))

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True
def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass
primelist=set(primes(10**6))

N=int(input())
if N==1:
    print(0)
    exit()
if is_prime(N):
    print(1)
    exit()
N_SQ=math.sqrt(N)
target=N
ans=0
last=0
sum=1
for i in range(2,int(N_SQ)+1):
    if target%i==0:
        for j in primelist:
            if j**int(math.log(i, j)) == i:
                ans+=1
                target/=i
                last=i
                break
if target!=1 and target!=last and N%target==0:
    for j in primelist:
        if j ** int(math.log(target, j)) == target:
            ans += 1
            break
print(ans)