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 #sqrt,gcd,pi
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# from itertools import product,permutations,\
#     combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

mod = int(1e9+7)
# mod = 998244353
INF = 1<<29
lINF = 1<<35

def Divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    divisors.sort()
    return divisors

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

def main():
    N = int(input())
    ans = 0
    div = Divisors(N)
    div.pop(0)
    while True:
        x = N
        for i in range(len(div)):
            if N%div[i]==0:
                N //= div[i]
                div.pop(i)
                ans += 1
                break
        if N==x:
            break
    print(ans)
    return

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
import itertools
import sys

N = int(input())

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


def prime_factors(n):
    # https://codereview.stackexchange.com/a/121869
    # i ranges over 2 and odd numbers 3, 5, 7, ...
    # returns each prime as many times as it divides n
    """Find prime factorization of n"""
    for i in itertools.chain([2], itertools.count(3, 2)):
        if n <= 1:
            break
        while n % i == 0:
            n //= i
            yield i

primes = {}

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

def find_k(E):
    k = 1
    while k**2 + k <= 2*E:
        k += 1
    return k-1

total = 0
for p in primes:
    total += find_k(primes[p])

#print(primes)
if not primes:
    print(1)
else:
    print(total)

Submission status: Wrong Answer

Solution code:

import collections

n = int(input())

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

def cnt(a,b):
    if a == 1:
        return b
    else:
        if a - b > 0:
            return cnt(a-b,b+1)
        elif a == b:
            return b
        else:
            return b
    

c = collections.Counter(prime_factorize(n))
cn = 0
for i in c.values():
    cn += cnt(i,1)

print(cn)

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)
    sa = list(sorted(p))
    ans = []
    i = 1
    for v in sa:
        i *= v
        if i not in ans and n % i == 0:
            ans.append(i)
            i = 1
    count = 0
    for v in ans:
        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:
N = int(input())

def factorization(n):
    a = []
    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
            a.append([i, cnt])

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

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

    return a

result = factorization(N)

count = 0
for p,i in result:
    if p == 1:
        continue
    for k in range(1, (i+1)//2+1):
        if p ** k > N:
            break
        N /= p ** k
        count += 1
print(count)

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]
 
N = int(input())

t = N
ans = 0

yaku = make_divisors(N)
so = [2]

for s in yaku[1:]:
    if t < s:
        break
    if t % s == 0:
        if s % 2 == 0:
            if math.log2(s) % 1 == 0:
                t = int(t / s)
                ans += 1
        else:
            if all(s % s2 != 0 for s2 in so):
                so.append(s)
                is_so = True
            elif any(math.log(s, s2) % 1 == 0 for s2 in so):
                is_so_baisu = True
            if is_so or is_so_baisu:
                t = int(t / s)
                ans += 1
print(ans)

Submission status: Wrong Answer

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

############ ---- Input Functions ---- ############
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))

def solve(b):
    primes = [n for n in range(b + 1)]
    for i in range(4,b + 1,2):
        primes[i] = 2
    
    for i in range(2,b + 1):
        if primes[i] == i:
            j = 2
            while j * i < b:
                primes[j * i] = i
                j += 1

    factors = {}
    while b != 1:
        for i,num in factors.items():
            if primes[b] == i:
                factors[i] += 1 
                break
        else:    
            factors[primes[b]] = 1

        b = b // primes[b]
    return factors

    

def main():
    n = inp()
    answer = solve(n)
    set1 = []
    res = -1
    for key,value in answer.items():
        d = 1
        while value >= d:
            value -=d
            d += 1
        res +=d

    print(res)

main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list()

if n == 1:
  print(0)
else:
  for i in range(1,n):
  	if n%i==0:
   	  a.append(i)
   	  a.append(n/i)
  	if i*i>n:break
    
  a = sorted(a[1:])   

  cnt=0

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

  print(cnt)

Submission status: Wrong Answer

Solution code:
#nの素数判定
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

import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n = I()
ans = 0
if is_prime(n):
    ans = 1
elif n == 1:
    ans = 0
else:
    l = [i for i in range(2, 1000000)]
    # d = collections.deque(l)
    for i in l:
        if n % i == 0:
            ans += 1
            n = n//i
        if n == 1:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

import math

def sieve_of_eratosthenes(n):
    candidate = [i for i in range(2, n+1)]
    prime = []
    limit = math.sqrt(n) + 1

    while True:
        p = min(candidate)
        if limit <= p:
            prime.extend(candidate)
            break
        prime.append(p)

        candidate = [i for i in candidate if i % p != 0]

    return prime


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

rn = math.ceil(math.sqrt(N))
L = sieve_of_eratosthenes(rn)

n = N
c = 0

for l in L:
    if n % l == 0:
        i = 1
        l2 = l
        while n % l2 == 0:
            c += 1
            i += 1
            n = n // l2
            l2 = l ** i

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

Submission status: Wrong Answer

Solution code:
from math import sqrt as s
def fact(n):
    c=0
    m=1
    l=[]
    while n%2==0:
        m=m*2
        n=n//m
        c+=1
    for i in range(3,int(s(n))+1,2):
        m=1
        while n%i==0:
            c+=1
            m=m*i
            n=n//m
    if n>2:
        c+=1
    return c

print(fact(int(input())))

Submission status: Wrong Answer

Solution code:
import math
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
d = factorization(n)
ins = []
for i in range(len(d)):
    for j in range(1,d[i][1]+1):
        ins.append(d[i][0]**j)
ins.sort()
cnt = 0
for z in ins:
    if n>1:
        n = n/z
        cnt += 1
    else:
        break
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
from copy import deepcopy
from collections import deque
from math import floor

def main():
    n = int(input())
    on = n
    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
    if is_prime(n):
        print(1)
        sys.exit()

    nn = floor(n**0.5)
    nn = max(6, nn)
    p = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(nn + 1)]
    p[0] = p[1] = False
    p[2] = p[3] = p[5] = True
    for i1 in range(7, floor(nn ** 0.5) + 1, 2):
        if p[i1]:
            for i2 in range(i1 ** 2, nn + 1, i1):
                p[i2] = False
        else:
            continue
    pl = [i for i, b in enumerate(p) if b == True]

    nums = deepcopy(pl)
    for pe in pl:
        cnt = 2
        while True:
            tnum = pow(pe, cnt)
            if tnum > n:
                break
            elif tnum != 0:
                if n % tnum == 0:
                    nums.append(tnum)
            cnt += 1
    nums.sort()
    numss = set(nums)
    numsd = deque(numss)
    #print(numsd)
    r = 0
    while True:
        if not numsd:
            break
        if n == 1:
            break
        nextn = numsd.popleft()
        if nextn > on:
            continue
        elif n % nextn == 0:
            n = int(n / nextn)
            r += 1
    print(r)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
a={}
temp=n
for i in range(2,int(n**0.5)+1):
    if temp % i ==0:
        count=0
        while temp % (i**(count+1)) ==0:
            count+=1
        temp= temp/(i**count)
        a[i]=count

sum=0
for i in a:
    jisu= a[i]
    temp=1
    while temp*(temp+1)/2<= jisu:
            temp+=1
    sum+= temp-1

print(sum)

Submission status: Wrong Answer

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

N= int(input().rstrip('\n'))
M=N
lim = math.floor(math.sqrt(N))+10
res = 0
pri=[2]
for i in range(2,lim+1):
  if all(i % x != 0 for x in pri) or i==2:
    if N % i ==0:
      pri.append(i)
      add = 1
      pl = 1
      n = N//i
      while n%i==0:
        pl += 1
        n = n//i
        if pl==((add+1)*(add+2)/2):
          add += 1
      res += add
      N = N//(i**pl)
if M == N and N>1:
  res += 1
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())

n = N
memo = []
cnt = 0

for i in range(2,N+1):
    if N == 1000000007:
        print(1)
        exit()
    if N == 1:
        break
    if i in memo:
        continue
    if N % i == 0:
        memo.append(i)
        n = N // i
        cnt += 1
    N = n    
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(0.5*i*(i+1)) for i in range(30)]
import math
res = 0
top = int(math.sqrt(N))
for i in range(2,top+1):
    count = 0
    while N%i == 0:
        N = N//i
        count += 1
    for j in range(10):
        if count < a[j]:
            res += (j-1)
            break
print(max(1,res))

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
i=0
l=list()
n2=n
while True:
        i=i+1
        n1=n2/(2**i)
        if n1-math.floor(n1)>0:
            l.append(i-1)
            break
        n2=n1
for p in range (3,6*(10**6)-1,2): 
    i=0
    while True:
        i=i+1
        n1=n2/(p**i)
        if n1-math.floor(n1)>0:
            l.append(i-1)
            break
        n2=n1
        if n2<p:
            break
if n2>p:
    print(1)
else:
    print(sum(l))

Submission status: Wrong Answer

Solution code:
import math

def search_divide_minimum_number(n, check_list):
    num = n
    for i in range(2, int(math.sqrt(n))+1):
        if (n%i == 0)&(not i in check_list):
            num = i
            break
    return num

if __name__ == "__main__":
    N = int(input())
    check_list = []
    while(N != 1):
        factor = search_divide_minimum_number(N, check_list)
        if not factor in check_list:
            check_list.append(factor)
        N //= factor
    
    print(len(check_list))

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 == 0:
                count += 1
                N /= now
    print(count)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
count = 0
mem = {}
def is_prime(p):
    dest = int(math.sqrt(p))
    for i in range(2, dest):
        if p % i == 0:
            return False
    return True

if is_prime(N):
    print(1)
else:
    for p in range(2, int(math.sqrt(N))):
        if N % p != 0:
            continue
        
        if not is_prime(p):
            continue

        if p not in mem:
            mem[p] = []
        e = 1
        while True:
            if p**e > N:
                break
            elif e not in mem[p] and N % p**e == 0:
                mem[p].append(e)
                z = p**e
                N = N // z
                count += 1
                
            if N % p != 0:
                break

            e += 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


bunkai = factorization(N)
count = 0

for x in bunkai:
    check = x[1]
    current = 1
    while True:
        check -= current
        if check > 1:
            current += 1
        else:
            break
    count += current
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]
n = int(input())
i = 0
remove_nums = [1]
while True:
    divisors = make_divisors(int(n))
    z_cand = [d for d in divisors if d not in remove_nums]
    if z_cand == []:
        break
    z = min(z_cand)
    remove_nums.append(z)
    n = n/z
    i += 1
print(i)

Submission status: Wrong Answer

Solution code:
import math
from sys import exit

n=int(input())
primes = {}
i = 2
ans = 0
square = math.floor(math.sqrt(n))

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

while True:
    if n % i == 0:
        if i not in primes.keys():
            primes[i] = 1
        else:
            primes[i] += 1
        n = n // i
    elif n == 1 or i > square:
        break
    else:
        if i == 2:
            i += 1
        else:
            i += 2
        continue

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

for k,v in primes.items():
    base = v * 2
    root = math.floor(math.sqrt(base))
    if root * (root + 1) > base:
        root -= 1
    ans += root

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

p = [2]
count = 0
for i in range(2,N):
  if N % i == 0:
    flag = 1
    for j in range(2,i):
      if j != 2 and i % j != 0:
        flag = 0
    if flag == 1:	# 素数である場合
      #print('sosuu:',i)
      p.append(i)
      N /= i
      count+=1
    elif flag == 0:	# 素数でないが、素数の冪乗である場合
      for j in range(len(p)):
        if i % p[j] == 0:
          #print(i)
          N /= i
          count+=1
          break
  if N == 1:
    break
print(count)

Submission status: Wrong Answer

Solution code:
###############################################################################
#Imports
import collections
import itertools
from functools import lru_cache
import sys
import math
###############################################################################
#Constants
MOD = int(1e9)+7
###############################################################################
#Helper
def helper():
	pass
###############################################################################
#Solver
def solve():
	n = int(input())
	if n == 1:
		print(0)
		return
	x = n
	count = 0
	for i in range(2,int(math.sqrt(n))+4):
		if i == 1:
			break
		if x % i == 0:
			x = x // i
			count += 1
	if x == n:
		print(count + 1)
		return
	print(count)

###############################################################################
#Driver
t = 1
for _ in range(t):
	solve()
###############################################################################

Submission status: Wrong Answer

Solution code:
N = int(input())
maxT = int(N**.5)+1
ans = 0
cnt = 0
while N%2 == 0:
    cnt += 1
    N //= 2
i = 1
while cnt >= i:
    ans += 1
    cnt -= i
    i += 1
t = 3
while t <= maxT:
    if N%t == 0:
        cnt = 0
        while N%t == 0:
            cnt += 1
            N //= t
        i = 1
        while cnt >= i:
            ans += 1
            cnt -= i
            i += 1
    t += 2
if ans == 0 and N > 2:
    ans = 1
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
    print(len(ans))
    # 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:
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]

if N == 1:
    print(0)
else:
    a = make_divisors(N)
    if len(a) == 2:
        print(1)
    else:
        b = len(a) / 2
        c = round(b) - 1
        print(c)

Submission status: Wrong Answer

Solution code:
def create_divisors(n):
  """
  自然数nの全ての約数を列挙したリストを作成する。

  Parameters
  ----------
  n : int
    自然数

  Returns
  -------
    divisors：list

  """
  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
def factorization(n):
    """
    引数の値を素因数分解したリストを返す

    Parameters
    ----------
    n : int
        素因数分解したい自然数

    Returns
    -------
    retlist : list
        2以上の整数n => [[素因数, 指数], ...]の2次元リスト
    """
    retlist = []
    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
            retlist.append([i, cnt])

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

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

    return retlist
def isPrime(x):
  """
  xが素数か否か判定する。

  Parameters
  ----------
  x: int
      自然数

  Returns
  -------
      True:素数
      False:素数ではない
  """
  if x<2:
    return False
  for i in range(2,int(x**0.5)+1):
    if x%i==0:
      return False
  return True

n=int(input())
d=factorization(n)
# print(d)
p=[]
for i in range(len(d)):
  if isPrime(d[i][0]):
    p.append(d[i]) 

w=[int(i)  for i in range(1,100001)]
from itertools import accumulate
from bisect import bisect_left
s=list(accumulate(w))
ans=0
for i in range(len(p)):
  idx=bisect_left(s,p[i][1])
  ans+=idx+1
  if p[i][1]-s[i-1]>0 and p[i][1]>1:
    ans-=1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
num=1
count=0
num2=int(math.sqrt(n))
while n!=1:
    num+=1
    if n%num==0:
        count+=1
        n=n//num
        num2=math.sqrt(n)
    if num2<num and count==0:
        count+=1
        break
    elif num2<num:
        if n<=num:
            break
        else:
            count+=1
            break
print(count)

Submission status: Wrong Answer

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

n = int(input())

def Prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

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

        if n == 1:
            break

    print(ans)

Submission status: Wrong Answer

Solution code:
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 search(s,l,i,d):

    if i not in s:
        return [i,d]
    elif len(l) <= 0:
        return [0,0]
    else:
        i = i*l[0]
        # print('se',i,l[0])
        d += 1
        return search(s,l[1:len(l)],i,d)


n = int(input())
l = factorization(n)
ans = 0



if n == 1:
    ans = 0
elif l[0][0] == n:
    ans = 1

else:
    l2 = []
    s = set()
    for i in l:
        for j in range(i[1]):
            l2.append(i[0])

    lc = 0
    for i in range(len(l2)):
        if lc > 0:
            lc -= 1
            continue

        tm = search(s,l2[i+1:len(l2)],l2[i],0)
        # print(s,l2[i],l2[i+1:len(l2)])
        if tm[0] != 0:
            # print('tm',tm)
            s.add(tm[0])
            ans += 1
            lc += tm[1]
        else :
            break

    
print(ans)

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
        count = 0
        for i in range(len(ans)):
            now = ans[i]
            if N % now == 0:
                count += 1
                N /= now
    print(count)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

cnt = 0
z = 2
def check(z):
    a = set(prime_factorize(z))
    if len(a) == 1:
        True
    else:
        False

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

while True:
    if n < z:
        break
    if check(z):
        z+=1
        continue
    if n % z == 0:
        n = n // z
        cnt += 1
    z += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
def seachPrimeNum(N):
    max = int(N ** (1/2))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

a = seachPrimeNum(10 ** 6)
n=(int)(input())
ans = 0
if n < 2:
  print(ans)
else:
  ans = 0
  count = 0
  while(count < 1230):
    temp = 0
    while(n % a[count] == 0):
      n = n // a[count]
      temp += 1
    if temp >= 36:
      ans += 8
    elif temp >= 28:
      ans += 7
    elif temp >= 21:
      ans += 6
    elif temp >= 15:
      ans += 5
    elif temp >= 10:
      ans += 4
    elif temp >= 6:
      ans += 3
    elif temp >= 3:
      ans += 2
    elif temp >= 1:
      ans += 1
    
    count += 1
    temp = 0
    if n < 2:
      print(ans)
      break
  if count == 1230:
      print(1)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 1:
    print(0)
    exit()
bag = [1]


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()
    if 1 in divisors:
        divisors.remove(1)
    return divisors


res = 0
for i in sorted(make_divisors(N)):
    N /= i
    res += 1
    if N == 1:
        break

print(res)

Submission status: Wrong Answer

Solution code:

def pri_me(x):
    if x == 2:
        return True
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            return False
    return True
#print(pri_me(n))


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())
if n==1:
    print(0)
    exit()
if pri_me(n):
    print(1)
    exit()
N = n
ans = 0
for i in range(2,int(N**0.5)+1):
    if n%i==0 and len(set(prime_factorize(i)))==1: 
        n=n//i
        ans += 1
        if n <=1:
            break
        #print(n,i)
        #print(len(set(prime_factorize(i)))
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

ans = primef(N)

print(len(ans))

Submission status: Wrong Answer

Solution code:
import bisect
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

arr = factorization(n) 
ans = 0

tosa = [0 for _ in range(1000)]
for i in range(1000):
    tosa[i] = int(i*(i+1)/2)

for s in arr:
    num = s[1]
    cnt = bisect.bisect_right(tosa, num) - 1
    ans += cnt

print(ans)