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())
#print(n)
if n == 1:
    print(0)
    exit()

import math

def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

import collections
from collections import defaultdict

def prime_factorization_1(num):
    if num <= 1:
        return False
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        dict_counter = defaultdict(int)
        for prime in prime_list:
            while num % prime == 0:
                dict_counter[prime] += 1
                num //= prime
        if num != 1:
            dict_counter[num] += 1

        dict_counter = dict(dict_counter)

        return dict_counter

x = prime_factorization_1(n)
#print(x)
y = list(x.keys())
z = list(x.values())
#print(y)
#print(z)

l = []
for i in range(len(y)):
    l += [y[i]]*z[i]
#print(l)

ans = []
tmp = 1
for j in l:
    if j not in ans:
        ans.append(j)
    else:
        r = tmp * j
        if r != tmp:
            if r not in ans:
                ans.append(r)
                tmp = 1
            else:
                tmp = r
#print(ans)
print(len(ans))

Submission status: Wrong Answer

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

def eratosthenes(N):
    data = [i for i in range(2, N + 1)]
    for d in data:
        data = [x for x in data if (x == d or x % d != 0)]
    return data

cands = []

for p in eratosthenes(10000):
    M = int(numpy.log2(N) / numpy.log2(p))
    print(p, M)
    for i in range(1, M):
        cands.append(p ** i)

cands = sorted(cands)
# print(cands)

cnt = 0

flag0 = False
flag1 = False

while True:
    for i, c in enumerate(cands):
        if N % c == 0:
            cnt += 1
            N = N / c
            cands.remove(c)
            flag0 = True
            break
    if not flag0:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
kazu  = []
ans = 0

def fact(n):
    a = []
    i = 1
    while n % 2 == 0:
        a.append(2 ** i)
        n //= 2
        i += 1
    f = 3
    j = 1
    while f <= math.sqrt(n) + 1:
        if n % f == 0:
            a.append(f ** j)
            n //= f
            j += 1
        else:
            f += 2
            j = 1
    if n != 1:
        a.append(n)
    return a 
"""
while a <= math.sqrt(n) + 1:
    if n % a == 0:
        kazu.append(a)
        j = 1
        while  n %   
    a += 1
"""
i = 0
kazu = fact(N)
kazu = sorted(kazu)
if len(kazu) == 0:
    ans = 0
else:
    while N > 1:
        
        N = N // kazu[i]
        i += 1
        ans += 1
        
print(ans)

Submission status: Wrong Answer

Solution code:
import itertools

def is_prime(num, prime_list):
    return all(num % prime != 0 for prime in prime_list)

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())
    divisors = make_divisors(N)[1:]
    cnt = 0
    while len(divisors) != 0:
        d = divisors.pop(0)
        if not is_prime(d, divisors):
            continue
        e = 1
        # print(d,e)
        # print('===================')
        while N%d**e == 0:
            # print(d,N,e,cnt)
            N = N/(d**e)
            e += 1
            cnt += 1
        #     print(d,N,e,cnt)
        # print('===================')
    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())

list=[2,3,4,5,7,8,9,11,13,16,17,19,23,25,27,29,31,32,37,41,43,47,49,53,59,61,64,67,71,73,79,81,83,89,97,121,125,128,169,243,256,289,343,361,512,529,625,729,841,961,1024,1331,1369,1681,1849,2048,2187,2197,2209,2401,2809,3125,3481,3721,4096,4489,4913,5041,5329,6241,6561,6859,6889,7921,8192,9409,12167,14641,15625,16384,16807,19683,24389,28561,29791,32768,50653,59049,65536,68921,78125,79507,83521,103823,117649,130321,131072,148877,161051,177147,205379,226981,262144,279841,300763,357911,371293,389017,390625,493039,531441,571787,704969,707281,823543,912673,923521]

Ans=0
now=0

if N==1:
    print(0)
    exit()
else:
    for i in range (117):
        if N%list[now]==0:
            Ans+=1
            N=N/list[now]
            list.pop(now)
        else:
            pass
    else:
        if N==1:
            pass
        else:
            Ans+=1
print(Ans)

Submission status: Wrong Answer

Solution code:
import math
import sys
n=int(input())
ans=0
x=2
if n==1:
  print(0)
  sys.exit()
def waru(n,x):
  for i in range(x,int(math.sqrt(n))+1):
    if n%i==0:
      return int(n/i),i
  return 1,n
xx=0
while(True):
  n_old=n
  x_old=x
  n,x=waru(n,x)
  if x==x_old:
    xx+=1
  else:
    xx+=1
    for i in range(1,xx):
      xx=xx-i
      if xx>=0:
        ans+=1
      else:
        xx=0
        break

  if n==1:
    xx+=1
    for i in range(1,xx):
      xx=xx-i
      if xx>=0:
        ans+=1
      else:
        xx=0
        break
    print(ans)
    sys.exit()

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 = {}
    x = n
    for i in range(2, n):
        if x == 1:
            break
        cnt = 0
        while x % i == 0:
            x = x // i
            cnt += 1
        if cnt > 0:
            ps[i] = cnt
        # print(n,i,cnt)

    return ps


def main():
    import decimal

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


    ans = 0
    x = n
    for i in range(2, n):

        if x == 1:
            break
        j = i
        cnt = 0
        while x % i == 0:
            x = x // i
            cnt += 1
            i *= j

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a = int(input())

z = 2
count = 0
while True:
    if z >= a:
        break
    mod = a % z
    if mod == 0:
        z = z + 1
        count = count + 1
        a = a / z
    else:
        z = z + 1


print(count)

Submission status: Wrong Answer

Solution code:

import sys
from copy import deepcopy
from collections import deque
from math import floor
from math import ceil
from itertools import combinations
from functools import reduce
from operator import mul
from itertools import chain

def main():
    n = int(input())
    on = n
    def is_prime(n):
        for i in range(2, n + 1):
            if i * i > n:
                break
            if n % i == 0:
                return False
        return n != 1
    if is_prime(n):
        print(1)
        sys.exit()

    nn = ceil(n**0.5)
    nn = max(6, nn)
    p = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(nn + 1)]
    p[0] = p[1] = False
    p[2] = p[3] = p[5] = True
    for i1 in range(3, floor(nn ** 0.5) + 1, 2):
        if p[i1]:
            for i2 in range(i1 ** 2, nn + 1, i1):
                p[i2] = False
        else:
            continue
    pl = [i for i, b in enumerate(p) if b == True]

    nums = deepcopy(pl)
    for pe in pl:
        cnt = 2
        while True:
            tnum = pow(pe, cnt)
            if tnum > n:
                break
            elif tnum != 0:
                if n % tnum == 0:
                    nums.append(tnum)
            cnt += 1

    nums.sort()
    numsd = deque(nums)
    ok = set()
    r = 0
    while True:
        if not numsd:
            break
        if n == 1:
            break
        nextn = numsd.popleft()
        if nextn > on or nextn > n:
            break
        elif n % nextn == 0:
            if nextn in ok:
                continue
            else:
                n = int(n // nextn)
                ok.add(nextn)
                r += 1
                if n == 1:
                    break
    print(r)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
num = int(input())
a = 2
number = 0
while num!=1:
  if num%a ==0:
    num = num/a
    number = number+1
    a = a**2
  else :
    a = a+1
  
print (number)

Submission status: Wrong Answer

Solution code:
import itertools
import copy
n=int(input())
c=0
A=[]
for i in range(2,int(n**0.5+1)):
  if n%i==0:
    a=0
    while(n%i==0):
      n//=i
      a+=1
    A.append(a)
l=len(A)
i=1
while(sum(A)>=l and l>0):
  for j in itertools.combinations_with_replacement(range(l), i):
    for k in j:
      C=copy.deepcopy(A)
      if A[k]==0:
        A[k]=C[k]
        break
      else:
        A[k]-=1
    else:
      c+=1
  B=[]
  for a in A:
    if a!=0:
      B.append(a)
  A=B
  l=len(A)
  i+=1
print(1 if c!=1 and c==0 else c)

Submission status: Wrong Answer

Solution code:
import random
import collections

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

l = prime_factorize(N)
c = collections.Counter(l)

kazu_l = [1, 1]
t = 1
for i in range(1000):
    for j in range(t+1):
        kazu_l.append(t+1)
    t += 1

v = list(c.values())
ans = 0

for i in range(len(v)):
    ans += kazu_l[v[i]-1]

print(ans)

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 is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1

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

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

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

    return arr

n = int(input())
a = divisor(n)

s = 1
cnt = 0

if is_prime(n) == True:
    print("1")
    exit(0)
if n == 1:
    print("0")
    exit(0)

i = 1
while(1):
    if len(factorization(i)) == 1:
        s = i * s
        if s >=n:
            print(i-1)
            exit(0)
        i = i+1

Submission status: Wrong Answer

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

    n = int(input())

    pows = [
        [2, 2],
        [3, 1],
        [5, 1]
    ]
    divs = [2, 3, 4, 5]

    count = 0
    while n > 1:
        if isPrime(n):
            count += 1
            break
        else:
            head = divs.pop(0)
            if n % head == 0:
                n //= head
                count += 1

            candidate_prime = 0
            for i in range(divs[-1]+1, 10**6+1):
                if isPrime(i):
                    candidate_prime = i
                    break

            candidates = []
            for i in range(len(pows)):
                candidate = pows[i][0] ** (pows[i][1] + 1)
                if candidate > divs[-1]:
                    candidates.append(candidate)

            if min(candidates) < candidate_prime:
                divs.append(min(candidates))
                pows[candidates.index(min(candidates))][1] += 1
            else:
                divs.append(candidate_prime)
                pows.append([candidate_prime, 1])

    print(count)
resolve()

Submission status: Wrong Answer

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

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

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

    return arr
  
a = factorization(n)

ans = 0

for i in a:
  j = 0
  temp = i[j]
  while temp-j >0:
    temp -= j
    j += 1
  ans += temp
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0 
ans_list = list()
skip_list = list()

import math as math
sqrt = math.sqrt(N)
wide = math.ceil(sqrt)
for i in range(3,wide,2):
  if N % i == 0:
    div = i
    ans +=1
    n = 1
    while N % div == 0:
      ans += 1
      N = N/div
      n += 1
      div = div**n
if ans == 0 and N != 0:
  print(1)
else:
  print(ans)

Submission status: Wrong Answer

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

n = int(input())

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

MAX = 100010 * 6
is_prime = [False] * MAX
is_prime[0] = False
is_prime[1] = False
for i in range(2, MAX):
    if Prime(i):
        j = i * i
        is_prime[i] = True
        while j < MAX:
            is_prime[j] = True
            j *= i
if (Prime(n)):
    print("1")
else:
    ans = 0
    sub = 0
    for i in range(2, MAX):
        if is_prime[i]:
            if n % i == 0:
                ans += 1
                sub = ans
                n = n / i       
        if n == 1:
            break

    print(max(ans,sub))

Submission status: Wrong Answer

Solution code:
n = int(input())

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 n==1:
    print(1)
else:
    div = []
    count = 0
    fct = factorize(n)
    div += [num(div) for div in divisorize(fct)]
    div = sorted(div)
    for i in div[1:]:
        fct2 = factorize(i)
        if n%i==0 and len(fct2)==1:
            n = n/i
            count += 1
        if n==1:
            break
    print(count)

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(divisor(n))[1:]

ans=0
u=[]
flag=0
while True:
    for i in a:
        if n%i==0:
            if i not in u:
                n=n//i
                u.append(i)
                a=sorted(divisor(n))[1:]
                ans+=1
            else:
                if i==n:
                    flag=-1
                    break
    if flag==-1 or n==1:
        break
        
print(ans)

Submission status: Wrong Answer

Solution code:
# import sys
# import math #sqrt,gcd,pi
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# from itertools import product,permutations,\
#     combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

mod = int(1e9+7)
# mod = 998244353
INF = 1<<29
lINF = 1<<35

def Divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    divisors.sort()
    return divisors

def readInt():
    return list(map(int,input().split()))

def main():
    N = int(input())
    if N==1:
        print(0)
        return
    ans = 0
    div = Divisors(N)
    div.pop(0)
    div.append(10000000000000000)
    while min(div)<=N:
        x = N
        for i in range(len(div)):
            if N%div[i]==0:
                N //= div[i]
                div.pop(i)
                ans += 1
                break
        if N==x:
            break
    print(ans)
    return

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import collections
def prime_factorize(n):
    a = []
    i=1
    j=1
    while n % 2**i == 0 and a.count(2**i)==0:
        a.append(2**i)
        n //= 2**i
        i+=1
        
    f = 3
    while f * f <= n:
        if n % f**j == 0 and a.count(f**j)==0:
            a.append(f**j)
            n //= f**j
            j+=1
           
        else:
            f += 2
            j=1
    if n != 1 and n != 2 and n != 3 and n != 5 and n != 7 and n != 11:
        a.append(n)
    return a
N = int(input())
c = prime_factorize(N)

c=set(c)

print(len(c))

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = {}
    while n % 2 == 0:
        if 2 not in a:
            a[2] = 1
        else:
            a[2] += 1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            if f not in a:
                a[f] = 1
            else:
                a[f] += 1
            n //= f
        else:
            f += 2
    if n != 1:
        if f not in a:
            a[f] = 1
        else:
            a[f] += 1
    return a

x = int(input())
y = prime_factorize(x)

num = 0
for v in y.values():
    now_v = v
    i = 1
    while True:
        if now_v < i:
            break
        now_v -= i
        num += 1
        i += 1

print(num)

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]

divisors = make_divisors(N)[1:]
count = 0
for i in divisors:
  if N<i:
    break
  if N%i == 0:
    N = N/i
    count +=1
print(count)

Submission status: Wrong Answer

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


if n == 1:
    print(0)
else:
    prime = []
    saidai = math.sqrt(n)
    i = 2
    while i <= saidai:
        if n % i == 0:
            n /= i
            prime.append(i)
        else:
            i +=1
    if len(prime) == 0:
        print(1)
    else:
        count = 1
        ans = 0
        i = 0
        prime.append(0)
        while i < len(prime)-1:
            if count == 1:
                ans += 1
                if prime[i] == prime[i+1]:
                    count += 1
                i += 1
            else:
                hantei = True
                atai = prime[i]
                j = 1
                while hantei:
                    if i + j > len(prime)-1:
                        hantei = False
                        i = i+j
                        count = 1
                    elif atai != prime[i+j]:
                        hantei = False
                        i = i + j
                        count = 1
                    else:
                        if j + 1 == count:
                            hantei = False
                            ans += 1
                            i = i + j + 1
                            if atai == prime[i]:
                                count += 1
                            else:
                                count = 1
                        else:
                            j += 1
        print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
# N = (2 ** 16) * (3 ** 16)
ans = 0
t = []
primeList = [2]
maxNumber = 15 * 10 ** 4
for x in range(3, maxNumber):
    for y in primeList:
        if x % y == 0:
            break
    else:
        primeList.append(x)  # 割り切れるものがなければリストに追加

for i in primeList:
    for x in range(1, 40):
        y = i ** x
        if N // y == N / y:
            ans += 1
            N = N // y
        else:
            break

if N > 15 * 10 ** 4:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math

def is_perfect_power(n):
    size = int(math.log2(n) + 1)
    for b in range(2, size):
        a = int(math.pow(n, 1 / b))
        if a ** b == n or (a+1) ** b == n: return True
    return False

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

N = int(input())
time = 0
z = 2
z_list = []
while 1:
    if N in z_list or N == 1:
        print(time)
        break
    elif is_prime(z) and N%z ==0:
        N = N/z
        time = time + 1
    elif is_perfect_power(z) and N%z == 0 :
        N = N/z
        time = time + 1
    z_list.append(z)
    z = z+1

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 == 1:
            break
        if N % div == 0:
            ans += 1
            N //= div
#            print(N)

    print(ans)


solve()

Submission status: Wrong Answer

Solution code:
import math
N = input()
jou = len(N)-1
L = int(N)
if L == 1:
    print(0)
else:
    num = 0
    if L > 100:
        limit = 10**(int(jou/2)+1)
    else:
        limit = L
    N = int(N)    
    for i in range(2, limit+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())
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
A = prime_factorize(N)
b = {}
for i in A:
    if i not in b:
        b[i] = 1
    elif i in b:
        b[i] += 1
count = 0
for v in b.values():
    if v >= 31:
        count += 5
        continue
    elif v >= 15 :
        count += 4
        continue
    elif v >= 7:
        count += 3
        continue
    elif v >= 3 :
        count += 2
        continue
    elif v >= 1 :
        count += 1
        continue
print(count)

Submission status: Wrong Answer

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

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

c = collections.Counter(prime_factorize(N))

ans = 0
for i in c.keys():
    num = c[i]
    m = 1
    while num > 1:
        num = num - m
        m += 1
        ans += 1

print(ans)

Submission status: Wrong Answer

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

    return arr

n = int(input())
n_list = factorization(n)
ans = 0
for i in range(len(n_list)):
    a = n_list[i][1]
    b = True
    cnt = 0
    cnt2= 1
    while b:
        a = a-cnt2
        cnt += 1
        if a < cnt+1:
            b = False
    ans += cnt
    
if n == 1:
  print(0)
elif len(n_list)==1:
  print(1)
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
def isprime(a):
    k=1
    for i in range(2,int(a**(1/2))):
        if(a%i==0):
            k=0
            break
    return k
n  = int(input())
p=[]
for i in range(2,int(n**(1/2))):
    if(n%i==0 and isprime(i)==1):
        p.append(i)

#print(p)       
c=0

for i in range(len(p)):
    for j in range(1,int(n)):
        if(n%(p[i]**j)==0):
            c+=1
            n = n/(p[i]**j)
            #print(p[i]**j)
        else:break
    
print(c)

Submission status: Wrong Answer

Solution code:
import math
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())
f = factorization(N)
v = []
m = 1
buf = 0
for i in range(len(f)) :
    v.append(f[i][1])

for i in range(len(v)) :
    buf += math.ceil(v[i]/2)
print(buf)
#for i in range(len(v)) :
#    d = divide(v[i])
#    #print(d)
#    s = 0
#    m = 0
#    for j in range(len(d)) :
#        if len(d[j]) >= m and (len(d[j]) == len(set(d[j]))) :
#            #print(len(d[j]))
#            m = len(d[j])
#    buf += m

Submission status: Wrong Answer

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

n = int(input())

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

MAX = 100010 * 5
is_prime = [False] * MAX
is_prime[0] = False
is_prime[1] = False
for i in range(2, MAX):
    if Prime(i):
        j = i * i
        is_prime[i] = True
        while j < MAX:
            is_prime[j] = True
            j *= i
if (Prime(n)):
    print("1")
else:
    ans = 0
    sub = 0
    for i in range(2, MAX):
        if is_prime[i]:
            if n % i == 0:
                ans += 1
                sub = ans
                n = n / i       
        if n == 1:
            break

    print(max(ans,sub))

Submission status: Wrong Answer

Solution code:
from math import sqrt
N = int(input())  # 10**12
sqrt_N = int(sqrt(N+2))
if N == 1:
    print(0)
    exit()

sosuu = [2]
# A = int(10**6 + 3)
A = sqrt_N + 2
for i in range(3, A, 2):
    is_prime = True
    sqrt_i = sqrt(i) + 2
    for j in sosuu:
        if i % j == 0:
            is_prime = False
            break
        if j > sqrt_i:
            break
    if is_prime:
        sosuu.append(i)

# print(*sosuu, sep='\n')
ans = 0
for i in sosuu:
    if N < i:
        break
    n = 1
    while 1:
        i_n = i ** n
        if N < i_n:
            break
        if N % i_n == 0:
            N //= i_n
            n += 1
            ans += 1
        else:
            break
if ans == 0:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
import itertools
import copy

N = int(input())
# N = (2 ** 4) * (3 ** 5) * (5 ** 2) * (7 ** 5)

# 素因数分解
# 戻り値: リスト
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

pf = prime_factor(N)
if len(pf) == 0:
    print(0)
    exit()

d = {}
for i in pf:
    if i not in d:
        d[i] = 1
        continue
    d[i] += 1

exist_num = []
ans = 0
for k in d.keys():
    for c in range(1, 100):
        if d[k] >= c:
            exist_num.append(k ** c)
            ans += 1
            d[k] -= c

l = []
for k in d.keys():
    if d[k] > 0:
        for _ in range(d[k]):
            l.append(k)
for i in range(1, len(l)+1):
    combs = list(itertools.combinations(l, i))
    if len(combs) > 0:
        for comb in combs:
            d_tmp = copy.copy(d)
            if max(d_tmp, key=d.get) not in comb:
                continue
            n = 1
            for j in comb:
                d_tmp[j] -= 1
                if d_tmp[j] < 0:
                    break
                n *= j
            if n not in exist_num and n != 1:
                print(n)
                ans += 1
                d = copy.copy(d_tmp)
                exist_num.append(n)
print(ans)