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 collections
n = int(input())
if n == 1:
    print(0)
else:
    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
    c = collections.Counter(prime_factorize(n))

    ans = 0
    if len(c) == 1:
        if c.values() == 1:
            ans += 1
        else:
            for k in range(1,100):
                if k/2*(2+(k-1)) >= list(c.values())[0]:
                    ans += k
                    break
    else:
        i = 0
        j = 0
        for l in range(len(c)):
            i == list(c.keys())[l]
            j = list(c.values())[l]
            if j == 1 or j == 2:
                ans += 1
            else:
                for k in range(1,100):
                    if k/2*(2+(k-1)) >= j:
                        ans += k
                        break

    print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
limit = math.ceil(math.sqrt(n))
result = 0
current = n
for i in range(2, limit+1):
  if current % i != 0:
    continue
  result += 1
  current = current // i
if n > 1 and result == 0: # こいつは素数
  result += 1
print(result)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if n == 1:
  print(0)
  exit(0)
  
pows = []
upto = int(math.sqrt(n))
for i in range(2, upto):
  if n % i == 0:
    cc = 0
    while n % i == 0:
      n //= i
      cc += 1
    pows.append(cc)

    
if len(pows) == 0:
  print(1)
  exit(0)
  
ans = 0
for pp in pows:
  start = 1
  cc = 0
  while pp - start >= 0:
    cc += 1
    pp -= start
    start += 1
    
  ans += cc

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

l=factorization(n)
cnt=0

for num,i in l:
    p=1
    while i>0:
        cnt+=1
        i-=p
        p+=1
        if i<p:
            break
print(cnt)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *
#import numpy as np
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
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=II()

current = 2
ans = factorization(N)

cnt = 0

for an in ans:
    if an[0] != 1:
        k = an[1]
        i = 1

        if k == 1:
            cnt += 1
        if k == 2:
            cnt += 1
        if k == 3:
            cnt += 2
        if k == 6:
            cnt += 3
        if k == 10:
            cnt += 4
        if k == 15:
            cnt += 5


print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
# = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]

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]

count = 0
z = make_divisors(N)

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

elif len(z) == 2:
    print(1)
    exit()

else:
    for i in range(1, len(z)):
        if N%z[i] == 0:
            count += 1
            N = N/z[i]

print(count)

Submission status: Wrong Answer

Solution code:
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
#sys.stdin = open("input.txt", "r")
#sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)
is_prime=[1 for i in range(10**6+1)]
is_prime[0]=0
is_prime[1]=0
for i in range(2,10**6+1):
    if(is_prime[i]):
        for j in range(2*i,10**6+1,i):
            is_prime[j]=0
n=l()[0]
ans=0
x=n
for i in range(2,int(n**0.5)+1):
    if(x%i==0 and is_prime[i]):
        p=i
        while(x%p==0):
            # print(i,x)
            ans+=1
            x//=p
            p*=i
if(ans==0 and n>=10**6):
    ans=1
print(ans)

Submission status: Wrong Answer

Solution code:
def fa(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)
  exit()
A=fa(n)
a=0
for i in range(len(A)):
  x=int(2*A[i][1]**(0.5))
  if (x-1)*x<=2*A[i][1]<x*(x+1):
    x=x-1
  if (x+1)*x<=2*A[i][1]<(x+2)*(x+1):
    x=x
  if (x+1)*(x+2)<=2*A[i][1]<(x+2)*(x+3):
    x=x+1
  a=a+x
print(a)

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
n=int(input())
t=prime_factorize(n)
t.append(0)
count=0
num=1
answer=0
for i in range(len(t)-1):
    if num==1:
        answer+=1
        if t[i]==t[i+1]:
            num+=1
    else:
        count+=1
        if count==num:
            answer+=1
            count=0
            if t[i]==t[i+1]:
                num+=1
            else:
                num=1
if n==1:
    answer=0
print(answer)

Submission status: Wrong Answer

Solution code:
import math
# def isPrime(n): 
      
#     # Corner case 
#     if (n <= 1): 
#         return False
  
#     # Check from 2 to n-1 
#     for i in range(2, n): 
#         if (n % i == 0): 
#             return False
  
#     return True
n=int(input())
count=0
# if isPrime(n)==True:
#     print(1)
# else:
for i in range(2,int(math.sqrt(n))+1):
        if n!=1:
            if n%i==0:
                count+=1
                n=n//i
        if n==1:
            break
if count==0:
    print(1)
else:
    print(count)

Submission status: Wrong Answer

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

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

for num, cnt in check:

    temp = 1
    while True:
        #print(ans, temp, cnt)
        if cnt >= temp:
            ans += 1
            cnt -= temp
            temp += 1
        else:break

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

Submission status: Wrong Answer

Solution code:
import math
def yakusu(n):
    results = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            results.append(i)
            results.append(n // i)
    return results

def eratos(n):
    isprime = [True for i in range(n+1)]
    isprime[0] = False
    isprime[1] = False
    for i in range(2, int(math.sqrt(n))+1):
        if isprime[i]:
            j = i + i
        while j <= n:
            isprime[j] = False
            j = j + i
    return isprime

N = int(input())
setA = set(yakusu(N))
A = list(setA)
is_prime = eratos(10**6)
if len(A) == 1:
    print(0)
elif len(A) == 2:
    print(1)
else:
    tmp = []
    ans = 0
    for i, b in enumerate(is_prime):
        if b:
            x = i
            while N % x == 0:
                ans += 1
                N = N//i
                x *= i
                print(N)
    # for ai in A:
    #     if is_prime[ai]:
    #         tmp += [ai]
    # for ti in tmp:
    #     while True:
    #         if ti in setA:
    #             ans += 1
    #             ti *= ti
    #         else:
    #             break
    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

f = factorization(N)
total = 0
for c in f:
    target = c[1]
    cnt = 0
    for i in range(1, c[1] + 1):
        target -= i
        if target < 0:
            break
        cnt += 1
    total += cnt

print(total)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
init_n = n
lst = []
for i in range(2, int(math.sqrt(n))+1):
  if n % i == 0:
    lst.append(i)
lst.append(n)
c = 0
for i in range(len(lst)):
  a = lst.pop(0)
  if n % a == 0:
    n = n / a
    c += 1
if init_n == 1:
  print(0)
else:
  print(c)

Submission status: Wrong Answer

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

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

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

    return arr




N = int(input())
sosuu = factorization(N)
#print(sosuu)
ans = 0

for partial in sosuu:
    #print(partial)
    partial_count = 0
    if partial[0] == 1:
        print(0)
        break
    for x in range(1,partial[1]+1):
        partial_count += x
        if partial_count > partial[1]:
            break
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

tmpn = n

dic = dict([])

for i in range(2, int(math.sqrt(n))+1):
    if tmpn%i == 0 and tmpn/i > 0:
        divided = True
        while divided:
            tmpn = tmpn/i
            if i in dic.keys():
                dic[i] += 1
            else:
                dic[i] = 1
            if tmpn%i == 0 and tmpn/i > 0:
                divided = True
            else:
                divided = False

if len(dic.keys()) == 0 and n != 1:
    ans = 1
else:
    ans = 0
    for key in dic.keys():
        num = dic[key]
        i = 1
        while num > 0:
            num -= i
            if num >= 0:
                ans += 1
            i += 1

print(ans)
# print(dic)

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 main():
  n = int(input())
  lst = factorization(n)

  ans = 0
  for _a, b in lst:
    i = 1
    while i <= b:
      b -= i
      i += 1
      ans += 1

  print(ans)

main()

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ruteN = math.ceil(math.sqrt(N))
prime=[1]*(ruteN+2)
prime[0]=0
primes=[]
count=0
for i in range(2,ruteN+2,1):
    if prime[i]==1:
        primes.append(i)
        count+=1
        for j in range(i*2,ruteN+2,i):
            prime[j]=0

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

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())

    def trial_division(n):
        divs = set()
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divs.add(i)
                if i != n//i:
                    divs.add(n//i)
        return divs

    divs = trial_division(N)
    if len(divs) == 2:
        return print(1)
    divs.discard(1)
    ans = 0
    for d in sorted(divs):
        if N == 1:
            break
        if N % d:
            continue
        N //= d
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

N = int(input())
a = prime(N)
import copy
b = copy.copy(a)
b = list(set(b))
res = 0
for i in b:
    cnt = 1
    while True:
        if a.count(i) < cnt:
            break
        cnt = cnt + cnt + 1
        res += 1
print(res)

Submission status: Wrong Answer

Solution code:
from collections import Counter


def pf(x):
  m = int(x ** 0.5)
  if x == 1:
    return []
  r = []
  while not x & 1:
    r += [2]
    x >>= 1
  i = 3
  while i < m + 1:
    while not x % i:
      r += [i]
      x //= i
    i += 2
  return r or [x]


def main():
  n = int(input())
  
  pp = pf(n)
 
  cc = Counter(pp)
  
  res = 0
  
  for c, v in cc.items():
    i = 1
    while True:
      if i > v:
        break
      v -= i
      res += 1
      i += 1
      
      
  print(res)
       


if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
n=int(input())
start=n
ans=0
for i in range(2,int((n+1)**0.5)):
    if(n%i==0):
        for j in range(1,100):
            if(n%(i**j)==0):
                ans+=1
                n/=i**j
            else:
                break
    if(n==1):
        break
if(n==start):
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
import math

def primeFactors(n): 
    ans = []
    # Print the number of two's that divide n 
    while n % 2 == 0: 
        ans.append(2) 
        n = n / 2
          
    # n must be odd at this point 
    # so a skip of 2 ( i = i + 2) can be used 
    for i in range(3,int(math.sqrt(n))+1,2): 
          
        # while i divides n , print i ad divide n 
        while n % i== 0: 
            ans.append(i)
            n = n / i 
              
    # Condition if n is a prime 
    # number greater than 2 
    if n > 2: 
        ans.append(int(n))

    return ans 

n = int(stdin.readline())

from collections import Counter

c = Counter(primeFactors(n))
# print(c)
ans = 0
t = list(c.keys())

for key in t:
    i = 1
    while c[key]!=0:
        if c[key]>=i:
            c[key] -= i
            ans += 1
            i += 1

        else:
            if c[key]%2 == 1:
                c[key] -= 1
            
            if c[key] == 0:
                del c[key]
            break

if len(c) == 0:
    print(ans)
else:
    # print(c)

    t = list(c.keys())

    processed = set()
    for k1 in t:
        for k2 in t:
            if k1!=k2:
                if (k1, k2) not in processed and (k2, k1) not in processed:
                    if c[k1] >= 2 and c[k2] >= 2:
                        
                        i = 2
                        while c[k1]>1 and c[k2]>1:
                            if c[k1] - i >= 0 and c[k2] - i >= 0:
                                ans += 1
                                c[k1] -= i
                                c[k2] -= i
                                i += 2

                            else:
                                processed.add((k1, k2))
                                break
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()

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

divs = get_divisors(N)

ans = 0
remains = []
for p, c in divs:
	i = 1
	while c >= i:
		c -= i
		ans += 1
		i += 1
	remains.append(c)

def get_minus(m):
	cnt = 0
	minus = 0
	i = 1
	while m >= i:
		m -= i
		cnt += 1
		minus += i
		i += 1
	return cnt, minus

import itertools
def get_cnt(remains, n):
	idx = range(len(remains))
	ret = 0
	for p in itertools.combinations(idx, n):
		m = min([remains[i] for i in p])
		if m <= 0:
			continue
		cnt, minus = get_minus(m)
		for i in p:
			remains[i] -= minus
		ret += cnt*n
	return ret

n = 2
while True:
	c = get_cnt(remains, n)
	remains = [r for r in remains if r != 0]
	if c == 0: break
	ans += c
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
b=[1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8]

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)
s=0
for i in range(len(a)):
    s+=b[a[i][1]-1]
print(s)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

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

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

from math import ceil, floor, log2
from collections import deque
from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product
from heapq import heapify, heappop, heappush

def solve():
    n = II()

    if n == 1:
        print(0)
        return

    num = n
    ans = 0
    for i in range(2, int(pow(n, 0.5))+1):
        if n % i: continue
        if num % i == 0:
            num //= i
            ans += 1
            if num == 1:
                print(ans)
                return
    print(ans if ans else 1)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *
#import numpy as np
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
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=II()

current = 2
ans = factorization(N)

cnt = 0

for an in ans:
    if an[0] != 1:
        k = an[1]
        i = 1

        if k == 1:
            cnt += 1
        if k == 2:
            cnt += 1
        if k == 3:
            cnt += 2
        if k == 6:
            cnt += 3
        if k == 10:
            cnt += 4        


print(cnt)

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 = []
ans = 0
for i in range(10**6):
    if p[i] < 1:
        continue
    j = 1
    while N%pow(i, j) == 0:
        L.append(pow(i, j))
        N //= pow(i, j)
        j += 1
        ans += 1

L2 = []
i = 2
while i <= N**0.5:
    if N%i == 0:
        L2 += [i, N//i]
    i += 1

if len(L2) == 0 and N > 1 and N not in L:
    ans += 1

print(ans)

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
c =  collections.Counter(prime_factorize(n))
a = c.values()

count =0
for i in a:
    k=1
    for j in range(n):
        if (i==1):
            count+=1
            break
        i-=k
        k +=j+1

        count +=1
        if (i<=j+1):
            break
    
print(count)

Submission status: Wrong Answer

Solution code:


import sys
from collections import defaultdict

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

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

def get_count(x):
    if x == 2:
        return 1
    s = set()
    i = 1
    while x:
        if x - i in s:
            break
        s.add(i)
        x -= i
        i += 1
    return len(s)



N = int(input())

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

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

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

ans = 0
for k, v in e.items():
    ans += get_count(v)
print(ans)

Submission status: Wrong Answer

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

ans = 0

for i in range(2, math.floor(math.sqrt(n + 1))):
    if n == 1:
        break
    if n % i == 0:
        n = n // i
        ans += 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
i = 2
while(N**0.5>i):
    tmpi = i
    while(N%tmpi==0):
        ans+=1
        N/=tmpi
        tmpi*=i
    i+=1
if N != 1:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
x = 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

l = factorization(x)
ans = 0
for i in range(len(l)):
  a = l[i]
  s = 0
  if a[1] == 1:
    ans += 1
  else:
    for j in range(1, a[1]):
      s += j
      if s >= a[1]:
        break
    ans += j
  
print(ans)

Submission status: Wrong Answer

Solution code:
def factorization(n): #素因数分解のプログラム([素因数,指数]のリストのリストで出力→24→[[2, 3], [3, 1]])
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

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

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

    return arr 

import math
import sys
n = int(input())
ls = factorization(n)
q = 0
if n == 1:
    print(0)
    sys.exit()
for i in range(len(ls)):
    j = 1
    k = 2
    p = 0
    while True:
        if ls[i][1] >= j:
            j += math.factorial(k)
            p += 1
            k += 1
        else:
            break
    q += p
print(q)

Submission status: Wrong Answer

Solution code:
from collections import Counter


def pf(x):
  m = int(x ** 0.5)
  if x == 1:
    return []
  r = []
  while not x & 1:
    r += [2]
    x >>= 1
  i = 3
  while i < m + 1:
    while not x % i:
      r += [i]
      x //= i
    i += 2
  return r or [x]


def main():
  n = int(input())
  
  pp = pf(n)
  
  print(pp)
 
  cc = Counter(pp)
  
  res = 0
  
  for c, v in cc.items():
    i = 1
    while True:
      if i > v:
        break
      v -= i
      res += 1
      i += 1
      
      
  print(res)
        
    
  

    


if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
import math
import random
from decimal import Decimal
import itertools
import re
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(2147483647)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

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 main():
	n = I()
	factos = factorization(n)
	count = 0
	for num, facto in factos:
		sum_tmp = 0
		for i in range(1,facto+1):
			sum_tmp += i
			if sum_tmp <= facto:
				count += 1
	print(count)


if __name__ == '__main__':
    main()

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

ans = factorization(n)
val = 0
for arr in ans:
    tmp = arr[1]
    for i in range(1,50):
        tmp = tmp -(i)
        if tmp < 0:
            val +=i - 1
            break
print(val)

Submission status: Wrong Answer

Solution code:
N=int(input())
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct


sosu=[1,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,57,59,61,67,71]

bunkai=factorize(N)
blist=list(set(bunkai))

ans=0
for i in blist:
    tmp=bunkai.count(i)
    for p in sosu:
        if tmp>=p:
            ans+=1
            tmp-=p
        else:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
def is_prime(n):
    for i in range(2, int(n ** 0.5)):
        if n % i == 0:
            return False
    return True


def primes(n):
    ps = {}
    for i in range(2, n):
        if n == 1:
            break
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                n = n // i
                cnt += 1

            ps[i] = cnt

    return ps


def main():
    n = int(input())
    if is_prime(n):
        print(1)
        exit()

    ps = primes(n)

    ans = 0
    # print(ps)
    for k, v in ps.items():
        m = (1 / 2) * (1 + 8 * (v - 1)) ** 0.5
        # print(m, 1 + int(m))
        ans += int(m)

    print(ans)


if __name__ == '__main__':
    main()