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:
a=int(input())
import math
def div(N):
   ans=0
   for i in range(2,int(N**0.5)+1):
      B=0
      sw=0
      if N%i==0:
         if N//i != i:
            sw=1
            c=N//i
         while N%i==0:
            N//=i
            B+=1
         for j in range(1,10000):
            B-=j
            if B >= 0:
               ans+=1
            else:
               break
         if sw==1:
            B=0
            while N%c==0:
               N//=i
               B+=1
            for j in range(1,10000):
               B-=j
               if B >= 0:
                  ans+=1
               else:
                  break
   return ans
ans=div(a)
if a != 1 and ans == 0:
   print(1)
else:
   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


## [[2, 3], [3, 1]] 
##  24 = 2^3 * 3^1

def ruisekiwa(n):
	if n<3:
		return 1
	elif n<6:
		return 2
	elif n<10:
		return 3
	elif n<15:
		return 4
	elif n<21:
		return 5
	elif n<28:
		return 6
	elif n<35:
		return 7
	else:
		return 8


a=factorization(N)
ans=0

for insu in a:
	ans+=ruisekiwa(insu[1])

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




# 2darray [[0] * 4 for i in range(3)]

Submission status: Wrong Answer

Solution code:
from math import sqrt
from decimal import Decimal
def factorint(n):
    d = {}
    for i in range(2, int(sqrt(n))+1):
        c = 0
        q, r = divmod(n, i)
        while not r:
            c += 1
            n = q
            q, r = divmod(n, i)
        if c:
            d[i] = c
    if n != 1:
        d[n] = 1
    return d

n = int(input())
if n == 1:
    print(0)
else:
    d = factorint(n)
    s = 0
    for v in d.values():
        s += int(Decimal(8*v-1).sqrt()/2)
    print(s)

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)+1))
sosu.sort()

if isPrime(n):
    sosu.append(n)
#print(sosu)
cnt=0
for item in sosu:
    c=item
    while n%c==0:
        n=n//c
        c=c*item
        cnt+=1
    if n==1:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
from math import sqrt
from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for y in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case #{}: {}".format(i, o))


def small_factors(n):
    result = set()
    for i in range(2, int(sqrt(n)) + 1):
        if n % i == 0:
            result.add(i)
    return result

def solve(n):
    factors_to_try = sorted(small_factors(n))
    if n > 1 and len(factors_to_try) == 0:
        return 1
    result = 0
    i = 0
    while n > 1 and i < len(factors_to_try):
        if n % factors_to_try[i] == 0:
            n //= factors_to_try[i]
            result += 1
        i += 1
    return result

if __name__ == "__main__":
    n = int_in()
    out(solve(n))

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]

def main():
    n = int(input())
    l = make_divisors(n)
    cnt = 0
    for i in range(1,len(l)):
        if n < l[i]:
            print(cnt)
            return 0
        if n%l[i] == 0:
            cnt += 1
            n = n//l[i]
    
    print(cnt)

if __name__ == '__main__':
    main()

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]
for i in range(100):
  huga.append(huga[-1]+i+2)
n=int(input())
hoge=factorization(n)
ans=0
for i in range(len(hoge)):
  for j in range(len(huga)):
    if(hoge[i][1]>=huga[j]):
      ans+=1
print(ans)

Submission status: Wrong Answer

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

n = int(input())

c = collections.Counter(prime_factorize(n))
ans = 0

for l in c.items():
    ans += (l[1]+1)//2

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

i = 2
cur_n = n
cnt = {}
while i * i <= n:
    while cur_n % i == 0:
        cnt.setdefault(i, 0)
        cnt[i] += 1
        cur_n //= i
    i += 1

if cur_n != 1:
    cnt[i] = 1

'''
ans_table = [0]
for i in range(40):
    ans_table[i // 2] + 1

[0, 1, 2
'''


def get_ans(power):
    i = 1
    res = 0
    while res + i <= power:
        res += 1
        i += 1
    return res


ans = 0
for v in cnt.values():
    ans += get_ans(v)


print(ans)

Submission status: Wrong Answer

Solution code:
def task(n):
    primes = {}
    i = 2
    while i < 1000001 and i <= n:
        if n % i == 0:
            n = n // i
            if not i in primes:
                primes[i] = 0
            primes[i] += 1
        else:
            i += 1

    ans = 0
    for prime in primes:
        suma = 1
        count = primes[prime]
        while count >= suma:
            count -= suma
            suma += 1
            ans += 1

    print(ans)


n = int(input())
task(n)

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
count = 0
# lists = factorization(n)
#
# print(lists)
#
# flag = True
# i=0
# while flag:
#     i=i+1
#     flag = False
#     for pair in lists:
#         if pair[1] >= i:
#             pair[1] -= i
#             count +=1
#             flag=True
#         else:
#             continue
#
# sumu = 1
# for l in lists:
#     if l[1] != 0:
#         sumu = sumu * l[0] * l[1]

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

    divisors.sort()
    return divisors

divs = make_divisors(n)[1:]
for div in divs:
    if n % div == 0:
        count = count + 1
        n = n / div

print(count)

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
    if n != 1:
        result += 1
    print(result)
main()

Submission status: Wrong Answer

Solution code:
n = int(input())

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

x = n ** 0.5
d = {}
z = 2
while True:
    if n % z == 0:
        n //= z
        if d.get(z) == None:
            d[z] = 1
        else:
            d[z] += 1
    else:
        z += 1
    if n == 1 or x < z:
        break
    
ans = 0
for dv in d.values():
    i = 1
    while True:
        dv -= i
        i += 1
        if dv < 0:
            break
        
        ans += 1

print(max(1, ans))

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    from math import log
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    N = int(input())
    prime = [True for i in range(int(N**.5)+1)]
    max_ = int(N ** .5) + 1
    ans = 0


    for p in range(2, max_):
        if not prime[p]:
            continue
        for q in range(p, max_, p):
            prime[q] = False
        if N % p != 0:
            continue
        # print('p = {}'.format(p))
        t = 1
        p_ = p
        while N % p_ == 0:
            t += 1
            p_ *= p
        if N % p_ > 0:
            t -= 1
        l, r = 0, 10 ** 6
        # print('t = {}'.format(t))
        while l + 1 < r:
            m = (l + r) // 2
            if m * (m + 1) // 2 <= t:
                l = m
            else:
                r = m
        # print('ans += {}'.format(l))
        ans += l
    if ans == 0:
        ans = 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

# 素数判定関数
def isPrime(num):
    # 2未満の数字は素数ではない
    if num < 2: return False
    # 2は素数
    elif num == 2: return True
    # 偶数は素数ではない
    elif num % 2 == 0: return False

    # 3 ~ numまでループし、途中で割り切れる数があるか検索
    # 途中で割り切れる場合は素数ではない
    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False

    # 素数
    return True

# 素数判定
def callIsPrime(input_num=1000):
    numbers = []
    # ループしながら素数を検索する
    for i in range(1, input_num):
        if isPrime(i):
            numbers.append(i)

    # 素数配列を返す
    return numbers

# 関数の呼び出し

P=callIsPrime(int(math.sqrt(N)))
ans=0
ans+=isPrime(N)
for i in P:
  count=1
  while(N%i**count==0):
    ans+=1
    N=N//(i**count)
    #print(i**count)
    count+=1

#print(make_divisors(N))
#print(N)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = (N**(1/2))//1
i = 2
c = 0
while i <= n and N !=1:
  if N%i ==0:
    N = int(N//i)
    c += 1
  i += 1
if c ==0:
  print(1)
else:  
  print(c)

Submission status: Wrong Answer

Solution code:
from math import sqrt
n = int(input())
count = 0 
for i in range(2,int(sqrt(n)) +1) :
    if n %i == 0  :
        count +=1
        print(i)
        n = n//i

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

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
i=2
while i*i<=n:
    cnt=0
    while n%i==0:
        n//=i
        cnt+=1
    i+=1
    j=cnt
    for k in range(1,cnt):
        if j>=k:
            ans+=1
            j-=k
        else: break
if n>1:
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter


def pf(x):
  r = []
  while not x & 1:
    r += [2]
    x >>= 1
  i = 3
  m = int(x ** 0.5)
  while i < m:
    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())
a = int(n**0.5)+1

if n == 0:
    print(0)
    exit()
ans = 0
for i in range(2, a+1):
    j = 1
    while 1:
        if n % pow(i, j) == 0:
            n = n//pow(i, j)
            ans += 1
            j += 1
        else:
            break
if ans == 0:
    print(1)
    exit()
print(ans)

Submission status: Wrong Answer

Solution code:
#d
import math
from collections import defaultdict


n = int(input())
a = defaultdict(int)
ans = 0
d = 2
while n > 1:
    if d > math.sqrt(n) and ans== 0:
        ans = 1
        break
    # print("a",n,d)
    if n%d == 0:
        ans+=1
        n /=d
        d += 1
        # print(d,ans,n)
    else:
        d += 1
print(ans)

Submission status: Wrong Answer

Solution code:
def f(i,n):
  ans =0
  cnt = i
  while n%cnt == 0:
    n//=cnt
    cnt*=i
    ans +=1
  while n%i ==0:
    n//=i
  return n,ans

n = int(input())
nn = n
i = 2
ans = 0
while i <= int(n**0.5)+1:
  if n%i ==0:
    n,a = f(i,n)
    ans += a
  i += 1
  
if n == nn:
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])

    ret = 0
    i = 2
    while pow(i, 2) <= n:
        if n % i == 0:
            n = n//i
            ret += 1
        i += 1
    if i <= n:
        ret += 1

    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Wrong Answer

Solution code:
import math


n = int(input())

def is_prime(n):
    if n == 2 or n == 3: return True
    if n < 2 or n%2 == 0: return False
    if n < 9: return True
    if n%3 == 0: return False
    r = int(n**0.5)
    # since all primes > 3 are of the form 6n ± 1
    # start with f=5 (which is prime)
    # and test f, f+2 for being prime
    # then loop by 6.
    f = 5
    while f <= r:
        if n % f == 0: return False
        if n % (f+2) == 0: return False
        f += 6
    return True

def solve(n):
    res = 0
    for i in range(2, int(math.sqrt(n)) + 1):
        if n % i == 0:
            n //= i
            res += 1
    if not res and is_prime(n):
        return 1
    return res


print(solve(n))

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

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

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

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

index = int(pow(N, 0.5) + 1)
ans = []
for i in range(2, index):
    while N % i == 0:
        N //= i
        ans.append(i)
if ans == []:
    print(1)
    exit()
d = defaultdict(int)
for i in ans:
    d[i] += 1

anscnt = 0

for v, c in d.items():
    cnt = 1
    while c > 0:
        c -= cnt
        cnt += 1
        if c < 0:
            break
        anscnt += 1

print(anscnt)

Submission status: Wrong Answer

Solution code:
n = int(input())


def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


c = 0
for z in make_divisors(n):
    if n % z == 0:
        n /= z
        c += 1
print(c - 1)

Submission status: Wrong Answer

Solution code:
n = int(input())
N = n
ans = 0
def pri_me(x):
    if x == 2:
        return True
    for i in range(3,int(x**0.5)+1):
        if x%i==0:
            return False
    return True
if pri_me(n):
    print(1)
    exit()
for i in range(2,int(N**0.5)+1):
    if n%i==0:
        n=n//i
        ans += 1
    if n<=0:
        break
print(ans)

Submission status: Wrong Answer

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

def factorization(n):
    global a
    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])
            a += 1

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

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

    return arr

soinsu = factorization(n)

ans = 0

for i in range(a):
    x = soinsu[i][1]
    for j in range(1,10**18):
        if x >= j:
            x = x-j
            ans += 1
        else:
            break

if ans == 0 and n!= 1:
    ans = 1

print (ans)

Submission status: Wrong Answer

Solution code:
import math as m
n=int(input())
c=0
if n==1:
    print(0)
elif n==2 or n==3:
    print(n)
else:
    for i in range(2,int(m.sqrt(n))+1):
        if n%i==0:
            c+=1
    if c==0:
        print(1)
    else:
        print(c)

Submission status: Wrong Answer

Solution code:
import sys
#import numpy as np
import math
#from fractions import Fraction
#import itertools
#from collections import deque
#import heapq
#from fractions  import gcd
input=sys.stdin.readline
n=int(input())
def factorize(n):
    fct={}
    temp=n
    if temp<4:
        fct[temp]=1
    else:
        e=0
        while temp%2==0:
            temp=temp//2
            e+=1
        if e>0:
            fct[2]=e
    
    for b in range(3,int(n**0.5)+1,2):
        e=0
        while temp%b == 0:
            temp=temp//b
            e+=1
        if e>0:
            fct[b]=e
    if temp!=1:
        fct[temp]=1
    return fct

p=factorize(n)
ans=0
if n==1:
  print(0)
for d in p.keys():
    e=p[d]
    i=1
    while True:
        if e-i>=0:
            ans+=1
            e-=i
            i+=1
            
        else:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    if n==1:
        print(0)
        return
    d = {}
    ans = 0
    for i in range(2,int(n**0.5)+1):
        if n%i==0:
            d[i] = [1]
            ans += 1
            n = n//i
            cnt = 0
            while n%i==0:
                n = n//i
                cnt += 1
                if cnt > d[i][-1]:
                    d[i].append(cnt)
                    cnt = 0
                    ans += 1
            if n==1:
                break
    if ans==0:
        print(1)
        return
    print(ans)



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

##### 割り算の切り上げ #####
# tmp = -(-4 // 3)

##### dict の for文 #####
# for k, v in d.items():
#     print(k, v)

##### 進数の変換 #####
# bin_str = bin(i)[2:]
# oct_str = oct(i)[2:]
# hex_str = hex(i)[2:]

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N = inputInt()

	tmp = factorize(N)
	ans = 0

	for i,val in enumerate(tmp):
		sosuu,kai = val
		kai -= 1
		ans += 1

		tmptmp = kai // 2
		ans += tmptmp

	print(ans)



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


#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# 2分検索のリバース
def bisect_left_reverse(a, x):
    if a[0] <= x:
        return 0
    if x < a[-1]:
        return len(a)
    # 二分探索
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] <= x:
            ok = mid
        else:
            ng = mid
    return ok

def bisect_right_reverse(a, x):
    if a[0] < x:
        return 0
    if x <= a[-1]:
        return len(a)
    # 二分探索
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] < x:
            ok = mid
        else:
            ng = mid
    return ok

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# 2分検索
# 存在しない場合: None 存在する場合: その値
def binary_search(list, item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if guess == item:
            return mid
        if guess > item:
            high = mid -1
        else:
            low = mid + 1
    return None

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# N 個のボールを K グループに分ける場合のパターン数
def sunuke(N, K, mod=10**9+7):
	if N < K or K-1 < 0:
		return 0
	else:
		return combination(N-1, K-1, mod)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# dfs のサンプル
def dfs(graph,parent,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()

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==1:
      break
  print(count)

Submission status: Wrong Answer

Solution code:
import sys
#import time
import copy
#from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**20
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))
n = ri()
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
acu=[0]*101
acu[0]=0
for i in range(100):
    acu[i+1]=acu[i]+(i+1)

li=factorization(n)
ans=0
for i in li:
    ans+=bisect.bisect_right(acu,i[1])-1
print(ans)

Submission status: Wrong Answer

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

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

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

if n == m and m > 1:
    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 heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()
N=int(input())
if N==1:
    print(0)
    exit()

i=2
#N=10**12
def sosuu(x):
    sosuulst=[]
    i=2
    while i<int(x**.5+1):
        for s in sosuulst:
            if i%s==0:
                break
        else:
            sosuulst.append(i)
        i+=1
    for s in sosuulst:
        if x%s==0:
            while x%s==0:
                x//=s
            if x==1:
                return(1)
            else:
                return(0)
    return(1)


c=0

for i in list(range(2,int(N**.5+1)))+[N]:
    I=i
    flag=0

    if N%i==0:

        if sosuu(i):
            N//=i
            c+=1
print(c)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
count = 0

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

for i in range(2, int(math.sqrt(n)) + 1):
    if n % i == 0:
        count += 1
        n = n // i
print(count)

Submission status: Wrong Answer

Solution code:
def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n % i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table


def main():
    n = int(input())
    divs = sorted(divisor(n))
    ans = 0
    for div in divs[1:]:
        if n % div == 0:
            n /= div
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

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 + 1):
    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:
from sys import stdin
from math import sqrt
input = stdin.readline

N = int(input())

ans = 0

seen = [0] * 10 ** 6

for i in range(2, int(sqrt(N)) + 1):
    tmp = i

    while N % tmp == 0:

        if seen[tmp] == 1:
            tmp *= i
            continue
        else:
            N //= tmp
            seen[tmp] = 1
            ans += 1
            tmp *= i

if ans == 0 and N != 1:
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math




def solve(n):
    ans = 0
    for i in range(2, int(math.sqrt(n) + 2)):
        if n % i == 0:
            times = 0
            needed = 1
            while n % i ==0:
                times += 1
                if times>= needed:
                    times = 0
                    needed += 1
                    ans += 1
                n //= i
    if not ans==0:
        print(ans)
    elif n<2:
        print(0)
    else:
        print(1)
    return



n = int(input())
solve(n)