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:
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, reverse=True)

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)
    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, reverse=True)

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)
    if is_prime(n):
        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
    primeExp = getPrimeExp(N) 
    n = N
    # print(primeExp)
    for z in primeExp:
        if n%z == 0:
            n = int(n/z)
            cnt += 1
    print(cnt)

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

cnt = 0
n = int(input())
#if n == 1:
#  print(0)

f_list = factorization(n)

for item in f_list:
  power = item[1]
  counter = 1
  while(True):
    power -= counter
    if power<0:
      break
      cnt+=1
      counter+=1
print(cnt)

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

cnt = 0
n = int(input())
if n == 1:
  print(0)
else:
  f_list = factorization(n)

  for item in f_list:
    power = item[1]
    counter = 1
    while(True):
      power -= counter
      if power<0:
        break
      cnt+=1
      counter+=1
print(cnt)

Submission status: Wrong Answer

Solution code:


def main(N: int):
    processedN = N
    count = 0

    for inc in range(2, int(N**0.5 // 1)):
        if inc > processedN:
            break
        if processedN % inc == 0:
            tmp_count = 0
            while processedN % inc == 0:
                print(inc, processedN, count)
                tmp_count += 1
                processedN //= inc
            tmp_inc = 1
            while tmp_count >= tmp_inc:
                count += 1
                tmp_count -= tmp_inc
                tmp_inc += 1

    if N == processedN:
        count += 1
    print(count)


N = int(input())
# line = list(map(str, input().split()))
main(N)

Submission status: Wrong Answer

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

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

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

    return arr


def main(N: int):
    numbers = factorization(N)
    count = 0
    for number in numbers:
        [n, c] = number
        inc = 1
        left = c
        while inc <= left:
            left -= inc
            inc += 1
            count += 1
    print(count)


N = int(input())
# line = list(map(str, input().split()))
main(N)

Submission status: Wrong Answer

Solution code:
from math import *
from collections import Counter
def factorize(n):
	res = []
	while n%2 == 0:
		res.append(2)
		n = n//2
	for i in range(3,int(sqrt(n))+1,2):
		while n%i == 0:
			res.append(i)
			n = n//i
	if n > 2:
		res.append(n)

	return res

n = int(input())
d = Counter(factorize(n))
ans = 0
for key,value in d.items():
	i = 0
	while value > i:
		value-=1
		i+=1
	ans+=i
print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import math


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def generatePrimes(n):
    if n < 2:
        return []
    isPrimeArray = [True] * (n + 1)
    isPrimeArray[0], isPrimeArray[1] = False, False
    for i in range(2, n+1):
        if isPrimeArray[i]:
            k = 2 * i
            while k < n + 1:
                isPrimeArray[k] = False
                k += i
    return list(filter(lambda i: isPrimeArray[i], range(n+1)))


def main():
    N = II()
    if N <= 1:
        print(0)
        exit()
    max_prime = math.ceil(N**0.5)
    primes = generatePrimes(max_prime)
    es = [0] * len(primes)
    for i in range(len(primes)):
        while N % primes[i] == 0:
            N /= primes[i]
            es[i] += 1

    if int(N) != 1:
        print(1)
        exit()

    ans = 0

    for i in range(len(es)):
        k = 1
        while es[i] - k >= 0:
            es[i] -= k
            k += 1
            ans += 1

    print(ans)


main()

Submission status: Wrong Answer

Solution code:
def sieve(n):
    flag = [True]*(n+1)
    flag[0] = False
    flag[1] = False
    for i in range(len(flag)):
        if flag[i]:
            yield i
            for j in range(i,len(flag),i):
                flag[j]=False

def factorization(n):
    primes = list(sieve(int((n**0.5)+1)))
    d = [0]*len(primes)
    for i in range(len(primes)):
        p = primes[i]
        while n%p == 0:
            d[i] += 1
            n //= p
    return d

n = int(input())
f = factorization(n)
cnt = 0
if sum(f)==0 and n!=1:
    cnt +=1
else:
    for i in range(len(f)):
        idx = int((1+(1+8*f[i])**0.5)/2)-1 if f[i]!=0 else 0
        cnt += idx 
print(cnt)

Submission status: Wrong Answer

Solution code:
from bisect import bisect_left
def sieve(n):
    flag = [True]*(n+1)
    flag[0] = False
    flag[1] = False
    for i in range(len(flag)):
        if flag[i]:
            yield i
            for j in range(i,len(flag),i):
                flag[j]=False
    

def factorization(n):
    primes = list(sieve(int((n**0.5)+1)))
    d = [0]*len(primes)
    for i in range(len(primes)):
        p = primes[i]
        while n%p == 0:
            d[i] += 1
            n //= p
    return d


n = int(input())
f = factorization(n)

x = [0]
for i in range(1,41):
    x.append(x[i-1]+i)

cnt = 0
if sum(f)==0:
    cnt +=1
else:
    for i in range(len(f)):
        cnt += bisect_left(x,f[i])
print(cnt)

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())
a = factorization(N)
cnt = 0
for i in a:
  temp = i[1]-1
  d = 2
  while temp>=d:
    temp -= d
    d += 1
  cnt+=d-1
print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())

def factorization(n):
    arr = []
    if n == 1:
        return 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

f_list = factorization(n)
ans = 0
print(f_list)
for i in range(len(f_list)):
    _tmp = f_list[i][1]
    print("tmp",_tmp)
    j = 1
    #素因数分解したときのx^y y=1,2のとき1 y=3,4,5のとき2 y=6,7,8,9のとき3
    while _tmp >= 0:
        _tmp -= j
        j += 1
    ans += j-2

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0 for k in range(int(N**0.5)+1)]

#N=1の処理
if N == 1:
  print(0)
  exit()
ans = 0


prime = [2]
for k in range(3, len(A), 2):
  if A[k] == 0:
    prime.append(k)
    for j in range(k, len(A), k):
      A[j] = 1
for p in prime:
  if N%p == 0:
    break
else: 
  print(1)
  exit()

used = []
use = []
#print(prime)
for p in prime:
  if p > N:
    break
  if N%p == 0:
    #print(p)
    ans += 1
    used.append(p)
    use.append(p)
    N = N // p
  np = p * p
  while N % np == 0:
    #print(np)
    ans += 1
    used.append(np)
    N = N // np
    np = np * p
    
#print(use)
#print(N)

for u in used:
  if N % u == 0:
    N = N // u
for u in used:
  if N % u == 0:
    N = N // u
if N > 1:
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0 for k in range(int(N**0.5)+1)]

#N=1の処理
if N == 1:
  print(0)
  exit()
ans = 0


prime = [2]
for k in range(3, len(A), 2):
  if A[k] == 0:
    prime.append(k)
    for j in range(k, len(A), k):
      A[j] = 1
for p in prime:
  if N%p == 0:
    break
else: 
  print(1)
  exit()

used = []
use = []
#print(prime)
for p in prime:
  if p > N:
    break
  if N%p == 0:
    #print(p)
    ans += 1
    used.append(p)
    use.append(p)
    print(p)
    N = N // p
  np = p * p
  while N % np == 0:
    #print(np)
    ans += 1
    used.append(np)
    N = N // np
    np = np * p
    
#print(use)
#print(N)

for u in used:
  if N % u == 0:
    N = N // u
for u in used:
  if N % u == 0:
    N = N // u
if N > 1:
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0 for k in range(int(N**0.5)+1)]

#N=1の処理
if N == 1:
  print(0)
  exit()
ans = 0


prime = [2]
for k in range(3, len(A), 2):
  if A[k] == 0:
    prime.append(k)
    for j in range(k, len(A), k):
      A[j] == 1
for p in prime:
  if N%p == 0:
    break
else: 
  print(1)
  exit()

used = []
use = []
#print(prime)
for p in prime:
  if p > N:
    break
  if N%p == 0:
    #print(p)
    ans += 1
    used.append(p)
    use.append(p)
    N = N // p
  op = 0 + p
  np = p * op
  while N % np == 0:
    #print(np)
    ans += 1
    use.append(np)
    N = N // np
    np = np * op
    
#print(use)
#print(N)

for u in used:
  if N % u == 0:
    N = N // u
for u in used:
  if N % u == 0:
    N = N // u
if N > 1:
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0 for k in range(int(N**0.5)+1)]

#N=1の処理
if N == 1:
  print(0)
  exit()
ans = 0


prime = [2]
for k in range(3, len(A), 2):
  if A[k] == 0:
    prime.append(k)
    for j in range(k, len(A), k):
      A[j] == 1
for p in prime:
  if N%p == 0:
    break
else: 
  print(1)
  exit()

used = []
use = []
#print(prime)
for p in prime:
  if p > N:
    break
  if N%p == 0:
    #print(p)
    ans += 1
    used.append(p)
    use.append(p)
    N = N // p
  op = 0 + p
  np = p * op
  while N % np == 0:
    #print(np)
    ans += 1
    use.append(np)
    N = N // np
    np = np * op
    
#print(use)
#print(N)

for u in used:
  if N % u == 0:
    N = N // u
if N > 1:
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
#N=1の処理
if N == 1:
  print(0)
  exit()
ans = 0

#素数判定
A = [0 for k in range(int(N**0.5)+1)]
prime = [2]
for k in range(3, len(A), 2):
  if A[k] == 0:
    prime.append(k)
    for j in range(k, len(A), k):
      A[j] == 1
for p in prime:
  if N%p == 0:
    break
else: 
  print(1)
  exit()

used = []
use = []
#print(prime)
for p in prime:
  if p > N:
    break
  if N%p == 0:
    #print(p)
    ans += 1
    used.append(p)
    use.append(p)
    N = N // p
  op = 0 + p
  np = p * op
  while N % np == 0:
    #print(np)
    ans += 1
    use.append(np)
    N = N // np
    np = np * op
    
#print(use)
#print(N)

for u in use:
  if N % u == 0:
    N = N // u
if N > 1:
  ans += 1
print(ans)

Submission status: Wrong Answer

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

A = [0 for k in range(int(N**0.5)+1)]
prime = [2]
for k in range(3, len(A), 2):
  if A[k] == 0:
    prime.append(k)
    for j in range(k, len(A), k):
      A[j] == 1
for p in prime:
  if N%p == 0:
    break
else: 
  print(1)
  exit()

used = []
use = []
for p in prime:
  if p > N:
    break
  if N%p == 0:
    #print(p)
    ans += 1
    used.append(p)
    use.append(p)
    N = N // p
  op = 0 + p
  np = p * op
  while N % np == 0:
    ans += 1
    use.append(np)
    N = N // np
    np = np * op


for u in used:
  if N % u == 0:
    N = N // u
if N > 1:
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
#N=1の処理
if N == 1:
  print(0)
  exit()
ans = 0

#素数判定
A = [0 for k in range(int(N**0.5)+1)]
prime = [2]
for k in range(3, len(A), 2):
  if A[k] == 0:
    prime.append(k)
    for j in range(k, len(A), k):
      A[j] == 1
for p in prime:
  if N%p == 0:
    break
else: 
  print(1)
  exit()

used = []
use = []
#print(prime)
for p in prime:
  if p > N:
    break
  if N%p == 0:
    #print(p)
    ans += 1
    used.append(p)
    use.append(p)
    N = N // p
  op = 0 + p
  np = p * op
  while N % np == 0:
    #print(np)
    ans += 1
    use.append(np)
    N = N // np
    np = np * op
    
#print(use)
#print(N)

for u in used:
  if N % u == 0:
    N = N // u
if N > 1:
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
#N=1の処理
if N == 1:
  print(0)
  exit()
ans = 0

#素数判定
A = [0 for k in range(int(N**0.5)+1)]
prime = [2]
for k in range(3, len(A), 2):
  if A[k] == 0:
    prime.append(k)
    for j in range(k, len(A), k):
      A[j] == 1
for p in prime:
  if N%p == 0:
    break
else: 
  print(1)
  exit()

used = []

#print(prime)
for p in prime:
  if p > N:
    break
  if N%p == 0:
    #print(p)
    ans += 1
    used.append(p)
    N = N // p
  op = 0 + p
  np = p * op
  while N % np == 0:
    #print(np)
    ans += 1
    N = N // np
    np = np * op

#print(N)
for u in used:
  if N % u == 0:
    N = N // u
if N > 1:
  ans += 1

Submission status: Wrong Answer

Solution code:
N = int(input())
if N == 1:
    print(0)
    exit()
ans = 0
A = [0 for k in range(int(N**0.5)+1)]
prime = [2]
for k in range(3, len(A), 2):
    if A[k] == 0:
        prime.append(k)
        for j in range(k, len(A), k):
            A[j] == 1
#print(prime)
for p in prime:
    if p > N:
        break
    if N%p == 0:
        #print(p)
        ans += 1
        N = N // p
    op = 0 + p
    np = p * op
    while N % np == 0:
        #print(np)
        ans += 1
        N = N // np
        np = np * op

print(max(ans, 1))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

ans = 0
ls = make_divisors(N)
lenls = len(ls)
a = N
for i in range(lenls):
    div = ls[i]
    if a%div == 0 and div != 1:
        if a == 1:
            #print("a",a)
            #print(ans)
            break
        ans += 1
        a = a/div
        #print(ans)

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

ans = 0
ls = make_divisors(N)
lenls = len(ls)
a = N
for i in range(lenls):
    div = ls[i]
    if a%div == 0 and div != 1:
        if a == 1:
          break
        ans += 1
        a = a/div
        
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

ans = 0
ls = make_divisors(N)
lenls = len(ls)
a = N
for i in range(lenls):
    div = ls[i]
    if a%div == 0 and div != 1:
        ans += 1
        a = a/div
        if a == 0:
          break
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

ans = 0
ls = make_divisors(N)
lenls = len(ls)
#print(len(make_divisors(N)))
a = N
for i in range(lenls):
    div = ls[i]
    if a%div == 0 and div != 1:
        ans += 1
        a = a/div
        if a == 1:
          break
        #print("a",a)
        #print("N",N)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

ans = 0
ls = make_divisors(N)
a = N
for i in range(len(make_divisors(N))):
    #ls = pf(N)
    #print(len(make_divisors(N)))
    #print(ls)
    #print(make_divisors(N)[i])
    #print(i)
    if a % (make_divisors(N)[i]) == 0 and make_divisors(N)[i] != 1:
        #print(ls[i][0]**ls[i][1])
        #print(i)
        ans += 1
        a = int(a/make_divisors(N)[i])
        #print("a",a)
print(ans)

Submission status: Wrong Answer

Solution code:
import bisect
import math
import sys
 
jd = []
for i in range(1,50) :
  jd.append((1+i)*i//2)
  
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())
  
p = factorization(n)

ans = 0
for i in p :
  c = i[1]
  ans += bisect.bisect_right(jd, c)
  
print(ans)

Submission status: Wrong Answer

Solution code:
import bisect
import math
 
jd = []
for i in range(1,50) :
  jd.append((1+i)*i//2)
  
def is_prime(n):
    if n == 1: return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
  
def sieve(n):
  num = [True]*n
  num[0] = num[1] = False
  for i in range(2,int(n**0.5)+1):
    if num[i]:
      for j in range(i**2, n, i):
        num[j] = False
  return [i for i in range(2,n) if num[i]]
      
n = int(input())
n1 = math.ceil(n**0.5)
if n == (n**0.5)**2 :
  n1 += 1
  
p = sieve(n1)

ans = 0
for i in range(len(p)) :
  c = 0
  if n%p[i] == 0 :
    for j in range(10**18) :
      n //= p[i]
      c += 1
      if n%p[i] != 0 :
        break
    ans += bisect.bisect_right(jd, c)
    
if is_prime(n) :
  ans = 1
  
print(ans)

Submission status: Wrong Answer

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

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

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

    return arr


N = int(input())
p = factorization(N)
count = 0
while N != 1:
    for x in p:
        for i in range(1, x[1] + 1):
            if N % x[0]**i == 0:
                N /= x[0]**i
                count += 1
            else:
                break
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt = 0
for i in range(2,N):
    if N%i == 0:
        #print("i",i)
        for j in range(2,i):
            #print("j",j)
            if i%j != 0 or j == 2:
                cnt += 1
            else:
                break
        N = N/i
print(cnt)

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
def pf(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(pf(N))
print(c)
ans = 0
for i in c.keys():
    for j in range(1,40):
        if j*(j+1)/2 <= c[i] < (j+1)*(j+2)/2:
            ans += j
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
NN = N
L = []
def isprime(n):
    a = True
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            a = False
            break
    if a:
        return True
    else:
        return False
for i in range(2,int(N**0.5)+1):
    if isprime(i):
        j = 1
        while i**j <= N:
            L.append(i**j)
            j += 1
L = list(set(L))
import heapq
heapq.heapify(L)
n = len(L)
ans = 0
for i in range(n):
    z = heapq.heappop(L)
    if N/z == N//z:
        N = N//z
        ans += 1
    if N == 1 or N < z:
        break
if ans != 0:
    print(ans)
else:
    if NN == 1:
        print(0)
    else:
        print(1)

Submission status: Wrong Answer

Solution code:
N = int(input())
NN = N
L = []
for i in range(2,int(N**0.5)+1):
    if N % i == 0:
        L.append(i)
        N = N//i
import heapq
heapq.heapify(L)
n = len(L)
ans = 0
for i in range(n):
    a = heapq.heappop(L)
    L = [j/a for j in L]
    ans += 1
if ans != 0:
    print(ans)
else:
    if NN == 1:
        print(0)
    else:
        print(1)

Submission status: Wrong Answer

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


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


ans = 0
#print(prime_factorize(n))
a = collections.Counter(prime_factorize(n))
for v in a.values():
    ans += (v+1)//2

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input(""))
s=0
i=1
while(n>i):
    
    i+=1
    if (n%2==0 and n!=2):
        continue
    t=0
    while(n%i==0):
        n/=i
        t+=1
    k=1
    while(t>=k):
    
        t-=k
        s+=1
        k+=1

print(s)

Submission status: Wrong Answer

Solution code:
def this (k):
  a=int(pow(1+8*k,0.5))
  return (a-1)//2
from collections import Counter
c=Counter([])
n=int(input())
for i in range(2,int(pow(n,0.5))+1):
  if n%i==0:
    sumi=0
    while n%i==0:
      n=n//i
      sumi+=1
    c[i]=sumi
ans=0
for item in c.values():
  ans+=this(item)
print (ans)

Submission status: Wrong Answer

Solution code:
def prime(n):
    nums = [True]*n
    primes = []
    for i in range(2,n):
        if nums[i]:
            primes.append(i)
            for j in range(2*i,n,i):
                nums[j] = False
    return primes

def prime_fac(n):
    fac = {}
    n_init = n
    primes = prime(int(n**0.5)+1)
    for p in primes:
        while n%p==0:
            fac[p] = fac.get(p,0)+1
            n//=p
    if fac=={}:
        fac[n_init] = 1
    return fac

def main():
    n = int(input())
    fac = prime_fac(n)

    ans = 0
    for i in fac.values():
        ct = 1
        while i >= ct*(ct+1)//2:
            ct += 1
            ans+=1
    print(ans)
main()

Submission status: Wrong Answer

Solution code:
def prime(n):
    nums = [True]*n
    primes = []
    for i in range(2,n):
        if nums[i]:
            primes.append(i)
            for j in range(2*i,n,i):
                nums[j] = False
    return primes

def prime_fac(n):
    fac = {}
    n_init = n
    primes = prime(int(n**0.5)+1)
    for p in primes:
        while n%p==0:
            fac[p] = fac.get(p,0)+1
            n//=p
    if fac=={}:
        fac[n_init] = 1
    return fac

def main():
    n = int(input())
    fac = prime_fac(n)

    ans = 0
    for i in fac.values():
        ct = 1
        k = 2
        while i >= ct:
            ct += k
            k+=1
            ans+=1
    print(ans)
main()

Submission status: Wrong Answer

Solution code:
def prime(n):
    nums = [True]*n
    primes = []
    for i in range(2,n):
        if nums[i]:
            primes.append(i)
            for j in range(2*i,n,i):
                nums[j] = False
    return primes

def prime_fac(n):
    fac = {}
    n_init = n
    primes = prime(int(n**0.5)+1)
    for p in primes:
        while n%p==0:
            fac[p] = fac.get(p,0)+1
            n//=p
    if fac=={}:
        fac[n_init] = 1
    return fac

def main():
    n = int(input())
    fac = prime_fac(n)

    ans = 0
    for i in fac.values():
        ct = 0
        k = 1
        while i > ct:
            ct += k
            k+=1
            ans+=1
    print(ans)
main()

Submission status: Wrong Answer

Solution code:
import math
a=int(input())
ans=0
for i in range(1,int(math.sqrt(a)),1):
  if a%i==0 and not i==1:
    cnt=0
    while a%i==0:
      cnt+=1
      a=a/i
    ans+=(math.sqrt(2*cnt+0.25)-0.5)//1
if not a==1:
  print(1)
else:
  print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
a=int(input())
b=[]
ans=0
for i in range(2,int(math.sqrt(a)+1),1):
  if a%i==0:
    b=b+[i]
for i in b:
  cnt=0
  if a%i==0:
    while a%i==0:
      cnt+=1
      a=a/i
    ans+=(math.sqrt(2*cnt+0.25)-0.5)//1
  else:
    pass
print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
a=int(input())
b=[]
ans=0
for i in range(2,int(math.sqrt(a)),1):
  if a%i==0:
    b=b+[i]
for i in b:
  cnt=0
  if a%i==0:
    while a%i==0:
      cnt+=1
      a=a/i
    ans+=(math.sqrt(2*cnt+0.25)-0.5)//1
  else:
    pass
print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
Nb = N
Nc = N
so = []
counta = 0
for i in range(2,int(math.sqrt(N))+1):
  if N % i == 0:
    counta += 1
    countb = 1
    while N % i == 0:
      N //= i
      so.append(i)
      countb += 1
#print(so,counta)
so_n = [0]*counta
so_cn = [0]*counta
max = [0]*counta
i = 0
k = 0
while i < len(so):
  so_n[k]= so[i]
  n = so.count(so[i])
  so_cn[k] = n
  max[k] = so[i]**n
  k += 1
  i += n
#print(so_n,so_cn)
set = []

for i in range(len(so_n)):
  for j in range(1,so_cn[i]+1):
    if Nb % so_n[i]**j == 0:
      set.append(so_n[i]**j)
      Nb //= so_n[i]**j
      so_cn[i] -= j

set.sort()
#print(set,len(set))
countc = 0
for i in range(len(set)):
  if Nc % set[i] == 0:
    Nc //= set[i]
    countc += 1
if countc == 0 and Nc >= 2:
  countc = 1
print(countc)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
Nb = N
Nc = N
so = []
#counta = 0
for i in range(2,int(math.sqrt(N))+1):
  if N % i == 0:
#    counta += 1
    countb = 1
    #print(N,i**countb)
    while N % (i**countb) == 0:
      #print(i**countb)
      N //= i**countb
      so.append(i**countb)
      countb += 1
#print(so,counta)
so.sort()
#print(so,len(so))
countc = 0
for i in range(len(so)):
  if Nb % so[i] == 0:
    Nb /= so[i]
    countc += 1
    #print(countc)
  else:
    break
if countc == 0 and Nc >= 2:
  countc = 1
print(countc)