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

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

fact_N = factorization(N)
#fact_N = np.array(fact_N)
#num_sosuu = fact_N[:,1]

num_sosuu = []
for row in fact_N:
    num_sosuu.append(row[1])

#num_sosuu_max = num_sosuu.max()
num_sosuu_max = max(num_sosuu)

ans = 0
for i in range(len(num_sosuu)):
    num_i = num_sosuu[i]
#    for j in range(np.uint64(np.sqrt(2*num_sosuu_max))):
    for j in range(int((2*num_sosuu_max)**0.5)):
        if num_i >= j+1:
            ans += 1
            num_i -= j+1
        else:
            break

print(str(int(ans)))

Submission status: Wrong Answer

Solution code:
from sys import stdin
import sys

import array
import textwrap


# Eratosthenesの篩により、整数end未満の素数を列挙する
# 参考：高橋直大『最強最速アルゴリズマー養成講座』pp.410-412
def sieve_of_eratosthenes(end, typecode="L"):
    assert end > 1
    # 整数iが素数であるかをis_prime[i]が示す
    # 最初はすべてTrueで初期化しておく
    # 最終的にprimesではなくこれを返してもよい
    is_prime = array.array("B", (True for i in range(end)))
    # 0, 1はいずれも素数ではない
    is_prime[0] = False
    is_prime[1] = False
    # 素数を格納する配列
    primes = []
    # 篩う
    for i in range(2, end):
        if is_prime[i]:  # iが素数であるとき
            primes.append(i)  # 素数の配列に加える
            for j in range(2 * i, end, i):  # iを超えるiの倍数について
                is_prime[j] = False  # 素数ではないため除外する
    return primes


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


n = int(input())
if is_prime(n) is True:
    print('1')
    sys.exit()
temp = []
i = 2
primes = sieve_of_eratosthenes(1000000)
for i in range(2, 20):
    for k in range(2, 20):
        primes.append(i**k)
primes.sort()
print(primes)

for i in range(len(primes)):
    if n == 1:
        print(len(temp))
        break
    if n % primes[i] == 0 and primes[i] not in temp:
        temp.append(primes[i])
        n = n//primes[i]
        i = 0
        # print(temp, n)
    if n in temp:
        print(len(temp))
        break
    # print(primes[i])

Submission status: Wrong Answer

Solution code:
import math
def isPrime(n):
  if n == 2:
    return True
  if n % 2 == 0:
    return False

  m = math.floor(math.sqrt(n)) + 1
  for p in range(3, m, 2):
      if n % p == 0:
        return False
  return True

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

for i in range(2, (10 ** 12)+1):
    if N % i == 0:
        N = N // i
        cnt += 1
    if N <= 1:
        break

print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
import math

primes=list()

def is_prime(n):
    result=True

    m = int(math.sqrt(n))

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


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

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

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

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

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

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

N=int(input())

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

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

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

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

        m-=i
        i+=1

print(n)

Submission status: Wrong Answer

Solution code:
def divisor(x):
    ret = []
    for i in range(1, int(x ** 0.5) + 1):
        if x % i == 0:
            ret.append(i)
            ret.append(x // i)
    return list(set(ret))

n = int(input())

div = sorted(divisor(n))[1:]

ans = 0
for i in div:
    if n % i == 0:
        ans += 1
        n //= i

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
is_prime = [True] * MAX
is_prime[0] = False
is_prime[1] = False
for i in range(2, MAX):
    if is_prime[i]:
        j = i * 2
        while j < MAX:
            is_prime[j] = False
            j += i
tf = {}
if (Prime(n)):
    print("1")
else:
    ans = 0
    for i in range(2, 100010):
        if is_prime[i]:
            for j in range(1, 100):
                sub = i ** j
                if sub in tf:
                    continue
                if n % (sub) == 0:
                    ans += 1
                    n = n // (sub)
                    tf[sub] = 0
                if n == 1:
                    break
        if n == 1:
            break

    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())
l = factorization(n)
ans = 0

for i in l:
    if i[0] != 1:
        ans += (i[1]//3)+1

print(ans)

Submission status: Wrong Answer

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




m = int(input())


if not m >= 1:
    print(0)
    
else:
    count = 0
    for i in prime_factorize(m):
        sub_count = int(i ** 0.5) + 2
        while sub_count * (sub_count + 1) > 2 * i:
            sub_count -= 1
        count += sub_count
    print(count)

Submission status: Wrong Answer

Solution code:
def pfactor(n):
    result = []
    for i in range(2, int(n**0.5)+1):
        while n%i == 0:
            result.append(i)
            n //= i
    if result:
        return result
    else:
        return [n]


N = int(input())
factor = pfactor(N)
ans = 0

for p in set(factor):
    i = factor.count(p)
    while i > 0:
        c = (1 + 8*i) ** 0.5
        if c.is_integer():
            ans += (int(c)-1) // 2
            break
        i -= 1

print(ans)

Submission status: Wrong Answer

Solution code:
def fact(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())
ans = []
l = fact(n)
for i in l:
    a = i[0]
    b = i[1]
    up = 1
    if b > 2:
        for i in range(1,b+1):
            if up <= b:
                ans.append(a**i)
                up += i
            else:
                break
    else:
        ans.append(a)
        
ans = sorted(ans)
cnt = 0
for i in ans:
    if n == 1:
        break
    else:
        n //= i
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
if n == 1:
    print(0)
else:
    i = 2
    while True:
        if n == 1:
            print(ans)
            exit()
        elif n % i == 0:
            n /= i
            i += 1
            ans += 1
        else:
            if n == (10 ** 9) + 7:
                i = n
            else:
                i += 1

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

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

    return arr

def check(S):
  for i in range(S):
    if S ==1:
      return 1
    elif S == 2:
      return 1
    elif S == 3:
      return 2
    else:
      if i <= S:
        S -= i
      else:
        return i-1

if N != 1:
  result = factorization(N) 

  a = 0
  for r in result:
    b = check(r[1])
    a += b
  print(a)

else:
  print(0)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
num=1
count=0
num2=int(math.sqrt(n))
while n!=1:
    num+=1
    if n%num==0:
        count+=1
        n=n//num
    if n<num:
        break
    elif num2<num:
        count+=1
        break
print(count)

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict
N = int(input())
d = defaultdict(int)
def sieve_of_erastosthenes(num):
    input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)]
    input_list[0] = input_list[1] = False
    input_list[2] = input_list[3] = input_list[5] = True
    sqrt = math.sqrt(num)

    for serial in range(3, num, 2):

        if serial >= sqrt:
            return input_list

        for s in range(serial ** 2, num, serial):
            input_list[s] = False
if N > 100:
    l = sieve_of_erastosthenes(int(pow(N,0.5))+3)
else:
    l = sieve_of_erastosthenes(200)
cnt = 0
while N != 1 and cnt<len(l):

    while l[cnt] and N%cnt == 0:
        d[cnt] += 1
        N //=cnt
    cnt += 1
ans = 0
for i in d.values():
    tmp = 1
    while i - tmp >= 0:
        i -= tmp
        tmp += 1
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a={}
temp=n
for i in range(2,int(n**0.5)+1):
    if temp % i ==0:
        count=0
        while temp % (i**(count+1)) ==0:
            count+=1
        temp= temp/(i**count)
        a[i]=count

sum=0
for i in a:
    jisu= a[i]
    temp= int((2*jisu)**0.5)-1
    if temp*(temp+1) > 2*jisu:
        sum+= temp-1
    elif (temp+1)*(temp+2) > 2*jisu:
        sum+= temp
    elif (temp+2)*(temp+3)> 2*jisu:
        sum+= temp+1
print(sum)

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())
ans = factorization(N)
count = 0
for i in ans:
  for j in range(40):
    if i[1] < j*(j+1)/2:
      count += j-1
      break
print(count)

Submission status: Wrong Answer

Solution code:
from collections import deque
def is_prime(n):
    if n == 1:
        return False
    elif n == 2 or n== 3:
        return True
    i = 2
    while i ** 2 <= n:
        if n % i == 0:
            return False
        i += 1
    return True

def factors(n: int):
    q=deque()
    l = []
    for i in range(1, int(n**0.5) + 1):
        if n%i == 0 and is_prime(i):
            z = i
            while True:
                if z ** 2 <= n and n % z == 0:
                    l.append(z)
                else:
                    break
                z *= i
    q = sorted(set(l))
    return q
n = int(input())
q = deque(factors(n))
ans = 0
if not q:
    if n == 1:print(0);exit()
    print(1);exit()
while q:
    z = q.popleft()
    if z > n:break
    if n%z != 0:continue
    n = n // z
    #while q and q[-1] > n:
    #        q.pop()
    #print(n)
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
count = 0
flg = True

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

for i in range(2, int(math.sqrt(n)) + 1):

    if n % i == 0:
        n = n // i
        flg = False
        count += 1

if flg == True:
    print(1)
    exit()

print(count)

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

ans=0
arr=[]



for i in range(int(math.sqrt(N))+10):
    if N % (i+2) == 0:
        if i+2 not in [16,64,256,512,1024,4096,16384,32768,81,729,6561,625,15625,2401,117649,1296,46656]:
            ans+=1
            N=N/(i+2)

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

print(ans)

Submission status: Wrong Answer

Solution code:
###############################################################################
#Imports
import collections
import itertools
from functools import lru_cache
import sys
import math
###############################################################################
#Constants
MOD = int(1e9)+7
###############################################################################
#Helper
def helper():
	pass
###############################################################################
#Solver
def solve():
	n = int(input())
	if n == 1:
		print(0)
		return
	x = n
	count = 0
	for i in range(2,int(math.sqrt(n))):
		if i == 1:
			break
		if x % i == 0:
			x = x // i
			count += 1
			if x == i:
				x=1
				break
	if x == 1:
		print(count)
		return
	if x != 1:
		print(count+1)

###############################################################################
#Driver
t = 1
for _ in range(t):
	solve()
###############################################################################

Submission status: Wrong Answer

Solution code:
import sys
N=int(input())
ans=0
for i in range(2,int(N**(1/2))+1):
  if N%i==0:
    break
  if i==int(N**(1/2)):
    print(1)
    sys.exit()
i=1
k=1
while N % (2**i) == 0:
  ans+=1
  N=N//(2**i)
  i+=1
f=3
while f <= N:
  if N % (f**k) == 0:
    ans+=1
    N=N//(f**k)
    k+=1
  else:
    f += 2
    k=1
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
if n == 1:
    print(0)
else:
    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
    c = collections.Counter(prime_factorize(n))

    ans = 0
    tmp = []
    if len(c) == 1:
        if list(c.values())[0] == 1 or list(c.values())[0] == 2:
            ans += 1
        else:
            for k in range(1,100):
                if k/2*(2+(k-1)) >= list(c.values())[0]:
                    ans += k
                    break
    else:
        i = 0
        j = 0
        for l in range(len(c)):
            i = list(c.keys())[l]
            j = list(c.values())[l]
            if j == 1 or j == 2:
                ans += 1
            else:
                for k in range(1,100):
                    if k/2*(2+(k-1)) > j:
                        k = k-1
                        ans += k
                        tmp.append([k,i,j-k/2*(2+(k-1))])
                        break
    print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import sys

import array
import textwrap


# Eratosthenesの篩により、整数end未満の素数を列挙する
# 参考：高橋直大『最強最速アルゴリズマー養成講座』pp.410-412
def sieve_of_eratosthenes(end, typecode="L"):
    assert end > 1
    # 整数iが素数であるかをis_prime[i]が示す
    # 最初はすべてTrueで初期化しておく
    # 最終的にprimesではなくこれを返してもよい
    is_prime = array.array("B", (True for i in range(end)))
    # 0, 1はいずれも素数ではない
    is_prime[0] = False
    is_prime[1] = False
    # 素数を格納する配列
    primes = []
    # 篩う
    for i in range(2, end):
        if is_prime[i]:  # iが素数であるとき
            primes.append(i)  # 素数の配列に加える
            for j in range(2 * i, end, i):  # iを超えるiの倍数について
                is_prime[j] = False  # 素数ではないため除外する
    return primes


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


n = int(input())
if is_prime(n) is True:
    print('1')
    sys.exit()
temp = []
i = 2
primes = sieve_of_eratosthenes(10000)
for i in range(2,10):
    for k in range(2,10):
        primes.append(i**k)
primes.sort()
# print(primes)

for i in range(len(primes)):
    if n == 1:
        print(len(temp))
        break
    if n % primes[i] == 0 and primes[i] not in temp:
        temp.append(primes[i])
        n = n//primes[i]
        i = 0
        # print(temp, n)
    if n in temp:
        print(len(temp))
        break
    # print(primes[i])

Submission status: Wrong Answer

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


np = factorization(n)


def cont(x):
    if x == 1:
        return 1
    n = math.ceil(math.sqrt(2*x))
    return n-1


ans = 0
for i in np:
    if i[0] == 1:
        continue
    else:
        # print(cont(i[1]))
        ans += cont(i[1])
# print(np)
print(ans)

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3

import sys
from collections import deque, Counter
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(readline())

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


c = list(Counter(prime_factorize(N)).values())

ans = 0
used = {}

for i in range(len(c)):
    acc = 0
    cnt = 1
    while True:
        if c[i] >= acc + cnt:
            c[i] -= acc+cnt
            acc = acc+cnt
            ans += 1
        else:
            break
c = sorted(c)[::-1]

hoge = 1
for hoge in range(1, 100):
    for _ in range(10000):
        for i in range(len(c)-1):
            if min(c[i:i+hoge+1]) >= 1:
                for k in range(hoge+1):
                    c[i+k]-=1
                ans += 1
        c = sorted(c)[::-1]

print(ans)

Submission status: Wrong Answer

Solution code:
import math


N = int(input())


def isprime(n):
    if n == 1:
        return False
    if n % 2 == 0 and n > 2:
        return False
    for i in range(3, int(math.sqrt(n)) + 1, 2):
        if n % i == 0:
            return False
    return True


z = 2
count = 0

used = set([])

if isprime(N):
    z = N

while True:
    if z not in used:
        if N % z == 0:
            p = z
            e = 1
            while N % (p ** e) == 0:
                zd = p ** e
                N //= zd
                used.add(zd)
                count += 1
                e *= 2
    z += 1
    if N < z:
        break

print(count)

Submission status: Wrong Answer

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

n = int(readline().strip())

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)

if len(a) == 0:
  print(0)
  exit()

c = collections.Counter(a)
p = c.keys()

ans = 0
for i in p:
  v = c[i]
  m = 0
  ans += 1
  for j in range(1,v+1):
    m += j
    if m + j == v:
      break
    if m >= v:
      break
    else:
      ans += 1

print(ans)

Submission status: Wrong Answer

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

sosuu = [2]
A = sqrt_N + 2
for i in range(3, A, 2): # 2 以外の素数は奇数なので
    is_prime = True
    sqrt_i = math.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)
ans = 0
for i in sosuu:
    if N < i:
        break
    n = 1
    while 1:
        i_n = i ** n
        if N < i_n:
            break
        d,m = divmod(N, i_n)
        # print(d,m)
        if m == 0:
            N = d
            n += 1
            ans += 1
        else:
            break
if ans == 0:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:

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


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:
    print(0)
    exit()
if pri_me(n):
    print(1)
    exit()
N = n
ans = 0
for i in range(2,int(N**0.5)+4):
    if n%i==0 and len(set(prime_factorize(i)))==1: 
        n=n//i
        ans += 1
        #print(n,i)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a={}
temp=n
for i in range(2,int(n**0.5)+1):
    if temp % i ==0:
        count=0
        while temp % (i**(count+1)) ==0:
            count+=1
        temp= temp/(i**count)
        a[i]=count

print(a)
sum=0
for i in a:
    jisu= a[i]
    temp= int((2*jisu)**0.5)-1
    if temp*(temp+1) > 2*jisu:
        sum+= temp-1
    elif (temp+1)*(temp+2) > 2*jisu:
        sum+= temp
    elif (temp+2)*(temp+3)> 2*jisu:
        sum+= temp+1
print(sum)

Submission status: Wrong Answer

Solution code:
import collections
import numpy as np

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())
#print(N)
A = prime_factorize(N)
c = collections.Counter(A)

#print(A)

d = (-1. + np.sqrt(1 + 8 * np.array(list(c.values()))))/2
#print(d)
print(int(np.sum(d)))

Submission status: Wrong Answer

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

i=2
ans=0
count1=0
count2=1
while sq>=i:
    if nn%i==0:
        nn//=i
        count1+=1
        if count1//count2>0:
            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:
def factorization(y):
    arr = []
    temp = y
    for i in range(2, int(-(-y**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([y, 1])
    return arr
import math
n=int(input())
if n==1:
  print(0)
  exit()

ans=0
l=factorization(n)
for i,j in l:
  cnt=0
  for k in range(2,int(math.sqrt(i))+1):
    if i%k==0:
      cnt=1
      break
  if cnt==0:
    if j<=2:
      ans+=1
    else:
      c=1
      t=1
      while j>0:
        ans+=1
        j-=c
        c+=t
        t+=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())
insu = prime_factorize(N)

insu_num = []
ans = 0

while len(insu) != 0:
    num = insu.count(insu[0])
    insu_num.append(num)
    insu = insu[num:]

for num in insu_num:
    p_mae = 1
    p = 1
    while True:
        num -= p
        if num>=0:
            ans += 1
        else:
            break    
        t = p
        p = p_mae+p
        p_mae = t

print(ans)

Submission status: Wrong Answer

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

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)

b = len(a);

if n == 1:
    count = 0;
else:
    count = 1;
    x = 1;
    y = 1;

    for i in range(1,b):
        if a[i] == a[i-1]:
            x += 1;
            z = y * (y+1) // 2;
            if x - z > y:
                count += 1;
                y += 1;
            
        else:
            x = 1;
            y = 1;
            count += 1;

print(count);

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
ans = 0
for i in range(2, int(np.sqrt(10**12))):
  if N < i:
    break
  if N % i == 0:
    N = N // i
    ans += 1

if ans == 0:
  ans = 1
if N == 1:
  print(0)
else:
  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())
b = prime_factorize(n)
res = 0
i = 0
pre = 0
while i < len(b): 
    if pre != b[i]:
        count = 0
        maxcount = 2
        res += 1
    else:
        count +=1
        if count >= maxcount:
            maxcount += 1
            count = 0
            res += 1
        else:
            count += 1
    pre = b[i]
    i += 1
print(res)

Submission status: Wrong Answer

Solution code:
def prime(p):
    memo = []
    for i in range(2,(int(p**0.5)+1)):
        jousu = 1
        while p%(i**jousu)==0:
            p //= i**jousu
            memo.append(i**jousu)
            jousu += 1
    if p != 1:
        memo.append(p)
    return memo
 
n=int(input())
 
memo = prime(n)

memo = set(memo)

if len(memo) == 0:
  print(0)
else: 
  print(len(memo))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def divisor(x):
    ret = []
    for i in range(1, int(x ** 0.5) + 1):
        if x % i == 0:
            ret.append(i)
            ret.append(x // i)
    return list(set(ret))

n = int(input())

div = sorted(divisor(n)[1:])

ans = 0
for i in div:
    if n % i == 0:
        ans += 1
        n //= i

print(ans)

Submission status: Wrong Answer

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

    if N == 1:
        print(0)
        return

    count = 0

    for i in range(10**6):
        a = i + 2

        if a > 10**6:
            if N >= a:
                count += 1
            break

        if N % a == 0:
            N = N // a
            count += 1

        if N == 1:
            break

    print(count)


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

def fact(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


garr=0

def idontknow(P):
    global garr
    D=P
    garr=0
    for i in range(1,P+1):
        if D>=i:
            garr+=1
            D=D-i
        else:
            return garr


FFF=fact(N)


ans=0

for i in range(len(FFF)):
    idontknow(int(FFF[i][1]))
    ans+=garr

print(ans)

Submission status: Wrong Answer

Solution code:
import math
def sosu(x):
    for i in range(2,int(math.sqrt(x))+1):
        if x%i==0:
            return False
    return True
n=int(input())
if n==1:
    print(0)
    exit()
l=[]
for i in range(2,10**4 +1):
    if sosu(i):
        l.append(i)
#print(l)
ans=0
for i in range(len(l)):
    if n%l[i]==0:
        s=1
        while n>1:
            if n%l[i]**s==0:
                n=n//(l[i]**s)
                ans+=1
                s+=1
                #print(n)
            else:
                break

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