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:
# ABC169 D

import math


def factorization(n):
    """
    素因数分解した結果を[(要素, 数)]のリストで返す
    """
    arr = []
    temp = n
    for i in range(2, int(math.ceil(n ** 0.5))):
        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())

fact_li = factorization(n)
print(fact_li)

res = 0
for _, num in fact_li:
    temp_num = 1
    while temp_num <= num:
        res += 1
        num -= temp_num
        temp_num += 1

print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 1:
    print(0)
    exit()
primes = []
i = 2
tmp = N
flag = True
while (i-1)**2 <= tmp:
    if N % i == 0:
        count = 0
        while N % i == 0:
            N //= i
            count += 1
        primes.append((i, count))
    i += 1
if not primes:
    print(1)
    exit()

count = 0
for p in primes:
    c = 0
    t = 0
    for i in range(1, 10 ** 9):
        c += i
        t += 1
        if c > p[1]:
            count += t - 1
            break
        elif c == p[1]:
            count += t
            break

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 1:
    print(0)
    exit()
primes = []
i = 2
tmp = N
flag = False
while i**2 <= tmp:
    if N % i == 0:
        flag = True
        count = 0
        while N % i == 0:
            N //= i
            count += 1
        primes.append((i, count))
    i += 1

if (not N == 1) and not flag:
    i = 2
    tmp = N
    while N > 1:
        if N % i == 0:
            count = 0
            while N % i == 0:
                N //= i
                count += 1
            primes.append((i, count))
        i += 1

if not primes:
    print(1)
    exit()

count = 0
for p in primes:
    c = 0
    t = 0
    for i in range(1, 10 ** 9):
        c += i
        t += 1
        if c > p[1]:
            count += t - 1
            break
        elif c == p[1]:
            count += t
            break

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 1:
    print(0)
    exit()
primes = []
i = 2
tmp = N
while i ** 2 <= N:
    if tmp % i == 0:
        count = 0
        while tmp % i == 0:
            tmp //= i
            count += 1
        primes.append((i, count))
    i += 1

if not primes:
    print(1)
    exit()

count = 0
for p in primes:
    c = 0
    t = 0
    for i in range(1, 10 ** 9):
        c += i
        t += 1
        if c > p[1]:
            count += t - 1
            break
        elif c == p[1]:
            count += t
            break

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
primes = []
i = 2
tmp = N
while i ** 2 <= N:
    if tmp % i == 0:
        count = 0
        while tmp % i == 0:
            tmp //= i
            count += 1
        primes.append((i, count))
    i += 1

if not primes:
    print(1)
    exit()

count = 0
for p in primes:
    c = 0
    t = 0
    for i in range(1, 10 ** 9):
        c += i
        t += 1
        if c > p[1]:
            count += t - 1
            break
        elif c == p[1]:
            count += t
            break

print(count)

Submission status: Wrong Answer

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


class Eratos:
  def __init__(self, n):

    self.is_prime = [True]*(n+1)
    self.is_prime[0] = False
    self.is_prime[1] = False
    self.primes = []

    for i in range(2, int(math.sqrt(n))+1):
      if self.is_prime[i]:
        self.primes.append(i)
        j = i + i
        while j <= n:
          self.is_prime[j] = False
          j += i

  def all(self):
    return self.primes


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

  primes = Eratos(10**6).all()

  cnt = 0
  for p in primes:
    if N < p: break
    e = 1
    while not(N % p**e):
      N //= (p**e)
      cnt += 1
      e += 1

  if N > 10**6:
    for p in primes:
      while N % p == 0:
        N //= p
    if N > 10**6:
      print(cnt+1)
    else:
      print(cnt)
  else:
    print(cnt)


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

Submission status: Wrong Answer

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


class Eratos:
  def __init__(self, n):

    self.is_prime = [True]*(n+1)
    self.is_prime[0] = False
    self.is_prime[1] = False
    self.primes = []

    for i in range(2, int(math.sqrt(n))+1):
      if self.is_prime[i]:
        self.primes.append(i)
        j = i + i
        while j <= n:
          self.is_prime[j] = False
          j += i

  def all(self):
    return self.primes


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

  primes = Eratos(10**6).all()

  cnt = 0
  for p in primes:
    if N < p: break
    e = 1
    while not(N % p**e):
      N //= (p**e)
      cnt += 1
      e += 1

  if N > 10**6:
    print(cnt+1)
  else:
    print(cnt)


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

Submission status: Wrong Answer

Solution code:
def sieve(n):
    is_prime = [True for _ in range(n+1)]
    is_prime[0] = False

    for i in range(2, n+1):
        if is_prime[i-1]:
            j = 2 * i
            while j <= n:
                is_prime[j-1] = False
                j += i
    table = [ i for i in range(1, n+1) if is_prime[i-1]]
    return table
#引数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

N = int(input())
p_list = sieve(1000000)
cnt = 0
for i in range(10000):
    for j in range(1,100):
        q, mod = divmod(N, (p_list[i] ** j))
        if mod == 0:
            cnt += 1
            N = q
        else:
            break
    if N > 104743:
        a = is_prime(N)
        if a == True:
            cnt += 1
            break
print(cnt)

Submission status: Wrong Answer

Solution code:
def sieve(n):
    is_prime = [True for _ in range(n+1)]
    is_prime[0] = False

    for i in range(2, n+1):
        if is_prime[i-1]:
            j = 2 * i
            while j <= n:
                is_prime[j-1] = False
                j += i
    table = [ i for i in range(1, n+1) if is_prime[i-1]]
    return table
#引数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

N = int(input())
p_list = sieve(1000000)
cnt = 0
for i in range(10000):
    j = 1
    while N % (p_list[i] ** j) == 0:
        cnt += 1
        N = N // (p_list[i] ** j)
        j += 1
    if N > 104743:
        a = is_prime(N)
        if a == True:
            cnt += 1
            break

print(cnt)

Submission status: Wrong Answer

Solution code:
def sieve(n):
    is_prime = [True for _ in range(n+1)]
    is_prime[0] = False

    for i in range(2, n+1):
        if is_prime[i-1]:
            j = 2 * i
            while j <= n:
                is_prime[j-1] = False
                j += i
    table = [ i for i in range(1, n+1) if is_prime[i-1]]
    return table
#引数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

N = int(input())
p_list = sieve(1000000)
cnt = 0
for i in range(5000):
    j = 1
    while N % (p_list[i] ** j) == 0:
        cnt += 1
        N = N // (p_list[i] ** j)
        j += 1
    if N > 104743:
        a = is_prime(N)
        if a == True:
            cnt += 1
            break

print(cnt)

Submission status: Wrong Answer

Solution code:
def sieve(n):
    is_prime = [True for _ in range(n+1)]
    is_prime[0] = False

    for i in range(2, n+1):
        if is_prime[i-1]:
            j = 2 * i
            while j <= n:
                is_prime[j-1] = False
                j += i
    table = [ i for i in range(1, n+1) if is_prime[i-1]]
    return table
#引数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

N = int(input())
p_list = sieve(1000000)
cnt = 0
for i in range(10000):
    j = 1
    while N % (p_list[i] ** j) == 0:
        cnt += 1
        N = N // (p_list[i] ** j)
        j += 1
    if N > 999983:
        a = is_prime(N)
        if a == True:
            cnt += 1
            break

print(cnt)

Submission status: Wrong Answer

Solution code:
from math import sqrt
n = int(input())
if n == 1:
    print (0)
    exit()
isP = True
for i in range(2, int(sqrt(n))+1):
    if n % i == 0:
        isP = False
        break
if isP:
    print (1)
    exit()
i = 2
isP = [True]* (int(sqrt(n))+2)
op = 0
n2 = n
while i <= int(sqrt(n2)+1):
    if isP[i] and n % i == 0:
        n //= i
        op += 1
        j = i * 2
        while j <= int(sqrt(n2)+1):
            isP[j] = False
            if n % j == 0:
                n //= j
                op += 1
            j += i
    i += 1
print (op)

Submission status: Wrong Answer

Solution code:
from math import sqrt
n = int(input())
if n == 1:
    print (0)
    exit()
isP = True
for i in range(2, int(sqrt(n))+1):
    if n % i == 0:
        isP = False
        break
if isP:
    print (1)
    exit()
i = 2
isP = [True]* (int(sqrt(n))+1)
op = 0
n2 = n
while i <= int(sqrt(n2)):
    if isP[i] and n % i == 0:
        n //= i
        op += 1
        j = i * 2
        while j <= int(sqrt(n2)):
            isP[j] = False
            if n % j == 0:
                n //= j
                op += 1
            j += i
    i += 1
print (op)

Submission status: Wrong Answer

Solution code:
from math import sqrt
n = int(input())
if n == 1:
    print (0)
    exit()
isP = True
for i in range(2, int(sqrt(n))+1):
    if n % i == 0:
        isP = False
        break
if isP:
    print (1)
    exit()
    
i = 2
op = 0
while i <= n:
    #print (n, i)
    if n % i == 0:
        op += 1
        n //= i
    i += 1
print (op)

Submission status: Wrong Answer

Solution code:
n = int(input())

count = 0
i = 1
num = n
while num % (2 ** i) == 0:
  num //= 2 ** i
  count += 1
  #print('{}: {}'.format(2**i, count))
  i += 1
  #print(n)
f = 3
i = 1
while f * f <= num:
  if num % (f ** i) == 0:
    num //= f ** i
    count += 1
    #print('{}: {}'.format(f ** i, count))
    i += 1
    #print(n)
  else:
    f += 2
    i = 1
if num % (f ** i) == 0:
  num //= f ** i
  count += 1
if num == n:
  if num != 1:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

count = 0
i = 1
num = n
while num % (2 ** i) == 0:
  num //= 2 ** i
  count += 1
  #print('{}: {}'.format(2**i, count))
  i += 1
  #print(n)
f = 3
i = 1
while f * f <= num:
  if num % (f ** i) == 0:
    num //= f ** i
    count += 1
    #print('{}: {}'.format(f ** i, count))
    i += 1
    #print(n)
  else:
    f += 2
    i = 1
if num == n:
  if num != 1:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

m = int(n ** 0.5)
lst = [1] * (m + 1)
if n == 1:
  print(0)
else:
  count = 0
  num = n
  for i in range(2, m + 1):
    if lst[i] == 0:
      continue
    for j in range(i, m + 1, i):
      lst[j] = 0
      if num % j == 0:
        num /= j
        count += 1
      if num % j == num:
        break
    if num == 1:
      break
  if count == 0:
    count += 1
  print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N==1:
    print(0)

count = 0
n = 2

while (N//n >= 1):
    if N % n == 0:
        N = N / n
        count += 1

    n += 1

print(count)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(math.sqrt(n)) + 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(stdin.readline().rstrip())
a = factorization(n)

m = 0
for b in a:
    bb = b[1]
    i = 1
    while True:
        if bb > 0:
            bb -= i
            i += 1
        else:
            break
    m = m + i - 1

print(m)

Submission status: Wrong Answer

Solution code:
import sys
import math
import numpy as np
from collections import defaultdict
input = sys.stdin.readline


def log(*args):
    print(*args, file=sys.stderr)


def main():
    np.set_printoptions(threshold=20)
    N = int(input())
    d = defaultdict(int)
    for i in range(2, math.ceil(math.sqrt(N))):
        while N % i == 0:
            d[i] += 1
            N //= i
    if not N == 1:
        d[N] += 1

    ans = 0
    for key in d:
        val = d[key]
        tmp = 0
        count = 0
        for i in range(1, val):
            tmp += i
            count += 1
            if tmp >= val:
                break
        ans += max(count, 1)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def primeryNum(n):
    border=int(n**0.5**0.5)+2
    ary=list(range(int(n**0.5)+2))
    ary[1]=0
    for a in ary:
        if a>border: break
        elif a==0: continue
        for i in range(a*2,int(n**0.5)+2,a):
            ary[i]=0           
    return ary

primeryNumL=primeryNum(N)
# print(primeryNumL)
ans=0
for x in primeryNumL:
    if x==0 or N%x!=0:
        continue
    n=N
    cnt=0
    while n%x==0:
        cnt+=1
        n//=x
    buf=cnt-1
    res=1
    for i in range(2,cnt+1):
        if buf<i:
            break
        buf-=i
        res+=1
    ans+=res

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

Submission status: Wrong Answer

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

def primeryNum(n):
    logn=int(n**0.5**0.5)
    ary=list(range(int(n**0.5)+2))
    ary[1]=0
    for a in ary:
        if a>logn: break
        elif a==0: continue
        for i in range(a*2,int(n**0.5)+2,a):
            ary[i]=0           
    return ary

primeryNumL=primeryNum(N)
# print(primeryNumL)
ans=0
for x in primeryNumL:
    if x==0 or N%x!=0:
        continue
    n=N
    cnt=0
    while n%x==0:
        cnt+=1
        n//=x
    buf=cnt-1
    res=1
    for i in range(2,cnt+1):
        if buf<i:
            break
        buf-=i
        res+=1
    ans+=res

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

Submission status: Wrong Answer

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

def primeryNum(n):
    logn=int(n**0.5**0.5)
    ary=list(range(int(n**0.5)+1))
    ary[1]=0
    for a in ary:
        if a>logn: break
        elif a==0: continue
        for i in range(a*2,int(n**0.5)+1,a):
            ary[i]=0           
    return ary

primeryNumL=primeryNum(N)
# print(primeryNumL)
ans=0
for x in primeryNumL:
    if x==0 or N%x!=0:
        continue
    n=N
    cnt=0
    while n%x==0:
        cnt+=1
        n//=x
    buf=cnt-1
    res=1
    for i in range(2,cnt+1):
        if buf<i:
            break
        buf-=i
        res+=1
    ans+=res

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

Submission status: Wrong Answer

Solution code:

from collections import defaultdict

def prime_factor(n):
    d = defaultdict(int)
    for i in range(2, n + 1):
        if i * i > n:
            break

        while n % i == 0:
            d[i] += 1
            n //= i

    if n != 1:
        d[n] += 1

    return d


N = int(input())
d = prime_factor(N)
ans = 0
for v in d.values():
    i = 1
    res = 0
    while res < v:
        res += i
        i += 1
    ans += i - 1

print(ans)

Submission status: Wrong Answer

Solution code:
import collections
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())
A = factorization(n)


if n == 1:
    print(0)
elif len(A) ==1 and A[0] == 1:
    print(1)
else:
    t = 0
    for i in A:
        total = 0
        for j in range(1, max(A)+1):
            if total + j > i:
                break
            else:
                total += j
        t += j - 1
    print(t)

Submission status: Wrong Answer

Solution code:
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

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

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

temp = factorization(N)
temp = sorted(temp, key= lambda x: x[0])

output_set = []
output = [ output_set + [t[0]]*t[1] for t in temp ]


count = 0
for i in output:
    temp = len(i)
    sums = 0
    for t in range(1,temp+1):
        sums += t
        if temp >= sums:
            count += 1

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
xs = set()
for i in range(2, n + 1):
    if i * i > n:
        break
    if n % i == 0:
        xs.add(i)
        n //= i
if n > 1:
    xs.add(n)
print(len(xs))

Submission status: Wrong Answer

Solution code:
from collections import Counter

N=int(input())
N_=N
f_=[]
for n in range(2,int(N**(1/2))+2):    
    while N_ % n==0: 
        N_=int(N_/n)
        f_.append(n)
        
if len(f_) == 0:
    f_.append(N)
    

C=Counter(f_)
N_=N
ans=0
for c in C.keys():
    for c_ in range(1,C[c]+1):
        if N_ % c**c_ == 0:
            N_ = N_/c**c_
            ans+=1
if N==1:
    ans=0
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter

N=int(input())
N_=N
f_=[]
for n in range(2,int(N**(1/2))+2):    
    while N_ % n==0: 
        N_=int(N_/n)
        f_.append(n)
        
if len(f_) == 0:
    f_.append(N)
    

C=Counter(f_)
ans=0
for c in C.keys():
    for c_ in range(1,C[c]+1):
        if N % c**c_ == 0:
            N = N/c**c_
            ans+=1
if N==1:
    ans=0
    
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def factorization(num):
    res = []
    n = num
    div_max = int(num ** 0.5)
    for i in range(2, div_max+1):
        if n % i == 0:
            count = 0
            while n % i == 0:
                count += 1
                n //= i
            res.append([i, count])

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

    if len(res) == 0:
        res.append([num, 1])

    return res

res = factorization(N)

ans = 0
for i in range(len(res)):
    n = res[i][1]
    j = 1
    while n - j >= 0:
        ans += 1
        n -= j
        j += 1

print(ans)

Submission status: Wrong Answer

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


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


def q(m):
    check = 0
    while m >= check * (check + 1) / 2:
        check += 1
    return check - 1


a = prime_factorize(n)
keep = 0
for j in set(a):
    keep = 0
    for i in range(len(a)):
        if a[i] == j:
            keep += 1
        else:
            ans += q(keep)


print(ans + q(keep))

Submission status: Wrong Answer

Solution code:
def INT():
    return int(input())

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

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

from math import sqrt

N = INT()
tmp = N
fact = {}
is_prime = True

for n in range(2, int(sqrt(N)) + 1):
    if tmp == 1:
        break
    
    e = 0
    while 1:
        if tmp % n != 0:
            break
        tmp //= n
        e += 1
    
    if e == 0:
        continue

    fact[n] = e

if tmp != 1:
    fact[tmp] = 1

if fact == {}:
    fact[N] = 1

ans = 0

for p, e in fact.items():
    n = 1
    while 1:
        if n * (n + 1) // 2 > e:
            break
        n += 1 
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
def INT():
    return int(input())

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

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

from math import sqrt

N = INT()
tmp = N
fact = {}
is_prime = True

for n in range(2, int(sqrt(N)) + 1):
    if tmp == 1:
        break
    
    e = 0
    while 1:
        if tmp % n != 0:
            break
        tmp //= n
        e += 1
    
    if e != 0:
        is_prime = False
    else:
        continue

    fact[n] = e
        
if is_prime:
    fact = {N : 1}
elif tmp != 1:
    fact[tmp] = 1

ans = 0

for p, e in fact.items():
    n = 1
    while 1:
        if n * (n + 1) // 2 > e:
            break
        n += 1 
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
def INT():
    return int(input())

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

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

from math import sqrt

N = INT()
tmp = N
fact = {}
is_prime = True

for n in range(2, int(sqrt(N)) + 1):
    if tmp == 1:
        break
    
    e = 0
    while 1:
        if tmp % n != 0:
            break
        tmp //= n
        e += 1
    
    if e != 0:
        is_prime = False
    else:
        continue
    
    fact[n] = e
        
if is_prime:
    fact = {N : 1}

ans = 0

for p, e in fact.items():
    n = 1
    while 1:
        if n * (n + 1) // 2 > e:
            break
        n += 1 
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

ans =0
for i in range(2,int(n**0.5)+5):
    cnt = 0
    while n%i==0:
        n//=i
        cnt += 1
        s=0
    while cnt>0:
        s +=1
        cnt -= s
        ans += 1
if n!=1:ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())


hash = {}
end = int(N ** (1/2))
for i in range(2, end + 2):
    while N % i == 0:
        if i in hash:
            hash[i] += 1
        else:
            hash[i] = 1
        N = N // i
if len(hash.keys()) == 0 and N != 1:
    print(1)
    exit()


count = 0
trans = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55]

res = 0
for i in hash.values():
    for j in range(len(trans)):
        if i > trans[j]:
            continue
        elif i == trans[j]:
            res += (j + 1)
            break
        else:
            res += j
            break



print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())


hash = {}
end = int(N ** (1/2))
for i in range(2, end + 1):
    while N % i == 0:
        if i in hash:
            hash[i] += 1
        else:
            hash[i] = 1
        N = N // i

if len(hash.keys()) == 0 and N != 1:
    print(1)
    exit()


count = 0
trans = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55]

res = 0
for i in hash.values():
    for j in range(len(trans)):
        if i > trans[j]:
            continue
        elif i == trans[j]:
            res += (j + 1)
            break
        else:
            res += j
            break



print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = []
end = int(N ** (1/2))
for i in range(2, end + 1):
    while N % i == 0:
        ans.append(i)
        N = N // i


count = 0
trans = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55]

res = 0
for i in range(len(ans) - 1):
    if ans[i] != ans[i+1]:
        for j in range(len(trans)):
            if count > trans[j]:
                continue
            else:
                res += j +1
                break
        count = 1
    else:
        count += 1

if trans[-1] == trans[-2]:
    count += 1
for j in range(len(trans)):
    if count > trans[j]:
        continue
    else:
        res += j + 1
        break

print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = []
end = int(N ** (1/2))
for i in range(2, end + 1):
    while N % i == 0:
        ans.append(i)
        N = N // i


count = 0
trans = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55]

res = 0
for i in range(len(ans) - 1):
    if ans[i] != ans[i+1]:
        for j in range(len(trans)):
            if count > trans[j]:
                continue
            else:
                res += j +1
                break
        count = 1
    else:
        count += 1

if trans[-1] == trans[-2]:
    count += 1
for j in range(len(trans)):
    if count > trans[j]:
        continue
    else:
        res += j
        break

print(res)

Submission status: Wrong Answer

Solution code:
import math
def factorization(n):
    fac_list = []
    tmp = n
    for i in range(2, int(math.sqrt(n)) + 1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            fac_list.append(cnt)
    if tmp != 1:
        fac_list.append(1)
    if fac_list == []:
        fac_list.append(1)
    return fac_list

n = int(input())
fac_list = factorization(n)
ans = 0

for x in fac_list:
    tmp = 1
    while x - tmp >= 0:
        x -= tmp
        tmp += 1
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
arr = collections.Counter()
def factorize(num):
    while num % 2 == 0:
        arr[2] += 1
        num //= 2
    f = 3
    while f ** 2 <= n:
        if num % f == 0:
            arr[f] += 1
            num //= f
        else:
            f += 2
    if num != 1:
        arr[num] = 1

factorize(n)
varr = list(arr.values())
ans = 0
for i in varr:
    fv = i
    c = 0
    while c < fv:
        fv -= 1
        ans += 1
        c += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
 
#引数nが素数かどうかを判定
def is_prime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if n%i == 0:
            return False
    return True
 
def getPrimeExp(n):
    n_sqrt = int(math.sqrt(n))
    array = [True]*(n_sqrt+1)
    result = []
    for i in range(2, n_sqrt+1):
        if array[i]:
            array[i] = False
            result.append(i)
            for j in range(2, n_sqrt+1):
                ij = i**j
                if ij <= n_sqrt and array[ij]:
                    result.append(ij)
                    array[ij] = False
                elif ij > n:
                    break
            for j in range(i*2, n_sqrt+1, i):
                array[j] = False
 
            # for j in range(2, n):
            #     ij = i**j
            #     if ij <= n:
            #         result.append(ij)
            #         array[ij] = False
    return sorted(result)
 
N = int(input())
if N == 1:
    print(0)
elif is_prime(N) and N != 1:
    print(1)
else:
    cnt = 0
    primeExp = getPrimeExp(N) 
    n = N
    already = []
    # print(primeExp)
    for z in primeExp:
        if n%z == 0:
            n = int(n/z)
            cnt += 1
            already.append(z)
    if is_prime(n) and n not in already:
        cnt += 1
    else:
        for a in already:
            if n%a == 0:
                while n%a == 0:
                    n = int(n/a)
        if is_prime(n) and n not in already:
            cnt += 1

    print(cnt)

Submission status: Wrong Answer

Solution code:
import math

#引数nが素数かどうかを判定
def is_prime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if n%i == 0:
            return False
    return True

def getPrimeExp(n):
    n_sqrt = int(math.sqrt(n))
    array = [True]*(n_sqrt+1)
    result = []
    for i in range(2, n_sqrt+1):
        if array[i]:
            array[i] = False
            result.append(i)
            for j in range(2, n_sqrt+1):
                ij = i**j
                if ij <= n_sqrt and array[ij]:
                    result.append(ij)
                    array[ij] = False
                elif ij > n:
                    break
            for j in range(i*2, n_sqrt+1, i):
                array[j] = False

            # for j in range(2, n):
            #     ij = i**j
            #     if ij <= n:
            #         result.append(ij)
            #         array[ij] = False
    return sorted(result)

N = int(input())
if N == 1:
    print(0)
elif is_prime(N) and N != 1:
    print(1)
else:
    cnt = 0
    n = N
    primeExp = getPrimeExp(n) 
    already = []
    # print(primeExp)
    for z in primeExp:
        if n%z == 0:
            n = int(n/z)
            cnt += 1
            already.append(z)
            # print(z)
            # print(n)
    for a in already:
        if n%a == 0:
            n = int(n/a)
            if is_prime(n) and n not in already:
                cnt += 1
                break
    print(cnt)

Submission status: Wrong Answer

Solution code:
import math

#引数nが素数かどうかを判定
def is_prime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if n%i == 0:
            return False
    return True

def getPrimeExp(n):
    n_sqrt = int(math.sqrt(n))
    array = [True]*(n_sqrt+1)
    result = []
    for i in range(2, n_sqrt+1):
        if array[i]:
            array[i] = False
            result.append(i)
            for j in range(2, n_sqrt+1):
                ij = i**j
                if ij <= n_sqrt and array[ij]:
                    result.append(ij)
                    array[ij] = False
                elif ij > n:
                    break
            for j in range(i*2, n_sqrt+1, i):
                array[j] = False

            # for j in range(2, n):
            #     ij = i**j
            #     if ij <= n:
            #         result.append(ij)
            #         array[ij] = False
    return sorted(result)

N = int(input())
if N == 1:
    print(0)
elif is_prime(N) and N != 1:
    print(1)
else:
    cnt = 0
    n = N
    primeExp = getPrimeExp(n) 
    already = []
    # print(primeExp)
    for z in primeExp:
        if n%z == 0:
            n = int(n/z)
            cnt += 1
            already.append(z)
            # print(z)
            # print(n)
    for a in already:
        if n%a == 0:
            n = int(n/a)
            if is_prime(n):
                cnt += 1
                break
    print(cnt)