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

# import math
#
# def sieve_of_eratosthenes(n):
#     candidate = [i for i in range(2, n+1)]
#     prime = []
#     limit = math.sqrt(n) + 1
#
#     while True:
#         p = min(candidate)
#         if limit <= p:
#             prime.extend(candidate)
#             break
#         prime.append(p)
#
#         candidate = [i for i in candidate if i % p != 0]
#
#     return prime
#
#
# if N == 1:
#     print(0)
#     exit()
#
# rn = math.ceil(math.sqrt(N))
# L = sieve_of_eratosthenes(rn)
# print('hoge')
#
# n = N
# c = 0
# used = {}
#
# for l in L:
#     if n % l == 0:
#         i = 1
#         l2 = l
#         while n % l2 == 0:
#             c += 1
#             i += 1
#             used[l2] = True
#             n = n // l2
#             l2 = l ** i
#
# if c == 0:
#     print(1)
# else:
#     if n != 1:
#         # x = sieve_of_eratosthenes(n)
#         if n not in used:
#             c += 1
#     print(c)

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

ans = 0
used = {}

n = N
i = 1
p = 2
while n % p == 0:
    ans += 1
    n = n // p
    used[p] = True
    i += 1
    p = 2**i


i = 1
p = 3
k = p
while p * p <= N:
    while n % k == 0:
        if k in used:
            i += 1
            k = k ** i
        else:
            ans += 1
            i += 1
            n = n // k
            used[k] = True
            k = k ** i
    i = 1
    p += 2
    k = p

if n not in used and n != 1:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
prime_list = []

for i in range(2, int(math.sqrt(n)) + 1):
    if n % i == 0:
        prime_list.append(i)
        n /= i
        index = 2
        counter = 0
        while 1:
            if n % i == 0:
                n /= i
                counter += 1
                if(counter == index):
                    prime_list.append(i ** index)
                    index += 1
                    counter = 0
            else:
                break
if len(prime_list) > 0:
    print(len(prime_list))
elif n == 1:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
N = int(input())

# import math
#
# def sieve_of_eratosthenes(n):
#     candidate = [i for i in range(2, n+1)]
#     prime = []
#     limit = math.sqrt(n) + 1
#
#     while True:
#         p = min(candidate)
#         if limit <= p:
#             prime.extend(candidate)
#             break
#         prime.append(p)
#
#         candidate = [i for i in candidate if i % p != 0]
#
#     return prime
#
#
# if N == 1:
#     print(0)
#     exit()
#
# rn = math.ceil(math.sqrt(N))
# L = sieve_of_eratosthenes(rn)
# print('hoge')
#
# n = N
# c = 0
# used = {}
#
# for l in L:
#     if n % l == 0:
#         i = 1
#         l2 = l
#         while n % l2 == 0:
#             c += 1
#             i += 1
#             used[l2] = True
#             n = n // l2
#             l2 = l ** i
#
# if c == 0:
#     print(1)
# else:
#     if n != 1:
#         # x = sieve_of_eratosthenes(n)
#         if n not in used:
#             c += 1
#     print(c)

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

ans = 0
used = {}

n = N
i = 1
p = 2
while n % p == 0:
    ans += 1
    n = n // p
    used[p] = True
    i += 1
    p = 2**i


i = 1
p = 3
k = p
while p * p <= N:
    while n % k == 0:
        if k in used:
            i += 1
            k = k ** i
        else:
            ans += 1
            i += 1
            n = n // k
            used[k] = True
            k = k ** i
    i = 1
    p += 2
    k = p

if n not in used and used != 1:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from collections import defaultdict

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7
# ----------

def P(x):
    i = 1
    total = 1
    while True:
        total += i
        if total >= x:
            break
        i += 1
    return i


N = int(input())

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

e = defaultdict(int)
for i in range(2, int(N ** 0.5) + 1):
    while N % i == 0:
        e[i] += 1
        N //= i

if len(e) == 0:
    print(1)
    exit()

ans = 0
for k, v in e.items():
    ans += P(v)
print(ans)

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
n=int(input())
if n==1:
    ans=0
else:
    a=prime_factorize(n)
    if a==[]:
        ans=1
    else:
        ans=0
        xzen=a[0]
        count=1
        ans+=1
        for x in range(1,len(a)):
            if xzen==a[x]:
                count+=1
                if count==3 or count==6 or count==10 or count==15 or count==21 or count==28:
                    ans+=1
            else:
                xzen=a[x]
                count=1
                ans+=1
print(ans)

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
n=int(input())
if n==1:
    ans=0
else:
    a=prime_factorize(n)
    if a==[]:
        ans=1
    else:
        ans=0
        xzen=a[0]
        count=1
        ans+=1
        for x in range(1,len(a)):
            if xzen==a[x]:
                count+=1
                if count==3 or count==6 or count==10 or count==15 or count==21:
                    ans+=1
            else:
                xzen=a[x]
                count=1
                ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
# A, B = [i for i in input().split()]


def prime_factorization(n):
    fact_list = []
    for p in range(2, int(math.sqrt(n)) + 1):
        e = 0
        while n % p == 0:
            n //= p
            e += 1
        if e > 0:
            fact_list.append((p, e))
    return fact_list


prime_list = prime_factorization(N)
if len(prime_list) == 0:
    if N == 1:
        print(0)
    else:
        print(1)
else:
    count = 0
    for p, e in prime_list:
        a = 1
        sum_a = 0
        while True:
            sum_a += a
            if e < sum_a:
                break
            a += 1
        count += a - 1
    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

# import math
#
# def sieve_of_eratosthenes(n):
#     candidate = [i for i in range(2, n+1)]
#     prime = []
#     limit = math.sqrt(n) + 1
#
#     while True:
#         p = min(candidate)
#         if limit <= p:
#             prime.extend(candidate)
#             break
#         prime.append(p)
#
#         candidate = [i for i in candidate if i % p != 0]
#
#     return prime
#
#
# if N == 1:
#     print(0)
#     exit()
#
# rn = math.ceil(math.sqrt(N))
# L = sieve_of_eratosthenes(rn)
# print('hoge')
#
# n = N
# c = 0
# used = {}
#
# for l in L:
#     if n % l == 0:
#         i = 1
#         l2 = l
#         while n % l2 == 0:
#             c += 1
#             i += 1
#             used[l2] = True
#             n = n // l2
#             l2 = l ** i
#
# if c == 0:
#     print(1)
# else:
#     if n != 1:
#         # x = sieve_of_eratosthenes(n)
#         if n not in used:
#             c += 1
#     print(c)

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

ans = 0
used = {}

n = N
i = 1
p = 2
while n % p == 0:
    ans += 1
    n = n // p
    used[p] = True
    i += 1
    p = 2**i


i = 1
p = 3
k = p
while p * p <= N:
    while n % k == 0:
        if k in used:
            i += 1
            k = k ** i
        else:
            ans += 1
            i += 1
            n = n // k
            used[k] = True
            k = k ** i
    i = 1
    p += 2
    k = p

print(max(ans, 1))

Submission status: Wrong Answer

Solution code:


import sys
from collections import defaultdict

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7
# ----------

def P(x):
    i = 0
    total = 0
    while True:
        total += i
        if total >= x:
            break
        i += 1
    return i


N = int(input())

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

e = defaultdict(int)
for i in range(2, int(N ** 0.5) + 1):
    while N % i == 0:
        e[i] += 1
        N //= i

if len(e) == 0:
    print(1)
    exit()

ans = 0
for k, v in e.items():
    ans += P(v)
print(ans)

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())
if N==1:
  print(0)
  exit(0)
c=0
p=factorization(N)
print(p)
for i in range(len(p)):
    r=1
    s=0
    while 1:
        s+=r
        if p[i][1]>=s:
            N/=pow(p[i][0],r)
            print(N)
            c+=1
            r+=1
        else:
            break
            
print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
t = []
for i in range(2,int(-(-n**0.5//1))+1):
    if(n%i == 0):
        cmp = 0
        while(n%i == 0):
            cmp += 1
            n //= i
        t.append([i,cmp])
    if(n == 1):
        break
#print(t)
if(t == []):
    print(1)
else:
    z = -len(t)
    for i in range(len(t)):
        j = 1
        while(t[i][1] >= 0):
            t[i][1] -= j
            j += 1
            z += 1
        
    print(z)
#print(t)

Submission status: Wrong Answer

Solution code:
n = int(input())
import math
import numpy as np
t = []
b = n

for i in range(int(math.sqrt(n))-1):
    if b >= i+2:
        if b % (i + 2) == 0:
            t.append(0)
            while b % (i + 2) == 0:
                t[-1] += 1
                b /= (i+2)
    # print('a')
ans = 0
# print(t)
# exit()

tt = t

for i in range(len(t)):
    count = 1
    while t[i] >= count:
        ans += 1
        t[i] = t[i] - count
        count += 1

# for i in range(len(t)):
#     count = 1
#     while t[i]

if n != 1 and ans == 0:
    print('1')
    exit()
# print(t)
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter
 
def factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
 
 
N = int(input())
arr = dict(Counter(factorize(N)))
ans = 0
 
for v, c in arr.items():
    ans += 1
    z = 1
    for _ in range(2, c+1):
        z += z
        if c - z <= 0:
            break
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
nn=N
import math
sq=round(math.sqrt(N))+1

i=2
ans=0
count1=0
count2=1
while sq>=i:
    if nn%i==0:
        nn//=i
        count1+=1
        if count1==count2:
            ans+=1
            count2+=1
            count1=0
    else:
        i+=1
        count1=0
        count2=1

if ans==0 and N>=2:
    ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
import math
from sys import exit

n=int(input())
primes = {}
i = 2
ans = 0
square = math.floor(math.sqrt(n))

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

while i * i <= n:
    if n == 1:
        break
    if n % i == 0:
        if i not in primes.keys():
            primes[i] = 1
        else:
            primes[i] += 1
        n = n // i
    else:
        if i == 2:
            i += 1
        else:
            i += 2
        continue

if len(primes) == 0:
    print(1)
    exit()

for k,v in primes.items():
    if k == 1:
        continue
    base = v * 2
    root = math.floor(math.sqrt(base))
    if root * (root + 1) > base:
        root -= 1
    ans += root
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
prime_list = []

for i in range(2, int(math.sqrt(n)) + 1):
    if n % i == 0:
        prime_list.append(i)
        n /= i
        index = 2
        counter = 0
        while 1:
            if n % i == 0:
                n /= i
                counter += 1
                if(counter == index):
                    prime_list.append(i ** index)
                    index += 1
                    counter = 0
            else:
                break
print(len(prime_list))

Submission status: Wrong Answer

Solution code:
from collections import Counter

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


N = int(input())
arr = dict(Counter(factorize(N)))
ans = 0

for v, c in arr.items():
    ans += 1
    z = 1
    for _ in range(2, c+1):
        z += z
        if c - z < 0:
            break
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

# import math
#
# def sieve_of_eratosthenes(n):
#     candidate = [i for i in range(2, n+1)]
#     prime = []
#     limit = math.sqrt(n) + 1
#
#     while True:
#         p = min(candidate)
#         if limit <= p:
#             prime.extend(candidate)
#             break
#         prime.append(p)
#
#         candidate = [i for i in candidate if i % p != 0]
#
#     return prime
#
#
# if N == 1:
#     print(0)
#     exit()
#
# rn = math.ceil(math.sqrt(N))
# L = sieve_of_eratosthenes(rn)
# print('hoge')
#
# n = N
# c = 0
# used = {}
#
# for l in L:
#     if n % l == 0:
#         i = 1
#         l2 = l
#         while n % l2 == 0:
#             c += 1
#             i += 1
#             used[l2] = True
#             n = n // l2
#             l2 = l ** i
#
# if c == 0:
#     print(1)
# else:
#     if n != 1:
#         # x = sieve_of_eratosthenes(n)
#         if n not in used:
#             c += 1
#     print(c)

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

ans = 0

n = N
i = 1
p = 2
while n % p == 0:
    ans += 1
    n = n // p
    i += 1
    p = 2**i

i = 1
p = 3
k = p
while p * p <= N:
    while n % k == 0:
        ans += 1
        i += 1
        n = n // k
        k = k ** i
    i = 1
    p += 2
    k = p

print(max(ans, 1))

Submission status: Wrong Answer

Solution code:
import collections as cl
#素因数分解
N = int(input())
res = 0
def prime(N):
    l = []
    p = 2
    while N % 2 == 0:
        l.append(p)
        N //= p
    p += 1
    while p * p <= N:
        if N % p == 0:
            l.append(p)
            N //= p
        else:
            p += 2
    if N != 1:
        l.append(N)
    return l

c = cl.Counter(prime(N))

for k,v in c.items():
    i = 1
    while i <= v:
        res += 1
        v -= 1
        i += 1

print(res)

Submission status: Wrong Answer

Solution code:
import sys
import math
import copy

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

def main():
    N = int(input())
    if N == 1:
        print(0)
        sys.exit()
    if is_prime(N):
        print(1)
        sys.exit()
    else:
        count = 0
        ori_N = copy.copy(N)
        for i in range(2, ori_N, 1):
            if i * i > ori_N:
                break
            if N < i:
                break
            if N % i == 0:
                if is_prime(i):
                    count += 1
                    N //= i
                else:
                    j = 2
                    while i % j != 0:
                        j += 1
                    now = copy.copy(i)
                    while now >= j:
                        if now == j:
                            count += 1
                            N //= i
                        now /= j
        print(count)

if __name__ == '__main__':
     main()

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    cnt = 0
    while n % 2 == 0:
        cnt += 1
        n //= 2
    if cnt > 0:
        a.append(cnt)
    f = 3
    cnt = 0
    while f * f <= n:

        if n % f == 0:
            cnt += 1
            n //= f
        else:
            f += 2
            if cnt > 0:
                a.append(cnt)
            cnt = 0

    if n != 1:
        a.append(1)
    return a

n = int(input())
ans = 0
lis = prime_factorize(n)
#print(lis)

for i in range(len(lis)):
    val = 1
    while val <= lis[i]:
        lis[i] -= val
        val += 1
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

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

    return arr


hoge = factorization(n)
ret = 0

if (hoge[0][0] == 1):
    print(0)
else:
    for i in hoge:
        tmp = i[1]
        cnt = 1
        while True:
            if tmp < cnt:
                break
            ret += 1
            tmp -= cnt
            cnt += 1
print(ret)

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    cnt = 0
    while n % 2 == 0:
        cnt += 1
        n //= 2
    a.append(cnt)
    f = 3
    cnt = 0
    while f * f <= n:

        if n % f == 0:
            cnt += 1
            n //= f
        else:
            f += 2
            if cnt > 0:
                a.append(cnt)
            cnt = 0

    if n != 1:
        a.append(1)
    return a

n = int(input())
ans = 0
lis = prime_factorize(n)
#print(lis)

for i in range(len(lis)):
    val = 1
    while val <= lis[i]:
        lis[i] -= val
        val += 1
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t = []
for i in range(2,int(-(-n**0.5//1))+1):
    if(n%i == 0):
        cmp = 0
        while(n%i == 0):
            cmp += 1
            n //= i
        t.append([i,cmp])
if(t == []):
    print(1)
else:
    z = -len(t)
    for i in range(len(t)):
        j = 1
        while(t[i][1] >= 0):
            t[i][1] -= j
            j += 1
            z += 1
        
    print(z)

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

def get_count(c):
  ans = 0
  _max = c
  for i in range(1,c+1):
    if i <= _max:
      ans += 1
      _max -= i
    else:
      break
  return ans
a = int(input())
counter = Counter(prime_factor(a))
ans = 0
for i in counter:
  ans += get_count(counter[i])
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
N = n

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

yakusu = []
multi = []

i = 2
while(i <= math.ceil(math.sqrt(N))):
    
    if(n % i == 0):
        if(i in yakusu):
            multi[yakusu.index(i)] += 1
        else:
            yakusu.append(i)
            multi.append(1)
        n = int(n / i)
        continue
    
    if(n == 1):
        break
    
    i += 1

if(len(yakusu) == 0):
    print(1)
    exit()
    
#print(yakusu)
#print(multi)

ans = 0

for j in range(len(multi)):
    h = (-1 + int(math.sqrt(1 + 8 * multi[j]))) / 2
    ans += int(h)

print(ans)

Submission status: Wrong Answer

Solution code:
import math
def check(n):
    count = 0
    if n>1:
        end = int(math.sqrt(n)+1)
        for i in range(2,end):
            if n%i==0:
                count += 1
                n/=i
            if n==1:
                return count
        if count==0:
            return 1
        else:
            return count
    else:
        return 0        
n = int(input())
ans = check(n)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
import copy

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

def main():
    N = int(input())
    if N == 1:
        print(0)
        sys.exit()
    if is_prime(N):
        print(1)
        sys.exit()
    else:
        count = 0
        ori_N = copy.copy(N)
        for i in range(2, ori_N, 1):
            if i * i > ori_N:
                break
            if N < i:
                break
            if N % i == 0:
                if is_prime(i):
                    count += 1
                    N //= i
                else:
                    j = 2
                    while i % j != 0:
                        j += 1
                    now = i
                    while now > j:
                        now /= j
                        if now == j:
                            count += 1
                            N //= i
        print(count)

if __name__ == '__main__':
     main()

Submission status: Wrong Answer

Solution code:
n = int(input("choose num:"))
cnt = 0
cntN = n
 
for i in range(2,n+1):

    p = i
    while n%p ==0:
        cnt += 1
        cntN /= p
        p *= p
    if cntN+1 <= i:
        break
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
from sys import exit

n=int(input())
primes = {}
i = 2
ans = 0
square = math.floor(math.sqrt(n))

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

while True:
    if n == 1 or i > square:
        break
    if n % i == 0:
        if i not in primes.keys():
            primes[i] = 1
        else:
            primes[i] += 1
        n = n // i
    else:
        i += 1
        continue

if len(primes) == 0:
    print(1)
    exit()

for k,v in primes.items():
    tmp = 0
    while tmp * (tmp+1) // 2 <= v:
        tmp += 1
    ans += tmp - 1

print(ans)

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

c=0
p=factorization(N)
#print(p)
for i in range(len(p)):
    r=1
    s=0
    while 1:
        s+=r
        if p[i][1]>=s:
            N=N//pow(p[i][0],r)
            #print(N)
            c+=1
            r+=1
        else:
            break
            
print(c)

Submission status: Wrong Answer

Solution code:
import sys
import math
import copy

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

def main():
    N = int(input())
    if N == 1:
        print(0)
        sys.exit()
    a = is_prime(N)
    if a == N:
        print(1)
        sys.exit()
    else:
        count = 0
        ori_N = copy.copy(N)
        for i in range(2, ori_N, 1):
            if i * i > ori_N:
                break
            if N < i:
                break
            if N % i == 0:
                if is_prime(i):
                    count += 1
                    N //= i
                else:
                    j = 2
                    while i % j != 0:
                        j += 1
                    now = i
                    while now > j:
                        now /= j
                        if now == j:
                            count += 1
                            N //= i
        print(count)

if __name__ == '__main__':
     main()

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 = 0

if (hoge[0][0] == 1):
    print(0)
else:
    for i in hoge:
        tmp = i[1]
        cnt = 1
        while True:
            if tmp >= cnt:
                ret += 1
            else:
                break
            tmp -= cnt
            cnt += 1
print(ret)

Submission status: Wrong Answer

Solution code:
# Problem D - Div Game

# 素因数分解
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

# input
N = int(input())

# initialization
fact_arr = factorization(N)
count = 0

# count
for f in fact_arr:
    c = f[1]
    tmp_count = 0
    i = 1
    while c-i>=0:
        c -= i
        tmp_count += 1
        i += 1
    count += tmp_count

# output
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
import math
from sys import exit

n=int(input())
primes = {}
i = 2
ans = 0
square = math.floor(math.sqrt(n))

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

while True:
    if n == 1 or i > square:
        break
    if n % i == 0:
        if i not in primes.keys():
            primes[i] = 1
        else:
            primes[i] += 1
        n = n // i
    else:
        if i == 2:
            i += 1
        else:
            i += 2
        continue

if len(primes) == 0:
    print(1)
    exit()

for k,v in primes.items():
    tmp = 0
    while tmp * (tmp+1) // 2 <= v:
        tmp += 1
    ans += tmp - 1

print(ans)

Submission status: Wrong Answer

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

repeat = [1]*9
for i in range(1,10):
    repeat[i-1] = i*(i+1)//2

ans = 0
judge = False
for d in range(2, 10**6):
    count = 0
    if n%d == 0:
        judge = True
        j = -1
        while n%d == 0:
            n = n//d
            count += 1
        while judge:
            j += 1
            if count < repeat[j]:
                ans += j
                judge = False

if ans == 0 and n2 != 1:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
# 素因数分解
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=NTL_1_A&lang=ja

import math
from collections import Counter
n = int(input())
origin = n
ans = []

i = 2
while i <= math.sqrt(n):
    if n % i == 0:
        n //= i
        ans.append(str(i))
    else:
        i += 1

if n != 1:
    ans.append(str(n))
# print(Counter(ans))
f_ans = 0
for x, y in Counter(ans).items():
    cnt = 0
    for i in range(1, y):
        cnt += i
        if cnt == y:
            f_ans += i
            break
        if cnt > y:
            f_ans += (i - 1)
            break


print(f_ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = []
while True:
    for i in range(2, N):
        if N % i == 0:
            a.append(i)
            N //= i
            break
    else:
        a.append(N)
        break

b = set(a)

c = []
for i in b:
    c.append(a.count(i))

d = []
for i in c:
    for j in range(1, i + 1):
        i -= j
        if i >= 0:
            d.append(j)
        else:
            break
print(len(d))

Submission status: Wrong Answer

Solution code:
# 素因数分解
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=NTL_1_A&lang=ja

import math
from collections import Counter
n = int(input())
origin = n
ans = []

i = 2
while i <= math.sqrt(n):
    if n % i == 0:
        n //= i
        ans.append(str(i))
    else:
        i += 1

if n != 1:
    ans.append(str(n))
# print(Counter(ans))
f_ans = 0
for x, y in Counter(ans).items():
    cnt = 0
    for i in range(1, y):
        cnt += i
        if cnt == y:
            f_ans += i
            break
        if cnt > y:
            f_ans += (i - 1)
        

print(f_ans)

Submission status: Wrong Answer

Solution code:
#D
import math
#試し割法
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            if num not in factor:
                factor.append(num)
    #リストが空ならそれは素数
    if not factor:
        return 'prime number'
    else:
        factor.append(n)
        return factor
    
n=int(input())
if n==1:
    ans=0
elif trial_division(n)== 'prime number':
    ans=1
else:
    z=2
    ans=0
    while z <= n:
        if n%z !=0:
            z += 1
            continue
        if trial_division(z)== 'prime number':
            n = int(n/z)
            z += 1
            ans += 1
        elif len(trial_division(z))==2:
            n = int(n/z)
            z += 1
            ans += 1
        else:
            z += 1
        
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(read())

U = 10**6
is_prime = np.zeros(U, np.bool_)
is_prime[2] = 1
is_prime[3::2] = 1
for p in range(3, U, 2):
    if p * p >= U:
        break
    if is_prime[p]:
        is_prime[p::p] = 0

primes = is_prime.nonzero()[0]


def factor(N):
    div = primes[N % primes == 0]
    for p in div:
        e = 0
        while N % p == 0:
            e += 1
            N //= p
        yield (p, e)
    if N != 1:
        yield (N, 1)


A = np.zeros(100, np.int32)
for i in range(14):
    k = i * (i + 1) // 2
    A[k] = i
np.maximum.accumulate(A, out=A)

x = 0
for p, e in factor(N):
    x += A[e]
print(x)