Problem:


Score : 400 points

Problem Statement

Given is a positive integer N. Consider repeatedly applying the operation below on N:

First, choose a positive integer z satisfying all of the conditions below:

z can be represented as z=p^e, where p is a prime number and e is a positive integer;

z divides N;

z is different from all integers chosen in previous operations.

Then, replace N with N/z.

Find the maximum number of times the operation can be applied.

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

Print the maximum number of times the operation can be applied.

Sample Input 1

24

Sample Output 1

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=12.)

Choose z=3 (=3^1). (Now we have N=4.)

Choose z=4 (=2^2). (Now we have N=1.)

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=32.)

Choose z=4 (=2^2). (Now we have N=8.)

Choose z=8 (=2^3). (Now we have N=1.)

Sample Input 4

1000000007

Sample Output 4

1

We can apply the operation once by, for example, making the following choice:

z=1000000007 (=1000000007^1). (Now we have N=1.)

Sample Input 5

997764507000

Sample Output 5

7



Sample input:
24


Sample output:
3

Submission status: Wrong Answer

Solution code:
N = int(input())
maxT = int(N**(1/2))+1
ans = 0
cnt = 0
while N%2 == 0:
    cnt += 1
    N //= 2
i = 1
while cnt >= i:
    ans += 1
    cnt -= i
    i += 1
t = 3
while N >= t and t <= maxT:
    if N%t == 0:
        cnt = 0
        while N%t == 0:
            cnt += 1
            N //= t
        i = 1
        while cnt >= i:
            ans += 1
            cnt -= i
            i += 1
    t += 2
if ans == 0 and N > 2:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
from itertools import combinations
from functools import reduce
from operator import mul

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

facts = prime_factorize(N)
facts.sort()

used = set()
cnt = 0

while facts:
  #print(used)
  #print(facts)
  for i in range(1, len(facts) + 1):
    for s in combinations(facts, i):
      m = reduce(mul, s)
      if not m in used:
        used |= {m}
        cnt += 1
        for j in s:
          facts.remove(j)
        break
    else:
      continue
    break
  else:
    break

print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000000)
import numpy as np
from heapq import heapify, heappop, heappush
import copy
from math import gcd, ceil
from collections import deque
# queueとして使う場合 push, popleftを使う
from bisect import bisect_left, bisect_right
# bisect_left: 配列の順序関係が崩れない条件で挿入することができる一番左の点
# bisect_right: 配列の順序関係が崩れない条件で挿入することができる一番右の点
# A = [1, 1, 1, 2, 2, 2, 4]
# print(bisect_left(A, 2))  # 3
# print(bisect_right(A, 2))  # 6
# print(bisect_left(A, 3))  # 6
# print(bisect_right(A, 3))  # 6


def is_prime(N):
    """Nを2~int(N**0.5)までで割る"""
    for i in range(2, int(N**0.5)+1):
        if N % i == 0:
            return False
    return True


def calc_eratosthenes(N):
    is_primes = [True] * (N + 1)
    is_primes[0], is_primes[1] = False, False
    primes = []
    for i in range(2, N + 1):
        if is_primes[i]:
            primes.append(i)
            k = 2
            while(k * i <= N):
                if i == k:
                    k += 1
                    continue
                is_primes[k * i] = False
                k += 1
        else:
            continue
    return primes, len(primes)


def main():
    N = int(input())
    if N == 1:
        print(0)
        sys.exit()
    if is_prime(N):
        print(1)
        sys.exit()
    count = 0
    orig_N = N
    sosuu, _ = calc_eratosthenes(ceil(N ** 0.5))
    
    for i in range(len(sosuu)):
        if i * i > orig_N:
            break
        if orig_N % sosuu[i] == 0:
            N = N // sosuu[i]
            count += 1
    print(count)
    




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


def sum_n(n):
    return int(n*(1+n)/2)


N = int(input())

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

fac = factorization(N)
print(fac)

count = 0

for i in range(len(fac)):
    j = 0
    while (True):
        j += 1
        if (sum_n(j) == fac[i][1]):
            break
        elif (sum_n(j) > fac[i][1]):
            j = j - 1
            break

    count += j

print(count)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
if N == 1:
    print(0)
    exit()

#素数リスト
M = int(math.sqrt(N))+1
sosu = [2]
a = 0
for i in range(3,M,2):
  if sosu[a] <= math.sqrt(i):
    a += 1
  hantei = (i%x for x in sosu[:a+1])
  if 0 not in hantei:
    sosu.append(i)

soin = []
for p in sosu:
    for j in range(1,N+1):
        pe = p**j
        if N % pe != 0:
            if pe != p:
                soin.append(j-1)
            break

Ans = 0
for k in soin:
    if k == 1:
        Ans += 1
        continue
    for n in range(1,k+1):
        if (n*(n+1))//2 > k:
            Ans += n-1
            break
print(max(Ans,1))

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


hoge = factorization(n)
ret = len(hoge)

if (hoge[0][0] == 1):
    print(0)
else:
    for i in hoge:
        cnt = i[1]
        sub = 1
        while cnt - sub > 0:
            sub += 1
            cnt -= sub
        if i[1] != 1 and i[1] != 2:
            ret += sub - 1
    print(ret)

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    sys.setrecursionlimit(10**9)
    input = sys.stdin.readline

    N = int(input())

    if N == 1:
        print(0)
        return

    def get_prime(n):
        import math
        p = []
        if n % 2 == 0:
            p.append(2)

        sq = math.ceil(math.sqrt(n))
        i = 3
        while i <= sq:
            if n % i == 0:
                p.append(i)
                if i*i != n:
                    p.append(n//i)
            i += 2
        p.append(n)
        return p
    
    p = get_prime(N)

    def prime_factorization(n, p):
        from collections import Counter
        d = Counter()
        for i in p:
            while n % i == 0:
                d[i] += 1
                n //= i
        return d

    d = prime_factorization(N, p)

    ans = 0
    for i in d:
        tmp = 1
        for j in range(d[i]):
            tmp *= i
            if N % tmp == 0:
                ans += 1
                N //= tmp
            else:
                break

    print(ans)

main()

Submission status: Wrong Answer

Solution code:
import math


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


def primes(n):
    ps = {}
    for i in range(2, int(n ** 0.5) + 20):
        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():
    import decimal
    n = int(input())
    if n == 1:
        print(0)
        exit()

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

    ps = primes(n)

    ans = sum([int(decimal.Decimal((-1 + (1 + 8 * v) ** 0.5) / 2)) for v in ps.values()])
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
def prime_factorize(n):
    ans = 0
    while n % 2 == 0:
        i = 1
        j = 0
        while n % 2 == 0:
            n = n//2
            j += 1
            if i <= j:
                ans += 1
                i += 1
                j = 0
    f = 3
    while f * f <= N:
        i = 1
        j = 0
        while n % f == 0:
            n //= f
            j += 1
            if i <= j:
                ans += 1
                i += 1
                j = 0
        f += 2
    if n*n >= N:
        ans += 1
    return ans
print(prime_factorize(N))

Submission status: Wrong Answer

Solution code:
import sys
import math

primes=list()

def is_prime(n):
    result=True

    m = int(math.sqrt(n))

    i=0
    while primes[i] <= m:
        if n % primes[i] == 0:
            result = False
            break
        i+=1
    
    return result


def calc_primes(n):
    primes.append(2)

    for i in range(3,n+1,2):
        if is_prime(i):
            primes.append(i)

def decomp(n):
    # ans=list()
    prime_count=dict()

    m=n
    i=0
    n_primes = len(primes)
    while (i<n_primes and primes[i]<=m):
        if m % primes[i] == 0:
            m /= primes[i]
            # ans.append(primes[i])

            if primes[i] in prime_count.keys():
                prime_count[primes[i]]+=1
            else:
                prime_count[primes[i]]=1

            # print(primes[i])
        else:
            i+=1
    # return ans, prime_count
    return prime_count

N=int(input())
calc_primes(int(math.sqrt(N)))
# ans, prime_count=decomp(N)
# print(ans)
prime_count=decomp(N)

if len(prime_count) == 0:
    print(1)
    sys.exit(0)

n=0
for i in prime_count.keys():
    m=prime_count[i]
    
    i=1
    while (m>0):
        n+=1

        m-=i
        i+=1

print(n)

Submission status: Wrong Answer

Solution code:
N = int(input())
ANS = 0
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)

for i in range(len(L)):
    for j in range(50):
        if j * (j+1) >= L[i][1]:
            ANS += j
            break
if len(L) == 1 and L[0][0] == 1:
    ANS = 0

print(ANS)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
rest = []

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)

if A != [[1, 1]]:
    for i in range(len(A)):
        j = 1
        count = 1
        while A[i][1] >= j:
            ans = ans + 1
            if A[i][1] == j:
                break
            count = count + 1
            j = j + count
        rest.append(j - A[i][1])

while len(rest) > 1:
    rest.sort(reverse = True)
    if rest[0] > 0 and rest[1] > 0:
        rest[0] = rest[0] - 1
        rest[1] = rest[1] - 1
        ans = ans + 1
    else:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
"nの約数列挙"
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass

"nの素因数分解"
def prime_factor(n):
    ass = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            ass.append(i)
            n = n//i
    if n != 1:
        ass.append(n)
    return ass

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


N = int(input())
A = divisor(N)
A.sort()

count = 0
for a in A:
  if a == 1:
    continue
  if N % a != 0 and is_prime(a) == False:
    continue
  N //= a
  count += 1

print(count)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
c = 0
n = int(input())
a = n
for i in range(2, int(n**0.5)+1):
    if n % i == 0:
        n = n//i
        c += 1
if a == 1:
    print(0)
elif c == 0:
    print(1)
else:
    print(c)

Submission status: Wrong Answer

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

#n = int(input())
#l = list(map(int, input().split()))

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''
def yakusuu(n):
    yakusuu_list = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            yakusuu_list.append(i)
            if i != n // i:
                yakusuu_list.append(n//i)
    return yakusuu_list

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


cnt=0
def ok(z,l,n,cnt):
    for j in range(len(l)):
        #print(z,l[j])
        if z%l[j]==0 or z>l[j]:
            if n%z==0:
                n//=z
                cnt+=1
                #print(n,z,cnt)
                return n,cnt
    return n,cnt

n=int(input())
l=eratos(int(n**(1/2)+1))
#print(l)
ll=yakusuu(n)
ll.sort()
#print(ll)


for i in range(1,len(ll)):
    if n==1:
        break
    if ll[i]%2==0:
        #print(ll[i],n//ll[i])
        if n%ll[i]==0:
            #print(n//ll[i])
            cnt=cnt+1
            n//=ll[i]
            #print(n,cnt,ll[i])
            
    else:
        #print(ll[i])
        n,cnt=ok(ll[i],l,n,cnt)
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
n1 = n
if n == 1:
    print(0)
else:
    a = [0]*(int(math.sqrt(n)) + 1)
    a[1] = 1
    ans = 0
    for i in range(2, int(math.sqrt(n)) + 1):
        if a[i] == 0:
            for j in range(i+i, int(math.sqrt(n)) + 1, i):
                a[j] = 1
    for i in range(2, len(a)):
        if a[i] == 0:
            k = 1
            s = i
            while n % s == 0:

                ans += 1
                n //= s
                s *= i
    for i in range(2, len(a)):
        if a[i] == 0 and n % (n1 // i) == 0 and (n1 // i)**2 != n1:
            f = 1
            for j in range(2, int(math.sqrt(n // (n1 // i))) + 1):
                if (n // (n1 // i)) % j == 0:
                    f = 0
                    break
            ans += f

    if ans == 0:
        print(1)
    else:
        print(ans)
    # print(len('997764507000'))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

a = set()
i = 2
while i * i <= n:
    if (n % i) == 0:
        a.add(i)
        n /= i
    i += 1
if n != 1:
    a.add(n)
print(len(a))

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())
#N=10**18

lst=defaultdict(int)
for i in list(range(2,int(N**.5)+1))+[N]:
    while N>1 and N%i==0:
        N//=i
        lst[i]+=1
c=0
#print(lst)
for l in lst:
    l=lst[l]
    i=1
    while l>=i:
        l-=i
        c+=1
        i+=1
print(c)

Submission status: Wrong Answer

Solution code:
24

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
import collections
n=int(input())

c = collections.Counter(prime_factorize(n))
count=0
for k,v in c.items():
  i=1
  while v>1:
    count+=1
    v-=i
    i+=1
print(count)

Submission status: Wrong Answer

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

"""
z = p^e where p is a prime number and e = positive int
z divides N
"""

def get_primes(up_to=1000):
    primes = []

    A = [True] * (up_to + 2)

    for i in range(2, int(up_to**0.5)+1):
        if A[i]:
            j = i*2
            while j < up_to:
                A[j] = False
                j += i
    
    i = 2

    while i < up_to:
        if A[i]:
            primes.append(i)
        i += 1

    return primes

from math import sqrt

n = int(input())
primes = get_primes(int(sqrt(n))+2)
count = 0

#print(primes)
for z in primes:
    if z > n:
        break
    
    #ori_z = z
    exp = 1
    while n % z**exp == 0:
        count += 1
        n //= z**exp
        exp += 1

def is_prime(n):
    if n < 2:
        return False
    elif n == 2 or  n == 3:
        return True

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

if primes[-1] < n and is_prime(n):
    print(count +1)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
#素因数分解
def prime_factorization(N):
    ans = []
    if N==1:
        return [[1,0]]
    a = 2
    count = 0
    t = N
    while a*a<=t:
        if N%a!=0:
            a = a + 1
            count = 0
            continue
        while N%a==0:
            count = count + 1
            N = N//a
        ans.append([a, count])
        a = a + 1
        count = 0
    if (N!=1):
        ans.append([N,1])
    return ans
e = 0
def dfs(N, n, sum):
    global e
    if N<sum:
        return
    e = e + 1
    dfs(N, n+1, sum+n+1)

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

ans = 0

for a,b in L:
   e = 0
   dfs(b, 1, 0)
   ans = ans + e

print(ans)

Submission status: Wrong Answer

Solution code:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def printDivisors(n):
    factors = []
    # Note that this loop runs till square root
    i = 1
    while i <= sqrt(n):

        if (n % i == 0):

            # If divisors are equal, print only one
            if (n / i == i):
                factors.append(i)
            else:
                factors.append(i)
                factors.append(n//i)# Otherwise print both

        i = i + 1
    return factors

n = INT()

if(n==1):
    print(0)
else:
    factors = printDivisors(n)

    factors.sort()
    i = 1
    ans = 0

    while(True):
        if(i>=len(factors) or factors[i]>n):
            break

        n/=factors[i]
        ans+=1
        i+=1

    print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass

a=sorted(list(divisor(n)))

ans=0
u=[]
for i in range(1,len(a)):
    if n%a[i]==0:
        if a[i] not in u:
            n=n//a[i]
            u.append(a[i])
            ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict


def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

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

def main():
    n=int(input())
    yaku=make_divisors(n)
    memo = defaultdict(int)
    for i in range(len(yaku)):
        memo[yaku[i]]+=1
    ans=0
    for b in memo.values():
        if b<=2:
            ans+=1
        elif b>=3 and b<=5:
            ans+=2
        elif b>=6 and b<=9:
            ans+=3
        elif b >= 10 and b <= 14:
            ans += 4
        elif b >= 15 and b <= 20:
            ans += 5
        elif b >= 21:
            ans += 6
#    print(memo)
    print(ans)
 #   print(yaku)








if __name__ == "__main__":

    main()

Submission status: Wrong Answer

Solution code:
L = int(input())
L_ = L
devider = 2
good = True
ans = 0
while devider <= L_:
    devider_ = devider
    good = True
    while good:
        if L_ % devider_ == 0:
            L_ = L_ //devider_
            devider_ *= devider
            ans += 1
        else:
            good = False
    devider += 1

print(ans)

Submission status: Wrong Answer

Solution code:

def prime_factorization(n):
  seen = []
  cnt = 0

  times = 1
  primes = []
  while n % 2 == 0:
    divided = True
    tmpn = n
    for _ in range(times):
      if tmpn%2==0:
        tmpn //= 2
      else:
        divided = False
        break
    if divided:
      seen.append(2**times)
      times += 1
      cnt += 1
      n = tmpn
    else:
      break

  f = 3
  times = 1
  divided = True
  while f*f <= n:
    tmpn = n
    for _ in range(times):
      if tmpn%f==0:
        tmpn //= f
      else:
        divided = False
        break
    if divided:
      seen.append(f**times)
      times += 1
      cnt += 1
      n = tmpn
    else:
      f += 2
      times = 1
      divided = True

  if n != 1 and n not in seen:
    cnt += 1

  return cnt

n = int(input())
print(prime_factorization(n))

Submission status: Wrong Answer

Solution code:
import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

def gen_list_n_removed(l, n):
    return [i for i in l if i != n]



N = int(input())

num_list = set()

hoge = [i for i in range(2, 100000) if is_prime(i)]

for i in range(1, 30):
    for j in hoge:
        res = j ** i
        if res > 10 ** 12:
            break
        num_list.add(j ** i)

num_list = sorted(num_list)

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

count = 0
while True:
    for i in num_list:
        if N % i == 0:
            N = N / i
            count += 1
            num_list = gen_list_n_removed(num_list, i)
            break
        if i == num_list[-1]:
            print(count)
            exit(0)

Submission status: Wrong Answer

Solution code:
import math
def main():

    N = int(input())
    primes = []
    def isprime(n):
        if n == 1: return False
        for i in range(2, int(math.sqrt(n))+1):
            if n % i == 0:
                return False
        return True

    primes = set()
    for i in range(1, int(math.sqrt(N))+1):
        if isprime(i):
            primes.add(i)
    if isprime(N):
        primes.add(N)
    # print(primes)

    ans = 0
    for p in primes:
        q = p
        while N % q == 0:
            ans += 1
            N //= q
            q *= p
    return ans


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

Submission status: Wrong Answer

Solution code:
from collections import deque


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


n = int(input())
d = factorization(n)
d = deque(d)
count = 0
while d:
    m = 1
    a = d.popleft()
    while a >= m:
        a = a - m
        m += 1
        count += 1
if count == 1:
    print(0)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
import math


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

def get_list(i):
    loop_cnt = int(math.sqrt(i)) + 1
    ret_list = []
    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]:
                        break
                for _ in range(k):
                    ret_list.append(j)
                cnt = 0
            j += 1
    if i != 1:
        ret_list.append(i)
    return ret_list

print(len(get_list(n)))

Submission status: Wrong Answer

Solution code:
N = int(input())
n = N
ans = 0
num = [2]
for i in range(3, int(N ** 0.5)):
  if all(i % x != 0 for x in num):
    num.append(i)
  if n % i == 0:
    index = 1
    while n % i**index == 0:
      ans += 1
      n = n // (i**index)
      index += 1
  if n == 1:
    break
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
d = 2
count = 0 
def f(c):

	cumul = 0
	step = 1
	count = 0
	while(cumul < c):
		count +=1
		#stack.append(step)
		cumul += step
		step += 1
	if cumul > c:
		count -=1
		#cumul -= stack.pop()
	return count
	return len(stack)



while(n != 1 and d*d <= n):
	if n%d==0:
		c = 0
		while(n%d == 0): 
			c += 1
			n /= d
		count += f(c)
	d+=1
print count

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [0 for i in range(int(N**0.5)+1)]
c = 0
i = 2
m = 0
while i < N**0.5:
    if N % i == 0:
        a[i] += 1
        N = N / i
        m = i
        i -= 1
    i += 1
    if N == 1:
        break 
for j in range(2, m+1):
    if a[j] != 0:
        d = 0
        while a[j] > d:
            a[j] -= d+1
            d += 1
        c += d
if N <= 1:
    print(0)
else:
    print(c+1, end='')

Submission status: Wrong Answer

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

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

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
    memo = {}
    for i in range(2, int(pow(n, 0.5))+1):
        if n % i: continue
        if num % i == 0 & memo.get(i, 0) == 0:
            # print(i)
            memo[i] = 1
            num //= i
            ans += 1
            if num == 1:
                print(ans)
                return
    # print(num, memo.get(num, 0))
    if num > 1 & memo.get(num, 0) == 0:
        ans += 1
    print(ans)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
c=0
for i in range(2,int(math.sqrt(N))+1):
  if N%i==0:
    c+=1
    N=N/i
if N>1 and c==0:
  print(1)
else:
  print(c)

Submission status: Wrong Answer

Solution code:
import sys

def input():
    return sys.stdin.readline()[:-1]

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

def func1(lst, value):
    return [i for i, x in enumerate(lst) if x <= value]


ans_ = factorization(N)
nums = []
index_list = []

ans = 0
for i in range(1, 100):
	ans += i
	index_list.append(ans)

for a in ans_:
	#nums.append(int(format(a[1], 'b')))
	nums.append(a[1])
	
ans = 0
for i in nums:
	index = func1(index_list, i)
	#print(max(index)+1)
	ans += max(index)+1
	
print(ans)