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=int(input())
import sys
sys.setrecursionlimit(2147483647)
input=sys.stdin.readline

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

import math
def isPrime(num):
    if num < 2: return False
    elif num == 2: return True
    elif num % 2 == 0: return False
    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False
    return True
def callIsPrime(input_num):
    numbers = []
    for i in range(1, input_num):
        if isPrime(i):
            numbers.append(i)
    return numbers

sosu=(callIsPrime(int(n**0.5)))
sosu.sort()

if isPrime(n):
    sosu.append(n)

cnt=0
for item in sosu:
    c=item
    while n%c==0:
        n=n//c
        c=c*item
        cnt+=1

print(cnt)

Submission status: Wrong Answer

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

n = int(input())

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

if (Prime(n)):
    print("1")
else:
    cnt = 2
    ans = 0
    while n != 1 and n >= cnt:
        if n % cnt == 0:
            ans += 1
            n /= cnt
        cnt += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from collections import Counter
import math

def make_prime_list(N):
    prime_list = [2]
    for i in range(3,int(N**0.5)+1,2):
        flag = True
        for j in range(3,int(i**0.5)+1):
            if i % j == 0:
                flag = False
                break
        if flag:
            prime_list.append(i)
    return prime_list

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 main():
    N = int(input())
    C = Counter(prime_factorize(N))
    # print(C)
    ans = 0
    for c in C.values():
        ans += math.floor((2*c-1)**0.5)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def make_divisors(n):
    divisors = []
    for i in range(2, 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 main():
    N = readint()
    if N == 1:
        print(0)
        exit()
    p = make_divisors(N)
    if not p:
        print(1)
        exit()
    ans = 0
    for z in p:
        if not N % z:
            N //= z
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

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

ib = factorization(N)

ans = 0
for i in ib:
    ans += math.ceil(i[1] / 2)
print(ans)

Submission status: Wrong Answer

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

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

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

    return arr

def renzoku(n):
    i = 1
    while n - (i+1) > 0:
        n = n-i
        i += 1
    return i
      
N = int(input())
if N == 1:
  print("0")
  sys.exit()
oriN = N*1
A = factorization(N)
#print(A)
M = len(A)

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

Submission status: Wrong Answer

Solution code:
n = int(input())
N = n
count = 0
if N == 1:
    print("0")
elif N == 2:
    print("1")
elif N == 3:
    print("1")
else:
    for i in range(2,N):
        if i*i > N:
            if n >= i:
                count += 1
            break
        else:
            if n % i == 0:
                n = n / i
                count += 1
    print(count)

Submission status: Wrong Answer

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

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

    return arr

huga=[1,1]
for i in range(100):
  huga.append(huga[-1]+huga[-2])

n=int(input())
hoge=factorization(n)

ans=0
for i in range(len(hoge)):
  ans+=huga[hoge[i][1]-1]
  
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(100000)


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


elements = set()


def decomposition(used_set, last_used, rest):
    global elements

    if rest == 0:
        if len(used_set) > len(elements):
            elements = used_set
    i = last_used + 1
    while rest - i >= 0:
        if i in used_set:
            continue
        decomposition(used_set | {i}, i, rest - i)
        i += 1


N = int(input())
factors = factorization(N)
ans = 0
for p, e in factors:
    if e == 2:
        ans += 1
    else:
        elements = set()
        decomposition({1}, 1, e - 1)
        ans += len(elements)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
def solve() :
    n = int(input())
    m = int(math.sqrt(n))+1
    is_prime = [True]*m
    ans = 0
    temp = n
    if n == 1 :
        return 0
    for i in range(2, m) :
        if is_prime[i] :
            j=i 
            while n%j == 0 :
                n//=j 
                j*=i
                ans += 1
            
            j=i+i 
            while j<m :
                is_prime[j] = False
                j += i 
    if n == temp :
        return 1
    return ans

print(solve())

Submission status: Wrong Answer

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

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

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

    return arr
N = int(input())
l = factorization(N) 

ans = 0

for arr in l:
  if arr[0] != 1:
    a = ( arr[1]+1 ) // 2
    ans += a
  
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
if N == 1:
  print(0)
  exit(0)
f = factorization(N)
print(f)
ans = 0
amari_cnt = 0
for a,b in f:
  wk = b
  tempc = 1
  while wk  - tempc >= 0:
    wk -= tempc
    ans += 1
    tempc += 1

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
dic={}
import math
for i in range(2,math.floor(math.sqrt(n))):
  for j in range(10**10):
    if n%i==0:
      if i in dic:
        dic[i]+=1
      else:
        dic[i]=1
      n=n//i
    else:
      break

count=0
if n!=1:
  if not dic:
    count+=1
while dic:
  keep=1
  x=dic.popitem()
  num=x[1]
  for i in range(10**10):
    if num>=keep:
      num-=keep
      count+=1
      keep+=1
    else:
      break
print(count)

Submission status: Wrong Answer

Solution code:
import math
input = raw_input

def fctr1(n): 
    f=[]
    c=0
    r=int(n**0.5)
    for i in range(2,r+2):
        while n%i==0:
            c+=1
            n=n//i
        if c!=0:
            f.append([i,c])
            c=0
    if n!=1:
        f.append([n,1])
    return f

def find_max(x):
    #n0 = int(math.sqrt(2*x))

    #while True:
    #    n1 = n0 + 1
    #    if 2 * x < n1 * (n1+1):
    #        return n0
    #    n0 = n1 

    n0 = (-1 + math.sqrt(1+9*x)) // 2
    n0 = int(n0)
    return n0

n = int(input())

pairs = fctr1(n)

out = 0
for p, num in pairs:
    x0 = find_max(num)
    out += x0
print(out)

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())
t=make_divisors(N)
count=0
if N==1:
  print(0)
else:
  for i in range(1,len(t)):
    if N%t[i]==0:
      N=int(N//t[i])
      count+=1
    if N==0:
      break
  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

if n == 1:
    print(0)
    quit()
f = factorization(n)
ans = 0
c = len(f)
for i in range(c):
    s = 0
    g = f[i][1]
    if g == 2:
        ans += 1
    else:
        for j in range(g):
            s += j + 1
            f[i][1] -= j+1
            ans += 1
            if s >= g:
                break
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

#2以上の整数nに対して素因数分解
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 count(n):
    ret = 0
    for i in range(1,5):
        n -= i
        if n < 0:
            break
        else:
            ret += 1
    return ret

N = int(input())
if N == 1:
    print(0)
    sys.exit()
bunkai = factorization(N)
ans = 0
for i in bunkai:
    ans += count(i[1])
print(ans)

Submission status: Wrong Answer

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
#n = 2*10**8
n = 10000000
prime = [] # i番目の素数
is_prime = [True] * (n+1)
p = 0 # 何番目か　0-indexed
is_prime[0] = False
is_prime[1] = False
ll = 0
#print('a')
for i in range(2,n+1):
    #ll += 1
    #print(i)
    if is_prime[i] == True:
        prime.append(i) # p番目の素数はiとなる
        p += 1
        # print(ll)
        # if p == 1000*ll:
        #     print(p)
        for j in range(2*i, n+1,i):
            is_prime[j] = False # その素数の倍数のやつ

#print(sieve(n,11000000))
#print(prime)
import math
def is_prime(n):
    for i in range(2,int(math.sqrt(n)+1)):
        if n % i == 0:
            return False
    return n != 1 # 1の場合は除外

n = int(input())
if is_prime(n):
    print(1)
    exit()
cnt = 0
for v in prime:
    nya = v
    while n % v == 0:
        cnt += 1
        n //= v
        v *= nya
print(cnt)

Submission status: Wrong Answer

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

exp = []
div = []
for i in range(2, int(n**(1/2))+1):
    cnt = 0
    while n%i == 0:
        cnt += 1
        n //= i
    if cnt >= 1:
        exp.append(cnt)
        div.append(i)

for i in div:
    cnt = 0
    while n%i == 0:
        cnt += 1
        n //= i
    if cnt >= 1:
        exp.append(cnt)

if n == m:
    exp.append(1)

opr = 0
for x in exp:
    for i in range(x+1):
        if i*(i+1)//2 <= x < (i+1)*(i+2)//2:
            opr += i
            break

print(opr)

Submission status: Wrong Answer

Solution code:
from math import sqrt

N = int(input())

rn = int(sqrt(N))
sieve = [0] * (rn + 1)
sieve[0] = -1
sieve[1] = -1
t = [0] * (rn + 1)
for i in range(2, rn + 1):
    if sieve[i] != 0:
        continue
    sieve[i] = i
    j = i
    while j < rn + 1:
        t[j] = 1
        j *= i
    for j in range(i * i, rn + 1, i):
        if sieve[j] == 0:
            sieve[j] = i

result = 0
last = -1
for i in range(2, rn + 1):
    if t[i] == 0:
        continue
    if N % i == 0:
        result += 1
        N //= i
        last = i
if N != 1 and N > last:
    result += 1
print(result)

Submission status: Wrong Answer

Solution code:
n=int(input())
p=2
c=0
while n%p==0:
    c+=1
    n//=p
    p*=2
for i in range (3,n+1,2):
    p=i
    while n%p==0:
        c+=1
        n//=p
        p*=i
print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
num = int(n ** 0.5 // 1)
check = []
for i in range(2, num + 1):
    if n % i == 0:
        cnt = 0
        while True:
            if n % i != 0:break
            n = n // i
            cnt += 1
        check.append([i, cnt])
#print(check)
ans = 0

for num, cnt in check:

    temp = 1
    while True:
        if cnt >= temp:
            ans += 1
            temp += 1
            cnt -= 1

        else:break
print(ans if len(check) != 0 else 1)

Submission status: Wrong Answer

Solution code:
N=int(input())
l=[1,3,6,10,15,21,28,36,45]
a=0
for i in range(2,1000001):
    t=0
    while N%i==0:
        t+=1
        N//=i
    if t:
        for i in range(9):
            if t<l[i]:
                a+=i
                break
if N>1000000:
    a=1
print(a)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
X=[0]*(10**6+1)
for i in range(2,int(math.sqrt(n)+1)):
    cnt=0
    while n%i==0:
        n//=i
        cnt+=1
    X[i]=cnt
ans=0
for x in X:
    if x>=21:
        ans+=6
    elif x>=15:
        ans+=5
    elif x>=10:
        ans+=4
    elif x>=6:
        ans+=3
    elif x>=3:
        ans+=2
    elif x>=1:
        ans+=1
print(ans)

Submission status: Wrong Answer

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

    # Counter({3: 1, 673: 1}) - You can use this by enabling the following:
    a = collections.Counter(a)
    return a

def main():
    N = int(input())
    
    fct = prime_factorize(N)
    ans = 0
    for i_fct in fct:
        m = fct[i_fct]
        if m == 1:
            ans += 1
            continue
        
        sum = 1
        add = 1
        while True:
            if sum >= m:
                break
            sum += add
            add += 1
            ans += 1

    print(ans)
    return


if __name__ == "__main__":
    main()
    sys.exit(0)

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

if n == 1:
    print(0)
    quit()
f = factorization(n)
print(f)
ans = 0
c = len(f)
for i in range(c):
    s = 0
    g = f[i][1]
    if g == 2:
        ans += 1
    else:
        for j in range(g):
            s += j + 1
            f[i][1] -= j+1
            ans += 1
            if s >= g:
                break
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    if n == 1:
        print(0)
        return
    def eratos(n):
        flag = [True] * (n + 1)
        for i in range(2, int(n**0.5) + 1):
            if flag[i]:
                for j in range(2*i, n + 1, i):
                    flag[j] = False
        return [i for i, x in enumerate(flag) if x and i >= 2]
    p = eratos(10**6)
    work = []
    for i in p:
        piyo = 0
        while n % i == 0:
            n //= i
            piyo += 1
        if piyo > 0:
            work.append(piyo)
        if n == 1:
            break
    if len(work) == 0:
        result = 1
    else:
        result = 0
        for i in work:
            for j in range(1, 10**6):
                i -= j
                if i <0:
                    break
                result += 1
    print(result)
main()

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):
    # 素因数を格納するリスト
    factor = []
    # 2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            factor.append(num)

    # リストが空ならそれは素数
    if not factor and n != 1:
        factor.append(n)

    return factor


def main():
    n = input_int()

    a = factorization(n)

    target = set()

    from collections import deque
    tyofuku = deque()

    for _a in a:
        if _a in target:
            tyofuku.append(_a)
        else:
            target.add(_a)

    pre_val = 1
    while tyofuku:
        t_val = tyofuku.popleft()
        pre_val *= t_val
        if not pre_val in target:
            target.add(pre_val)
            pre_val = 1

    print(len(target))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
N_ = N = int(input())
if N == 1:
    print(0)
    exit()
div = {}
for i in range(2, int(math.sqrt(N))+1):
    while N % i == 0:
        N /= i
        if i in div:
            div[i] += 1
        else:
            div[i] = 1
    if N == 1:
        break
if len(div) == 0:
    div[N_] = 1
ans = 0
for v in div.values():
    i = 1
    while v >= i:
        v -= i
        i += 1
        ans += 1
print(ans)

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

ib = factorization(N)

ans = 0
for i in ib:
    ans += math.ceil(i[1] / 2)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

p = [0]*10**6
for i in range(2, 10**6):
    if p[i] == 0:
        p[i] = 1
        j = 2
        while i*j < 10**6:
            p[i*j] = -1
            j += 1

L = []
for i in range(10**6):
    if p[i] < 1:
        continue
    j = 1
    while pow(i, j) <= N:
        L.append(pow(i, j))
        j += 1

L.sort()
ans = 0
temp = []
for i in L:
    if N%i == 0:
        N //= i
        ans += 1
        temp.append(i)

i = 2
f = True
while i <= N**0.5:
    if N%i == 0 and i in temp:
        f = False
        break
    i += 1
if N in temp:
    f = False
if f:
    ans += 1
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) 
A=[]
d=0
for i in range(1,50):
  d+=i
  A.append(d)
import bisect
cnt=0
for x,y in a:
  e=bisect.bisect_right(A,y)
  cnt+=e
print(cnt)

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right

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

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

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

    return arr

N = int(input())
L = factorization(N)
A = [i for i in range(1,101)]
for i in range(99):
    A[i+1] += A[i]

ans = 0
for _, l in L:
    ans += bisect_right(A,l)
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

N = int(input())
A = factorization(N)
ans = 0
for i in range(len(A)):
    for j in range(1,A[i][1]+1):
        if N % A[i][0]**j == 0:
            ans += 1
            N //= A[i][0]**j
        else:
            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


elements = set()


def decomposition(used_set, last_used, rest):
    global elements

    if rest == 0:
        if len(used_set) > len(elements):
            elements = used_set
    i = last_used + 1
    while rest - i >= 0:
        if i in used_set:
            continue
        decomposition(used_set | {i}, i, rest - i)
        i += 1


N = int(input())
factors = factorization(N)
ans = 0
for p, e in factors:
    if e == 2:
        ans += 1
    else:
        elements = set()
        decomposition({1}, 1, e - 1)
        ans += len(elements)
print(ans)

Submission status: Wrong Answer

Solution code:
def sieve(x):
    """
    Sieve of Eratosthenes
    :param x: max value
    :return: list of bool
    """

    is_prime = [True] * (x + 1)
    is_prime[0] = is_prime[1] = False

    for i in range(2, x + 1):
        if is_prime[i]:
            for j in range(i * 2, x + 1, i):
                is_prime[j] = False

    return is_prime



def f(x):
    if x < 2:
        return False

    i = 2
    while i * i <= x:
        if x % i == 0:
            return False
        i += 1

    return True



n = int(input())

if f(n):
    print(1)
    exit()

is_prime = sieve(10 ** 6)
primes = [i for i, e in enumerate(is_prime) if e]

ans = 0
for e in primes:
    div = e
    while n % div == 0:
        n //= div
        ans += 1
        div *= e


print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
import numpy as np
from decimal import *

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

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

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

    return arr


n = int(input())
if n == 1:
    print(0)
else:
    arr = factorization(n)

    arr = np.array(arr)

    kazu = arr[:,1]
    sum = 0
    for i in range(1, 1000000):
        if len(kazu) ==0:
            break
        sum += len(kazu)
        kazu -= (i)
        tugi =[]
        for k in kazu:
            if k <= 0:
                sum -=1
                pass
            else:
                tugi.append(k)
        kazu = np.array(tugi)
    print(sum)

Submission status: Wrong Answer

Solution code:
import sys

# 実行環境(0:vscode, 1:atcoder)
MODE = 1

# 入力の次元
DIMENSION = 0

# int型に変換
INT_TYPE = 1

if not (MODE):
    with open("input.txt", "r") as f:
        s = f.read()
else:
    s = sys.stdin.read()

if DIMENSION == 0:
    if INT_TYPE == 1:
        s = int(s)
elif DIMENSION == 1:
    if INT_TYPE == 0:
        s = s.split()
    elif INT_TYPE == 1:
        s = [int(x) for x in s.split()]
elif DIMENSION == 2:
    if INT_TYPE == 0:
        s = [x.split() for x in s.splitlines()]
    elif INT_TYPE == 1:
        s = [[int(y) for y in x.split()] for x in s.splitlines()]


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


F = factorization(s)

cnt = 0
for i in range(len(F)):
    num = 1
    while 1:
        F[i][1] -= num
        if F[i][1] < 0:
            break
        else:
            num += 1
            cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
lis = []
for i in range(2,math.ceil(math.sqrt(n))+1):
    cnt = 0
    while n % i == 0:
        n //= i
        cnt += 1
    if cnt:lis.append(cnt)
ans = 0
if lis == []:
    if n == 1:
        print(0)
        exit()
    else:
        print(1)
        exit()
for num in lis:
    go = 1
    while num >= go:
        ans += 1
        num -= go
        go += 1
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque
N = int(input())

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

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

print(count)