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 math
n = int(input())
if n == 1:
    print(0)
    exit()
def makeprime(value):
    flag  = [True for _ in range(value)]
    ans = []
    for i in range(1,len(flag)):
        if flag[i]:
            ans.append(i+1)
            for j in range(i,len(flag),i+1):
                flag[j] = False
    return ans
for i in range(2,int(math.sqrt(n)+1)):
    if n%i == 0:
        flag = 1
        break
else:
    flag = 0
if flag:
    u = []
    r = n
    ans = 0
    rem = makeprime(int(math.sqrt(n)))
    for i in rem:
        o = 1
        while (i**o <= n):
            u.append(i**o)
            o += 1
    u.sort()
    for i in u:
        if n%i == 0:
            ans += 1
            n //= i
    print(ans)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
from collections import Counter
# 素因数分解する
# 10 = 2,5 -> 2回
def 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())
arr = dict(Counter(factorize(N)))
amap = {}
ans = 0
for v, c in arr.items():
    ans += 1
    if c > 2:
        i = 2
        while c > i:
            i += i
            ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))
 
def main():
    n=I()
    dic={}
    import math
    for i in range(2,int(math.sqrt(n))*2):
        if n%i==0:
            while(n%i==0):
                if i in dic:
                    dic[i]+=1
                else:
                    dic[i]=1
                n//=i
        if n==1:
            break
    if not dic:
        if n!=1:
            dic[n]=1
    ans=0
    for k,v in list(dic.items()):
        tmp=v
        sub=1
        tmp-=sub
        if tmp==0:
            ans+=1
        while tmp>0:
            ans+=1
            tmp-=sub
            sub+=1
        if tmp<0:
            dic[k]=tmp+sub
        else:
            dic.pop(k)
    print(ans)
        

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
maxn = (10**6) + 10

primes = []

def ESieve():
    sieve = [True] * maxn
    sieve[0] = sieve[1] = False;

    for i in range(2, maxn):
        if sieve[i]:
            primes  .append(i)
            
            for j in range(i*i, maxn, i):
                sieve[j] = False

def is_prime(n):
    if n < 2:
        return False;

    for p in primes:
        if n % p == 0:
            return False;
    
    return True

ESieve();

n = int(input())
ans = 0

if n == 1:
    ans = 0
elif is_prime(n):
    ans = 1;
else:
    for p in primes:
        q = p
        while n % q == 0:
            n = n // q
            q = q * p
            ans = 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(cnt)

    if temp!=1:
        arr.append(1)

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

    return arr
A = factorization(N)
if N == 1:
    print(0)
else:
    for i in range(len(A)):
        if A[i] == 1:
            A[i] = 1
        else:
            s = (-1+math.sqrt(1+8*A[i]))/2
            A[i] = s
    print(int(sum(A)))

Submission status: Wrong Answer

Solution code:
n = int(input())

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

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

cnt = 0
flag = 10*110
for z in range(2,10**12):
    if n % flag == 0:
        continue
    if n % z == 0:
        n = n // z
        cnt += 1
    else:
        flag +=z

    if n == 1 or is_prime(n) == True:
        print(cnt)
        exit()

Submission status: Wrong Answer

Solution code:
import math


n = int(input())
cnt_list = [1,3,6,10,15,21,28,36]

def get_cnt(i):
    loop_cnt = min([int(math.sqrt(i)) + 10, i])
    ret = 0
    j = 2
    cnt = 0
    while j <= loop_cnt:
        if i % j == 0:
            i /= j
            cnt += 1
        else:
            if cnt > 0:
                for k in range(8):
                    if cnt < cnt_list[k]:
                        ret += k
                        break
                cnt = 0
            j += 1
        if i == 0:
            break
    if i != 1:
        ret += 1
    return ret

print(get_cnt(n))

Submission status: Wrong Answer

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

A=make_divisors(N)
#print(A)

c=0
for i in range(2,len(A)):
    if N%A[i]==0:
        N = N//A[i]
        c+=1
print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = 0
for i in range(2, int(-(-N**0.5//1))+1):
  if N == 1:
    break
  if N % i == 0:
    N = int(N / i)
    n += 1

if N != 1 and n == 0:
  print(1)
else:
  print(n)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
m=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(m)
ans=0
for i in range(len(l)):
    a=1
    while(l[i][1]>=a):
        ans+=1
        l[i][1]-=a
        a+=1

print(ans)

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))+5):
		if x == 1:
			break
		if x % i == 0:
			x = x // i
			count += 1
			if x == i:
				break
	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())
# = 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 z[i]>N:
            break
        elif N%z[i] == 0:
            count += 1
            N = N//z[i]

print(count)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
ans = 0
k = int(math.sqrt(n)) + 1
for i in range(2,k):
    p = 1
    while n%(i**p)==0:
        ans+=1
        p+=1
        n = n//(i**p)
    if n==1: break
print(ans)

Submission status: Wrong Answer

Solution code:
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") # 無限
# 参考URL
# https://qiita.com/LorseKudos/items/9eb560494862c8b4eb56
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]

input_n = int(input())

divisor_list = make_divisors(input_n)
divisor_list.remove(1)

count = 0

# print(divisor_list)
if 0 < len(divisor_list):
    for divisor in divisor_list[:]:
        # print("n:{} div:{}".format(n,divisor))
        if input_n%divisor==0:
            count += 1
            input_n //= divisor
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())


def prime_factorize_n(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


a_list = prime_factorize_n(n)
# print(a_list)

tmp = 1
used_list = []
for i in range(len(a_list)):
    if a_list[i] not in used_list:
        used_list.append(a_list[i])

    else:
        if tmp == 1:
            tmp = a_list[i]

        else:
            if tmp % a_list[i] == 0:
                tmp *= a_list[i]
                if tmp not in used_list:
                    used_list.append(tmp)
                    tmp = 1
            else:
                tmp = 1

# print(used_list)
print(len(used_list))

Submission status: Wrong Answer

Solution code:
n = int(input())

def get_primenumber(N):
    prime_list = [2]
    for num in range(3,N+1,2):
      if all( num % prime != 0 for prime in prime_list):
        prime_list.append(num)

    return prime_list

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

pri = get_primenumber(10000)

l = []
for z in make_divisors(n):
  if n == 1:
    break
  if n == z:
    l.append(z)
    break
  for i in reversed(pri):
    for e in range(1,100):
      if z < i**e:
        break
      if z == i**e:
        if n%z == 0:
          l.append(z)
          n = int(n/z)
          if n == 1:
            print(l)
            exit()
        
print(len(l))

Submission status: Wrong Answer

Solution code:
def fac(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(cnt)

    if temp!=1:
        arr.append(1)

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

    return arr

n=int(input())
li=fac(n)

ans=0
y=0
for x in range(1,1000):
    y=y+x
    ans=ans+len([i for i in li if i >= y])
    if len([i for i in li if i >= y])==0:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import itertools
from collections import defaultdict

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

    if temp!=1:
        arr[temp] = 1

    if arr==[]:
        arr[n] = 1

    return arr

ng = {}
lv = 1
F = factorization(N)

result = 0
remain = 0
check = 1
for k, v in F.items():
    remain += v

while remain > 0:

    # 候補を取得
    f_candidate = []
    for k, v in F.items():
        for i in range(min(lv, v)):
            f_candidate.append(k)

    candidates = itertools.combinations_with_replacement(f_candidate, lv)
    allNg = True
    for candidate in candidates:
        red_map = defaultdict(int)

        next = False
        value = 1

        for c in candidate:
            value *= c
            red_map[c] += 1
            if red_map[c] > F[c]:
                next = True
                break
        if next:
            continue

        if value in ng:
            continue

        ng[value] = True
        result+=1

        # 減らす
        for c in candidate:
            F[c] -= 1
            remain -= 1
        allNg = False
        break

    if allNg:
        lv+=1
    if lv > remain:
        break

print(result)

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])
    return arr

z = factorization(int(input()))
print(z)
i = 1
ans = 0
flag = True
while flag:
    flag2 = False
    for j in range(len(z)):
        if z[j][1] >= i:
            z[j][1] -= i
            ans += 1
            flag2 = True

    i += 1
    if flag2 == False: flag = False
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

ans = 0
flg=True
reg = factorization(N)
for b, a in reg:
    if a==b==1:
        print(0)
        flg=False
        break
    elif a<3:
        ans+=1
    elif a<6:
        ans+=2
    elif a<10:
        ans+=3
    elif a<15:
        ans+=4
    elif a<21:
        ans+=5
if flg:
    print(ans)
        

# print(reg)

Submission status: Wrong Answer

Solution code:
n = int(input())

def primes(x):
   is_prime = [True] * (x+1)
   is_prime[0] = False
   is_prime[1] = False
   for i in range(2, int(x**0.5)+1):
      if not is_prime[i]:
         continue
      for j in range(i*2, x+1, i):
         is_prime[j] = False
   return [i for i in range(x+1) if is_prime[i]]

pl = primes(int(n**0.5)+1)

def factorization(x):
   arr = []
   tmp = x
   while x > 1:
      for i in pl:
         if x % i == 0:
            x /= i
            arr.append(i)
            break
      if x == tmp and len(arr) == 0:
         return [x]
   return arr

l = factorization(n)
used = [1]
cnt = 0
while len(l) > 0:
   y = 1
   while y <= used[-1]:
      if len(l) == 0:
         break
      y *= l.pop(0)
   used.append(y)
   cnt += 1
if len(used) != len(set(used)):
   cnt -= 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
import math


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

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

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import itertools
import decimal
import math
import collections

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

def iskaijo(n):
    i=1
    while True:
        if(n==1):
            break
        if(n%i==0):
            n=n/i
            i=i+1
        else:
            i=-1
            break
    return i

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())


ng=False
ans=0
List =factorization(N)
#c=collections.Counter(List)
for i in range(len(List)):
    test = List[i][1]
    i=1
    while True:
        test=test-i
        i=i+1
        ans=ans+1
        if(test == 0):
            break
        elif(test < 0 ):
             i=i-1
             break

if N!=1:
    print(ans)
else:
    print(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

Nlist = factorization(N)

count = 0
for n in Nlist:
    a = n[0]
    b = n[1]
    if a != 1:
        if b == 2:
            count += 1
        else:
            for i in range(1, b + 1):
                if b > 0:
                    count += 1
                    b -= i

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

n=int(input())
if n==1:
    print(0)
    exit()
ans=0
t=factorization(n)

fg=[]
for i in range(1,16):
    fg.append(i*(i+1)//2)

tmp=[]
for i in range(len(t)):
    cnt=0
    for j in range(len(fg)):
        if t[i][1]>=fg[j]:
            cnt=(j+1)
    ans+=cnt
    g=max(0,cnt-1)
    if t[i][1]-fg[g]>0:
        tmp.append([t[i][0],t[i][1]-fg[cnt-1]])


print(ans+len(tmp)//2)

Submission status: Wrong Answer

Solution code:
import itertools

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 for x in range(cnt)])

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

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

    return arr

ret = factorization(N)
L = list(itertools.chain.from_iterable(ret))
if 1 in L:
    while 1 in L:
        L.remove(1)
if 0 in L:
    L.remove(0)

cnt = 0
mem = []
e = 0
while True:
    e += 1
    flg = 0
    for l in set(L):
        if N <= l**e:
            flg += 1

    if len(L) == 0:
        break
    for p in set(L):
        z = p**e
        q,mod = divmod(N,z)
        if mod == 0 and (z not in mem):
            N = q
            for x in range(e):
                L.remove(p)
            mem.append(z)
            #print(z,N,mod,L)
            cnt += 1
            break

    if flg == len(set(L)):
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = {}
max_count = 0
while n % 2 == 0:
    if 2 in a:
        a[2] += 1
    else:
        a[2] = 1
#    a.append(2)
    n //= 2
    max_count += 1

f = 3
while f * f <= n:
    if n % f == 0:
        if f in a:
            a[f] += 1
        else:
            a[f] = 1
        n //= f
    else:
        f += 2

if n > 1:
    if f in a:
        a[f] += 1
    else:
        a[n] = 1

cnt = 0
for k, v in a.items():
    d = 1
    while (v - d >= 0):
        v = v - d
        d +=1
        cnt += 1

print(cnt)

Submission status: Wrong Answer

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

    def getDivisors(x):
        anss = set()
        for d in range(1, int(x**0.5)+1):
            if x%d == 0:
                anss.add(d)
                anss.add(x//d)
        return sorted(anss)

    divs = getDivisors(N)
#    print('divs:', divs)

    ans = 0
    for div in divs[1:]:
        if N % div == 0:
            ans += 1
            N //= div
#            print(N)
        if N == 1:
            break

    print(ans)


solve()

Submission status: Wrong Answer

Solution code:
import sys
from math import sqrt
from bisect import bisect_right


def _i(): return int(sys.stdin.readline().strip())


def main():
    n = _i()
    sqn = int(sqrt(n))
    p = [True] * (sqn+1)
    f = True
    c = 0
    for i in range(2, sqn+1):
        if not p[i]:
            continue
        if f and n % i == 0:
            f = False

        for j in range(i+i, sqn+1, i):
            p[j] = False

        x = i
        while n % x == 0:
            c += 1
            n //= x
            x *= i

    if f:
        c += 1

    return c


if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0

#########################  ネットから拾ってきた
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
######################### 

soinnsuu = prime_factorize(n)

import collections
c = collections.Counter(soinnsuu)

z = []
amari = []

for i in sorted(set(soinnsuu)):
    res = c[i]
    for j in range(1,50):
        res -= j
        
        if res >= 0:
            ans += 1
            z.append(i**j)
            
        else:
            for k in range(j+res):
                amari.append(i)
                
            break
                
                
                
import itertools
hosei = []
 
for i in range(len(amari)):
    c = list(itertools.combinations(amari,i+1))
    
    for j in c:
        add = 1
        
        for k in range(i+1):
            add *= j[k]
            
        if add not in z:
            hosei.append(add)
            
for i in z:
    n //= i
        
for i in hosei:
    if n % i == 0:
        n //= i
        ans += 1
        
print(ans)

Submission status: Wrong Answer

Solution code:

N = int(input())

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

import math
n = math.floor(math.sqrt(N)) + 1

cm = []
for i in range(2, n+1):
    if (N % i != 0):
        continue
    
    ex = 0
    while (N % i == 0):
        ex += 1
        N //= i
        
    cm.append([i, ex])
    
if len(cm) == 0:
    print(1)
    exit()
        
#print(cm)

su = [0] * 6000
s = 0
for i in range(1, 100+1):
    s += i
    su[s] = i
    
#print(su)

f = 0
for i in range(6000):
    if su[i] == 0:
        su[i] = f
    else:
        f = su[i]
        
#print(su)

count = 0
for i in cm:
    #print(i)
    #print(i[1])
    count += su[i[1]]

print(count)

Submission status: Wrong Answer

Solution code:
import heapq
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)
l = []
for i in f:
    for j in range(1, i[1]+1):
        l.append(i[0]**j)

heapq.heapify(l)

cnt = 0
while l:
    tmp = heapq.heappop(l)
    if n % tmp == 0:
        n = n // tmp
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
a = []
i = 0
ret = 0
while n % 2 == 0:
	i += 1
	n //= 2
if(i >= 1):
	temp = 0
	for j in range(i+2):
		temp += j
		if(temp > i):
			break
	ret+=j-1
	#print(2,i,j,n,temp,ret)
f = 3
i = 0
while f * f <= n:
	if n % f == 0:
		i += 1
		n //= f
		#print("bb",n,f,i,ret)
	else:
		f += 2
		if(i >= 1):
			temp = 0
			for j in range(i+2):
				temp += j
				if(temp > i):
					break
			ret+=j-1
			#print("cc",f,i,j,ret)
		i = 0

if(n > 1):
	i+=1
	if(i >= 1):
		temp = 0
		for j in range(i+2):
			temp += j
			if(temp > i):
				break
		ret+=j-1
		#print("dd",f,i,j,ret)


print(ret)

Submission status: Wrong Answer

Solution code:
def fac(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(cnt)

    if temp!=1:
        arr.append(1)

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

    return arr

n=int(input())
li=fac(n)

ans=0
y=0
for x in range(1,100):
    y=y+x
    ans=ans+len([i for i in li if i >= y])
    if len([i for i in li if i >= y])==0:
        break
print(ans)

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
sumi = True
if n < 2:
  print(ans)
  sumi = False
else:
  ans = 0
  count = 0
  while(count < 78498):
    temp = 0
    while(n % a[count] == 0):
      n = n // a[count]
      temp += 1
    if temp >= 45:
      ans += 9
    elif 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)
      sumi = False
      break
  if count == 78498 and sumi:
      print(1)

Submission status: Wrong Answer

Solution code:
N = int(input())

def make_divisors(n: int):
    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)
    return divisors

divisiors = sorted(make_divisors(N))
ans = 0

# print(divisiors)

for d in divisiors:
    if d == 1:
        continue
    if N % d == 0:
        N //= d
        # print(N, d)
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt

n = int(input())
div = []
for i in range(2, int(sqrt(n))+1):
    if n % i == 0:
        div.append(i)
        
prime = {}
for i in div:
    while n % i == 0:
        n /= i
        if i not in prime:
            prime[i] = 1
        else:
            prime[i] += 1
    
ans = 0
for i, num in enumerate(prime):
    ans += int( (-1+sqrt(1+8*prime[num])) / 2 )
   
    
print(ans)

Submission status: Wrong Answer

Solution code:
def make_div_list(num):
    div_list=[]
    for i in range(1, int(num**0.5)+1):
        if num%i==0:
            div_list.append(i)
            if i!=num//i:
                div_list.append(num//i)
    
    div_list.sort()
    return div_list

n=int(input())
t=make_div_list(n)

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

    for num in t:
        if n%num==0:
            n/=num
            ans+=1
        
        if n<num:
            print(ans-1)
            exit()

Submission status: Wrong Answer

Solution code:
N=int(input())
def sample_code():
    n = N
    
    #print('# 素因数')
    fct = factorize(n)
    #print(fct)
    count=0
    count2=0
    for i in range(len(fct)):
        if fct[i]== 1:
            count+=0
        else:
            count+=fct[i][1]//2
            count2+=1
    if N==1:
        print("0")
    #elif len(fct)+count==0:
        #print("1")
    else:
        print(len(fct)+count-count2)
    #print('# 約数')
    #for div in divisorize(fct):
        #print(div, num(div))


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]


def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a
if __name__ == '__main__':
    sample_code()