Problem:


Score : 400 points

Problem Statement

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

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

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

z divides N;

z is different from all integers chosen in previous operations.

Then, replace N with N/z.

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

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

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

Sample Input 1

24

Sample Output 1

3

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

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

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

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

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

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

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

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

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

Sample Input 4

1000000007

Sample Output 4

1

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

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

Sample Input 5

997764507000

Sample Output 5

7



Sample input:
24


Sample output:
3

Submission status: Wrong Answer

Solution code:
# N:正の整数
# ある素数p
# 正の整数e
# z=p**eと表せる
# N % z == 0
# N = N/Z

# 因数分解
# 各因数は1からカウントアップして取れるだけ取る
import math
N=int(input())
p={}

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

for i in range(2,int(math.sqrt(N)+1)):
    while N % i == 0:
        if i in p:
            p[i]+=1
        else:
            p[i]=1
        N/=i
#
# print (p)

ans=0
for Pi in p.values():
    for j in range (1,Pi+1) :
        if Pi >= j:
            Pi  -= j
            ans +=1

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))

import math


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

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

   return arr


def main():
    n = input_int()

    ans = 0
    if n == 1:
        print(1)
        return
    a = factorization(n)
    for _, i in a:
        j = 1
        while i >= j:
            ans += 1
            i -= j
            j += 1

    print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def isPrime(x):
    if x==1:
        return False
    for i in range(2, int(x**0.5)+1):
        if x%i==0:
            return False
    return True

def primeFactorization2(x):
    ps = []
    es = []
    i=2
    upper = int(x**0.5)+1
    while i<upper:
        if x%i==0 and isPrime(i):
            ps.append(i)
            e=0
            while x%i==0:
                x = x//i
                e+=1
            es.append(e)
        i+=1
    return [ps, es]


n=int(input())
nums = primeFactorization2(n)[1]

ans=0
for i in nums:
    ans += int((-1+(1+8*i)**0.5)/2)

if isPrime(n):
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
def isPrime(x):
    if x==1:
        return False
    for i in range(2, int(x**0.5)+1):
        if x%i==0:
            return False
    return True

def primeFactorization2(x):
    ps = []
    es = []
    i=2
    upper = int(x**0.5)+1
    while i<upper:
        if x%i==0 and isPrime(i):
            ps.append(i)
            e=0
            while x%i==0:
                x = x//i
                e+=1
            es.append(e)
        i+=1
    return [ps, es]


n=int(input())
nums = primeFactorization2(n)[1]

ans=0
for i in nums:
    ans += int((-1+(1+8*i)**0.5)/2)
print(ans)

Submission status: Wrong Answer

Solution code:
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(n**0.5)+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(int(input()))
b = [1, 3, 6, 10, 15, 21, 28, 36, 43]

ans = 0

if len(a) == 1 and a[0][0] == 1:
  print(0)
  exit()
  
for i in a:
  for j in range(len(b)):
    if 2 < b[j]:
      ans+=j
      break
    
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
Log = []
Num = list(range(2,int(-(-N**0.5//1))+1))
for i in Num:
  for j in range(len(Log)):
    try:
      Num.remove(Log[j])
    except:
      continue
  Log.clear()
  c = 1
  T = True
  while T:
    if N%(i**c) == 0:
      N = int(N / (i**c))
      Log.append(i**c)
      c += 1
      count += 1
    else:
      T = False
      
if count == 0 and not N == 1:
  count = 1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
Log = []
Num = range(2,int(-(-N**0.5//1))+1)
for i in Num:
  if N % i == 0:
    count += 1
    N = int(N/i)
      
if count == 0 and not N == 1:
  count = 1
print(count)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if n==1: 
    print(0)
else:
    ans = 0
    k = int(math.sqrt(n)) + 1
    prime = set()
    n1 = n


    for i in range(2,k):
        while n1%i==0:
            prime.add(i)
            n1 = n1//i
        if n1==1: break


    for i in range(2,k):
        p = 1
        while n%(i**p)==0 and i in prime:
            ans+=1
            n = n//(i**p)
            p+=1
        if n<i: break

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
ans = 0
k = int(math.sqrt(n)) + 1
prime = set()
n1 = n


for i in range(2,k):
    while n1%i==0:
        prime.add(i)
        n1 = n1//i
    if n1==1: break


for i in range(2,k):
    p = 1
    while n%(i**p)==0 and i in prime:
        ans+=1
        n = n//(i**p)
        p+=1
    if n<i: break

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

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
for i in range(2,int(-(-N**0.5//1))+1):
  c = 1
  T = True
  while T:
    if N%(i**c) == 0:
      N = int(N / (i**c))
      c += 1
      count += 1
    else:
      T = False
      
if count == 0 and not N == 1:
  count = 1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
T = True
for i in range(2,int(-(-N**0.5//1))+1):
  c = 1
  while T:
    if N%(i**c) == 0:
      N = N / (i**c)
      c += 1
      count += 1
    else:
      T = False
      
if count == 0 and not N == 1:
  count = 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

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

    return arr

s = factorization(n)

count,ans = 1,0
for i in range(len(s)):
    while(s[i][1] >= count):
        ans += 1
        s[i][1] -= count
        count += 1
    count = 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

result = 0

n = N
p = 2
e = 0
while True:
    if n%p != 0:
        m = 1
        while e >= m:
            e -= m
            result += 1
            m += 1
        break
    else:
        n = n//p
        e += 1

n = N
p = 3
e = 0
l = int(N**(1/2))
while p <= l:
    if n%p != 0:
        m = 1
        while e >= m:
            e -= m
            result += 1
            m += 1
        e = 0
        p += 2
    else:
        n = n//p
        e += 1

if result == 0 and N != 1:
    result = 1

print(result)

Submission status: Wrong Answer

Solution code:
import math as m

def Div():
    N = int(input())
    c = 0
    k = N//2 + 1
    for i in range(2,k):
        if(prime(i)):
            for j in range(1,int(m.sqrt(N))+1):
                i = i ** j
                if(i>N):
                    break
                if(N%i==0):
                    N = N //i
                    c = c + 1
    
    return c

Submission status: Wrong Answer

Solution code:
from math import sqrt
itl = lambda: list(map(float, input().strip().split()))


def solve():
    N = int(input())
    if N == 1:
        return 0

    ans = 0
    for i in range(2, int(sqrt(N)) + 1):
        nxt = 1
        count = 0
        while N % i == 0:
            N //= i
            count += 1
            if count == nxt:
                count = 0
                ans += 1
                nxt += 1
    return 1 if ans == 0 else ans

 
if __name__ == '__main__':
    print(solve())

Submission status: Wrong Answer

Solution code:
import math
itl = lambda: list(map(float, input().strip().split()))


def isPrime(N):
    for i in range(2, int(math.sqrt(N)) + 1):
        if N % i == 0:
            return False
    return True
 
 
def solve():
    N = int(input())
    if N == 1:
        return 0
    elif isPrime(N):
        return 1
    ans = 0
    num = 2
    while num <= N:
        if N % num == 0:
            N //= num
            ans += 1
            if N >= num + 1 and isPrime(N):
                return ans + 1
        num += 1
    return ans
 
 
if __name__ == '__main__':
    print(solve())

Submission status: Wrong Answer

Solution code:
import math
itl = lambda: list(map(float, input().strip().split()))


def solve():
    N = int(input())
    if N == 1:
        return 0

    tmp = N
    ans = 0
    for i in range(2, int(math.sqrt(N)) + 1):
        if N % i == 0:
            N //= i
            ans += 1
            
    if N == tmp:
        ans += 1
    return ans


if __name__ == '__main__':
    print(solve())

Submission status: Wrong Answer

Solution code:
N = int(input())

result = 0
n = N
i = 2
e = 1
while n%(i**e)==0:
    n = n//(i**e)
    result += 1
    e += 1

for i in range(3,int(N**(1/2)+1),2):
    e = 1
    while n%(i**e)==0:
        n = n//(i**e)
        result += 1
        e += 1

if result == 0 and N != 1:
    result = 1

print(result)

Submission status: Wrong Answer

Solution code:
import math
itl = lambda: list(map(float, input().strip().split()))


def solve():
    N = int(input())

    tmp = N
    ans = 0
    for i in range(2, int(math.sqrt(N)) + 1):
        if N % i == 0:
            ans += 1
            N //= i
    if N == tmp:
        ans += 1
    return ans


if __name__ == '__main__':
    print(solve())

Submission status: Wrong Answer

Solution code:
num  = int(input())
#prime number counter
ans = 0
prime_check = [1]*1000100
count = 2
while num>1:
    if prime_check[count]==1: #countが素数だった場合
        tmp = 0
        while num % count == 0: #numの因数にcountが何個含まれているか
            num/= count
            tmp += 1
        tmp2 =1
        while tmp>=tmp2: #ansに加える
            ans += 1
            tmp -= tmp2
            tmp2 += 1
        tmp = count
        while tmp*count<=1e6:
            prime_check[tmp*count] = 0
            tmp += 1
    count += 1
    if(count>1e6):
        num = 0
if ans ==0:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
num  = int(input())
#prime number counter
ans = 0
prime_check = [1]*1000100
count = 2
while num>1:
    if prime_check[count]==1: #countが素数だった場合
        tmp = 0
        while num % count == 0: #numの因数にcountが何個含まれているか
            num/= count
            tmp += 1
        tmp2 =1
        while tmp>=tmp2: #ansに加える
            ans += 1
            tmp -= tmp2
            tmp2 += 1
        tmp = count
        while tmp*count<=1e6:
            prime_check[tmp*count] = 0
            tmp += 1
    count += 1
    if(count>1e6):
        num = 0

print(ans)

Submission status: Wrong Answer

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

a = factorization(int(input()))
b = [1, 3, 6, 10, 15, 21, 28, 36, 43]

ans = 0

if len(a) == 1 and a[0][0] == 1:
  print(0)
  exit()
  
for i in a:
  for j in range(len(b)):
    if i[1] < b[j]:
      ans+=j
      break
    
print(ans)

Submission status: Wrong Answer

Solution code:
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(n**0.5)+1):
    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(int(input()))
b = [1, 3, 6, 10, 15, 21, 28, 36, 43]

ans = 0

if len(a) == 1 and a[0][0] == 1:
  print(0)
  exit()
  
for i in a:
  for j in range(len(b)):
    if i[1] < b[j]:
      ans+=j
      break
    
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = []
count =0
count2 = 0
count3 = 0
X=int(N**0.5)
for i in range(X+1):
	if i ==0 or i == 1:
		pass
	elif N % i == 0:

		while N % i==0:
			N /= i
			count2 += 1
		j =1
		count3 = 0
		while count2 - j >=0:
			count2 -= j
			j = j+1
			count3 += 1 
		count += count3 		
		count2 = 0            
if count ==0 and N >1:
	count =1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = []
count =0
count2 = 0
count3 = 0
print(N)
X=int(N**0.5)
for i in range(X+1):
	if i ==0 or i == 1:
		pass
	elif N % i == 0:

		while N % i==0:
			N /= i
			count2 += 1
		j =1
		count3 = 0
		while count2 - j >=0:
			count2 -= j
			j = j+1
			count3 += 1 
		count += count3 		
		count2 = 0            
if count ==0 and N >1:
	count =1
print(count)

Submission status: Wrong Answer

Solution code:
import collections
n=int(input())
a=[]
count=0
max=n
while n%2==0:
    a.append(2)
    n=n/2
num=3
while num**2<=n+1:
    if n%num==0:
        a.append(num)
        n=n/num
    else:
        num+=2
if n!=1:
    a.append(n)
a=collections.Counter(a)
for i in a.values():
    x=1
    while x<=i:
        count+=1
        x+=1
        i-=1
print(count)

Submission status: Wrong Answer

Solution code:
import collections
import sys
n=int(input())
a=[]
count=0
number=n
max=n
while n%2==0:
    a.append(2)
    n=n/2
num=3
while num**2<=number+1:
    if number%num==0:
        a.append(num)
        number=number/num
    else:
        num+=2
if a==[]:
    count+=1
a=collections.Counter(a)
for i in a.values():
    count+=int(((8*i+1)**0.5)/2)
print(count)

Submission status: Wrong Answer

Solution code:
import collections
import sys
n=int(input())
a=[]
count=0
number=n
max=n
if(n==1):
    print(0)
    sys.exit()
while n%2==0:
    a.append(2)
    n=n/2
num=3
while num**2<=number:
    if number%num==0:
        a.append(num)
        number=number/num
    else:
        num+=2
if a==[]:
    count+=1
a=collections.Counter(a)
for i in a.values():
    x=1
    while x<=i:
        count+=1
        x+=1
        i-=1
print(count)

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 = []  # 全て素数であると初期化
    for i in range(N):
        if i * i > N:
            break
        is_prime.append(True)
    is_prime[0] = is_prime[1] = False # 0,1は素数ではない
    n = len(is_prime)
    for i in range(2, n):
        if is_prime[i]:
            # iは素数である
            prime.append(i)
            for j in range(2 * i, n, i):
                # iの倍数は素数でない
                is_prime[j] = False
    # N以下の素数を表示
    return prime, n

def main():
    N = int(input())
    if N == 1:
        print(0)
    else:
        if is_prime(N):
            print(1)
        else:
            prime_list, n = prime(N)
            used = []
            prime_exponentiation = []
            count = 0
            for i in range(len(prime_list)):
                now = prime_list[i]
                j = 1
                while now ** j <= n:
                    prime_exponentiation.append(now ** j)
                    j += 1
            prime_exponentiation.sort()
            for i in range(len(prime_exponentiation)):
                now = prime_exponentiation[i]
                if N < now:
                    break
                if N % now == 0:
                    count += 1
                    used.append(now)
                    N //= now
            if is_prime(N) and N not in used:
                count += 1
            print(count)


if __name__ == '__main__':
    main()

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 = []  # 全て素数であると初期化
    for i in range(N):
        if i * i > N:
            break
        is_prime.append(True)
    is_prime[0] = is_prime[1] = False # 0,1は素数ではない
    n = len(is_prime)
    for i in range(2, n):
        if is_prime[i]:
            # iは素数である
            prime.append(i)
            for j in range(2 * i, n, i):
                # iの倍数は素数でない
                is_prime[j] = False
    # N以下の素数を表示
    return prime

def main():
    N = int(input())
    if N == 1:
        print(0)
    else:
        if is_prime(N):
            print(1)
        else:
            prime_list = prime(N)
            used = []
            prime_exponentiation = []
            count = 0
            for i in range(len(prime_list)):
                now = prime_list[i]
                j = 1
                while now ** j <=  math.ceil(math.sqrt(N)):
                    prime_exponentiation.append(now ** j)
                    j += 1
            prime_exponentiation.sort()
            for i in range(len(prime_exponentiation)):
                now = prime_exponentiation[i]
                if N < now:
                    break
                if N % now == 0:
                    count += 1
                    used.append(now)
                    N //= now
            if N != 1 and N not in used:
                count += 1
            print(count)


if __name__ == '__main__':
    main()

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 = []  # 全て素数であると初期化
    for i in range(N):
        if i * i > N:
            break
        is_prime.append(True)
    is_prime[0] = is_prime[1] = False # 0,1は素数ではない
    n = len(is_prime)
    for i in range(2, n):
        if is_prime[i]:
            # iは素数である
            prime.append(i)
            for j in range(2 * i, n, i):
                # iの倍数は素数でない
                is_prime[j] = False
    # N以下の素数を表示
    return prime

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import collections
n=int(input())
a=[]
count=0
number=n
max=n
while n%2==0:
    a.append(2)
    n=n/2
num=3
while num<=number**0.5:
    if number%num==0:
        a.append(num)
        number=number/num
    num+=2
if a==[]:
    count+=1
a=collections.Counter(a)
for i in a.values():
    x=1
    while x<=i:
        count+=1
        x+=1
        i-=1
print(count)

Submission status: Wrong Answer

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

n = N
i = 2
while i <= N**0.5:
    if n%i != 0:
        i += 1
        continue
    
    N_prime.append(i)
    n = n/i
    if n == 1:
        break

if N_prime == []:
    N_prime.append(N)
elif n != 1:
    N_prime.append(int(n))

ct = []
for i in N_prime:
    if i not in ct:
        ct.append(i)
        temp_i = 1
        continue
    temp_i *= i
    if temp_i not in ct:
        ct.append(temp_i)
        temp_i = i
        continue

print(len(ct))

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 = []  # 全て素数であると初期化
    for i in range(N):
        if i * i > N:
            break
        is_prime.append(True)
    is_prime[0] = is_prime[1] = False # 0,1は素数ではない
    n = len(is_prime)
    for i in range(2, n):
        if is_prime[i]:
            # iは素数である
            prime.append(i)
            for j in range(2 * i, n, i):
                # iの倍数は素数でない
                is_prime[j] = False
    # N以下の素数を表示
    return prime

def main():
    N = int(input())
    if is_prime(N) or N == 1:
        print(1)
    else:
        prime_list = prime(N)
        used = []
        prime_exponentiation = []
        count = 0
        for i in range(len(prime_list)):
            now = prime_list[i]
            j = 1
            while now ** j <=  N:
                prime_exponentiation.append(now ** j)
                j += 1
        prime_exponentiation.sort()
        for i in range(len(prime_exponentiation)):
            now = prime_exponentiation[i]
            if N < now:
                break
            if N % now == 0:
                count += 1
                used.append(now)
                N //= now
        if is_prime(N) and not(N in used):
            count += 1
        print(count)


if __name__ == '__main__':
    main()

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 = []  # 全て素数であると初期化
    for i in range(N):
        if i * i > N:
            break
        is_prime.append(True)
    is_prime[0] = is_prime[1] = False # 0,1は素数ではない
    n = len(is_prime)
    for i in range(2, n):
        if is_prime[i]:
            # iは素数である
            prime.append(i)
            for j in range(2 * i, n, i):
                # iの倍数は素数でない
                is_prime[j] = False
    # N以下の素数を表示
    return prime

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


if __name__ == '__main__':
    main()

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 = math.ceil(math.sqrt(N))
        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
        used = []
        for i in range(len(ans)):
            now = ans[i]
            if N < now:
                break
            if N % now == 0:
                count += 1
                used.append(now)
                N //= now
        if is_prime(N) and not(N in used):
            count += 1
        print(count)

if __name__ == '__main__':
    main()

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 = math.ceil(math.sqrt(N))
        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
        if is_prime(N) and not(N in prime_list):
            count += 1
        print(count)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
ans = 0
if n == 1:
    print(0)
    quit()
m = n
for i in range(2, int(math.sqrt(n)) + 1):
    if n % i == 0:
        cnt = 0
        while n % i == 0:
            cnt += 1
            n //= i
        tmp = 1
        while cnt >= tmp:
            ans += 1
            cnt -= tmp
            tmp += 1
if n % m == 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
ans = 0
m = n
for i in range(2, int(math.sqrt(n)) + 1):
    if n % i == 0:
        cnt = 0
        while n % i == 0:
            cnt += 1
            n //= i
        tmp = 1
        while cnt >= tmp:
            ans += 1
            cnt -= tmp
            tmp += 1
if n % m == 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
ans = 0
for i in range(2, int(math.sqrt(n)) + 1):
    if n % i == 0:
        cnt = 0
        while n % i == 0:
            cnt += 1
            n //= i
        tmp = 1
        while cnt >= tmp:
            ans += 1
            cnt -= tmp
            tmp += 1

if ans == 0 and n != 1:
    ans = 1
print(ans)

Submission status: Wrong Answer

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
ans = 0
for i in range(2, int(math.sqrt(n)) + 1):
    if n % i == 0:
        cnt = 1
        j = i
        while n % j == 0:
            ans += 1
            n //= j
            j *= i
if ans == 0 and n != 1:
    ans = 1
print(ans)

Submission status: Wrong Answer

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
ans = 0
for i in range(2, int(math.sqrt(n)) + 1):
    if n % i == 0:
        cnt = 1
        while n % i == 0:
            ans += 1
            n //= i
            i *= i
if ans == 0 and n != 1:
    ans = 1
print(ans)